1

the following MWE produces a subequation numbering of 1a and 1b. However, I would like to have it displayed as 1A and 1B. I probably have to rename, \theequation, but so far I did not have any success :(. Do you know the correct code?

Thank you

\documentclass{report}
\usepackage{amsmath}
\begin{document}
\begin{subequations}
\begin{align} 
3 &= 1+2 \\
6 &= 2+4 
\end{align}
\end{subequations}
\end{document}

1 Answer 1

6

You can patch the subequations environment with etoolbox's \patchcmd to use \Alph instead of \alph:

\documentclass{report}
\usepackage{amsmath}
\usepackage{etoolbox}
\patchcmd\subequations{\alph}{\Alph}{}{\GenericError{}{Patching failed.}{}{}}
\begin{document}
\begin{subequations}
\begin{align} 
3 &= 1+2 \\
6 &= 2+4 
\end{align}
\end{subequations}
\end{document}

enter image description here

EDIT: If hyperref is already loaded, instead of patching subequations we have to patch HyOrg@subequations. The following does so (without testing whether hyperref is actually loaded):

\documentclass{report}
\usepackage{amsmath}
\usepackage{etoolbox}
\usepackage[]{hyperref}
\makeatletter
\AtBeginDocument
  {%
    \patchcmd\HyOrg@subequations
      {\alph}{\Alph}{}{\GenericError{}{Patching failed}{}{}}%
  }
\makeatother
\begin{document}
\begin{subequations}
\begin{align} 
3 &= 1+2 \\
6 &= 2+4 
\end{align}
\end{subequations}
\end{document}

EDIT2: If you can control when hyperref is loaded, you can simply do the patching of the first code in this answer, and load hyperref afterwards. hyperref uses the definition in effect when it was loaded.

3
  • Thank you for the quick answer. Unfortunately I use patching of subequations together with the hyperref package. The patching only works if hyperref is loaded before amsmath and etoolbox. It then, however, generates a pdfTeX warning (ext4): destination with the same identifier... warning. If hyperref is loaded after amsmath and etoolbox, no warning is produced but then the patching also does not work. Has anyone an idea how to fix this?
    – Thet619
    Dec 15, 2019 at 16:38
  • @Thet619 see my edit.
    – Skillmon
    Dec 16, 2019 at 0:10
  • Thank you, now compiles correctly without any errors :)
    – Thet619
    Dec 16, 2019 at 10:26

You must log in to answer this question.

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