5

How can I change the font size of regular text and the font size of equations separately, but globally? I have a lot of equations in my document, and I want to reduce the font size of all regular text, while maintaining or even enlarging the font size of all equations. Changing all equations one by one (using grouping or something like that) is infeasible, and \DeclareMathSizes does not work for me.

If anyone has a global solution, that would be much apprectiated! As of now, I set the font size of all text (regular and math mode) by using \footnotesize at the beginning of the whole document, but this makes my equations too small to be legible.

\documentclass{article}
\usepackage[utf8]{inputenc}
\DeclareMathSizes{14pt}{12pt}{12pt}{12pt} 
\begin{document} 
\Huge Testing the math font size: $99.9\%$ 
\end{document}
4
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Aradnix
    Commented Nov 8, 2017 at 21:02
  • 2
    DeclareMathSizes is the answer, so if it isn't working, make a small complete document that can be used to debug and say what error you got Commented Nov 8, 2017 at 21:02
  • Well, many typographical decisions such as what you ask depend to a large extent on the typographical choice you have made. Since TeX was designed with the highest standards of typographical and editorial quality in mind, rather than separating the base sizes from the font size for text and equations, you could try other fonts that give you a visual look like the one you want. It's a myth that Computer Modern is the only typeface in LaTeX ;)
    – Aradnix
    Commented Nov 8, 2017 at 21:06
  • @DavidCarlisle I get no error; the math font size simply remains unchanged. Code for reference: \documentclass{article} \usepackage[utf8]{inputenc} \DeclareMathSizes{14pt}{12pt}{12pt}{12pt} \begin{document} \Huge Testing the math font size: $99.9\%$ \end{document}
    – user147753
    Commented Nov 8, 2017 at 21:06

2 Answers 2

5

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\DeclareMathSizes{24.88pt}{12pt}{12pt}{12pt} 
\begin{document} 
\Huge Testing the math font size: $99.9\%$ 
\end{document}

You had specified the math font sizes to use if the text font size was 14pt but your example text was Huge, and size10.clo specifies

\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}

so \Huge is \@xxvpt so more or less 25pt, but \DeclareMathSizes needs the exact size so you could use \@xxvpt or 24.88pt as I use above, the latex format defines these shortcuts for font sizes:

 \def\@vpt{5}
 \def\@vipt{6}
 \def\@viipt{7}
 \def\@viiipt{8}
 \def\@ixpt{9}
 \def\@xpt{10}
 \def\@xipt{10.95}
 \def\@xiipt{12}
 \def\@xivpt{14.4}
 \def\@xviipt{17.28}
 \def\@xxpt{20.74}
 \def\@xxvpt{24.88}
3

If you're free to use LuaLaTeX, you can make use of the unicode-math package and its \setmathfont directive, which takes a Scale=<some number> option. The following example employs Scale=2; obviously, you're free to use other scaling factors. (The default, you may have already guessed, is Scale=1.)

enter image description here

\documentclass{article}
\usepackage{geometry}

\usepackage{unicode-math}
\setmainfont{Latin Modern Roman} % select a suitable text font
\setmathfont{Latin Modern Math}[Scale=2] % set scaling factor

\newcommand\blurb{Test $H1+P2+U3$ Test}
\begin{document}
\tiny\blurb

\medskip
\footnotesize\blurb

\medskip
\normalsize\blurb

\bigskip
\Large\blurb

\bigskip
\huge\blurb
\end{document}

You must log in to answer this question.