3
votes
1answer
68 views

Is there a way to know how often latex has already run? [duplicate]

A few days ago, I have seen an example of a latex file, that did conditional \defs on subsequent runs but I can't find that one again. I still remember that it was by looking into the \jobname.aux do ...
7
votes
3answers
105 views

Conditional compilation of code based on package version [duplicate]

I am working on a document with a colleague and we have different versions of PGF/Tikz installed -- I have version 3 and he has version 2.10. This is causing a problem for compilation on our two ...
0
votes
0answers
33 views

Include subsections depending on variables/ifthen [duplicate]

I am making a template for several books. I have a mainfile which includes the .tex files for my chapters. For each book, some chapters are always almost the same except for a few subsections. How ...
17
votes
1answer
140 views

Compile PDF without proofs

I am writing my degree thesis, and I need to make a synthesis of it: basically what I want to do is make a copy without the proofs...is there a way to exclude them automatically, without having to ...
8
votes
1answer
191 views

Is there a macro telling which OS we're using?

I got some LaTeX documents that I have to compile them under different TeX Live, such as MacTeX or TeX Live. But in different OS, the font seems different too, for example, while in Windows, I prefer ...
2
votes
1answer
170 views

Homework generation [duplicate]

Possible Duplicate: Conditional typesetting / build I have a database of LaTeX homework questions like this: question1 question2 question3 etc Is it possible to create a flag to ...
3
votes
2answers
322 views

Beamer conditional pdf file generation

I would like to know if there is a method to generate beamer pdf presentation based on conditions. For example: -Main Beamer presentation: Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 -For the first ...
12
votes
2answers
459 views

How to tell when to use pdflatex, latex, and xelatex for any given tex file?

I'm writing an automatic compiling pipeline that should be able to compile any given tex file into a pdf. The diversity of the input tex files mainly shows up in what format of figures they use and ...
4
votes
1answer
265 views

How to control the PDF output based on the compiler being used?

I have a batch file that will compile the same input file with 3 compilers one after another as shown below. This mechanism is used to see the file size of the resulting PDF (before and after ...
9
votes
1answer
384 views

Require a certain (or later) version of a package?

Is there a way to enforce that a certain version, or a later version, of a package is loaded when building the document? I've found that compiling a document on another platform, where the package ...
7
votes
2answers
665 views

How to test --jobname compilation option within latex file

Due to some commands in my preamble (\synctex=1,\makenomenclature,\settocdepth{subsection}) which are not fully compatible with --jobname procedure, I would like to add a test before these three line ...
31
votes
7answers
6k views

Conditional typesetting / build

Let's say I have .tex file which is a set of problems and solutions, of which I want to make two pdf files, one which includes the solutions and one which doesn't. so I need to build the .tex file ...
7
votes
4answers
290 views

How to detect and condition based on hostname

How do I construct a conditional statement based on the hostname of the compiling computer in LaTeX? For example: \ifhostname{mymachine} \dostuff \else \dootherstuff \fi Why: I am working with ...
15
votes
4answers
1k views

Running new command only if it exists

How do I get LaTeX to run a command only if it exists? I need something like: \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} % \newcommand{\mytitle}{Title Test} \begin{document} \if ...
6
votes
2answers
268 views

Telling LaTeX where to compile to from inside your document?

Here is a hypothetical scenario. I want to make a beamer presentation and a handout for that presentation. I start my file as follows: \newif\ifhandout \handouttrue \ifhandout ...
7
votes
1answer
714 views

Conditional compilation of beamer slides

I'm preparing a beamer slideshow, and I will have to print slides. I would rather use landscape mode slides, but it is possible that I need to use portrait mode ones. Sadly, I won't know until a few ...
1
vote
2answers
240 views

How to multiply compile according to selected tags?

I would like to do the following, by I am not sure how. Say I have a LaTeX file with series of annotations, each with zero or more "tags" (say, about their contents or the project they are related ...