7

Some colleagues and I are writing a series of math notes and the house style (not up to us) is to use the Gotham Book family of fonts. So our math italic font is Gotham Book Italic.

We're noticing that some of the placement of symbols is less than optimal. See for instance the MWE below:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathspec}
\setmainfont{Gotham Book}
\setmathrm{Gotham Book}
\setmathfont(Digits,Latin){Gotham Book}
\begin{document}
\begin{align*}
    f'(x) &= x^2 \\
    f\,'(x) &= x^2 \\
\end{align*}
\end{document}

sample output

In the first line the prime symbol is crashing into the f. Adding a thin space (second line) makes it look almost right, but obviously we don't want to go adding \,s throughout the code.

Is there a way to automatically add space to the f in this font to prevent the crashing?

  • Define your own prime \newcommand\myprime{\,'} – A.Ellett Feb 6 '15 at 18:35
5

You're forgetting the proper mathspec way:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathspec}
\setmainfont{Gotham Book}
\setmathrm{Gotham Book}
\setmathfont(Digits,Latin){Gotham Book}
\begin{document}
\begin{align*}
"f'(x) &= x^2 \\
f'(x) &= x^2 \\
f\,'(x) &= x^2
\end{align*}
\end{document}

enter image description here

With the italic font (that I managed to find in the meanwhile):

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathspec}
\setmainfont{Gotham Book}
\setmathrm{Gotham Book}
\setmathfont(Digits,Latin){Gotham Book}

\begin{document}
\begin{align*}
"f'(x) &= x^2 \\
"h'(x) &= x^2 \\
"g'(x) &= x^2
\end{align*}

\end{document}

enter image description here

| improve this answer | |
  • Ah, no I didn't forget; I've never known that syntax! I had trouble finding it in mathspec's documentation, too. But there it is, in the code comments: put the " before a character, e.g $􏰐"f$􏰐, and the character is printed with kerns on either side. – Matthew Leingang Feb 6 '15 at 18:45
  • 1
    @egreg -- matthew's visual shows the italic "f"; yours is upright. i think something has been omitted from matthew's code. one could remedy the spacing by creating a virtual font for the gotham book italic, with "proper" italic corrections, but it would be a real pain. – barbara beeton Feb 6 '15 at 19:26
  • 1
    @barbarabeeton I only found the upright version. Now it's with italics. – egreg Feb 6 '15 at 20:33
-1

Use ^{\prime}, e.g.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathspec}
\begin{document}
\begin{align*}
&f^{\prime}(x) = x^2\\
&f^{\prime \prime}(x) = 2 x
\end{align*}
\end{document}

prime

| improve this answer | |
  • Typing $f'(x)$ or $f^{\prime}(x)$ produces exactly the same result. – egreg Feb 7 '15 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.