7

I am getting the following error code:

./main.aux:113:
Missing \endcsname inserted.
<to be read again> 
                   \protect 
l.113 ... find region o

f proportionality}{{1}{10}}

Minimum working example (long due to vague error):

\documentclass[a4paper]{article}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage[utf8x]{inputenc}
\usepackage{siunitx}
\usepackage{filecontents}
\usepackage{amsmath}
\usepackage[titletoc]{appendix}
\usepackage{mathtools}
\usepackage{subcaption}
\usepackage{caption}
\usepackage[verbose]{placeins}
\graphicspath{ {images/} }

\begin{document}

%the following section is included as it is around line 113
text $^{241}\textrm{Am}$ text 
\begin{equation}
^{241}_{95}\textrm{Am}\rightarrow ^{237}_{93}\textrm{Np}+^4_2\alpha
\end{equation}

%the following section is included as it is the last bit i worked on
\section{text}

text B$\textrm{F}_3$ text

\begin{figure}[h]
\includegraphics[scale=0.5]{file.png}
\centering
\caption{text B$\textrm{F}_3$ text}
\label{text}
\end{text}

\section{text}

\section{text}

\bibliographystyle{ieeetr}
\bibliography{references}

\section{Appendices}
\subsection{Appendix A}

\begin{table}[h]
\centering
\caption{text B$\textrm{F}_3$ text}
\label{text}
\begin{tabular}{|c|c|}
\hline
data taken from table generator so v.likely correct
\end{tabular}
\end{table}


\end{document}

2 Answers2

10
./main.aux:113:
Missing \endcsname inserted.
<to be read again> 
                   \protect 
l.113 ... find region of proportionality}{{1}{10}}

The error is caused by line 113 in the *.aux file, not the .tex file. The end of line 113 looks like a label definition with an entity (section, equation, figure, ...) numbered with 1 on page 10.

The label name in \label{...} must survive a \csname ...\endcsname. Thus, my suspicion is that the label name contains stuff (non-ASCII letters, ...) that breaks in the .aux file.

Heiko Oberdiek
  • 271,626
  • I have not created a .aux file. Is this something that is created automatically? – Adam Woolsey Mar 05 '18 at 22:18
  • I used the recompile from scratch function in overleaf and all is working well thanks for your help!! – Adam Woolsey Mar 05 '18 at 22:32
  • 1
    @AdamWoolsey The .aux file is created automatically. For example, it stores the contents for the \label commands. Then, at the next LaTeX run, the .aux file is read and \ref can now use the label data from the .aux file. – Heiko Oberdiek Mar 05 '18 at 22:52
1

I had a very similar error:

<...> aux ! Missing \endcsname inserted. <to be read again> <...>

Heiko Oberdiek's answer led me to suspect the characters in the following line were the cause:

\bibliographystyle{~/.TeXfiles/C-APAbibliographystyle.bst}

This is itself a reference to a symlink (.TeXFiles) in my home directory.

When I instead used a symlink just one directory up from my .tex file (to make the symlink I ran: ln -s ~/<...>/TeXfiles/C-APAbibliographystyle.bst C-APAbibliographystyle.bst in the directory above my .tex file), and not the path-in-TeX-file method (\bibliographystyle{~/.TeXfiles/C-APAbibliographystyle.bst}), my new line became simply:

\bibliographystyle{../C-APAbibliographystyle.bst}

Fixed.

I don't know if it was the ~ or the . or if there was something about sending TeX on that particular path to the file (to my home dir, then through a symlink to the target file), but I'm using the same file in the same location, only via a cleaner symlink path.

jeffrecode
  • 11
  • 1