1

This question already has an answer here:

I have an urgent question. I am writing a document and I have equations (but they are more than 26). I get the error 'counter too large'. I saw in other topics that I need to use alphalph package but it does not work and I still get the same error. I would be so grateful if you help me solve this. I have copied and pasted a minimal example of my code and all packages which I am using:

\documentclass {article} 
\usepackage[T1,T5]{fontenc}
\usepackage{amsthm}
\usepackage{latexsym}
\usepackage[cmex10]{amsmath}
\usepackage{amsfonts,amssymb,amsthm}
\usepackage{graphicx}
\usepackage{psfrag,balance,arydshln}
\usepackage{rotating}
\usepackage{mempatch}
\usepackage{ifdraft}
\usepackage[cp1252]{inputenc}
\usepackage{acronym}
\usepackage{textcomp}   
\usepackage[swedish,english]{babel} 
\usepackage{cleveref}   
\usepackage{xr}     
\usepackage{nomencl}  
\usepackage{bibentry}
\usepackage{color}
\usepackage{url}    
\usepackage{bbold}  
\usepackage{paralist}
\usepackage{enumitem}
\usepackage{bm}     
\usepackage{pgfplots}   
\usepackage{epstopdf}   
\usepackage{nameref}    
\usepackage{dsfont}     
\usepackage{verbatim}
\usepackage{glossaries} 
\usepackage{gensymb}
\usepackage{algorithmic}
\usepackage{enumerate}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage{cite}
\usepackage{hhline}
\usepackage{multirow}
\usepackage{framed}
\usepackage{lipsum}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{capt-of}
\usepackage{makecell}
\usepackage{appendix}
\usepackage[none]{hyphenat}
\usepackage{pgfplots}   
\usepackage{pgfplotstable}  
\usepackage{mathtools}
\usepackage{tikz}       
\usepackage{xcolor}     
\usepackage{alphalph,etoolbox}
    \allowdisplaybreaks

\begin{document}
\section{section 1}
\begin{subequations}
\label{equation1}
\begin{align}
& a=b+c \\ 
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c 
\end{align}
\end{subequations}
\end{document}

Thank you

marked as duplicate by Mico, Stefan Pinnow, Mensch, Zarko, diabonas Sep 2 '17 at 22:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • off-topic: for reproduce your problem is sufficient the following preamble: \documentclass{article} \usepackage{alphalph,mathtools} \usepackage{etoolbox} \begin{document} ... – Zarko Sep 2 '17 at 19:00
  • 1
    Needless to load amsmath if you load mathtools, epsfig is obsolete (graphicx does the job) and enumerate is incompatible with enumitem. – Bernard Sep 2 '17 at 19:44
  • Are you sure about T5? – egreg Sep 2 '17 at 20:33
1

Your code is a little bit messed up. Several packages are repeated...

Anyways just very fastly i tried to fix with alphalph and etoolbox.

Try this:

\documentclass {article}

\usepackage[T1,T5]{fontenc}
\usepackage[cp1252]{inputenc}%%%lemme convince you to use utf8 here...
\usepackage[swedish,english]{babel}


\usepackage{amsthm, latexsym, amsfonts,amssymb, psfrag,balance,arydshln, bbold, pgfplots, epstopdf, dsfont}
\usepackage[cmex10]{amsmath}
\usepackage{graphicx, rotating, mempatch, ifdraft, color, enumitem, verbatim, gensymb, enumerate, epsfig, hhline}
\usepackage{textcomp, acronym, cleveref, xr, nomencl, url, paralist, bm, glossaries, algorithmic, pgfplots}
\usepackage{bibentry, nameref, booktabs, cite, multirow, framed, lipsum}
\usepackage{subcaption, capt-of, makecell, appendix, pgfplotstable, mathtools, xcolor, alphalph,etoolbox}

\usepackage[none]{hyphenat}
\usepackage{tikz}

 %%    
 %% I don't remember from where i got this
 %% probably from Werner user
 %%
\usepackage{alphalph}
\usepackage{etoolbox}
\newcommand{\alphalphval}[1]{\alphalph{\value{#1}}}
\AtBeginDocument{%
  \AtBeginEnvironment{subequations}{%
    \let\alph\alphalphval%
  }
}
   %%
   %% Probable Werner's code.
   %% Who knows please provide link here.
   %%

\allowdisplaybreaks

\begin{document}

\section{section 1}


\begin{subequations}\label{equation1}
\begin{align}
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c
\end{align}
\end{subequations}

\end{document}
  • U welcome! not my solution though. I had that code in one of my .tex files but i forgot who told me how to deal with it. – P. Oliva Sep 2 '17 at 19:05
1

Merely loading the alphalph package isn't enough. You also need to provide the following instruction after \begin{subequations} and before \begin{align}:

\renewcommand{\theequation}{\theparentequation \alphalph{\value{equation}}}

A full MWE:

\documentclass{article} 
\usepackage[T1,T5]{fontenc}
\usepackage[cmex10]{amsmath}
\allowdisplaybreaks
\usepackage[cp1252]{inputenc} % why not 'utf8'?
\usepackage{alphalph}   

\begin{document}
\begin{subequations}
\label{equation1}
\renewcommand{\theequation}{\theparentequation\alphalph{\value{equation}}}
\begin{align}
& a=b+c \\ 
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c \\
& a=b+c 
\end{align}
\end{subequations}
\end{document}

Not the answer you're looking for? Browse other questions tagged or ask your own question.