General ⇒ error from \input{} but not from same code in main file
-
- Posts: 2
- Joined: Tue Feb 22, 2011 1:30 am
error from \input{} but not from same code in main file
I'm having a problem with the \include and \input commands. I have something like...
\include{file1}
\include{file2}
\include{file3}
where file2 has only the following...
\section{Background}
some text
\subsection{something}
some text
\subsubsection{something}
some text
\subsection{something}
some text
And I get errors saying "1.21 missing $ inserted."
If I cut the contents of file2 and paste them in the main document, these compile errors don't show up. I'm not changing them at all. The \input{file2} still has the compile errors. Has anyone else had this problem?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 2
- Joined: Tue Feb 22, 2011 1:30 am
Re: error from \input{} but not from same code in main file
my filenames had underscores in them. That's why latex gave me "missing $" errors.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
error from \input{} but not from same code in main file
Then please mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting).kaneofawesome wrote:found the problem […]
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10