Consider the following example: \define \HighlightColor {red} \definehighlight[RED][color=\HighlightColor] \definelabel[AA][alternative=inright,headcolor=\HighlightColor,text=] \definelabel[BB][alternative=inright,headcolor=red,text=] \noheaderandfooterlines \starttext \hsize3cm Is the label red?\AA Is the label red?\BB \RED{Is this line red?} \stoptext When run with --luatex, I get the colors I expect, as: When run as lmtx, I get this: All test were run with ConTeXt ver: 2021.05.20 11:08 MKIV fmt: 2021.5.20. This worked very well for a long time, then became a problem a while ago, then it resolved, and once more it is a problem. -- Rik
On Thu, 20 May 2021, Rik Kabel wrote:
Consider the following example:
\define \HighlightColor {red}
Why not just use: \definecolor[HighlightColor][red] and then use color=HighlightColor, etc.
\definehighlight[RED][color=\HighlightColor] \definelabel[AA][alternative=inright,headcolor=\HighlightColor,text=] \definelabel[BB][alternative=inright,headcolor=red,text=] \noheaderandfooterlines \starttext \hsize3cm Is the label red?\AA
Is the label red?\BB
\RED{Is this line red?} \stoptext
Aditya
Aditya Mahajan schrieb am 21.05.2021 um 04:47:
On Thu, 20 May 2021, Rik Kabel wrote:
Consider the following example:
\define \HighlightColor {red} Why not just use:
\definecolor[HighlightColor][red]
and then use color=HighlightColor, etc.
This is the better way to create unique color names but the problem in the example was the use of \define instead of \defineexpandable. \defineexpandable\HighlightColor{red} Wolfgang
On 5/21/2021 00:26, Wolfgang Schuster wrote:
Aditya Mahajan schrieb am 21.05.2021 um 04:47:
On Thu, 20 May 2021, Rik Kabel wrote:
Consider the following example:
\define \HighlightColor {red} Why not just use:
\definecolor[HighlightColor][red]
and then use color=HighlightColor, etc.
This is the better way to create unique color names but the problem in the example was the use of \define instead of \defineexpandable.
\defineexpandable\HighlightColor{red}
Wolfgang
Wolfgang and Aditya, Thank you both for the lesson. Is the difference between MkIV (--luatex) and LMTX due to stricter application of expandability in LMTX? -- Rik
participants (3)
-
Aditya Mahajan
-
Rik Kabel
-
Wolfgang Schuster