# How to select a font for math mode only?

I use the class a0poster to write a poster.

\documentclass[a0,portrait]{a0poster}


I have chosen a font named "AntPolt", which however turns out to only take effect on regular text.

\usepackage{antpolt}


Because I do not want to use the default math font, I need to select a slanted font for the math as well, under the condition that the main text is in antpolt. How can I achieve that?

PS. The font eulervm can almost be suitable, except that it is upright.

Note, that text fonts and math fonts are completely independent in every dialect of TeX and LaTeX. By default, they are from the same design (Computer Modern), but you can change either the text fonts or the math fonts (usually be loading a suitable font package).

Note also, that there thousands of usable text fonts around, but math fonts are rare beasts (and math fonts usable with TeX/LeTeX are even more rare).

There are packages for LaTeX setting only the text fonts, only the math fonts, or doing both at the same time (like mathptmx).

For your question, I suggest the package euler in addition to the AntPol font package:

\usepackage{antpolt}
\usepackage{euler}


An alternative to the euler/eulervm packages ist the mathpazo package providing Palatino based math fonts. The order of the packages matters, load mathpazo first, and antpolt second.

\usepackage{mathpazo}
\usepackage{antpolt}


If I remember correctly, texts in math mode are already in italics(slanted). Anyway, with XeLaTeX you can choose dedicated font family for math, roman(main font), san serif, and teletypefont to meet your purposes. If you want to change the fonts in math mode, \setmathrm{} to set the main math font, and bold math font can be set with \setboldmathrm{}.

If you are using pdflatex, then you need to change it to xelatex and the rest is the same.

Here is the example.

\documentclass[portrait]{article}
\usepackage{amsmath} % for aligning the texts in math mode
\usepackage{antpolt}
\usepackage{fontspec,xunicode} % to change the fonts
%\setmainfont{Optima} % to change the font for the main roman text
\setmathrm{Optima} % here is the line to change the font for the math
% if you want to change to other fonts,
% then you have it installed in your system.
%\setboldmathrm[BoldFont={Optima ExtraBlack}]{Optima Bold}
% use this line, if you need to change the bold math font
\begin{document}
Here is a sample.
$foo = \int ^{6} _{x} fd(x) dx$

\begin{align}
foo~is~roman \\
\textbf{bar~is~bold}  \\
\textit{baz~is~italic} \\
\textit{\textbf{qux~is~bold~and~italic}} \\
\textsc{foobar~is~Upright} \\
\sum^{100}_{i=0} = \frac{ \mu \times 10^6}{\int^{10}_{1} x^2 dx}
\end{align}
\end{document}


The result is as follows.

texdoc fontspec to learn more about fonts in LaTeX.