Font switching for titles and subtitle not working as expected ?
Hi, I just jumbled upon this question on tex stackexchange : https://tex.stackexchange.com/questions/715799/context-switching-font-for-bo... Using the style key as suggested in the accepted answer works, but I've had a look in to this, and I don't understand why the original code does not work. I've also tried to find a solution using textcommand instead of command, but that makes no difference. Only one setting will be accepted. As soon as both, titles and subjects, are changed only the first change will be accepted. Is this a bug, or am I missing something? Best, Denis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Original MWE \define[2]\mytitle{% \switchtobodyfont[chorus]% #2 } \define[2]\mysubject{% \switchtobodyfont[chorus]% #2 } \setuphead[title][command=\mytitle] \setuphead[subject][command=\mysubject] \starttext \title{In Zapf Chancery} \subject{Apparently the default font. Why?} And in the default font, just as expected. \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Adapted MWE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \define[1]\mytitleformat{% \switchtobodyfont[chorus]% #1 } %\setuphead[subject,title][textcommand=\mytitleformat] %\setuphead[title][textcommand=\mytitleformat] \setuphead[subject][textcommand=\mytitleformat] % this will adapt the format for subjects, as long as titles are not changed \starttext \title{In Zapf Chancery} \subject{Apparently the default font. Why?} And in the default font, just as expected. \stoptext %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
denis.maier@unibe.ch schrieb am 30.04.2024 um 14:22:
Hi,
I just jumbled upon this question on tex stackexchange : https://tex.stackexchange.com/questions/715799/context-switching-font-for-bo...
Using the style key as suggested in the accepted answer works, but I’ve had a look in to this, and I don’t understand why the original code does not work.
I’ve also tried to find a solution using textcommand instead of command, but that makes no difference. Only one setting will be accepted. As soon as both, titles and subjects, are changed only the first change will be accepted.
Is this a bug, or am I missing something?
When you load a typescript only in a local group (e.g. a section title) you should always load it at the start of the document to avoid such side effects. \usebodyfont[chorus] % load the chorus typescript \setupbodyfont[modern] % set the default font for the document Wolfgang
participants (2)
-
denis.maier@unibe.ch
-
Wolfgang Schuster