Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to use the \include command to import chapters into Latex. For some reason, Latex is completely ignoring files in the \include command. If I replace \include with \input they are included fine, why might this be? FOr information I am using TeXnicCenter on windows. It fails for both Latex and pdflatex.

\documentclass[10pt,twoside,openright]{report} 

\begin{document}

% Ignored
\include{./integrated_linear_generator_models.tex}

% Works
\input{./integrated_linear_generator_models.tex}

\end{document}
share|improve this question
    
Have you tried taking the ./ out of the paths? –  qubyte Nov 14 '11 at 12:06
    
Did you try without the ./? I remember windows LaTeX sometimes being confused with the slash, backslash. –  Andy Nov 14 '11 at 12:08
    
Actually I've just discovered it works if I remove the '.tex' from the filename!! Is this how it's supposed to work? –  crobar Nov 14 '11 at 12:09
2  
@crobar: Yes, the .tex is always optional but not allowed for \include. The reason is that it also creates a <name>.aux file and needs the name without extension for that. –  Martin Scharrer Nov 14 '11 at 12:11
    
ok, I hadn't come across that in any of the places I'd found documentation on the \include command (first two results of google). Thanks, by the way. –  crobar Nov 14 '11 at 12:14

1 Answer 1

up vote 7 down vote accepted

The issue is the .tex extension. It is always optional and will be added automatically. However, in the case of \include is is not be allowed. The reason is that it also creates a <name>.aux file and needs the name without extension for that. Otherwise it will create <name>.tex.aux and try to read `<name>.tex.tex, which causes the error.

You should also try to avoid the ./ which might cause also some issues and isn't required as well.

So simply use:

\include{integrated_linear_generator_models}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.