13

Everytime i change equation font size using \footnotesize the label (for example (3.12)) on the right side also changes its size. Is tere a way to change equation font size but not its label font size? Or maybe even vice versa - to change label font size but not equation font size.

This is how i usually write down equations:

\begin{minipage}[t]{\textwidth}
\footnotesize
\begin{equation}\label{eee013}
\begin{split}
f(x) = A e^{-\frac{(x-\textcolor{1}{\mu})^2}{2 \textcolor{1}{\sigma^2}}}
\end{split}
\end{equation}
\end{minipage}
1
  • the code that will be used for this when amsmath is overhauled is in the answer to Use of \small in the equation environment. for convenience, here's the code: \renewcommand{\maketag@@@}[1]{\hbox{\m@th\normalsize\normalfont#1}} (don't know whether this question should now be considered a duplicate.) Commented Feb 27, 2013 at 19:09

3 Answers 3

16

The \maketag@@@ macro, which is responsible for producing equation numbers in amsmath, is defined as follows:

\def\maketag@@@#1{\hbox{\m@th\normalfont#1}}

You can see that it sets \normalfont but doesn't alter the font size, so in your case the number is also in footnote size. To change the size of all equation numbers back to the document font size, add the following lines to your preamble, after \usepackage{amsmath}:

\makeatletter
\def\maketag@@@#1{\hbox{\m@th\normalfont\normalsize#1}}
\makeatother

You can also replace \normalsize with any other sizing command, of course.

Note: please add a minimal working example (MWE) next time you ask a question. In particular, you didn't mention that you were using the amsmath and color/xcolor packages, and that you defined a new color 1. This made your code harder to read.

edit:

A drawback of this approach is that amsmath's \eqref macro also formats references using \maketag@@@. So if you don't want these references to be typeset in \normalsize, you could for example also redefine \eqref. To do this, use the following code fragment instead of the one given above:

\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

Then, everything you define as \my@tag@font will be used for equation numbers, but discarded for \eqref references.

3
  • There is one problem. This solution makes all the oher labels within text look smaller too. Can this be prevented? I want only a label lying next to equation to look smaller and not all the labels.
    – 71GA
    Commented Feb 27, 2013 at 11:55
  • 1
    @71GA see my recent edit Commented Feb 27, 2013 at 12:52
  • Your last edit is awesome, but there is one problem: Usually, under a theorem statement, which is in textit format by default, LaTeX brings the labels without the textit format, but with this hack it shows the labels also italic, which seems weird. how would you fix this bug?
    – Dr Potato
    Commented Jun 15, 2020 at 1:38
9

Please always post complete documents showing all packages used. I had to make some guesses based on commands used in the fragment.

enter image description here

You can add \normalsize to the command used to set the equation number in AMS alignments.

\documentclass{article}
\usepackage{color,amsmath}
\definecolor{1}{rgb}{1,0,0}
\makeatletter
\def\maketag@@@#1{\hbox{\m@th\normalfont\normalsize#1}}
\makeatother

\begin{document}
\centering

\begin{minipage}[t]{\textwidth}
\footnotesize
\begin{equation}\label{eee013}
\begin{split}
f(x) = A e^{-\frac{(x-\textcolor{1}{\mu})^2}{2 \textcolor{1}{\sigma^2}}}
\end{split}
\end{equation}
\end{minipage}

\begin{minipage}[t]{\textwidth}
\begin{equation}\label{eee013x}
\begin{split}
f(x) = A e^{-\frac{(x-\textcolor{1}{\mu})^2}{2 \textcolor{1}{\sigma^2}}}
\end{split}
\end{equation}
\end{minipage}

\end{document} 

Note putting equations in minipages defeats most of the above and below display space logic, it should only be needed in special cases.

2
  • Sorry, @David, didn't see that you'd beat me to the answer by two minutes ;) Commented Feb 27, 2013 at 11:15
  • @benwilfut no harm done, your answer is identical even down to the complaint about lack of MWE:-) Commented Feb 27, 2013 at 11:26
4

I assume you are using the amsmath-package. You can change the formatting and style of the equation numbers using

\makeatletter
    \def\tagform@#1{\maketag@@@{\normalsize(#1)\@@italiccorr}}
\makeatother

Here I added \normalsize just before the opening brace. Here is a complete example:

\documentclass{article}
\usepackage{amsmath}
\usepackage{color}

\begin{document}

the small equation, with small equation number
\footnotesize
\begin{equation}\label{eee013-a}
    \begin{split}
        f(x) = A e^{\cfrac{(x-\textcolor{red}{\mu})^2}{2 \textcolor{red}{\sigma^2}}}
    \end{split}
\end{equation}
\normalsize

for comparison: a normal equation
\begin{equation}\label{eee013-b}
    \begin{split}
        f(x) = A e^{\cfrac{(x-\textcolor{red}{\mu})^2}{2 \textcolor{red}{\sigma^2}}}
    \end{split}
\end{equation}

%changing the equation number to 'normalsize'
\makeatletter
    \def\tagform@#1{\maketag@@@{\normalsize(#1)\@@italiccorr}}
\makeatother

the small equation with 'normalsized' equation number
\footnotesize
\begin{equation}\label{eee013-c}
    \begin{split}
        f(x) = A e^{\cfrac{(x-\textcolor{red}{\mu})^2}{2 \textcolor{red}{\sigma^2}}}
    \end{split}
\end{equation}

\end{document}

Screenshot

2
  • Sorry, I have't seen the other two answeres when posting mine... Is there no alert that somebody else already posted something when composing my answere, or have I missed something? Commented Feb 27, 2013 at 11:14
  • You should have had an alert that there was another answer and an option to redisplay Commented Feb 27, 2013 at 11:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .