9

I used a command to change the font family of my equation number, but it only affected the right parenthesis. The left one didn't change. What is going on? How do I fix this?

Thanks in advance!

MWE:

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage{amsmath}
     \renewcommand{\theequation}{\sffamily\footnotesize\bfseries\Alph{equation}} 

\begin{document}
\blindtext
\begin{equation}
    a^2 + b^2 = c^2
\end{equation}
\end{document}

Example of error: enter image description here

  • What do you mean? The opening parenthesis is normal, and the closing parenthesis is boldface? – Bernard May 11 '18 at 18:35
  • And what do you want, exactly? – Bernard May 11 '18 at 18:36
  • 2
    you have (\theequation) so if you put a font change in \theequation then it will naturally only apply on one side (but you shouldn't put formatting in \thezzz counter macros. – David Carlisle May 11 '18 at 18:42
  • Ok - but is there now a better way to change the font of equation caption? – D5E May 11 '18 at 18:45
10

I don't know if this is the most correct way of doing this, but...

enter image description here

The macro that holds the format of the equation tag is \maketag@@@. The standard definition is \hbox {\m@th \normalfont #1}, where #1 is (\theequation).

Adapting it to your example:

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage{amsmath}
\makeatletter
\renewcommand{\theequation}{\Alph{equation}}
\renewcommand{\maketag@@@}[1]{\hbox {\m@th \sffamily\footnotesize\bfseries #1}}
\makeatother

\begin{document}
\blindtext
\begin{equation}
    a^2 + b^2 = c^2
\end{equation}

\end{document}
13

Here it is, with the \newtagform command from mathtools:

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage{mathtools}
\renewcommand{\theequation}{\Alph{equation}}
\newtagform{sans}{\sffamily\bfseries\footnotesize(})

\begin{document}

\usetagform{sans}
\blindtext
\begin{equation}
    a^2 + b^2 = c^2
\end{equation}

\end{document} 

enter image description here

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.