* \definehighlight + \words | \WORDS
@ 2012-05-08 8:35 Philipp Gesang
2012-05-08 9:07 ` Wolfgang Schuster
0 siblings, 1 reply; 7+ messages in thread
From: Philipp Gesang @ 2012-05-08 8:35 UTC (permalink / raw)
To: ConTeXt ML
[-- Attachment #1.1: Type: text/plain, Size: 1286 bytes --]
Dear listmates,
I rely on automated uppercasing and lowercasing a lot and I’m
very happy with the \words and \WORD macros. But I can’t find a
way to properly combine them with the “style” parameter of
highlights: it breaks frames and enumerations. Example:
········································································
\definehighlight [tolower] [style=\words,] %%% This is problematic.
\def\mylower#1{\bgroup\words#1\egroup} %%% The command itself
%%% works, though.
\starttext
FOO \tolower{FOO} FOO\par %%% Works.
\framed{BAR \mylower{BAR} BAR} %%% Works.
\framed{BAR \tolower{BAR} BAR} %%% Fails.
\startitemize %%% Enumerations don’t work either.
\item FOO \mylower{FOO} FOO %%% Works.
\item FOO \tolower{FOO} FOO %%% Fails.
\stopitemize
\stoptext
········································································
In short: while I can always wrap it in a \def, the more elegant
doesn’t work in all cases. Is there anything wrong with my
approach?
Best regards
Philipp
[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \definehighlight + \words | \WORDS
2012-05-08 8:35 \definehighlight + \words | \WORDS Philipp Gesang
@ 2012-05-08 9:07 ` Wolfgang Schuster
2012-05-08 9:18 ` Philipp Gesang
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2012-05-08 9:07 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 08.05.2012 um 10:35 schrieb Philipp Gesang:
> Dear listmates,
>
> I rely on automated uppercasing and lowercasing a lot and I’m
> very happy with the \words and \WORD macros. But I can’t find a
> way to properly combine them with the “style” parameter of
> highlights: it breaks frames and enumerations. Example:
>
> ········································································
>
> \definehighlight [tolower] [style=\words,] %%% This is problematic.
> \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself
> %%% works, though.
>
> \starttext
>
> FOO \tolower{FOO} FOO\par %%% Works.
> \framed{BAR \mylower{BAR} BAR} %%% Works.
> \framed{BAR \tolower{BAR} BAR} %%% Fails.
> \startitemize %%% Enumerations don’t work either.
> \item FOO \mylower{FOO} FOO %%% Works.
> \item FOO \tolower{FOO} FOO %%% Fails.
> \stopitemize
>
> \stoptext
>
> ········································································
>
> In short: while I can always wrap it in a \def, the more elegant
> doesn’t work in all cases. Is there anything wrong with my
> approach?
You can use
\definehighlight [tolower] [style={\setcharactercasing[2]}]
to create the \tolower command.
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \definehighlight + \words | \WORDS
2012-05-08 9:07 ` Wolfgang Schuster
@ 2012-05-08 9:18 ` Philipp Gesang
2012-05-08 11:17 ` Hans Hagen
0 siblings, 1 reply; 7+ messages in thread
From: Philipp Gesang @ 2012-05-08 9:18 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 2359 bytes --]
On 2012-05-08 11:07, Wolfgang Schuster wrote:
>
> Am 08.05.2012 um 10:35 schrieb Philipp Gesang:
>
> > Dear listmates,
> >
> > I rely on automated uppercasing and lowercasing a lot and I’m
> > very happy with the \words and \WORD macros. But I can’t find a
> > way to properly combine them with the “style” parameter of
> > highlights: it breaks frames and enumerations. Example:
> >
> > ········································································
> >
> > \definehighlight [tolower] [style=\words,] %%% This is problematic.
> > \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself
> > %%% works, though.
> >
> > \starttext
> >
> > FOO \tolower{FOO} FOO\par %%% Works.
> > \framed{BAR \mylower{BAR} BAR} %%% Works.
> > \framed{BAR \tolower{BAR} BAR} %%% Fails.
> > \startitemize %%% Enumerations don’t work either.
> > \item FOO \mylower{FOO} FOO %%% Works.
> > \item FOO \tolower{FOO} FOO %%% Fails.
> > \stopitemize
> >
> > \stoptext
> >
> > ········································································
> >
> > In short: while I can always wrap it in a \def, the more elegant
> > doesn’t work in all cases. Is there anything wrong with my
> > approach?
>
> You can use
>
> \definehighlight [tolower] [style={\setcharactercasing[2]}]
>
> to create the \tolower command.
Perfect, thanks a lot. So it was caused by the \groupedcommand in
the definition of \word.
Philipp
>
> Wolfgang
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \definehighlight + \words | \WORDS
2012-05-08 9:18 ` Philipp Gesang
@ 2012-05-08 11:17 ` Hans Hagen
2012-05-08 11:28 ` Wolfgang Schuster
0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2012-05-08 11:17 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 8-5-2012 11:18, Philipp Gesang wrote:
> On 2012-05-08 11:07, Wolfgang Schuster wrote:
>>
>> Am 08.05.2012 um 10:35 schrieb Philipp Gesang:
>>
>>> Dear listmates,
>>>
>>> I rely on automated uppercasing and lowercasing a lot and I’m
>>> very happy with the \words and \WORD macros. But I can’t find a
>>> way to properly combine them with the “style” parameter of
>>> highlights: it breaks frames and enumerations. Example:
>>>
>>> ········································································
>>>
>>> \definehighlight [tolower] [style=\words,] %%% This is problematic.
>>> \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself
>>> %%% works, though.
>>>
>>> \starttext
>>>
>>> FOO \tolower{FOO} FOO\par %%% Works.
>>> \framed{BAR \mylower{BAR} BAR} %%% Works.
>>> \framed{BAR \tolower{BAR} BAR} %%% Fails.
>>> \startitemize %%% Enumerations don’t work either.
>>> \item FOO \mylower{FOO} FOO %%% Works.
>>> \item FOO \tolower{FOO} FOO %%% Fails.
>>> \stopitemize
>>>
>>> \stoptext
>>>
>>> ········································································
>>>
>>> In short: while I can always wrap it in a \def, the more elegant
>>> doesn’t work in all cases. Is there anything wrong with my
>>> approach?
>>
>> You can use
>>
>> \definehighlight [tolower] [style={\setcharactercasing[2]}]
>>
>> to create the \tolower command.
>
> Perfect, thanks a lot. So it was caused by the \groupedcommand in
> the definition of \word.
The next version will support named casing:
WORD
word
Word
Words
capitals cap
Capitals Cap
none
random
-----------------------------------------------------------------
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \definehighlight + \words | \WORDS
2012-05-08 11:17 ` Hans Hagen
@ 2012-05-08 11:28 ` Wolfgang Schuster
2012-05-08 11:44 ` Philipp Gesang
2012-05-08 11:47 ` Hans Hagen
0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2012-05-08 11:28 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 08.05.2012 um 13:17 schrieb Hans Hagen:
> On 8-5-2012 11:18, Philipp Gesang wrote:
>> On 2012-05-08 11:07, Wolfgang Schuster wrote:
>>>
>>> Am 08.05.2012 um 10:35 schrieb Philipp Gesang:
>>>
>>>> Dear listmates,
>>>>
>>>> I rely on automated uppercasing and lowercasing a lot and I’m
>>>> very happy with the \words and \WORD macros. But I can’t find a
>>>> way to properly combine them with the “style” parameter of
>>>> highlights: it breaks frames and enumerations. Example:
>>>>
>>>> ········································································
>>>>
>>>> \definehighlight [tolower] [style=\words,] %%% This is problematic.
>>>> \def\mylower#1{\bgroup\words#1\egroup} %%% The command itself
>>>> %%% works, though.
>>>>
>>>> \starttext
>>>>
>>>> FOO \tolower{FOO} FOO\par %%% Works.
>>>> \framed{BAR \mylower{BAR} BAR} %%% Works.
>>>> \framed{BAR \tolower{BAR} BAR} %%% Fails.
>>>> \startitemize %%% Enumerations don’t work either.
>>>> \item FOO \mylower{FOO} FOO %%% Works.
>>>> \item FOO \tolower{FOO} FOO %%% Fails.
>>>> \stopitemize
>>>>
>>>> \stoptext
>>>>
>>>> ········································································
>>>>
>>>> In short: while I can always wrap it in a \def, the more elegant
>>>> doesn’t work in all cases. Is there anything wrong with my
>>>> approach?
>>>
>>> You can use
>>>
>>> \definehighlight [tolower] [style={\setcharactercasing[2]}]
>>>
>>> to create the \tolower command.
>>
>> Perfect, thanks a lot. So it was caused by the \groupedcommand in
>> the definition of \word.
>
> The next version will support named casing:
>
> WORD
> word
> Word
> Words
> capitals cap
> Capitals Cap
> none
> random
It would be also useful to change the following line in font-pre.mkiv to use \setcharacterchasing instead of \WORD (won’t work anymore when you remove \groupedcommand from the \WORD as written in the comments in typo-cap.mkiv)
\definealternativestyle [\v!WORD] [\WORD] [\WORD]
Additional entries for \word, Words etc. in font-pre.mkvi are useful as well because “style=word” looks better than “style={\setcharacterchasing[word]}”.
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \definehighlight + \words | \WORDS
2012-05-08 11:28 ` Wolfgang Schuster
@ 2012-05-08 11:44 ` Philipp Gesang
2012-05-08 11:47 ` Hans Hagen
1 sibling, 0 replies; 7+ messages in thread
From: Philipp Gesang @ 2012-05-08 11:44 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1266 bytes --]
On 2012-05-08 13:28, Wolfgang Schuster wrote:
>
> It would be also useful to change the following line in font-pre.mkiv to use \setcharacterchasing instead of \WORD (won’t work anymore when you remove \groupedcommand from the \WORD as written in the comments in typo-cap.mkiv)
>
> \definealternativestyle [\v!WORD] [\WORD] [\WORD]
>
> Additional entries for \word, Words etc. in font-pre.mkvi are useful as well because “style=word” looks better than “style={\setcharacterchasing[word]}”.
Seconded. That would be of great value and at least I will use it
very often.
philipp
>
> Wolfgang
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \definehighlight + \words | \WORDS
2012-05-08 11:28 ` Wolfgang Schuster
2012-05-08 11:44 ` Philipp Gesang
@ 2012-05-08 11:47 ` Hans Hagen
1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2012-05-08 11:47 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 8-5-2012 13:28, Wolfgang Schuster wrote:
>> The next version will support named casing:
>>
>> WORD
>> word
>> Word
>> Words
>> capitals cap
>> Capitals Cap
>> none
>> random
>
> It would be also useful to change the following line in font-pre.mkiv to use \setcharacterchasing instead of \WORD (won’t work anymore when you remove \groupedcommand from the \WORD as written in the comments in typo-cap.mkiv)
>
> \definealternativestyle [\v!WORD] [\WORD] [\WORD]
>
> Additional entries for \word, Words etc. in font-pre.mkvi are useful as well because “style=word” looks better than “style={\setcharacterchasing[word]}”.
I had been thinking about a 'vector' key (in addition to style) but
that's a bit of work as we then need to provide some *vectore variants
as well and integrate it in the style/color switching helpers which is
ab it of work
but anyhow, it doesn't hurt to have them as alternative styles so you
can test it later today (making a beta)
Hans
-----------------------------------------------------------------
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-05-08 11:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-08 8:35 \definehighlight + \words | \WORDS Philipp Gesang
2012-05-08 9:07 ` Wolfgang Schuster
2012-05-08 9:18 ` Philipp Gesang
2012-05-08 11:17 ` Hans Hagen
2012-05-08 11:28 ` Wolfgang Schuster
2012-05-08 11:44 ` Philipp Gesang
2012-05-08 11:47 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).