4

enter image description here

My question is: how can I make the equation number of the footnotesize equation desplayed in the normalsize? Currently, the equation number (2) appears too small in footnotesize.

\documentclass[a4paper,11pt]{report}
\usepackage[utf8]{inputenc}
% Math related
\usepackage{amsmath,amssymb}
% matrix spacing
\usepackage{tabstackengine}
\setstackEOL{\cr} 
%%%%%%%%%%%

\begin{document} This is the normalsize equation. \begin{equation} \label{eq.normal} \setstacktabbedgap{1pt} \begin{pmatrix} \frac{dF_1(t,:T_1)}{F_1(t,:T_1)}\ \frac{dF_2(t,:T_2)}{F_i(t,:T_2)}\ \vdots\ \frac{dF_N(t,:T_N)}{F_N(t,:T_N)}\ \end{pmatrix} = \parenMatrixstack{ v_{11} & v_{12} & v_{13}\cr v_{21} & v_{22} & v_{23}\cr \vdots & \vdots & \vdots\cr v_{N1} & v_{N2} & v_{N3} } \parenMatrixstack{ \sqrt{\lambda_{1}}&0 & 0\cr 0 & \sqrt{\lambda_{2}} & 0\cr 0 & 0 & \sqrt{\lambda_{3}} } \begin{pmatrix} dZ_{1}(t)\ dZ_{2}(t)\ dZ_{3}(t)\ \end{pmatrix} \end{equation} \

This is the footnotesize equation. \footnotesize{ \begin{equation} \label{eq.footnotesize} \setstacktabbedgap{1pt} \begin{pmatrix} \frac{dF_1(t,:T_1)}{F_1(t,:T_1)}\ \frac{dF_2(t,:T_2)}{F_i(t,:T_2)}\ \vdots\ \frac{dF_N(t,:T_N)}{F_N(t,:T_N)}\ \end{pmatrix} = \parenMatrixstack{ v_{11} & v_{12} & v_{13}\cr v_{21} & v_{22} & v_{23}\cr \vdots & \vdots & \vdots\cr v_{N1} & v_{N2} & v_{N3} } \parenMatrixstack{ \sqrt{\lambda_{1}}&0 & 0\cr 0 & \sqrt{\lambda_{2}} & 0\cr 0 & 0 & \sqrt{\lambda_{3}} } \begin{pmatrix} dZ_{1}(t)\ dZ_{2}(t)\ dZ_{3}(t)\ \end{pmatrix} \end{equation} } \normalsize \

\end{document}

yufiP
  • 107

3 Answers3

5

Using \footnotesize before an equation is not the best thing to do, because it would impact on the baseline skip of the text before the equation.

I suggest a new environment where you can decide the font size.

\documentclass{article}
\usepackage{amsmath}

