Generalerror from \input{} but not from same code in main file

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
kaneofawesome
Posts: 2
Joined: Tue Feb 22, 2011 1:30 am

error from \input{} but not from same code in main file

Post by kaneofawesome »

Hello,

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?
Last edited by kaneofawesome on Tue Feb 22, 2011 8:46 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

kaneofawesome
Posts: 2
Joined: Tue Feb 22, 2011 1:30 am

Re: error from \input{} but not from same code in main file

Post by kaneofawesome »

found the problem...
my filenames had underscores in them. That's why latex gave me "missing $" errors.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

error from \input{} but not from same code in main file

Post by localghost »

kaneofawesome wrote:found the problem […]
Then please mark the topic (not the last post) accordingly as written in Section 3 of the Board Rules (to be read before posting).


Best regards and welcome to the board
Thorsten
Post Reply