Changes

Jump to navigation Jump to search
3,341 bytes added ,  21:18, 14 May 2015
Merged the font sizes article
You can generally combine font styles with alternatives, so if you want to
switch to bold sans serif, you can use either <code>\bf\ss</code> or
<code>\ss\bf</code>. The various combinations look like the following.
There is a font switch {{cmd|em}} to ''emphasize'' text<context mode="mkiv">\setupbodyfont[8pt]\setupcolors[rgb, state=start]\definecolor[one][c=0, m=. This is somewhat4, y=1, k=0]special: it does automatic italic correction and changes the alternative dependingon the current alternative\definecolor[two][c=0, m=. For example2, if the current font alternative is normal (iy=.e5, k=0]\setupTABLE[frame=off,offset=0. upright)5em] \setupTABLE[c][2][style=\rm]\setupTABLE[c][3][style=\ss]\setupTABLE[c][4][style=\tt]\setupTABLE[r][1][background=color, backgroundcolor=one]\setupTABLE[c][1][background=color,backgroundcolor=one] \startTABLE \NC \NC \type{\rm} serif \NC \type{cmd|em\ss}sans serif \NC \type{\tt} switches to slanted; and if the current font alternative is slanted,teletype \NC \NR \NC \type{\tf} \NC Normal \NC Normal \NC Normal \NC \NR \NC \type{\bf} \NC \bf Bold \NC \bf Bold \NC \bf Bold \NC \NR \NC \type{\it} \NC \it Italic \NC \it Italic \NC \it Italic \NC \NR \NC \type{\sl} \NC \sl Slanted \NC \sl Slanted \NC \sl Slanted\NC \NR \NC \type{\bi} \NC \bi Bold Italic \NC \bi Bold Italic \NC \bi Bold Italic\NC \NR \NC \type{cmd|em\bs} \NC \bs Bold Slanted \NC \bs Bold Slanted \NC \bs Bold Slanted\NC \NR \NC \type{\sc} switches to normal. \NC \sc Smallcaps \NC \sc Smallcaps \NC \sc Smallcaps\NC \NR\stopTABLE
ConTeXt uses the Latin Modern fonts by default; these fonts looksimilar to the original Computer Modern fonts, but have a much largercharacter repertoire. As it happens, in the Latin Modern (and ComputerModern) fonts, the slanted font does not stand out from theupright font enough for some tastes; so, many people prefer to use theitalic font for emphasis. To do that use <texcode>\definebodyfontenvironment[default][em=italic]</texcodecontext>
A font switch remains valid for the rest of the ''group''. So, if you want to
And serif again
</context>
 
== Emphasizing text ==
There is a font switch {{cmd|em}} to ''emphasize'' text. This is somewhat
special: it does automatic italic correction and changes the alternative depending
on the current alternative. For example, if the current font alternative is normal (i.e. upright),
{{cmd|em}} switches to slanted; and if the current font alternative is slanted,
{{cmd|em}} switches to normal.
 
ConTeXt uses the Latin Modern fonts by default; these fonts look
similar to the original Computer Modern fonts, but have a much larger
character repertoire. As it happens, in the Latin Modern (and Computer
Modern) fonts, the slanted font does not stand out from the
upright font enough for some tastes; so, many people prefer to use the
italic font for emphasis. To do that use
<texcode>
\definebodyfontenvironment[default][em=italic]
</texcode>
 
== Font sizes ==
of <code>0.6</code>.
The complete set of relative font sizes are listed below:{| style="border:1px solid #ffcc00; width:100%; padding: 0.5em;" |- align="right"!size||factor ||4pt||5pt||6pt||7pt||8pt||9pt||10pt||11pt||12pt||14.4pt||17.3pt||20.7pt|- align="right"|xx ||0.6 ||4 ||5 ||5 ||5 ||5 ||5 ||6 ||7 ||8 ||10 ||12 ||14.4|- align="right"|x ||0.8 ||4 ||5 ||5 ||6 ||6 ||7 ||8 ||9 ||10 ||12 ||14.4 ||17.3|- align="right" style="background-color: #ffeebb;"|tf ||1.0 ||4 ||5 ||6 ||7 ||8 ||9 ||10 ||11 ||12 ||14.4 ||17.3 ||20.7|- align="right"|a ||1.2 ||4.8||6.0||7.2||8.4||9.6||10.8||12.0||13.2||14.4||17.3 ||20.7 ||24.8|- align="right"|b ||1.44 ||5.8||7.2||8.6||10.1||11.5||13.0||14.4||15.8||17.3||20.7||24.9 ||29.8|- align="right"|c ||1.728 ||6.9||8.6||10.4||12.1||13.8||15.6||17.3||19.0||20.7||24.9||29.9||35.8|- align="right"|d ||2.074 ||8.3||10.4||12.4||14.5||16.6||18.7||20.7||22.8||24.9||29.9||35.9||42.9|- align="right"|e ||2.488 ||10.0||12.4||14.9||17.4||19.9||22.4||24.9||27.4||29.9||35.8||43.0||52.5|-| _|- align="right"|scriptscript|| 0.5 ||4 ||5 ||5 ||5 ||5 ||5 ||5 ||6 ||7 ||9 ||10 ||12|- align="right"|script|| 0.7 ||4 ||5 ||5 ||6 ||6 ||7 ||7 ||8 ||9 ||11 ||12 ||14.4|- align="right"|small|| 0.8 ||4 ||4 ||5 ||5 ||6 ||7 ||8 ||9 ||10 ||12 ||14.4||17.3|- align="right"|big || 1.2 ||6 ||7 ||8 ||9 ||10 ||11 ||12 ||12 ||14.4||17.3||20.7||20.7|} As defined in the article on [[Font Sizessource:font-ini.mkiv|font-ini]].All sizes in pt, except factor. 
The mapping of particular command suffixes (a, x, etc.) and current bodyfont size to effective font size can
be changed by {{cmd|definebodyfontenvironment}}.The default values defined in [[source:font-ini.mkiv|font-ini]] are:<texcode>\definebodyfontenvironment [\s!default] [ \s!text=1.0, \s!script=0.7, \s!scriptscript=0.5, \c!a=1.200, \c!b=1.440, \c!c=1.728, \c!d=2.074, *=\currentfontscale, % wildcard \c!x=0.8, \c!xx=0.6, \c!big=1.2, \c!small=0.8, \c!interlinespace=, \c!em=\v!slanted]</texcode>   For example, if you want{{cmd|tfa}} to set the effective font size to 12pt when the bodyfont size is 10pt, and to set the effective font size to
14pt when the bodyfont size is 11pt, then add
<texcode>
</texcode>
{{cmd|definebodyfontenvironment}} is described in detail in
the ConTeXt manual and the [[source:font-ini.texmkiv|font-ini.tex]] source file.
Font size can be combined with font styles. As a shortcut, you can use

Navigation menu