[Tex/LaTex] How to get the concrete font for math only

fontsmath-mode

Is there a package that loads the concrete font, but only for the math, not for the normal text?

Best Answer

Using How To Change Math Font Only? as a guide, here's what you can do:

enter image description here

\documentclass{article}
\usepackage{amsmath}% http;//ctan.org/pkg/amsmath
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{ccfonts}% http://ctan.org/pkg/{ccfonts}
\usepackage[T1]{fontenc}% http://ctan.or/pkg/fontenc
\renewcommand{\rmdefault}{cmr}% cmr = Computer Modern Roman
\begin{document}
\lipsum[1]
\begin{equation}
  \frac{1}{2\pi}\int_\gamma f=\sum_{k=1}^m n(\gamma;a_k)\mathrm{Res}(f;a_k) \label{eq}
\end{equation}
Take a look at $n(\gamma;a_k)$ in~\eqref{eq}.
\end{document}

Note that inline (or text style) and display math both use Concrete, while the equation numbers are set in Computer Modern.

The idea is, as mentioned in the linked post, you set the entire font change, and revert \rmdefault back to the font of your choice - cmr (or Computer Modern Roman) in this case.

If you're using other type face families, like \textsf and \texttt, these have to be modified (reverted as well):

\renewcommand{\ttdefault}{cmtt}% cmtt = Computer Modern Typewriter
\renewcommand{\sfdefault}{cmss}% cmss = Computer Modern Sans-Serif