6

I am working on a document which contains a wide range of font styles and sizes. I am using commands such as \ss to change to sans serif, \tfa to set the font size to size "a", and \bf to make text boldface. I am also using brackets to define which areas receive which formatting.

I found the behavior is sometimes unpredictable. Here is an example:

\starttext
    {\ss
        This is 12pt sans serif text. \crlf
        {\tfc This is 20.7pt sans serif text.} \crlf
        {\bf
            This is 12pt bold sans serif text. \crlf
    {\tfc This is 20.7pt bold sans serif text.} \crlf
    {\tfc \bf This is 20.7pt bold sans serif text.} \crlf
        }
     }
     This is 12pt serif text.
\stoptext

In this example, \ss from line 2 sets all text within the brackets to sans serif, however, the \bf command in line 5 does create boldface text in line 7.

Why is the text on line 7 ignoring the \bf command on line 5?

0

1 Answer 1

6

Both \bf and \tf are font alternatives. So, only one can be active at a time. If you just want to scale according to a, b, c values, use:

\unprotect
\unexpanded\def\setbodyfontscale#1%
    {\font_helpers_set_current_font_size{#1}\the\everybodyfont}
\protect

\setbodyfontscale{c}
2
  • In LaTeX \bf is therefore deprecated in favour of \textbf. Why is there no equivalent in ConTeXt?
    – mb21
    Jul 25, 2013 at 12:18
  • 1
    There is: \bold. It is equivalent to both \textbf and \bfseries.
    – Aditya
    Jul 26, 2013 at 5:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .