2

Everytime I press Typeset, I get a notification of

Runaway argument.

l.30\begin{document}

I read that I would solve it by deleting the aux.file of the document.

Any idea what to do?


I have tried to find the error by deleting parts of the code, without any result. Even though the document does not contain any actual text, still it reads error. Thus I am left with the prospect that something is wrong in the preamble, which is why I am posting it below:

\documentclass[a4paper, titlepage]{report}

\usepackage[T1]{fontenc}

\usepackage[swedish]{babel}

\usepackage{yfonts}

\usepackage{amsthm}

\usepackage{amssymb,amsmath}

\usepackage{bussproofs}

\usepackage{framed}

\usepackage{enumerate}

\newtheorem{thm}{Sats}[section]

\newtheorem{prop}[thm]{Proposition}

\newtheorem{lem}[thm]{Lemma}

\newtheorem{cor}[thm]{Följdsats}

\newtheorem{ex}[thm]{Övning}

\theoremstyle{definition}

\newtheorem{definition}[thm]{Definition}

\newtheorem{example}[thm]{Exempel}

\theoremstyle{remark}

\newtheorem*{rem}{Anmärkning}

\newtheorem{note}{Kommentar}

\numberwithin{equation}{subsection}

\title{Analys 1 (Övningar)}

\author{-}

\date{\today}
\begin{document}

\end{document}
Cost
  • 4,517
  • 2
    Welcome to TeX.SX! What you read somewhere else doesn’t seem to be very good advice. The aux file is often necessary; I’d only delete it once I’m done (for now) with editing a document. For more details see http://tex.stackexchange.com/questions/11123/prevent-pdflatex-from-writing-a-bunch-of-files. As for your actual problem, the runaway argument is pointing at some problem in your code. Try to create a minimal working example (MWE) and ask about it here if you need more help. – doncherry Nov 05 '13 at 11:39
  • 2
    The added code doesn't show errors; on the other hand, it has accented characters and there is no loading of inputenc, which is quite wrong. Can you tell what file encoding you're using? – egreg Nov 11 '13 at 08:59

2 Answers2

4

You only delete the .aux file if it is corrupted. TexLive will inform you if this is required.

I just had this happening when having an error in code. You need to fix an error in the code that corrupts your .aux file. For me it was a mistake in coding a new macro. Otherwise your .aux will be corrupted each time, I think, and you'd need to delete it each time.

It's always a error in the code that causes this. Delete parts of code and see if it keeps happening. Check order of commands when several are in one line. And you probably missed a bracket somewhere. This can corrupt the .aux. Once you find the error and delete it or fix it, the problem should go away.

If you code is not causing corruption of the .aux (your LaTeX distribution will tell you if this happened or not), don't delete it.

Please post a MWE for the actual error.

3

I realize that this is a very old question, but I have just stumbled upon it experiencing the same problem. The root cause turned out to be radically different than a mistake in the code for me, so I thought I will leave it here for others who also happen to stumble upon this question.

I am using VS Code together with the LaTeX Workshop extension to edit my LaTeX document. In default configuration, the extension launches compilation of the document whenever any changes to the files are saved. What I did not realize is that I had two instances of VS Code open with the same document, so whenever a file was saved, two compilations were simultaneously launched, causing the auxiliary files to get corrupted.

The solution was obviously closing one of the instances and making sure that only one LaTeX compilation runs at a time.