Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mathfont not working: for xelatex, mathspec package is required #734

Closed
njbart opened this issue Jan 28, 2013 · 0 comments
Closed

mathfont not working: for xelatex, mathspec package is required #734

njbart opened this issue Jan 28, 2013 · 0 comments

Comments

@njbart
Copy link

njbart commented Jan 28, 2013

Using the mathfont variable leads to a latex error:

pandoc -V mathfont="Minion Pro" --template=default.latex --latex-engine=xelatex -o file.pdf file.txt

gives

pandoc: Error producing PDF from TeX source.
! Undefined control sequence.
l.20     \setmathfont

Reason:
\setmathfont is a command from the mathspec package not contained in the fontspec package.

I’d suggest replacing fontspec by mathspec – for xelatex only, however; apparently mathspec does not work with lualatex.

With xelatex, I have had good results using a template with

\usepackage{mathspec}
...
$if(mainfont)$
    \setallmainfonts[Numbers=OldStyle]{$mainfont$}
$endif$
$if(sansfont)$
    \setsansfont[Numbers=OldStyle]{$sansfont$}
$endif$
$if(monofont)$
    \setmonofont{$monofont$}
$endif$
$if(mathfont)$
    \setmathsfont(Digits,Latin,Greek)
    [Numbers={Lining,Proportional}]{$mathfont$}
$endif$

Setting math fonts in lualatex seems possible too. I have never used lualatex, but http://tex.stackexchange.com/questions/34855/selecting-main-math-font-in-luatex has suggestions.

@jgm jgm closed this as completed in 466cc17 Apr 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant