I'm trying to use Verdana as the math font in beamer slides written in Markdown and rendered with pandoc using XeLaTeX as the PDF engine. As specifying Verdana with pandoc's mathfont option directly doesn't seem to have any effect, I tried resorting to the mathastext LaTeX package. While the latter takes care of the letters, digits are not rendered with Verdana. According to this post, mathastext needs to be loaded before fontspec to properly render the digits with the desired font; however, I'm not sure how to do that with pandoc. The following example raises an Option clash for package fontspec
error, which suggests that fontspec is being loaded before the lines in the header-includes option:
---
mainfont: Verdana
header-includes: |
\usepackage{mathastext}
\usepackage[no-math]{fontspec}
---
## Test
This is an equation: $E = m c^2$
Any thoughts as to how to address the above scenario to properly render everything in Verdana?
mathastext
you need to edit the tempate. You can get the default from pandoc withpandoc -D latex > mytemplate.latex
, edit that file and and call pandoc with the option--template=mytemplate.latex