2

I would like to use the following fonts within my exams:

  1. Normal text: Arial (12 pt)
  2. Math text: Times New Roman Mathtype (13 pt)

I use Arial with fontspec. How can I change the font and size math mode?

\documentclass[12pt,a4paper,addpoints]{exam}

\usepackage{amsmath} 
\usepackage{amssymb}    
\usepackage[dutch]{babel}
\usepackage{fontspec}

\setmainfont{Arial}

\begin{document}\noindent
    This exam is in accordance with the format of the Dutch Final Central Exams.
        \begin{questions}
            \question
            This text is \emph{Arial (12 pt)}.\\
            The following should be \emph{Times New Roman Mathtype (13 pt)}:    
               \[a^2+b^2=c^2\] and \[\alpha+\beta=\gamma\] and \[f(x)=\sin\left(\frac{1}{2}x+2\pi\right)\]
            Note that also $x+y=z$ should be in \emph{Times New Roman Mathtype (13 pt)}.
                \begin{parts}
                    \part[1000]
                    How is it done?
                \end{parts}
        \end{questions}
    End of the exam.    
\end{document}

Hereby an example of the format of the exam: Example of the format of the exam

And another one for the first two Greek letters: enter image description here

2 Answers 2

1

Egreg’s approach is the same basic one I would use, but a few subtleties.

First, your text will be too small. Here, “12 pt” almost certainly means twelve PostScript points of 1/72 inch. That’s what PDF, Word, and almost all software made since 1984 think a “point” means. But TeX is older than that, and has used a smaller “pt” for more than forty years. What other software calls a pt, it calls a bp, for “big point.” So, you’ll want to tell the document class to use 12bp, or 1/6", instead.

However, the standard TeX classes don’t let you do that, so you’ll want to load another package to change the size:

\usepackage[fontsize=12bp]{scrextend}

You don’t give a sample of the Dutch exam style, but the intent is probably to make the letter x the same height in text and math mode, which you can do with Scale=MatchLowercase. If it’s the capital letters that should line up, use Scale=MatchUppercase instead. Since all other fonts should scale to the main font, it’s simpler to make this the default:

\defaultfontfeatures{Scale=MatchLowercase}

Next, this specifies “Times New Roman Mathtype.” Since there is no such font, I take it to mean Times New Roman, as used by the program Mathtype. That’s a problem, since Mathtype takes its math symbols and Greek from Symbol, which doesn’t use a standard encoding. You’re going to have to substitute another math font, such as XITS or TeX Gyre Termes Math.

There is a way to get Times New Roman for your math letters, if the slight differences between it and other Times clones matter to you: the range= option of \setmathfont. Be aware that some systems still have an old version of Times New Roman and Arial from the ’90s, which did not include Greek.

Which leaves us with:

\documentclass[a4paper,addpoints]{exam}
\usepackage[fontsize=12bp]{scrextend}
\usepackage[dutch]{babel}
\usepackage{unicode-math}

\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{Arial}[Scale=1.0]
\setsansfont{Arial}
\setmathfont{XITS Math}
%\setmathfont{Times New Roman}[range={up,"00-"FF}]
%\setmathfont{Times New Roman Italic}[range=it]
%\setmathfont{Times New Roman Bold}[range=bfup]
%\setmathfont{Times New Roman Bold Italic}[range=bfit]

\begin{document}\noindent
    This exam is in accordance with the format of the Dutch Final Central Exams.
        \begin{questions}
            \question
            This text is \emph{Arial (12 pt)}.\\
            The following should be \emph{Times New Roman Mathtype (13 pt)}:    
            \[a^2+b^2=c^2\]
            Note that also $x+y=z$ should be in \emph{Times New Roman Mathtype (13 pt)}.\\
            And some Greek: $\Alpha\Beta\alpha\beta\symup{\alpha\beta}$. % These commands work in unicode-math.
                \begin{parts}
                    \part[1000]
                    How is it done?
                \end{parts}
        \end{questions}
    End of the exam.    
