Re: [NTG-context] fundamental problem with headings
Steffen Wolfrum wrote:
Hi,
Each kind of "emphasizing" - like \it \bf \cap \sc etc. - lets the respective phrase fall back to the documents bodyfont (see example below).
How can I avoid this bug?
not a bug, this is the expected behaviour of \definefont.
Do I use wrong code?
Yes. \definefont defines a single font (hence it's name).
What you actually need is a full-blown bodyfont switch:
\def\SectionStyle{% \switchtobodyfont[rm,20pt] \setupinterlinespace[line=30pt] }
Greetings, Taco
OK, so my example changes to \starttext \def\Textit{\groupedcommand\it\/} % \definefont[SectionFont][SerifBold at 20pt] % \def\SectionStyle{\SectionFont\setupinterlinespace[line=30pt]} \def\SectionStyle{% \switchtobodyfont[rm,20pt] \setupinterlinespace[line=30pt] } \setuphead[section] [alternative=paragraph,style=\SectionStyle] text \section{heading \Textit{italic} heading} text \stoptext But if the heading should be set in general in a bold face what do I use instead of \rm so that italic parts of he heading will be typeset in bold-italic (and \sc parts to bold-smallcaps)? I guess something (next to serif, sans, mono, ...) like serifbold (\brm?) should be defined in my typescript? Thank you, Steffen
Steffen Wolfrum said this at Thu, 10 Mar 2005 23:11:41 +0100:
But if the heading should be set in general in a bold face what do I use instead of \rm so that italic parts of he heading will be typeset in bold-italic (and \sc parts to bold-smallcaps)? I guess something (next to serif, sans, mono, ...) like serifbold (\brm?) should be defined in my typescript?
I'm a bit confused why you're not using \em in this situation, as it adapts to both bold and roman contexts. If you dislike that it defaults to slanted, then there's: \setupbodyfontenvironment[default][em=italic] {\bf Hello \em World} Hello \em World But if you want to follow the path of defining your own, adaptive switches, then you could look at these goodies already defined in font-ini: %D \macros %D {emphbf,emphit,emphsl,emphtf} %D %D The next emphasis alternatives are for \THANH. They adapt %D their style as good as possible. \def\emphbf{\groupedcommand{\bf\def\emphit{\bi}\def\emphsl{\bs}}{}} \def\emphit{\groupedcommand{\it\def\emphbf{\bi}\def\emphsl{\sl}}{}} \def\emphsl{\groupedcommand{\sl\def\emphbf{\bs}\def\emphit{\it}}{}} \def\emphtf{\groupedcommand{\tf\def\e mphbf{\bf}\def\emphit{\it}\def\emphsl{\sl}} {}} -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
participants (2)
-
Adam Lindsay
-
Steffen Wolfrum