0

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}
3

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 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}
| improve this answer | |
  • 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 '19 at 16:38
  • @Thet619 see my edit. – Skillmon likes topanswers.xyz Dec 16 '19 at 0:10
  • Thank you, now compiles correctly without any errors :) – Thet619 Dec 16 '19 at 10:26

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.