2

This question already has an answer here:

I have reduced my problem to a MWE and I have no idea what is going on.

The following code compiles and functions as expected when I remove the empheq package:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{empheq} %Put boxes around multiline equations/equation environments

\begin{document}

\tableofcontents

\section{blahsec1}
\subsection{blah1}
\subsection{blah2}
\section{blahsec2}
 \addtocontents{toc}{\setcounter{tocdepth}{1}} %
\subsection{blah1}
\subsection{blah2}

\end{document}

However, when I add the empheq package, I get the following error:

Missing number, treated as zero.

\begingroup l.5 ...oup \aftergroup \calc@B \calc@A \begingroup \aftergroup \calc@B \calc... A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look upweird error' in the index to The TeXbook.)

! Missing number, treated as zero. \afterassignment l.5 ...aftergroup \calc@B \calc@A \afterassignment \def {\GenericError {(cal... A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look upweird error' in the index to The TeXbook.)

marked as duplicate by Alan Munn, Community Feb 10 '18 at 19:58

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.