In order to create a different font style, such as italics or bold, start a group with an open bracket, issue the command, and close the group with a closed bracket.
% create italics style {\it The Old Man and the Sea}
Here are the commands for the different font styles.
{\bf bold } {\sl slanted} {\it italics} {\bi bold and italics} {\bs bold and slanted} {\sc small caps}
ConTeXt has a style that most word processors don’t, the slanted style. This style slants the style like italics, but is still distinct.
The em command allows more flexibility for emphasizing text because it takes the context into consideration. If the surrounding font is upright, it will make the emphasized text slanted. If the surronding text is slanted, it will make it upright. The following example is hypothetical title of a book about the American novel Huck Finn. The title itself will be slanted, but Huck Finn will not.
{\em Thoughts on {\em Huck Finn}}
The default font face for ConTeXt is serif. In order to create different font faces, such as sans serif, look at the following example.
{\rm roman text} {\tt mono spaced font} {\ss sans serif} {\hw this is hand written style} {\cg this is caligraphic style}
Set the body font size with the setupbodyfont command.
\setupbodyfont[12pt]
The setupbodyfont is also used to set up font family.
Use the switchtobodyfont to switch your body font.
{\switchtobodyfont[18pt] 18 point font}
An alternative to explicitly changing font size by a declaration is switching them proportionally by increasing or decreasing them by a size. (I’m not sure exactly how ConTeXt determines a size.) In order to increase the font size, use the letter a, b, c, or d after a font command (which I’ll explain below). In order to decrease the font size, use one or more of the letter x after a font command.
By font command, I mean any command that changes a font’s appearance, such as bf. If you wanted to create a font face which is bold in appearance, and decrease it by one size, type:
{\bfx bold reduced by one size}
If you just want to change the font size without changing any other characteristic, use the tf (type face) command followed by a letter.
{\tfa increase the font size by one size}
You can use the font-increasing/decreasing letters with bf, sl, it, rm, ss, tt, cg, hw, and sc. I may have missed some commands, so if you think you can add a letter after a font command, experiment.
{\tfxx decrease the font size by two} {\tfa increase font size by one} {\bfa increase font size by one and make bold} {\tfb increase font size by two} {\ssd create a sans serif font and increase its size by four}
Create space with the hspace command. You will first have to define the amount of space with the definespace command.
\definehspace[mine][12pt] \hspace[mine]
The high and low commands create super- and subscript text.
You can walk in \high{high} heels, but your height is still the same.\par You can walk in \low{low} heels, but your height is still the same.\par
copyright 2005 Paul Henry Tremblay
License: GPL
home | contents | previous | next
last updated: 2005-05-08