\ExplSyntaxOn \NewDocumentEnvironment{sequation}{O{\small}b} { \yufip_sequation:nnn {equation}{#1}{#2} }{} \NewDocumentEnvironment{sequation}{O{\small}b} { \yufip_sequation:nnn {equation}{#1}{#2} }{} \cs_new_protected:Nn \yufip_sequation:nnn { \begin{#1} \mbox{#2$\displaystyle#3$} \end{#1} } \ExplSyntaxOff

\begin{document} This is the normalsize equation. \begin{equation} \label{eq.normal} \begin{pmatrix} \frac{dF_1(t,:T_1)}{F_1(t,:T_1)}\[1ex] \frac{dF_2(t,:T_2)}{F_i(t,:T_2)}\ \vdots\ \frac{dF_N(t,:T_N)}{F_N(t,:T_N)}\ \end{pmatrix} = \begin{pmatrix} v_{11} & v_{12} & v_{13}\ v_{21} & v_{22} & v_{23}\ \vdots & \vdots & \vdots\ v_{N1} & v_{N2} & v_{N3} \end{pmatrix} \begin{pmatrix} \sqrt{\lambda_{1}}&0 & 0\ 0 & \sqrt{\lambda_{2}} & 0\ 0 & 0 & \sqrt{\lambda_{3}} \end{pmatrix} \begin{pmatrix} dZ_{1}(t)\ dZ_{2}(t)\ dZ_{3}(t)\ \end{pmatrix} \end{equation} This is the footnotesize equation. \begin{sequation}[\footnotesize] \label{eq.footnotesize} \begin{pmatrix} \frac{dF_1(t,:T_1)}{F_1(t,:T_1)}\[1ex] \frac{dF_2(t,:T_2)}{F_i(t,:T_2)}\ \vdots\ \frac{dF_N(t,:T_N)}{F_N(t,:T_N)}\ \end{pmatrix} = \begin{pmatrix} v_{11} & v_{12} & v_{13}\ v_{21} & v_{22} & v_{23}\ \vdots & \vdots & \vdots\ v_{N1} & v_{N2} & v_{N3} \end{pmatrix} \begin{pmatrix} \sqrt{\lambda_{1}}&0 & 0\ 0 & \sqrt{\lambda_{2}} & 0\ 0 & 0 & \sqrt{\lambda_{3}} \end{pmatrix} \begin{pmatrix} dZ_{1}(t)\ dZ_{2}(t)\ dZ_{3}(t)\ \end{pmatrix} \end{sequation} This is the small equation, without equation number. \begin{sequation} \begin{pmatrix} \frac{dF_1(t,:T_1)}{F_1(t,:T_1)}\[1ex] \frac{dF_2(t,:T_2)}{F_i(t,:T_2)}\ \vdots\ \frac{dF_N(t,:T_N)}{F_N(t,:T_N)}\ \end{pmatrix} = \begin{pmatrix} v_{11} & v_{12} & v_{13}\ v_{21} & v_{22} & v_{23}\ \vdots & \vdots & \vdots\ v_{N1} & v_{N2} & v_{N3} \end{pmatrix} \begin{pmatrix} \sqrt{\lambda_{1}}&0 & 0\ 0 & \sqrt{\lambda_{2}} & 0\ 0 & 0 & \sqrt{\lambda_{3}} \end{pmatrix} \begin{pmatrix} dZ_{1}(t)\ dZ_{2}(t)\ dZ_{3}(t)\ \end{pmatrix} \end{sequation}

\end{document}

enter image description here

egreg
  • 1,121,712
  • Thank you for the suggestion. I copied and pasted the new environment from your answer \ExplSyntaxOn... to \ExplSyntaxOff, after changing the document class from current report to article. But it gives errors within the comments \NewDocumentEnvironment. What am I missing? Apologies for the elementary question. – yufiP Sep 09 '21 at 11:07
  • @yufiP Add \usepackage{xparse}, but you should better upgrade your TeX system – egreg Sep 09 '21 at 19:45
  • I am using an online editor (overleaf) for a large project there. Trying to find out how I can upgrade the tex system running in the background. At this moment, after adding xparse package, in this block of codes \cs_new_protected:Nn \yufip_sequation:nnn { \begin{#1} \mbox{#2$\displaystyle#3$} \end{#1} }

    underlines '_' and '\begin' '\end' didn't seem working and the compiled output does not produce the desired outcome.

    – yufiP Sep 10 '21 at 08:57
  • @yufiP You need TeX Live 2019 or later. – egreg Sep 10 '21 at 09:03
  • I managed to produce the desired outcome! (I am sorry, I was not aware there was an unnecessary command causing the problem in my previous file). All sorted now. Thanks for your guidance. – yufiP Sep 10 '21 at 10:03
3

Another possibility uses the medsize environment, from nccmath (~ 80 % of \displaystyle):

\documentclass[a4paper,11pt]{report}
% Math related
\usepackage{amsmath,amssymb}
% matrix spacing
\usepackage{nccmath} 
\usepackage{tabstackengine}
\setstackEOL{\cr}
%%%%%%%%%%%

\begin{document} This is the normalsize equation. \begin{equation} \label{eq.normal} \setstacktabbedgap{1pt} \begin{pmatrix} \frac{dF_1(t,:T_1)}{F_1(t,:T_1)}\ \frac{dF_2(t,:T_2)}{F_i(t,:T_2)}\ \vdots\ \frac{dF_N(t,:T_N)}{F_N(t,:T_N)}\ \end{pmatrix} = \parenMatrixstack{ v_{11} & v_{12} & v_{13}\cr v_{21} & v_{22} & v_{23}\cr \vdots & \vdots & \vdots\cr v_{N1} & v_{N2} & v_{N3} } \parenMatrixstack{ \sqrt{\lambda_{1}}&0 & 0\cr 0 & \sqrt{\lambda_{2}} & 0\cr 0 & 0 & \sqrt{\lambda_{3}} } \begin{pmatrix} dZ_{1}(t)\ dZ_{2}(t)\ dZ_{3}(t)\ \end{pmatrix} \end{equation} \

\begin{equation} \label{eq.normal}

\begin{medsize} \setstacktabbedgap{1pt} \begin{pmatrix} \frac{dF_1(t,:T_1)}{F_1(t,:T_1)}\ \frac{dF_2(t,:T_2)}{F_i(t,:T_2)}\ \vdots\ \frac{dF_N(t,:T_N)}{F_N(t,:T_N)}\ \end{pmatrix} = \parenMatrixstack{ v_{11} & v_{12} & v_{13}\cr v_{21} & v_{22} & v_{23}\cr \vdots & \vdots & \vdots\cr v_{N1} & v_{N2} & v_{N3} } \parenMatrixstack{ \sqrt{\lambda_{1}}&0 & 0\cr 0 & \sqrt{\lambda_{2}} & 0\cr 0 & 0 & \sqrt{\lambda_{3}} } \begin{pmatrix} dZ_{1}(t)\ dZ_{2}(t)\ dZ_{3}(t)\ \end{pmatrix} \end{medsize} \end{equation}\

This is the footnotesize equation. \footnotesize{ \begin{equation} \label{eq.footnotesize} \setstacktabbedgap{1pt} \begin{pmatrix} \frac{dF_1(t,:T_1)}{F_1(t,:T_1)}\ \frac{dF_2(t,:T_2)}{F_i(t,:T_2)}\ \vdots\ \frac{dF_N(t,:T_N)}{F_N(t,:T_N)}\ \end{pmatrix} = \parenMatrixstack{ v_{11} & v_{12} & v_{13}\cr v_{21} & v_{22} & v_{23}\cr \vdots & \vdots & \vdots\cr v_{N1} & v_{N2} & v_{N3} } \parenMatrixstack{ \sqrt{\lambda_{1}}&0 & 0\cr 0 & \sqrt{\lambda_{2}} & 0\cr 0 & 0 & \sqrt{\lambda_{3}} } \begin{pmatrix} dZ_{1}(t)\ dZ_{2}(t)\ dZ_{3}(t)\ \end{pmatrix} \end{equation} } \normalsize

\end{document}

enter image description here

Bernard
  • 271,350
3

The mathtools package -- a superset of the amsmath package -- provides the commands \newtagform and \usetagform that make it straightforward to enforce \normalsize for the equation numbers and their associated parentheses. E.g.,

\newtagform{normalsize}[\normalsize]{\normalsize(}{\normalsize)}

In the following screenshot, the same equation is typeset 3 times: at \normalsize (the default), \footnotesize, and \Large. Because we execute \usetagform{normalsize}, the equation numbers do not vary in size even as the displayed math does.

enter image description here

\documentclass[11pt]{report}
\usepackage{mathtools}
\newtagform{normalsize}[\normalsize]{\normalsize(}{\normalsize)}
\setlength\textwidth{7cm} % just for this example

\begin{document} \usetagform{normalsize} \begin{equation} \label{eq.normal} 1+2+3+4+5=15 \end{equation} % \footnotesize% \begin{equation} \label{eq.footnotesize} 1+2+3+4+5=15 \end{equation} % \Large% \begin{equation} \label{eq.Large} 1+2+3+4+5=15 \end{equation} \end{document}

Mico
  • 506,678
  • 1
    mathtools and adjusting tagform is the way to go, but add some text (at least 2 lines) before each of these displays and watch what happens to the baselines. That "gotcha" is underappreciated (or simply unrecognized) by many (most?) authors, and need to be better known. – barbara beeton Sep 08 '21 at 21:40
  • @barbarabeeton - Thanks. I deliberately kept my answer very focused on just the task at hand -- keeping the equation numbers' sizes constant even as the main font size is being changed. As the OP hasn't provided a use case to motivate the query, I'm afraid I'm not in a position to say much on the subject of varying the baseline skip that might be directly useful to his/her document. – Mico Sep 08 '21 at 22:39
  • Thank you both. I was ignorant about the gotcha problems! Relating to that point I nominated egreg's answer. But it was very helpful to know 'tagform' too! – yufiP Sep 10 '21 at 10:06