Linked Questions
18 questions linked to/from How to do multiple calls to \includeonly?
1558 votes
7 answers
998k 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 ...
76 votes
9 answers
36k views
How to form "if ... or ... then" conditionals in TeX?
I feel really stupid for asking this, but how do you form more complex if conditionals in TeX? I'm looking for something like: \ifnum\x=1 OR \ifnum\x=14 {do this} \else {do that} \fi I don't ...
47 votes
4 answers
37k 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
5 answers
21k views
How to concatenate strings into a single command?
I'd like to concatenate several parts of math text into a single command, and i read a great solution here on this site, allowing me to create this working example of what i mean : \documentclass[...
29 votes
1 answer
85k views
Using string variable with LaTeX
I would like to define one variable containing some text that can be changed locally. The following code gives one example of the featuring I'm looking for. \documentclass{article} \newcommand{\...
-28 votes
2 answers
3k views
Stringified commands to macros sequence [closed]
First, what is the proper terminology for a "string" in TeX/LaTeX that is an argument for a macro? e.g., \macro{somestring} Obviously somestring is a token, set of tokens, string, argument, etc. I ...
14 votes
4 answers
9k views
Logical String Length
How do I do a conditional 'if then else' statement, based on length of string being greater than (or less than, or equal) a specified value. For example, something Like \def\mystring{XYZ} \def\...
18 votes
1 answer
14k views
How does 'filecontents' keep LaTeX parsing while temporarily stop writing output
We all know filecontents.sty can do \documentclass{article} \usepackage{filecontents} \begin{document} Hello World \begin{filecontents}{dummy.txt} No one will read this if I don't use it ...
6 votes
3 answers
11k views
How to merge several tex files so that they have one table of contents/List of tables & figures
I have three chapters which I combine into a thesis using pdfpages: as shown in this link Merging several papers This gets me 95% of what I need the only thing I still need is a table of contents ...
8 votes
2 answers
10k 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 ...
5 votes
1 answer
5k views
Using standalone to combine multiple .tex into a single file
I have a number of latex files section1.tex, section2.tex, etc. Each of them should be able to be compiled individually to give a normal LaTeX document. I would like to write a file master.tex that ...
8 votes
2 answers
651 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 ...
6 votes
1 answer
3k views
Generate a merged LaTeX file, with \input code in place?
I'm currently working on an experiment that involves re-typesetting a digitized physical book from OCRed images. For various reasons involving the workflow, the resulting project architecture is a "...
7 votes
1 answer
1k views
What happens to a relative path in a file added with \input{}?
I stumbled upon the following question: In the preamble of my main tex file for my thesis, I've included several other files with definitions for abbreviations which are in the same path as main.tex, ...
5 votes
2 answers
468 views
Can a file know if it has been \include'ed or \input'ed?
I have a somewhat large User's Guide for a code I've been working on with collaborators. Each chapter is in a subdirectory of the top directory, which includes the .tex file that grabs and stitches ...