2

I want to typeset mostly text with about four math formulae in Bitstream Charter font.

Here is the MWE:

\definefontfamily[mainface][rm][charter] \definefontfamily[mainface][ss][DejaVuSans] \definefontfamily[mainface][tt][Latin Modern Mono] [features=none] \definefontfamily[mainface][mm][charter] \setupbodyfont[mainface,rm,12bp] \starttext \input tufte \startformula \mathrm {NPV} =\sum _{n=0}^{N}{\frac{C_{n}}{(1+r)^{n}}}=0 \stopformula \stoptext 

The document compiles but it uses LM Roman 10 in body and Latin Modern Math in math formulae.

So I tried few things:

I used xcharter for rm and mm font. Didn't work. The error message was:

Sorry, but I can't typeset math unless various parameters have been set. This is normally done by loading special math fonts into the math family slots. Your font set is lacking at least the parameter mentioned earlier. mtx-context | fatal error: return code: 1 

I used xcharter for rm and charter for mm. The document compiled, body was in Extra Charter, and math formulae were in Latin Modern Math.

I tried other math fonts for mm from the list in ConTeXt Garden, and the document either compiled with wrong font, or failed with same error message.

How can I use Bitstream Charter, please? I am using ConTeXt LMTX Standalone (updated very recently). Thank you.

2 Answers 2

2

To use the charter serif font you have to change the fontname to XCharter (you can also write it all lowercase) and for the math font just load the existing typescript with \definetypeface.

\definefontfamily [mainface] [rm] [XCharter] \definefontfamily [mainface] [ss] [DejaVuSans] \definefontfamily [mainface] [tt] [Latin Modern Mono] [features=none] \definetypeface [mainface] [mm] [math] [xcharter] \setupbodyfont[mainface,rm,12bp] \starttext \input tufte \startformula \mathrm {NPV} =\sum _{n=0}^{N}{\frac{C_{n}}{(1+r)^{n}}}=0 \stopformula \stoptext 
3
\setupbodyfont[xcharter] 

should work.

4
  • It does, thank you. But then, how can I use ss and tt, if such needs arise? Commented Jul 22, 2024 at 10:56
  • You can for example copy (and rename) the typescript type-imp-xcharter.mkiv to your document directory, and edit it accordingly. But it should also be possible to use a setup in your file (not by computer, so cannot add how now). Commented Jul 22, 2024 at 11:38
  • I accepted the answer (since my question was really about using Charter font). But I am interested to know how to use sans serif and teletype. Commented Jul 22, 2024 at 13:33
  • Back. I would not be sad if you instead accept Wolfgang's answer, since I think that is more along the lines of what you wanted to do (even if that was not exactly what you wrote). Commented Jul 25, 2024 at 9:25

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.