Questions tagged [include]

{include} is about the \include command which makes LaTeX process the content of a given file, add page breaks before and after and open a new auxiliary file for the given file.

628 questions
71
votes
5 answers

How to include a document into another document?

I have two documents A and B. Both of them are separate documents. But document A also has to include document B. Now if I use \include{B} i get the following error: ! LaTeX Error: Can be used only in preamble. See the LaTeX manual or LaTeX…
65
votes
1 answer

Correct way to use include and includeonly when writing a large document like a thesis

I am writing a large document with several chapters and I would like to work on each chapter separately. In my main.tex I include the chapters either like \include{chap1.tex} \include{chap2.tex} \include{chap3.tex} or \input{chap1.tex} …
fpghost
  • 1,945
38
votes
3 answers

Using relative paths for \include commands

I have a top-level latex file: /thesis.tex And subfolders with chapters: /chap1/ch1.tex In thesis.tex I use \include commands like so: \include{chap1/ch1} And in ch1.tex I have more includes for the sections of the…
NP01
  • 2,935
24
votes
2 answers

(How) can I include the file somedir/file.tex in the file somedir/subdir/anotherfile.tex

I know that it is possible to include somedir/subdir/anotherfile.tex in somedir/file.tex by using \include{subdir/file}. Is it possible to do it the other way around? A Linux workaround that I'm aware of is a symbolic link of somedir/file.tex to…
Turion
  • 4,622
20
votes
1 answer

Include tex-files and compile separately

For a large project, I'd like to write each chapter on it's own. After that, I'd wish (of course) to incorporate all the chapters in a base document (the large project). I've heard ob \include and \input, but they don't seem to do what I'm searching…
Gabriel
  • 331
19
votes
1 answer

Why are my \include files ignored?

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…
crobar
  • 1,093
19
votes
2 answers

Is there an \exclude option?

When I'm debugging a big multifile project, it's often useful to make extensive use of \includeonly to narrow down where the problem is. but today I found myself using: \includeonly{chap1,chap2,chap4,chap5}. Surely \exclude{chap3} would be a simpler…
Seamus
  • 73,242
7
votes
1 answer

Skipping sections when compiling (without \include)

I'm writing a semi-long report with ten-ish sections - in other words, just short enough so that it's practical to keep it all in one file without getting lost. However, for compiling it'd be extremely useful to be able to skip some sections and…
Mary
  • 71
7
votes
1 answer

A variant of \includeonly

Is there a way to have pdfLaTeX emit separate PDF files for each \included file, and somehow massage the \include/\includeonly mechanism so that when using the \includeonly command those files are inserted in the resulting PDF file, but only the…
7
votes
3 answers

Standalone compilation of sources intended for \input{} or \include{}

My LaTeX workflow involves frequent recompiles (good ol' C-c C-c in AucTeX). Right now I'm working on a large document that's composed of chapters, each in an individual file. I would like to use the \input{} or \include{} mechanism to compile the…
6
votes
1 answer

Blank page inserted when using \include

Possible Duplicate: Page break with \include I am using the Report document class and to manage the document i have divided it into seperate .tex files that are compiled within a main document. The main document contains the prefatory material…
Bill Welling
6
votes
3 answers

About \include in LaTeX

When using \include{file}, if the including file is a complete LaTeX document, with documentclass{}, \begin{document}, etc., it generates an error. It doesn't generate the error if I remove everything except the content (those between…
ashpool
  • 1,361
4
votes
1 answer

Are there some predefined directories for .tex file inclusion?

My question is simple, are there some predefined directories (in the texmf file system) where I can save my .tex files for further inclusions ? If yes : which ones are they ? Can I defined mine manually editing a configuration file ? If not…
vdegenne
  • 822
4
votes
1 answer

Inserting two file with different preambles

Is it possible to insert a LaTeX file into another file without the same preamble?
Visitor
  • 41
4
votes
1 answer

Is there any way to read arbitrary part of external tex file?

I am not expert in tex programming, sorry if I am asking a simple question. I need to include an external tex file in a master one but after excluding its preamble and the commands of \begin{document} and \end{document}. In other words, I need to…
Os2015
  • 43
1
2 3 4