4

I am trying to change the font for two levels of headings, \title and subject in ConTeXt. Although the code for changing the font for titles is not different from the one for changing the font for subjects, only titles show up in Zapf Chancery.

This is my 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

It produces the following output:

Output of the minimal working example

Removing the call to \switchtobodyfont[chorus] in mytitle makes the subtitle use Zapf Chancery, however, I was unable to get them both use Zapf Chancery at the same time.

Thanks in advance for your help!

Note: I already asked this question in the German forum TeXWelt about two weeks ago, but unfortunately got no answer. See https://texwelt.de/fragen/29432/context-schriftart-einer-uberschrift-und-unteruberschrift-andern.

1
  • Welcome to TeX.SE! Good that you also referred to the other site where you asked this question. (+1)
    – mickep
    Commented Apr 17 at 18:30

1 Answer 1

5

Use the style key.

\setuphead
  [title,subject]
  [style=\switchtobodyfont[chorus]]


\starttext
\title{In Zapf Chancery}
\subject{Apparently the default font. Why?}

And in the default font, just as expected.
\stoptext

Chorus in title and subject

If you want them in separate styles/sizes, you go with one for title and one for subject.

1
  • 1
    Thank you very much for your help!
    – guemax
    Commented Apr 18 at 10:01

You must log in to answer this question.

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