Math & Science ⇒ Sans for text, Roman for Equations?
Sans for text, Roman for Equations?
Ideally without having to change every equation in a document...
Thanks!
Edit: Solved below.
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
Sans for text, Roman for Equations?
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}
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}
Re: Sans for text, Roman for Equations?
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!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Sans for text, Roman for Equations?
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10