1

I have been happily using latex with default fonts for Math mode and now our school has specified that all our test HAVE TO BE IN ARIAL. This is fine for the text part but when it comes to math mode, I need everything to be in arial EXCEPT the lower case letters, such as x, y z, etc. As below:

enter image description here

The following code obviously does not do what I want as the math output is all in cambria.

\documentclass[a4paper,addpoints,12pt]{exam}
\RequirePackage{amssymb,amsfonts,amsmath,latexsym, mathrsfs,unicode-math}
\setmathfont{Cambria Math}
\renewcommand{\rmdefault}{phv}
\renewcommand{\sfdefault}{phv}

\begin{document}
    $ 4x+y=ABC-2 $
\end{document}
  • There are several packages, which enable to use a sans font in math. I do not know, which of these is the best/most suitable, but take a look at: sfmath, sansmath, mathastext. I do use mathastext at the moment, but I do not know, which of these is the best solution (and haven't found one fully satisfying so far). – Skillmon Jun 15 '17 at 07:39
  • 1
    I guess there is no arial math, but you can use something like $4x+y=\text{ABC}-2$. – Michael Fraiman Jun 15 '17 at 07:46
  • @MichaelFraiman this way, x and y are not Arial. She would have to use \text{\textit{x}} for every variable in her document. I don't think this is a real option. – Skillmon Jun 15 '17 at 07:52
  • @Skillmon but x and y should not be in arial. – Michael Fraiman Jun 15 '17 at 07:54
  • Yes. x and y are fine as cambria. But typing \text{ABC} does not make it arial or even \textsf{ABC} does not work. – Angela van Wyngaard Jun 15 '17 at 07:57
  • @MichaelFraiman you're right, I overlooked that. – Skillmon Jun 15 '17 at 07:57
  • But if the test has to be ALL Arial, why is Cambria fine for small letters (I just don't get the reasoning here)? – Skillmon Jun 15 '17 at 07:59
  • @Skillmon I don't understand any reasons for Arial:-) – Michael Fraiman Jun 15 '17 at 08:02
  • @MichaelFraiman me neither (if I have to use it I just use helvet -- nobody who likes Arial will notice the difference), but the reasoning here is just a bit weirder in my eyes. – Skillmon Jun 15 '17 at 08:03
  • The lower case x in arial looks like a multiplication sign which is confusing to students. So the lower case letters need to look like proper mathematical symbols, hence the need for arial and cambria in math mode. Even if i have to define the font for the lower case letters in the preamble, that is fine, but I don't know how to do it. (I do not want to go back to MSWORD.) – Angela van Wyngaard Jun 15 '17 at 08:13
  • 1
    @AngelavanWyngaard are you sure that you need to typeset math in Arial also? I guess you can search this site for questions on using sans serif in math mode. Using different font families in one expression seems odd and is not recommended. – Michael Fraiman Jun 15 '17 at 09:05

2 Answers2

1

This is taken from my question Setting up a Sans Serif Document Including Math (in 2017, using pdftex).

sansmathfonts and helvet Package

\documentclass[preview]{standalone}

\usepackage{sansmathfonts}
\usepackage[scaled=0.95]{helvet}
\renewcommand{\rmdefault}{\sfdefault}

\usepackage{mathtools}
\begin{document}
Text
$\displaystyle
abc+\sum_{k=1}^{n}\int_{0}^{k}\sqrt{2}f(x)\,\text{d}x
$
Text
\end{document}

enter image description here

If you want upright letters then use \text{ABC} (provided by amsmath package which is loaded by mathtools package). You can see the result in the d of dx in my example.

0

These sound like requirements set by a Word user. Now (as noted by @Michael Fraiman) I don't think there is a version of Arial with a complete set of maths glyphs. However, I think Word uses Cambria for mathematics. So, you should get away with this (compile with lualatex or xelatex).

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{amsmath}
\setmainfont{Arial}
\setmathfont{Cambria Math}
\begin{document}
The quick brown fox jumps over the lazy dog.
\[
4x+y=ABC-2
\]
\[
4x+y=\text{ABC}-2
\]
\end{document}

enter image description here

Ian Thompson
  • 43,767