\end{document}

You can uncomment the \setmathfont command to change the font, which gives you:

Arial + Times New Roman sample

13
  • I added an example of the format to the original post. I'm not sure about the Mathtype. I asked an employee of the company how makes the exams and he told me 'Arial 12' for the text and 'times new roman 13 Math type' for the formulas.
    – KenAdams
    Commented Jun 28, 2023 at 20:24
  • @KenAdams From your description, I assume he means he uses the MathType software by Design Science, with those settings.
    – Davislor
    Commented Jun 28, 2023 at 20:28
  • It works and looks good though. All give a closer look to compare with the other solution to see which one I prefer. But this made my day!
    – KenAdams
    Commented Jun 28, 2023 at 20:38
  • @KenAdams Thanks for the sample. Based on that, the exams appear to be written in ISO 80000-2 style; that is, with capital letters for variables and functions italicized and constants such as π upright. To match that, \usepackage[math-style=ISO]{unicode-math} and write \uppi instead of pi. Write \symup{e} for other constants, or define \newcommand\upe{\symup{e}}.
    – Davislor
    Commented Jun 28, 2023 at 20:48
  • You're right: the output of \symup{e} is in accordance with the one used on the exams. Thanks. I'll give the unicode-math package a brief study later on.
    – KenAdams
    Commented Jun 28, 2023 at 21:43
1

I made an experiment:

\documentclass[12pt]{article}
\usepackage{fontspec}

\setmainfont{Arial}
\newfontfamily{\stix}{STIX Two Text}

\begin{document}

A{\stix A}

\sbox0{A}\the\ht0

\sbox0{\stix A}\the\ht0

\end{document}

enter image description here

Doing 8.58984/7.944 gives 1.081299 (rounding to the sixth decimal digit). Note that 13/12=1.083333.

Now if I do

\documentclass[12pt]{article}
\usepackage{fontspec}

\setmainfont{Arial}
\newfontfamily{\stix}{STIX Two Text}[Scale=1.081299]

\begin{document}

A{\stix A}

\sbox0{A}\the\ht0

\sbox0{\stix A}\the\ht0

\end{document}

I get

enter image description here

and I guess that the purpose of the specification is to have equal height for text and math.

If I implement it in your exam code:

\documentclass[12pt,a4paper,addpoints]{exam}

\usepackage{amsmath} 
\usepackage{amssymb}    
\usepackage[dutch]{babel}
\usepackage{unicode-math}

\setmainfont{Arial}
\setmathfont{STIX Two Math}[Scale=1.081299]

\begin{document}\noindent
    This exam is in accordance with the format of the Dutch Final Central Exams.
        \begin{questions}
            \question
            This text is \emph{Arial (12 pt)}.\\
            The following should be \emph{Times New Roman Mathtype (13 pt)}:    
            \[a^2+b^2=c^2\]
            Note that also $x+y=z$ should be in \emph{Times New Roman Mathtype (13 pt)}.
                \begin{parts}
                    \part[1000]
                    How is it done?
                \end{parts}
        \end{questions}
    End of the exam.    
\end{document}

enter image description here

For completeness, here's the output with Scale=1.083333:

enter image description here

Instead of STIX Two Math you may use TeX Gyre Termes Math.

4
  • That's great. Look much better than how it used to be. Especially things sin(x) and log(x) functions which were eyesore.
    – KenAdams
    Commented Jun 28, 2023 at 20:31
  • @KenAdams Text in Arial and math in Times is not the best choice, IMHO, but I understand you have to cope with rules set by people probably unaware of math typography.
    – egreg
    Commented Jun 28, 2023 at 20:39
  • What is IYHO the best choice?
    – KenAdams
    Commented Jun 28, 2023 at 21:29
  • @KenAdams Serif for everything.
    – egreg
    Commented Jun 28, 2023 at 21:51

You must log in to answer this question.

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