{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

368
votes
4answers
144k 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 ...
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. ...
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 ...
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 ...
6
votes
2answers
2k views

\usepackage[turkish]{babel} and \includegraphics inconcistency

Here is my document : \documentclass[12pt]{book} % must-have packages \usepackage[turkish]{babel} \usepackage[utf8]{inputenc} % This package will support Turkish chars % must-have packages ...
28
votes
6answers
940 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 ...
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 ...
6
votes
1answer
1k views

Page break with \include

I like to print my drafts with big fonts and small margins (i do this in memoir style in a single chapter), but the \include comand creates a page break. Is there a way to avoid this and have section ...
6
votes
4answers
1k views

How to make “\input” in a “\include”-d file use the correct current path?

I'm having a master file let's say test.tex and also some folders sub1/ and sub2/. There is also a TeX file in each of them: sub1/sub1.tex and sub2/sub2.tex. In the sub1/ and sub2/ are also some ...
7
votes
1answer
334 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 ...
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 ...
4
votes
3answers
389 views

Can i automatically load chapters and sections based on the filesystem?

I was interested in knowing if i can load chapters and sections of my book based on the filesystem. For example: Chapter 1/ Section 1.tex Section 2.tex Section 3.tex Chapter 2/ Section 1.tex ...
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 ...
23
votes
2answers
402 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 ...
9
votes
1answer
217 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. ...
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 ...
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 ...
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 ...
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 ...
3
votes
2answers
525 views

includegraphics[page=\pageref… possible? how to set [page=] to a variable?

I'm currently writing a quite complex document with a lot of graphics created using TikZ. Hence I decided to put all graphics into one big file called tikz.tex creating a multiple page PDF with one ...
2
votes
4answers
6k views

Combine several chapters (separate files) in to one report

I am writing my final year thesis. I was asked to write my report part by part. First I wrote the Introduction chapter. No I have completed the Literature Survey. Both these were written as two ...
2
votes
2answers
437 views

Disable including of system files [duplicate]

Possible Duplicate: How can I safely compile other people's LaTeX documents? I've got a Linux server that is rendering LaTeX documents, I want to disable the access of LaTeX to system ...
27
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 ...
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?)
11
votes
2answers
3k 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, ...
6
votes
1answer
155 views

Table including rows of a master table

I have a big master-table* containing reference items and that is a simple cross-project database of such items. Now I'd like to include in different documents parts of this master table and select ...
3
votes
1answer
128 views

Printing selected chapters without affecting cross-referencing

I am writing my thesis in Lyx and for some reason, probably due to the style sheet, I am unable to print the complete thesis. It gives weird errors. However, individually all chapters are easily ...
8
votes
3answers
840 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 ...
7
votes
2answers
274 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 ...
5
votes
3answers
993 views

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

Removing whitespaces caused by separate source files

I have an article which consists of multiple files, a main file with following section includes: \include{Introduction} \include{ProposedProtocol} \include{Comparison} \include{FutureWork} ...
3
votes
2answers
365 views

\pgfplotstableread and subfiles

Is there a way to use a folder structure with subfiles and \pgfplotstableread? I have the following structure: main.tex \documentclass{article} \usepackage{pgfplots} \usepackage{subfiles} ...
6
votes
1answer
51 views

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

import input pgfplots with relative paths

The package import makes it posible to \input (and \include) a .tex document which itself \input (or \includegraphics etc.) stuff using relative paths. I was hoping that this also would work with the ...
4
votes
1answer
238 views

subimport and includeonly

Say I have a document structured as follows. main.tex + ch1 - ch.tex - s1.tex - s2.tex + ch2 - ch.tex - s1.tex - s2.tex Here, *.tex are LaTeX ...
3
votes
1answer
199 views

Relative paths for \input and building from different directories

The minimal example If I have a directory containing my main LaTeX source file and it uses \input to incorporate some data in another file, I can use a relative pathname. E.g., with these files: ...
0
votes
1answer
296 views

Compiling Master and Individual Child documents with correct pagination

I'm using a master document by including the child documents with \include{} command. I can compile the master document to get the big document with all child documents included. I wonder how to get ...
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 ...
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 ...
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
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 ...
8
votes
2answers
233 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 ...
6
votes
3answers
13k views

How to shift graphics/adjust placement of figure with \includegraphics

I composed a diagram that takes up the entire sheet of paper in landscape mode, called diagram.tex (compiled it to generate pdf). I'm trying to include that into an article, but only half of it is ...
5
votes
1answer
92 views

Mark on document where input starts and what is the filename

I have a master document, and use many input{...} commands to compile the total document from many parts. I would like to mark on the working document, the start of each new input, and, what the ...
3
votes
1answer
131 views

How do I best combine several documents?

I have a collection of articles written in latex, and I would like to "merge" them into a larger thesis document, in which each article will be a chapter. I have been looking at include and input, ...
4
votes
1answer
201 views

How to change appearance of a particular line when using \lstincludelisting?

I'm using the listings package and include code into my document through \lstincludelistings. The problem is that I want to set some code lines to bold to indicate changes from previous code segments. ...
3
votes
0answers
494 views

BibTeX not working with \input or \include [closed]

I need some help with BibTeX. I use a seperate *.bib file which is working perfectly, but when the commands \input or \include are used to input text from another *.tex file the application tells me ...
2
votes
2answers
86 views

answers sometimes in test, sometimes in answer file [duplicate]

So this is going to sound strange, but I'm wondering if there is a clean way to do this. By the time I have a project done, I will have written two .tex files: one with questions, and another one ...
8
votes
1answer
105 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
5answers
625 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 ...