Math & ScienceSans for text, Roman for Equations?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
EdGatzke
Posts: 13
Joined: Thu Dec 02, 2010 5:48 pm

Sans for text, Roman for Equations?

Post by EdGatzke »

Is there an easy way to specify sans serif fonts for text in LaTeX and Roman / Times for equations?

Ideally without having to change every equation in a document...

Thanks!

Edit: Solved below.
Last edited by EdGatzke on Thu Dec 09, 2010 5:50 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Sans for text, Roman for Equations?

Post by frabjous »

This can be done very easily. See, e.g., this thread, but it would help to know exactly what fonts you want!


For Computer Modern Roman math and Computer Modern sans text:

Code: Select all

\documentclass{article}
\usepackage[english]{babel} % required for blindtext
\usepackage{blindtext} % for auto-generating a document

\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\blindmathpaper % auto-generate math document
\end{document}
For Times math with Helvetica text:

Code: Select all

\documentclass{article}
\usepackage[english]{babel} % required for blindtext
\usepackage{blindtext} % for auto-generating a document
\usepackage[T1]{fontenc}
\usepackage{txfonts}

\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\blindmathpaper % auto-generate math document
\end{document}
If you want some other combination, let us know which.
EdGatzke
Posts: 13
Joined: Thu Dec 02, 2010 5:48 pm

Re: Sans for text, Roman for Equations?

Post by EdGatzke »

Thanks a ton for helping me out! I had troubles with the blindtext, but your link to the other thread and some more googling got me fixed. I though I had searched on this adequately, but apparently not.

I am a big idiot. I am using Beamer which defaults to sans for all fonts. I finally found a nice example with a variety of example pages, and one of them pointed out the beamer class takes a option of mathserif that does exactly what I needed, equations are in serif and text is in sans.

In case you want to see some nice beamer font combo examples, here it is:
http://math.ecnu.edu.cn/~latex/beamer/MathFonts.pdf

Thanks again!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Sans for text, Roman for Equations?

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.


Thorsten
Post Reply