Really strange demand..
Changing math font may help you---font Euler can be loaded by \usepackage{euler}
.
\documentclass{article}
\usepackage{euler}
\usepackage{amsmath}
\begin{document}
\[
E = mc^2.
\]
\end{document}
In addition, \usepackage[LGRgreek]{mathastext}
may be what you are looking for, see here:
\documentclass{article}
\usepackage[LGRgreek]{mathastext}
\usepackage{amsmath}
\begin{document}
\[
E = mc^2.
\]
\end{document}
Or, if you want to use your own font, have a look at the section 3.4 "Declaring math alphabets" of document fntguide (type texdoc fntguide
in terminal window).
Indeed, I strongly advise not to do evil things like printing all math upright.. PLUS ONE.
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:
Best Answer
Mico’s solution works, but here’s a more comprehensive set of options.
Traditional TeX used commands such as
\mathit
,\mathrm
and\mathbf
both for words in math mode and also for math symbols. Theunicode-math
package attempts to separate these two things. Compare:By default in
fontspec
,\mathit
gives you the first (iff typeset as a word, not the product of the three math symbols i, f and f). As you’ve seen, it defaults to using the text font for\mathrm
,\mathit
and\mathbf
. Here are some ways to override that.The Simple Fix
You’re using
\mathit
and want it to behave like\symit
. There’s aunicode-math
package option for that,mathit=sym
.Here. I used Fira Math as a sans-serif math font that matches reasonably well. You mentioned that you’re using any serif math font; the default for Office’s Equation Editor is Cambria Math.
If you still want to use words in math mode, and have them appear in the main text font, you can use the commands
\textnormal
and\textit
in math mode.If you’re using
\mathit
this way, you might also expect\mathrm
and\mathbf
to work the same way, so the command you want might in fact beSay Precisely What You Mean
You want the behavior of
\symit
, rather than the default behavior of\mathit
underunicode-math
, which isn’t precisely the same as the default behavior of\mathit
under other packages. Your code will be much less likely to break unexpectedly when you copy it into another document if you write\symit
or\textit
in your source, instead of the ambiguous\mathit
.Change the
\mathit
FontThe
\setmathrm
command fromfontspec
also lets you set the\mathit
,\mathbf
and\mathbfit
fonts, as theItalicFont
,BoldFont
andBoldItalicFont
of\mathrm
:Use a Legacy Math Font
You don’t have to use
unicode-math
. If you loadfontspec
with theno-math
option, it will leave the existing definition of\mathit
unchanged. Here is one of the few combinations of legacy sans-serif math packages that works, more or less: