Re: [NTG-context] Smart Acronym Pluralization (`y' or `ie' before `s')

2015-05-24 Thread Alexander Shukaev
On Sun, May 24, 2015 at 11:17 AM, Hans Hagen pra...@wxs.nl wrote:

 On 5/24/2015 1:39 AM, Alexander Shukaev wrote:

 Hello,

 Consider the following:

 \definesynonyms
 [ACRONYM]
 [ACRONYMS]
 [\FULL]
 [\SHORT]

 ​​
 \ACRONYM{DLL}{Dynamic-Link Librar\doifnextcharelse{s}{ie}{y}}

 Why

 \FULL{DLL}s

 does not do what I expect it to do?  I assume that it's because
 `\doifnextcharelse' expands before `\FULL'.  So how to achieve the
 desired effect?  Thanks.


 \FULL is doing a lot and it's unlikely that inside there the nest token
 seen is the 's' so your test fails

 \ACRONYM{DLL}{\SelectFull{Dynamic-Link Library}{Dynamic-Link Libraries}}

 \def\VeryFullSingular#1#2{\FULL{#1}}
 \def\VeryFullPlural  #1#2{\FULL{#2}}

 \unexpanded\def\VeryFull
   {
 ​​
 \doifnextcharelse{s}
  {\let\SelectFull\VeryFullPlural}
  {\let\SelectFull\VeryFullSingular}}

 test \VeryFull{DLL} or \VeryFull{DLL}s it is

 if there is real need for this i can consider building something in but
 the check for a following 's' is not that common I think


 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | www.pragma-pod.nl
 -

 ___
 If your question is of interest to others as well, please add an entry to
 the Wiki!

 maillist : ntg-context@ntg.nl /
 http://www.ntg.nl/mailman/listinfo/ntg-context
 webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
 archive  : http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net

 ___


​Hello Hans,

Thanks for your response.  It seems to me that a simple (and backward
compatible) extension would be to add ​the 3rd optional parameter to
`ACRONYM':

​\ACRONYM{DLL}{Dynamic-Link Library}[Dynamic-Link Libraries][s]
​ ​   ^^  ^
  single  pluraltrigger
(should of course be `s' by default, but let it be configurable just in
case)

​and put

\doifnextcharelse{trigger}{plural}{single}​

​inside `FULL' properly so that it can indeed find trigger in case of
`\FULL{DLL}trigger'.​

Regards,
Alexander
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Smart Acronym Pluralization (`y' or `ie' before `s')

2015-05-24 Thread Hans Hagen

On 5/24/2015 1:39 AM, Alexander Shukaev wrote:

Hello,

Consider the following:

\definesynonyms
[ACRONYM]
[ACRONYMS]
[\FULL]
[\SHORT]

\ACRONYM{DLL}{Dynamic-Link Librar\doifnextcharelse{s}{ie}{y}}

Why

\FULL{DLL}s

does not do what I expect it to do?  I assume that it's because
`\doifnextcharelse' expands before `\FULL'.  So how to achieve the
desired effect?  Thanks.


\FULL is doing a lot and it's unlikely that inside there the nest token 
seen is the 's' so your test fails


\ACRONYM{DLL}{\SelectFull{Dynamic-Link Library}{Dynamic-Link Libraries}}

\def\VeryFullSingular#1#2{\FULL{#1}}
\def\VeryFullPlural  #1#2{\FULL{#2}}

\unexpanded\def\VeryFull
  {\doifnextcharelse{s}
 {\let\SelectFull\VeryFullPlural}
 {\let\SelectFull\VeryFullSingular}}

test \VeryFull{DLL} or \VeryFull{DLL}s it is

if there is real need for this i can consider building something in but 
the check for a following 's' is not that common I think



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Smart Acronym Pluralization (`y' or `ie' before `s')

2015-05-23 Thread Alexander Shukaev
Hello,

Consider the following:

\definesynonyms
[ACRONYM]
[ACRONYMS]
[\FULL]
[\SHORT]

\ACRONYM{DLL}{Dynamic-Link Librar\doifnextcharelse{s}{ie}{y}}

Why

\FULL{DLL}s

does not do what I expect it to do?  I assume that it's because
`\doifnextcharelse' expands before `\FULL'.  So how to achieve the desired
effect?  Thanks.

Kind regards,
Alexander
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re[2]: [NTG-context] Smart \in

2005-10-09 Thread Giuseppe Bilotta
Saturday, October 8, 2005 Hans Hagen wrote:

 Giuseppe Bilotta wrote:

Hello all,

I have a document which is split into separate \parts. I
would like the \in command ( friends) to automatically add
the part reference when cross-referencing across parts.

Example:



\part[part:one]{Part one}

\chapter[ch:one]{Chapter one}

\chapter[ch:two]{Chapter two}
As seen in \in chapter[ch:one]

\part[part:two]{Part two}

\chater[ch:2-1]{Chapter two}

As seen in \in chapter[ch:one]


The first \in would say chapter~1, the second chapter~1,
part~1.

  

 \setuphead[part][prefix=part]
 \setuphead[chapter][prefix=ch]

 \setuphead[chapter]prefix=+] % kind of automatic

 (actually, prefixes are blabla::whatever deep down in context)


Looks like I didn't make myself clear. I don't want the
label prefix to be automatic.

I want the reference to automatically add part ... (in the
text) when the current part is different from the part of
the referenced thing.

I see that the example was too verbose to be minimal
enough. Second go:


\starttext
\part{Part one}
\chapter[interest]{Chapter one}
\chapter{Chapter two}
As seen in \in chapter[interest]
\part{Part two}
\chapter{Chapter one of part two}
\chapter{Chapter two of part two}
As seen in \in chapter[interest]
\stoptext


If you compile this example, you'll see that both \in's
print the same output, but the second one is referring to
chapter 2 in part 1, and this is not clear (it seems it's
referring to chapter 1 in the same part), so it should add
, part 1 to make it clear.

-- 
Giuseppe Oblomov Bilotta

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Smart \in

2005-10-08 Thread Hans Hagen

Giuseppe Bilotta wrote:


Hello all,

I have a document which is split into separate \parts. I
would like the \in command ( friends) to automatically add
the part reference when cross-referencing across parts.

Example:



\part[part:one]{Part one}

\chapter[ch:one]{Chapter one}

\chapter[ch:two]{Chapter two}
As seen in \in chapter[ch:one]

\part[part:two]{Part two}

\chater[ch:2-1]{Chapter two}

As seen in \in chapter[ch:one]


The first \in would say chapter~1, the second chapter~1,
part~1.

 


\setuphead[part][prefix=part]
\setuphead[chapter][prefix=ch]

\setuphead[chapter]prefix=+] % kind of automatic

(actually, prefixes are blabla::whatever deep down in context)

--

-
 Hans Hagen | PRAGMA ADE
 Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Smart \in

2005-10-07 Thread Giuseppe Bilotta
Hello all,

I have a document which is split into separate \parts. I
would like the \in command ( friends) to automatically add
the part reference when cross-referencing across parts.

Example:



\part[part:one]{Part one}

\chapter[ch:one]{Chapter one}

\chapter[ch:two]{Chapter two}
As seen in \in chapter[ch:one]

\part[part:two]{Part two}

\chater[ch:2-1]{Chapter two}

As seen in \in chapter[ch:one]


The first \in would say chapter~1, the second chapter~1,
part~1.

-- 
Giuseppe Oblomov Bilotta

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context