3

I'm copy-editing a paper where the author used \fontsize to resize equations:

\documentclass[11pt]{article}
\usepackage{amsmath}
\pagestyle{empty}
\begin{document}
 
Normal size equation and equation number:
\begin{equation}
x+y=z
\end{equation}

Resized size equation and equation numbers
{\fontsize{8pt}{0}
\begin{align}
\widehat{P}_1 & = 3 {\left(N + 3\right)} {\left(N + 2\right)} {\left(N + 1\right)}^{2} N^{2} {\left(N - 1\right)} {\left(N - 2\right)} {\left(N - 3\right)} Q_{mult} Q_{1} \label{EQ1}\\
\widehat{P}_2 & = 3 {\left(N + 1\right)} N^{2} {\left(N - 1\right)} {\left(N - 2\right)} {\left(N - 3\right)} Q_{mult} Q_{2}
\label{EQ2}\end{align}}

\end{document}

enter image description here

In the most cases the resizing is acceptable (ugly but acceptable) but I need the equation numbers not be resized. Can I get the equation numbers to not be resized?

2
3

I'm not sure this is typographically sound.

\documentclass{article}
\usepackage{amsmath}
\usepackage{xpatch}

\makeatletter
\let\nicolardi@align@preamble\align@preamble
\xpatchcmd{\nicolardi@align@preamble}
  {&\hfil}
  {&\nicolardi@size\hfil}
  {}{}
\xpatchcmd{\nicolardi@align@preamble}
  {&\setboxz@h}
  {&\nicolardi@size\setboxz@h}
  {}{}
\newenvironment{sizedalign}[1]
  {\def\nicolardi@size{#1}\let\align@preamble\nicolardi@align@preamble\align}
  {\endalign}
\makeatother

\begin{document}

\begin{align}
a &= b \\
c &= ddddddddd
\end{align}
\begin{sizedalign}{\footnotesize}
a &= b \\
c &= ddddddddd
\end{sizedalign}

\end{document}

enter image description here

Here's your example, with the needed corrections: I removed all \left and \right commands and the useless braces; moreover, the mult subscript requires \mathrm.

\begin{sizedalign}{\footnotesize}
\widehat{P}_1 & = 3(N+3)(N+2)(N+1)^{2}N^{2}(N-1)(N-2)(N-3)Q_{\mathrm{mult}}Q_{1}
\label{EQ1}\\
\widehat{P}_2 & = 3(N+1)N^{2}(N-1)(N-2)(N-3)Q_{\mathrm{mult}} Q_{2}
\label{EQ2}
\end{sizedalign}

enter image description here

Explanation. The align environment uses \halign with a suitable preamble that's stored in \align@preamble which defines repeatable pairs of columns. The macro is copied and the copy is patched to add at the beginning of every cell the size declaration given as argument to sizedalign. This new environment locally redefines \align@preamble to the patched copy, then calls \align to do the work.

3
  • I didn't understand what you mean with "no useless braces and \mathrm for the subscript". In the example you are using \mathrm for the subscript. Anyway I don't need the subscripts to be always in roman. – Gabriele Nicolardi Feb 28 at 23:33
  • @GabrieleNicolardi I reworded the comment. – egreg Mar 1 at 8:02
  • Ah, ok! Thanks! I know that mult subscript requires \mathrm. I would have fixed it later. But thank you for pointing it. – Gabriele Nicolardi Mar 1 at 19:45
2

I propose a variant solution with the medmath command from nccmath, which reduces the size of math formulæ by about 20 % (so the result will not be exactly 8 pt, but not very different):

    \documentclass[11pt]{article}
    \usepackage{amsmath, nccmath}
    \pagestyle{empty}

    \begin{document}

    Resized size equation and equation numbers
    {\fontsize{8pt}{0}
    \begin{align}
    \widehat{P}_1 & = 3 {\left(N + 3\right)} {\left(N + 2\right)} {\left(N + 1\right)}^{2} N^{2} {\left(N - 1\right)} {\left(N - 2\right)} {\left(N - 3\right)} Q_\text{mult} Q_{1} \label{EQ1}\\
    \widehat{P}_2 & = 3 {\left(N + 1\right)} N^{2} {\left(N - 1\right)} {\left(N - 2\right)} {\left(N - 3\right)} Q_\text{mult} Q_{2}
    \label{EQ2}\end{align}}

    With the medmath command:
    \begin{align}
    \medmath{\widehat{P}_1} & = \medmath{3 {\left(N + 3\right)} {\left(N + 2\right)} {\left(N + 1\right)}^{2} N^{2} {\left(N - 1\right)} {\left(N - 2\right)} {\left(N - 3\right)} Q_\text{mult} Q_{1} }\label{EQ1}\\
    \medmath{\widehat{P}_2 }& = \medmath{3 {\left(N + 1\right)} N^{2} {\left(N - 1\right)} {\left(N - 2\right)} {\left(N - 3\right)} Q_\text{mult} Q_{2}}
    \label{EQ2}
    \end{align}

    Normal size:
    \begin{align}
    \widehat{P}_1 & = 3 {\left(N + 3\right)} {\left(N + 2\right)} {\left(N + 1\right)}^{2} N^{2} {\left(N - 1\right)} {\left(N - 2\right)} {\left(N - 3\right)} Q_\text{mult} Q_{1} \label{EQ1}\\
    \widehat{P}_2 & = 3 {\left(N + 1\right)} N^{2} {\left(N - 1\right)} {\left(N - 2\right)} {\left(N - 3\right)} Q_\text{mult} Q_{2}
    \label{EQ2}
\end{align}
\end{document} 
 

enter image description here

4
  • Can you please provide the code for your solution? – Gabriele Nicolardi Feb 28 at 20:13
  • Sorry, it seems I had a copy-paste accident. I'l fix that instantly. Thanks! – Bernard Feb 28 at 20:15
  • Thanks for your \medmath solution but, in my case, it requires to much work. – Gabriele Nicolardi Feb 28 at 20:33
  • I also tried the medsize environment, but unfortunately it does not seem to be compatible with align (don't know whether it is due to the & or the `\\` ). – Bernard Feb 28 at 20:40
0

As Ulrike Fischer suggested in the comments I solved with:

\makeatletter
  \def\my@tag@font{\normalsize}
  \def\maketag@@@#1{\hbox{\m@th\normalfont\my@tag@font#1}}
  \let\amsmath@eqref\eqref
  \renewcommand\eqref[1]{{\let\my@tag@font\relax\amsmath@eqref{#1}}}
\makeatother

provided here: https://tex.stackexchange.com/a/100148/33634

I learned a lot also from egreg and Bernard answers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.