{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.

learn more… | top users | synonyms

372
votes
4answers
148k views

When should I use \input vs. \include?

There are two different commands to incorporate another file into the source of some document, \input and \include. When should I use one or the other? What are the differences between them? Are there ...
28
votes
6answers
947 views

Is it possible to write all mathematical formulas in a separate file and add them in main file on-demand?

Consider this scenario: I have a report to write and I want to write all mathematical formulas in a separate file and then add them in the main report file on demand (i.e. include/import/add/call a ...
28
votes
1answer
3k views

Adding Table of Contents to existing PDF

How can I add a Table of Contents (TOC) to an existing PDF? I have an existing PDF (scanned notes from a class). I'd like to improve this basic scan as much as possible. I do not think that any OCR ...
27
votes
4answers
18k views

How to make the main file recognize relative paths used in the imported files?

I'm currently using doxygen to generate some documentation for a project, and doxygen generate some LaTeX code that then can be used to generate a nice pdf. But let's say I would like to write ...
23
votes
2answers
408 views

Redefining \include

A puzzling choice made by Leslie Lamport was to define \include in such a way as to issue a \clearpage before reading the file. This has been puzzling me for sometime as it is not a very good choice ...
18
votes
5answers
15k views

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 ...
18
votes
2answers
3k views

Speed up compilation by (pre-)compiling chapters separately?

I am writing a long document with many chapters. They are all included from a root document using \input{chapterX.tex} etc. Compiling everything takes pretty long. As a workaround to make compilation ...
17
votes
4answers
2k views

Include without pagebreak

I really like the \input command, but what I really like more is the \includeonly command. Is there a way to have the best of these worlds? (i.e. an \inputonly or an \include without page-breaks?)
15
votes
4answers
283 views

Test if file is in \includeonly

Is it possible to check if a file is listed inside \includeonly{...} ? For example I would like to do something like this \includeonly{file1,file2} \if\isincluded file1 % \isincluded is a ...
15
votes
3answers
5k views

How to include audio file in PDF

How do I include audio file, or should I say, link to audio file in PDF? Audio should be playable "from PDF directly", without opening any additional window. Is it possible to attach audios to PDF ...
15
votes
2answers
2k views

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: ...
14
votes
6answers
2k views

\endinput: what is it for?

I am working on a big document and I am using the \include command to put chapters one after the other. On the internet I came to know about the existence of the \endinput command. However I do not ...
14
votes
3answers
2k views

Create list of all external files used by master LaTeX document?

Is there an easy way to create a list of all external files (complete path) which are used by a LaTeX document (and its "sub-documents") by \input \include \includegraphics ? (may I have forgotten ...
14
votes
2answers
2k views

Keep chapter number of chapters inserted with \include

Okay, I've puzzled over this for a while and I can't work it out. I have a document with several chapters, using the memoir class. I've separated each chapter into separate files, and I'm including ...
13
votes
1answer
1k views

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} ...
13
votes
2answers
22k views

\graphicspath and \include

I am trying to define a central graphics path for my thesis, however, the chapters are included with the \include command and by using \include with \graphicspath, pdflatex complains about it can not ...
12
votes
3answers
897 views

I'd like to include Markdown in a LaTeX file

I have a LaTeX file, foo.tex and a bunch of markdown files {1..N}.markdown in the same directory. Basically, I'd like to be able to \include{1.markdown} and have the markdown rendered to LaTeX and ...
12
votes
2answers
325 views

How can I easily use the same preamble on all my documents?

I use multiple computers (Mac and PC), so creating a path (e.g. \input{c:/folder/Preamble}) won't work. I really want to assign a URL (in Dropbox) to the file and input the file via the URL, but I ...
12
votes
1answer
218 views

Is there a limit to the size of a tex-file?

I've been writing a document for some time now. It is steadily growing and hopefully will continue to do so. Lately I realised that -- although I just recently bought a new MacBook -- when I work on ...
12
votes
2answers
5k views

Multiple bibliographies

I have the following: \documentclass{report} \begin{document} \include{chapter1} \include{chapter2} \end{document} I also have a reference.bib file, with entries book1, book2 and book3. ...
12
votes
2answers
4k views

Changing the working directory when including files in a subdirectory

I'm working on a mathematics magazine that involves multiple articles from different authors. I would like to give each article a sub-directory in which I can store all the relevant files - .tex, ...
11
votes
2answers
3k views

(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 ...
11
votes
2answers
2k views

Splitting a large document into several files

Why is it recommended to split a large document into several parts and include them with \include? Is it only a relic of the past times when computers and LaTeX compilers were slower, or is it still ...
11
votes
3answers
480 views

Table of contents numbering is strange [duplicate]

Possible Duplicate: ToC numbering problem My LaTeX document is acting strangely. Here is a simplified version of it: \documentclass{article} \begin{document} \tableofcontents \newpage ...
11
votes
2answers
2k views

How to make \include work with a quoted string path containing spaces?

In Windows, \input can work with a quoted string path containing spaces, but \include cannot. How to fix it? \documentclass{book} \begin{document} %\input works! \input{"Contents/Installing and ...
10
votes
2answers
264 views

Large document edited by a dozen people

We, a team of 12 people, plan to write a 50 pages paper. The paper will be divided into chapters. Usually, no more than 2 or 3 people will work on a given chapter. Having one large file will create ...
10
votes
3answers
717 views

Open included files in emacs+AUCTeX

When working with emacs+AUCTeX I would like to consider a project with one main.tex in which you have many include's. Is it possible somehow to open the included files from within the buffer where ...
10
votes
2answers
3k views

Where to put a custom macros file?

I have a bunch of common commands I put in document preambles. I don't always use them all, but it makes the preamble too long for my tastes. I want to put them all in an external file (preferably in ...
10
votes
1answer
259 views

Refsection and \includeonly warning

I'm using biblatex with a biber backend to create a cumulative bibliography, subdivided by chapter. My (simplified) main file (main.tex) is: \documentclass{book} \usepackage[refsection=chapter, ...
10
votes
1answer
113 views

Avoiding recompilation of unchanged part of a document

I am currently editing a relatively long document in arabic with the package arabtex, everything is going quite fine but the compilation takes several minutes. As I need to edit only small parts at ...
9
votes
2answers
5k views

How to add a pagenumber of included PDF sides?

I'm creating a documentation with some included pdf files (mostly diagrams or tables) in the following way. \includepdf[pages=1-10, angle=90]{requirements/Requirements.pdf} The command ...
9
votes
1answer
137 views

Can I use \input inside an \include?

I know it is not possible to nest one \include inside another, but what about \input? Is it possible to have something like: \documentclass{article} \begin{document} \include{file1} ...
9
votes
3answers
1k views

Combining Document Classes

I have a complicated document containing files with a letter as the first document followed by several article type documents. I have done this by setting up a master tex file with all the frontpeice ...
9
votes
1answer
219 views

What are your best practices to compile only a part of the document or presentation (or how do you prepare the big ones)?

I see that there a number of questions (A, B, C, D, E) on best practices, none of them answer the issue I am going to talk about. We all need to prepare large documents (or slides) from time-to-time. ...
9
votes
1answer
213 views

Make a “standalone” version of multiple files: all document in one .tex file

Disclaimer: this question is not related to the standalone package. When writing an article, I split the content between several files, to ease the versionning notably. At the time of writing, most ...
8
votes
3answers
7k views

How to include multiple pages in latex

I have a pdf file consisting of four pages (see attached). I want to include it in Latex, but when I use the basic code given below, only the first page of the pdf appears. I want to do is to present ...
8
votes
5answers
634 views

Calling \end{document} in a macro

I have a file, which is meant to be used as a fragment file inside a larger document: \include{boilerplate} content \include{boilerplate} The goal is to make a fragment file compilable. So inside ...
8
votes
1answer
110 views

Reference label with included file and relaxed clearpage

I am running into a rather weird error that apparently originates from the combination of \include, \let\clearpage\relax and a referenced label after a page break. In this particular example, the ...
8
votes
2answers
462 views

How can I include subfiles in to a subfiles?

First of all, I am a newbie here and I have no idea to post a query but I have a problem for which I require your help. I even don't know what should be the title of my problem but what my intuition ...
8
votes
3answers
877 views

Producing different versions of a document

I am writing a documentation for a software environment which will be composed of several subfile put together using the \include command. The thing is, I would like to be able to output different ...
8
votes
3answers
531 views

Include figure from PDF file

I want to include a figure from another PDF. There is the quick way, where I take a screen shot, save as my desired format and the \includegraphics[scale=xx]{<file path>} but this is messing up ...
8
votes
2answers
1k views

“Reference does not exist” warning with \includeonly

I am in the process of writing my thesis and am using the \include command to separate the files. But when I use the \includeonly command to select on the current chapter which has references to ...
8
votes
2answers
239 views

What is the recommended practice for making multi-article publications with LaTeX?

I would like to migrate the process of preparing a scientific journal at our department from MS Word to LaTeX. There is already a document class that could be used for individual articles. However ...
8
votes
1answer
294 views

Can you put git revision information in a multifile document?

I have my PhD thesis under revision control (git), with a master file (~/Thesis/thesis.tex) using the \include command to include the chapters (~/Thesis/tex/chapter1.tex, etc). Is there a way to ...
7
votes
2answers
275 views

Options for building multiple documents from the same content with different layouts

I need to produce two document layouts using the same content. I'm going to be making heavy use of the input{} command to do this, but it is more complex than just this. I'm looking for suggestions ...
7
votes
2answers
753 views

Including published Matlab code and figures in separate LaTeX document

I'm writing up a homework set in LaTeX. I'm writing the theoretical parts of the homework using LaTeX, and the implementation in Matlab. I want to combine these two easily. My problem is: How do ...
7
votes
2answers
8k views

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 ...
7
votes
1answer
341 views

First chapter appearing before first line in table of contents

I have a table of contents in my memoir book. I want there to be one line for each chapter, in addition to headings for each set of similar chapters. For some reason, the line for the first chapter ...
7
votes
1answer
195 views

Multiple PDF generation with one tex file

I'm writing my cv using moderncv, and I want to make it in 2 languages. I wrote a common part, which both languages will have, and specific ones, where I put the translated content. I also want to ...
7
votes
1answer
1k views

Beamer/Beamerarticle: \mode<article> is ignored after <presentation> was set, and vice versa

I have a problem with latex ignoring text after \mode<presentation> or \mode<article> was set. MWE description I have a large document that changes modes often, and I also \include some ...