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.
638 questions
2
votes
2
answers
44
views
LaTeX - start new chapter on same page - scrreprt [duplicate]
I am using scrreprt document class. When I create a new chapter, it starts it on a new blank page.
\documentclass[11pt,oneside]{scrreprt}
I want to be able to start new chapters on the same page as ...
0
votes
0
answers
44
views
Error while using \include{} or \import{} -- After 7 \include{} or import{}, I get "Too deeply nested"
I am trying to write my thesis and I arranged the chapters and their materials in various folders. I am including them to my main document using the \import{} or \include{}. There is no problem until ...
0
votes
0
answers
29
views
Watermark allocated per Chapter or Section, not per page
I have taken a look at the draftmark, and draftwatermark packages (draftwatermark is more recently updated so will use it for the example), but cannot find the use case I need/want:
I want to apply a ...
2
votes
1
answer
137
views
Could one hypothetically parallelize LaTeX compilation using \include statements?
I believe I understand the reason why LaTeX/TeX compilers are single threaded. I have a very limited knowledge of typesetting, but I can see the issue. However, surely if \include ensures a \clearpage ...
1
vote
2
answers
92
views
How to remove extra blank page at the end of compiled PDF when using includepdf?
I'm encountering a problem related to \includepdf where my compiled PDF (which is more than 1 page) always has an extra blank page at the very end, even though my PDF file doesn't contain any blank ...
0
votes
1
answer
75
views
Adding pdfs from custom directory inserts only one page
When I put the "ToBeInserted.pdf" file in my latex project folder (XeLaTex, TexLive 2024), it inserts all the pages. However, if I put into any other directory it inserts only one page! Why ...
0
votes
1
answer
56
views
Using æ, ø and å in \include files [closed]
In include files I get error if I use \usepackage[utf8]{inputenc} and
if use \usepackage[latin1]{inputenc} get æ. , Ã, and Ã¥ insted of æ, ø and å.
0
votes
0
answers
32
views
Is there a way to specify directories to search files in them and relative imports in files in these directories
In project folder, I have directory tex from which I would like to import files without specifying directory name. For this, I added this directory to input@path. tex directory actually contains other ...
0
votes
1
answer
82
views
Can I include pdf (using pdfpages pack) and automatically get the number of the inserted pdf
I make long technical (building engineering) documentation.
In those docs, the standard is to explain stuff in the main doc and put a reference to a detailed calculation at the end.
So I would like to ...
0
votes
0
answers
55
views
Include all chapters, but compile only one?
Instead of one big tex file, I put the chapters into separate tex files for faster compilation. My main tex file now looks like this:
\include{ch-abstract}
\include{ch-acknowledgments}
\include{ch-...
0
votes
1
answer
47
views
Difficulty with template for multiple chapters
Folks:
I am a Latex newbie.
I have a book consisting of 24 chapters in word.
I would like to be able to work on each chapter separately, but compile them as one Latex file. I copied code from ...
0
votes
2
answers
165
views
Importing a section from another document (with begin document)
I have two different latex files, which I would like to import one to another file. Here's what I've searched previously in older posts.
This one
Another one
To understand my case, I provide the ...
0
votes
0
answers
31
views
problem compiling the " \include" in apa7
Can somebody help me with my code.
Everything was working perfectly until 4 days ago; it does not run anymore. I present a troubleshooting about \include .
here my code:
\documentclass[table,a4paper,...
0
votes
0
answers
56
views
How to include a preamble file in a main file
I have a main01.tex file for a training course with a pretty big pre-amble.
I have a main02.tex file for another training course with the same pretty big pre-amble.
I have a main03.tex file for yet ...
0
votes
1
answer
36
views
TeXstudio: create chapters in subfolders and figurtes in subsubfolders
I'd like to setup my document as such:
/folder/main.tex %includes the preamble info
/folder/chapter1/CH1.tex
/folder/chapter1/Figures/<all_Ch1pictures.png>
/folder/chapter2/CH2.tex
/folder/...
3
votes
3
answers
178
views
`\settocdepth` followed by `\include` incorrect order in ToC file
I can use \settocdepth to change the depth of the ToC min-document.
This works as expected in the MWE below when I comment out the \include statement.
However, when the \settocdepth command is ...
0
votes
5
answers
498
views
How to include result values in a LaTeX document?
We are often in the following situation: a lengthy (data analysis) computation spits out a bunch of result values. Imagine a Python or script or an R script doing some resource intensive calculations.
...
2
votes
1
answer
177
views
Problem with command `\includeonly` on Overleaf: `.aux` files are deleted automatically after some time
I am writing a paper on Overleaf (free version) that is starting to be a little long, so to optimize the compilation time I decided to put each section in a separate .tex file, and use the command \...
-1
votes
1
answer
123
views
\today not showing other than "0"
Good evening, I cant figure out how to get the proper date on my first page, and I've already done it without \maketitle in the past without problems.
Big document, so nested:
root: -> title
-...
1
vote
3
answers
81
views
How to fix page numbering and page references in the table of contents?
Hey in my table of contents appendixes display incorrectly
The chapter "List of tables" is actually on page 40, but "Appendix A" (In the picture named as "Dodatek A", &...
0
votes
0
answers
35
views
\addcontentsline misplaced in ToC when followed by \include
I seem to have hit a bug in LaTeX concerning the table of contents. Apparently, if a \addcontentsline is followed by an \include, all the headers in the included file are printed in the table of ...
2
votes
1
answer
139
views
\Include working on mac, but not on windows
I am working on a big LaTeX document (thesis), that's broken down into multiple .tex files, and I thus have only a thesismain.tex file to compile that uses \include.
On a MacBook, compilation goes ...
1
vote
1
answer
90
views
Beamer: Show frame if it is defined
When constructing larger presentations with beamer, I often split them into several files on which I work individually. For the sake of an MWE, it might look something like this:
\documentclass{...
0
votes
1
answer
85
views
\includeonly{} not Working with Precompiled Preamble
Summary of issue
I followed the guide linked in this answer, and it works perfectly for me. However, I find that if I use a precompiled preamble, and then specify \includeonly{}, the full document is ...
0
votes
0
answers
60
views
Compiling one file
We are collaborating on a project, each member is responsible for a topic.
The file structure is like this. Aiac-paper is the main file, and I added every file with \include{...}. My question is, is ...
1
vote
0
answers
51
views
Are header guards necessary for LaTeX packages? If so, how to implement one?
A header guard is used in some programming languages to avoid repeatedly importing the same file. Here's one example of this scenario in LaTeX: Let's say we have header1.sty, header2.sty and main.tex ...
1
vote
0
answers
38
views
Citations do not show correctly in the \include{} text
I am writing my thesis, and I use \include{} command so I could write each chapter separately and then combine them in the main document to have a more clear structure.
However, I find that the ...
0
votes
0
answers
22
views
Getting LaTeX to ignore a number in \include
I am writing a book (using Memoir class in LaTeX if it matters). One of the chapters is titled
RT_June_13
when I put
\include{RT_June_13}
in my main file, and then PDF it (using WinEdt, if it ...
2
votes
2
answers
349
views
chapterbib with subfiles for sections
I'm using chapterbib for a long document and the creation of bibliographies for each chapter works fine.
Each chapter is in its own file that gets included.
Is there any option to split the chapter ...
1
vote
1
answer
240
views
Overleaf 'forgets' user defined commands in different tex files [closed]
I am working on my master thesis and thus have a lot of different tex files which get included in main.tex (using \include{}). However I now face the problem that all commands I define in the preamble ...
2
votes
2
answers
49
views
Testing the appartenance to a list
I want to have a command \myInclude{} doing the following thing:
\myInclude{} does nothing (if the argument if empty)
\myInclude{file.tex} includes the file named file.tex if it has not been ...
0
votes
1
answer
79
views
\include{Glossary} does not work [duplicate]
I am writing the final version of my PhD thesis.
Everything works fine except that the Glossary external file I created is completely ignored by the program. I am using Texstudio to compile it.
The ...
0
votes
1
answer
268
views
Can't build an included file, using texstudio [closed]
I'm doing my thesis in LaTeX, and have multiple chapters, separated in different .tex files and included in the main.tex using \include{}, which worked normally, and I can build it, without returning ...
0
votes
0
answers
41
views
Please suggest which method is correct to proceed
I'm using the following tags to generate a project:
\documentclass{book}
\begin{document}
\frontmatter
\include{fm}
\mainmatter
\include{ch01}
...
\include{ch10}
\backmatter
\bibliographystyle{...}
\...
0
votes
0
answers
33
views
Reference an entire environment with its content
I have big-book.tex containing many exercises in \begin{problem} environments, and I want to make a homework.tex for students selecting only a few of them.
Here are some methods I can think of:
Copy-...
0
votes
0
answers
23
views
problem with \cite{} in multipart article with separate bibliographies for each \include{} file
I've got a little problem with the consistency of \cite{} across multiple \include{} files, where each such file gets its own bibliography. Just to be clear: I'm not using natbib.
Each \include{} file ...
0
votes
0
answers
34
views
how to reduce vertical space before parts and increase chapter size in table of contents
currently writing a Geometry textbook and the start of the table of contents looks like this:
With this code, using the tocloft package for my TOC:
Edit: Here is what the beginning of each chapter ...
0
votes
0
answers
663
views
Import a table and figure from another tex file
Is it possible to include the whole content of the table and figure in another tex file?
Let's say we have A.tex
\documentclass{article}
\begin{document}
write something here.
\begin{table}[tbp]
...
2
votes
1
answer
643
views
What is the correct way to import files within subfiles?
The subfiles docs explains that it handles path issues when main files and subfiles are in different directories and subfiles contain paths relative to their own directories using the \import package. ...
3
votes
2
answers
285
views
How do (relative) paths work with the subfile package?
I am trying to understand how (relative) paths need to be used with the subfiles package. In particular, it's not clear how content that I usually would include with \include, \input, \includegraphics,...
0
votes
0
answers
49
views
Is there a way to `\includeonly` when the memoir document is monolithic?
When writing a memoir document it's easy to focus on just one chapter by using \includeonly.
\documentclass{memoir}
\title{title}
\author{author}
\includeonly{chap-3}
\begin{document}
\include{chap-0}...
1
vote
0
answers
31
views
Make a list of labels from other included chapters
I try to automatically generate a list of relevant \label in the form of hyperrefs.
I almost managed to do what I want, using a solution proposed in this topic: List of all labels with hyperlinks
Here ...
1
vote
1
answer
68
views
Why does \WithSuffix\providecommand overwrite command already defined by instance of thmtools's restatable environment?
Consider the output
of this MWE:
\documentclass{book}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{suffix}
\declaretheorem[numberwithin=chapter, style=plain,name=Theorem,refname={theorem,...
0
votes
1
answer
118
views
\input function doesn't work: trying to include contents of external text file
I want to include the contents of an external text file into my LaTeX document. I've tried \input{./message}, but all I get is an error containing the very last line of the text file:
(./message.txt
! ...
2
votes
0
answers
520
views
How to define path for use with /input, such that TeXStudio can detect the location of the file using global command
Background
I am writing a large document (main.tex) with several chapters (Introduction.tex, LiteratureReview.tex, etc). I use TeXStudio to compile the document. Each chapter is included using /input (...
0
votes
0
answers
26
views
Avoid page break between section title and included subsections [duplicate]
When I apply the following code, I have a page break between the \section{*} and the \include{chapters/*.tex} (the chapters are composed of subsection). I would like to have no page break between the ...
1
vote
2
answers
69
views
Import Information into Several Documents from a Master Document
Context: I'm a university lecturer and therefore facing the same tasks whenever I prepare for a new semester. One of them is creating course material with LaTeX which includes a syllabus, slides for ...
0
votes
0
answers
263
views
Export parts of tex file separately
I'm writing a longer document and need this version, where everything is put together, and a few parts of the file in seperate pdfs. For example it might be that I need subsection 1.2 as a standalone ...
1
vote
2
answers
140
views
RequirePackage and usepretex from latexmk change output file to texput.tex
I want to compile a larger file completly based on a toggle (my@final) from the commandline using a makefile.
My .tex-file looks like:
\documentclass{scrbook}
\begin{filecontents}[overwrite]{01.tex}
...
0
votes
0
answers
155
views
How to put everything in front of \begin{document} in a separate file?
So as I am doing a lot of similar documents I tend to always use the same preamble for all of my documents. But as I sometimes add new commands, it gets a little iffy to always remember which document ...