Hi, for making editing easier I'd like my italics (\em) to be in PDF typeset colored. Something like \setupem[color=blue] How can this be done? Steffen
It should be something like \Colorit{this} example: \def\Colorit{\it\color[magenta]} But this above never closes the italics, while ... \def\Colorit{\strut\groupedcommand\it\color[magenta]\/} ... gives an error. Someone can help? St. Am 22.09.2008 um 11:09 schrieb Steffen Wolfrum:
Hi,
for making editing easier I'd like my italics (\em) to be in PDF typeset colored.
Something like \setupem[color=blue]
How can this be done?
Steffen ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On Mon, 22 Sep 2008, Taco Hoekwater wrote:
Steffen Wolfrum wrote:
But this above never closes the italics, while ...
\def\Colorit{\strut\groupedcommand\it\color[magenta]\/}
... gives an error.
Someone can help?
Worryingly lowlevel:
\def\emphasistypeface{\it\color[magenta]}
This has to be used {\emphasistypeface ....}. If you want something that works as \emph{....} as well as {\emph ...} and can also be passed as an option to all the style= keys, try \definealternativestyle [emph] [{\it\color[magenta]}] [] Aditya
Aditya Mahajan wrote:
On Mon, 22 Sep 2008, Taco Hoekwater wrote:
Steffen Wolfrum wrote:
But this above never closes the italics, while ...
\def\Colorit{\strut\groupedcommand\it\color[magenta]\/}
... gives an error.
Someone can help? Worryingly lowlevel:
\def\emphasistypeface{\it\color[magenta]}
This has to be used {\emphasistypeface ....}. If you want something that
No. Instead it redefines the internals of the normal \em command. Best wishes, Taco
On Mon, 22 Sep 2008, Taco Hoekwater wrote:
Aditya Mahajan wrote:
On Mon, 22 Sep 2008, Taco Hoekwater wrote:
Steffen Wolfrum wrote:
But this above never closes the italics, while ...
\def\Colorit{\strut\groupedcommand\it\color[magenta]\/}
... gives an error.
Someone can help? Worryingly lowlevel:
\def\emphasistypeface{\it\color[magenta]}
This has to be used {\emphasistypeface ....}. If you want something that
No. Instead it redefines the internals of the normal \em command.
Ah, so that is why it is lowlevel. I wonder why the following does not work. \setupbodyfontenvironment [default] [em={\italic\color[red]}] Aditya
Aditya Mahajan wrote:
Ah, so that is why it is lowlevel. I wonder why the following does not work.
\setupbodyfontenvironment [default] [em={\italic\color[red]}]
The em key is a bit extra extra special: it has to be either 'italic' or 'slanted', everything else is ignored. This is because of the need to allow bold emphasis. (\bf\em == \bs or \bi). I would personally be happier if it would just use whatever was in the argument when it is *not* italic or slanted, instead of ignoring the argument, but that's how it is. Best wishes, Taco
Hello, I am having trouble drawing rotated molecules using ppchtex. In the example below, I would like to draw the molecule shown in (a) rotated as shown in (b). I would appreciate any suggestions. Thanks. Alan \usemodule[chemic] \setupchemical[width=fit] \starttext \startcombination[2*1] {\startchemical \chemical[SIX,B,C,MOV2,B,C,R234,RZ234,MOV5,MOV6,B,C,R561,RZ561] [R,R,R,R,R,R] \stopchemical} {(a)} {\startchemical \chemical[SIX,ROT2,B,C,R234,RZ234,ADJ1,ADJ1,ADJ2,B,C,ADJ1,ADJ1,ADJ4,B,C,R156,RZ156] [R,R,R,R,R,R] \stopchemical} {(b)} \stopcombination \stoptext
Taco Hoekwater wrote:
Aditya Mahajan wrote:
Ah, so that is why it is lowlevel. I wonder why the following does not work.
\setupbodyfontenvironment [default] [em={\italic\color[red]}]
The em key is a bit extra extra special: it has to be either 'italic' or 'slanted', everything else is ignored. This is because of the need to allow bold emphasis. (\bf\em == \bs or \bi).
I would personally be happier if it would just use whatever was in the argument when it is *not* italic or slanted, instead of ignoring the argument, but that's how it is.
\def\doemphasistypeface#1#2% {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!slanted {#1}% {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!italic {#2}% {\doifelsevaluenothing{\??ft\fontclass\normalizedbodyfontsize\c!em} {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v!slanted {#1}% {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v!italic {#2}% {\getvalue{\??ft\normalizedbodyfontsize\c!em}}}} {\getvalue{\??ft\fontclass\normalizedbodyfontsize\c!em}}}}} however, this does not provide italic correction, so better is: \newtoks\everyemphasized \unexpanded\def\em {\relax \ifdim\slantperpoint>\zeropoint \settrue\emneeded \else \setfalse\emneeded \fi \setemphasisboldface % new \ifx\fontalternative\c!it % \ifnum\fam=\itfam \def\emphasistypeface{\it}\tf \else\ifx\fontalternative\c!sl % \ifnum\fam=\slfam \def\emphasistypeface{\sl}\tf \else\ifx\fontalternative\c!bf % \ifnum\fam=\bffam \emphasisboldface \else\ifx\fontalternative\c!bs % \ifnum\fam=\bsfam \def\emphasisboldface{\bs}\bf \else\ifx\fontalternative\c!bi % \ifnum\fam=\bifam \def\emphasisboldface{\bi}\bf \else \emphasistypeface \fi\fi\fi\fi\fi \the\everyemphasized \ifconditional\emneeded\relax \else \expandafter\aftergroup \fi \emphasiscorrection} which provides a hook, as in: \appendtoks \red \to \everyemphasized both mechanisms will be provided (maybe something emcolor later, when i can get myself motivated for such an possibly never documented feature) ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Am 22.09.2008 um 15:00 schrieb Hans Hagen:
Taco Hoekwater wrote:
Aditya Mahajan wrote:
Ah, so that is why it is lowlevel. I wonder why the following does not work.
\setupbodyfontenvironment [default] [em={\italic\color[red]}]
The em key is a bit extra extra special: it has to be either 'italic' or 'slanted', everything else is ignored. This is because of the need to allow bold emphasis. (\bf\em == \bs or \bi).
I would personally be happier if it would just use whatever was in the argument when it is *not* italic or slanted, instead of ignoring the argument, but that's how it is.
\def\doemphasistypeface#1#2% {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v! slanted {#1}% {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v! italic {#2}% {\doifelsevaluenothing{\??ft\fontclass\normalizedbodyfontsize \c!em} {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v! slanted {#1}% {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v! italic {#2}% {\getvalue{\??ft\normalizedbodyfontsize\c!em}}}} {\getvalue{\??ft\fontclass\normalizedbodyfontsize\c!em}}}}}
however, this does not provide italic correction, so better is:
\newtoks\everyemphasized
\unexpanded\def\em {\relax \ifdim\slantperpoint>\zeropoint \settrue\emneeded \else \setfalse\emneeded \fi \setemphasisboldface % new \ifx\fontalternative\c!it % \ifnum\fam=\itfam \def\emphasistypeface{\it}\tf \else\ifx\fontalternative\c!sl % \ifnum\fam=\slfam \def\emphasistypeface{\sl}\tf \else\ifx\fontalternative\c!bf % \ifnum\fam=\bffam \emphasisboldface \else\ifx\fontalternative\c!bs % \ifnum\fam=\bsfam \def\emphasisboldface{\bs}\bf \else\ifx\fontalternative\c!bi % \ifnum\fam=\bifam \def\emphasisboldface{\bi}\bf \else \emphasistypeface \fi\fi\fi\fi\fi \the\everyemphasized \ifconditional\emneeded\relax \else \expandafter\aftergroup \fi \emphasiscorrection}
which provides a hook, as in:
\appendtoks \red \to \everyemphasized
Be careful: this kills the ability of the emphasized word to be hyphenated! (... at least here with MKII) Steffen
Am 22.09.2008 um 13:48 schrieb Taco Hoekwater:
Steffen Wolfrum wrote:
But this above never closes the italics, while ...
\def\Colorit{\strut\groupedcommand\it\color[magenta]\/}
... gives an error.
Someone can help?
Worryingly lowlevel:
\def\emphasistypeface{\it\color[magenta]}
... this looks very close to what I wrote in the same email at top: \def\Colorit{\it\color[magenta]} ... and this had the problem of never stopping (closing) the italics again! (BTW: sorry for introducing \it, I need \em of course) Steffen
On Sep 22, 2008, at 1:24 PM, Steffen Wolfrum wrote:
It should be something like \Colorit{this} example:
\def\Colorit{\it\color[magenta]}
But this above never closes the italics, while ...
\def\Colorit{\strut\groupedcommand\it\color[magenta]\/}
... gives an error.
Someone can help?
St.
You want your command to take an argument, so you have to mention that argument in the definition (untested): \define[1]\Colorit% {\color[magenta]{\it #1}} Thomas
Am 22.09.2008 um 13:48 schrieb Thomas A. Schmitz:
On Sep 22, 2008, at 1:24 PM, Steffen Wolfrum wrote:
It should be something like \Colorit{this} example:
\def\Colorit{\it\color[magenta]}
But this above never closes the italics, while ...
\def\Colorit{\strut\groupedcommand\it\color[magenta]\/}
... gives an error.
Someone can help?
St.
You want your command to take an argument, so you have to mention that argument in the definition (untested):
\define[1]\Colorit% {\color[magenta]{\it #1}}
... same problem as in Taco's proposal: the \it never stops st.
Am 22.09.2008 um 13:48 schrieb Thomas A. Schmitz:
On Sep 22, 2008, at 1:24 PM, Steffen Wolfrum wrote:
It should be something like \Colorit{this} example:
\def\Colorit{\it\color[magenta]}
But this above never closes the italics, while ...
\def\Colorit{\strut\groupedcommand\it\color[magenta]\/}
... gives an error.
Someone can help?
St.
You want your command to take an argument, so you have to mention that argument in the definition (untested):
\define[1]\Colorit% {\color[magenta]{\it #1}}
but, hey ... what about this: \define[1]\Colorit% {\color[magenta]{\groupedcommand\em\/ #1}} Thanks for pointing it to that Thomas! Steffen
participants (6)
-
Aditya Mahajan
-
Alan BRASLAU
-
Hans Hagen
-
Steffen Wolfrum
-
Taco Hoekwater
-
Thomas A. Schmitz