# Missing \endcsname inserted. <to be read again> \protect

I am getting the following error code:

./main.aux:113:
Missing \endcsname inserted.
\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
$$^{241}_{95}\textrm{Am}\rightarrow ^{237}_{93}\textrm{Np}+^4_2\alpha$$

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

• The parts of the code that you posted, by themselves, are correct and working. For we to find out what's going wrong we need a minimal working example (MWE) that produces this same error so we can debug your code. Mar 5 '18 at 21:58
• Looking at the error message you posted, it seems that the error occurs while reading line 113 of the .aux file, not of your source file. Try trashing the auxiliary files and recompiling.
– GuM
Mar 5 '18 at 22:08
• Ooohh, the .aux. Didn't notice that :\ Mar 5 '18 at 22:15
• I don't have a .aux file. I just have the main.tex, a .bib file, and then a series of .png images Mar 5 '18 at 22:17
• @AdamWoolsey The .aux is created by TeX. Try removing it, and compile again. If it doesn't work, read Heiko's answer carefully, it'll point you to the problem. Mar 5 '18 at 22:19

./main.aux:113:
Missing \endcsname inserted.
\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.

• I have not created a .aux file. Is this something that is created automatically? Mar 5 '18 at 22:18
• I used the recompile from scratch function in overleaf and all is working well thanks for your help!! Mar 5 '18 at 22:32
• @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. Mar 5 '18 at 22:52

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.