{automation} is about automating certain tasks when creating a (La)TeX document, e.g., with the help of {packages}, custom {macros} or {tools} for {compiling}.

learn more… | top users | synonyms

100
votes
24answers
10k views

Tools for automating document compilation

A lot of people write makefiles that say something like paper.pdf: paper.tex pdflatex paper bibtex paper pdflatex paper pdflatex paper To handle re-running TeX to ...
33
votes
10answers
5k views

Passing parameters to a document

I compile most of my documents via Makefiles which take care of the bibliography, indexes, etc. Often I'd like to compile different versions from the same TeX file changing only small things (e.g. a ...
30
votes
3answers
3k views

Replace \input{fileX} by the content of fileX automatically

Suppose I have a document with multiple include or input statements \input{fileA} \input{fileB} etc. Is there an easy way to generate a single .tex file where \input{fileA} is replaced by the ...
31
votes
5answers
4k views

How to make Latexmk use makeglossaries?

Is there a way to make Latexmk invoke makeglossaries (part of the glossaries package)? Specifically I want to use latexmk to compile a LaTeX document that uses the glossaries package to produce a ...
91
votes
12answers
6k views

LaTeX packages for use with revision control

I use revision control (Subversion, to be exact) to keep track of the edits to my LaTeX documents. Is there a LaTeX package that interfaces with revision control? Specifically, it would be nice to see ...
16
votes
4answers
2k views

How to automatically skip leading white spaces in listings

This question led to a new package: lstautogobble (lstaddons bundle) For my programming lecture slides I heavily use the listings package with \lstnewenvironment to typeset source code. It's a ...
2
votes
1answer
1k views

How to include all files within a directory relative to the edited *.tex-file?

I am writing my reports which need to reference complete *.java files with latex. I am using the Texlipse Eclipse plugin to do the editing. Right now I am referencing the complete path to each ...
29
votes
2answers
5k views

What's the advantage of using csquotes over using an editor's auto-replacement for "?

Many editors (TeXnicCenter, Texmaker, TeXworks, ...) offer auto-replacement of " by the desired form of quotation marks, be it `` and '' for English, "` and "' for German, or whatnot. Usually, I know ...
19
votes
1answer
1k views

ultrafast pdflatex with precompiling

I try to improve the time pdflatex needs to compile my book. Really working example book.tex %&preamble \begin{document} Hi \end{document} and preamble.tex \documentclass{article} I run ...
13
votes
6answers
843 views

Custom format file: How to automate the generation of the “precompiled preamble” whenever one of the files that are used there are changed

I would like to speed up compilation of my LaTeX documents using the precompiled preamble approach, and I was wondering whether any of the Tools for automating document compilation have support for ...
7
votes
1answer
2k views

How to use kile with feynmf or feynmp?

Does somebody know how to teach kile to automatically do the additional steps for compiling Latex documents that contain Feynman diagrams produced with feynmf or feynmp? For what I know I have to ...
26
votes
4answers
5k views

Script to automate externalizing TikZ graphics

Is there a script to automate externalizing TikZ graphics? (As suggested by Scott here)
12
votes
3answers
1k views

Generating a table of glyphs with XeTeX

I am trying to get XeTeX to generate a table of all the possible glyphs of a given font, but can not figure out how to make XeTeX know how many glyphs the font has, so I have to specify an exact ...
16
votes
3answers
3k views

How can I avoid compiling twice?

Sometimes I need to run compile twice (eg when I use lastpage). Is there a way to set things so TeX knows that there is need for second run and do it automatically? I use Texmaker.
16
votes
2answers
497 views

Avoid linebreaks in LaTeX console / log output

Is it possible to tell the LaTeX command not to use line breaks in its console / log output? This would make it easier to automate the processing of the log file, e.g. extracting the names of missing ...
13
votes
2answers
780 views

Automatically Locate Included Images

Do you think it's possible to include images into LaTeX without specifying the exact path to them. So instead of: \includegraphics{path/to/image/myfig.pdf} It would be: \includegraphics{myfig.pdf} ...
3
votes
1answer
1k views

Quick Build commands in WinEdt

I recently switched from TeXMaker to WinEdt. In TeXMaker I was used to customize my 'Quick Build' command in the 'Configure TeXMaker' dialog. In that dialog I was able to choose, for example: ...
9
votes
1answer
636 views

Automatic calculation of error in pgfplots

When taking in data through a file (such as table[x index=0, y index=1, y error index=2]{plots/mydata.table};) is it possible to automatically calculate the error bars (instead of putting them in ...
10
votes
2answers
294 views

How to create commands for automating the commenting process on some zones of a picture

I have a lot of comments to make on different pictures, I can do it with the following command for ex: \begin{tikzpicture} \node[anchor=south west,inner sep=0] (image) at (0,0) ...
6
votes
1answer
996 views

Include figure (from macro) with underscore in filename

I have a system of where a .tex is generated from a program. The final .tex file has a (simplified) structure like this: \newcommand{\PlotFrame}[1]{% \begin{frame} \frametitle{...} ... ... ...
22
votes
3answers
500 views

How to compute the remaining space on the current page

Is there a way to compute the remaining space on the current page and issue an optional command?
21
votes
2answers
902 views

Is LaTeX intended for unattended typesetting?

With markup converters like Pandoc, it is now possible to generate LaTeX documents without ever touching any LaTeX code. However, obtaining aesthetic page breaks for slightly complex documents, ...
20
votes
1answer
884 views

How to automatically arrange an unknown number of images?

I have several compilable LaTeX input files and their corresponding PDF files. Each PDF file contains any number of pages. I want to import each LaTeX input file with \lstinputlisting followed by its ...
16
votes
1answer
1k views

Automatic line break in alignat

Consider the following example from http://tex.stackexchange.com/a/12782/4011 \documentclass{article} \usepackage{amsmath} \newcounter{eqn} \renewcommand*{\theeqn}{\alph{eqn})} ...
10
votes
4answers
331 views

How can I automate the workflow for producing multiple versions of a document? [duplicate]

Say you have two versions of the same LaTeX document. For instance, you have one version of your lecture slides for actually delivering a lecture: as you're really not a big fan of the "wall of ...
10
votes
1answer
817 views

Create a “yearbook-style” multi-page layout of photos

I would like to create a "yearbook-style" layout of photos in LaTeX. Each photo would have a caption and the objective would be to automatically layout the differently sized rectangular photos to ...
7
votes
1answer
2k views

TeXstudio: how to automate LaTeX biber sequence of compilation

I'm a bit confused about how to configure TeXstudio to use biber. It's not that I can't find a way, I'm just wondering what is the intended way, i.e. coming from WinEdt I'm used to that "Build" or ...
12
votes
7answers
3k views

Is there an automatic process to create index creation?

Certainly, there must be some way to somewhat create a list of words suggested to be included in an index.
12
votes
1answer
1k views

Automatically connect nodes without overlapping other nodes or connections

In making a tree diagram with TikZ. Say that I've got the following nodes \node(a) {\(A\)}; \node(b1) at ($(a)+(4,1)$){\(B_1\)}; \node(b2) at ($(b1)+(0,-1)$){\(B_2\)}; \node(c) at ...
2
votes
2answers
128 views

Automatically Adding Potentially Referenced Macros From Auxillary File

In this question someone asked if there was any way to eliminate user defined macros from a TeX document and replace them with the appropriate primitives. The answer seemed to be that while some ...
1
vote
1answer
932 views

Run multiple commands in TeXShop typeset [duplicate]

I am a user of biblatex-mla and I wish to run the whole bibliography generation workflow with a single click of "Typeset" in TeXShop. pdflatex filename.tex bibtex filename pdflatex filename.tex How ...
24
votes
5answers
3k views

Intelligent paragraph reflowing in vim?

I'm not sure whether this is an appropriate question for tex.SE. If you think questions like this should not be asked here, please voice you concern. If necessary I'll open a question on meta. For ...
21
votes
4answers
738 views

Count and use the number of items in advance

When writing LaTeX code, I often successively make changes like adding or removing items. I'd like to have TeX count and update the number of items in the list automatically, as in There are ...
18
votes
2answers
5k views

Inputting multiple files in LaTeX

Suppose I have a directory containing a bunch of LaTeX source files, and I want to input all of them into a single main file. I could do this by saying \input{dir/file1.tex} \input{dir/file2.tex} ...
11
votes
5answers
1k views

Cross Platform LaTeX Build System

I am on Windows 7 Professional (64 bit) and would like to be able to execute one command to completely compile a PDF from source .tex files (including all required runs to get the table of contents, ...
18
votes
4answers
441 views

Avoid repeating [hbt] and \centering for every table

In a document I'm writing, I'm using the familiar [hbt] option for my floating tables, and I center them. I'd like to avoid repeating that every time I'm creating a table. I assume it's easy to add ...
4
votes
3answers
871 views

Automatically start the necessary pdflatex runs if .tex has changed (MacOS X)?

I read about Latex Daemon, which seems to automatically start a new latex run, when the source document (.tex) has changed. Can somebody recommend me a similar solution for MacOS X (as Latex daemon ...
17
votes
2answers
485 views

Automatically numbering constants

I would like to somehow use LaTeX to automatically number constants. Some background As a mathematician, in my daily work there are a lot of throw-away constants which are not extremely important ...
14
votes
1answer
3k views

Auto generate an Index

Is there any way to auto-gererate an index for the makeidx package? I've written ~270 pages and didn't think of adding \index{} everywhere. Do I really need to go over everything and add \index{}?
12
votes
3answers
337 views

Draw Polygonal Number Using PSTricks (or TikZ)

I would like to draw the following using PSTricks (or TikZ): (Found on http://i1.wp.com/mathandmultimedia.com/wp-content/uploads/2012/08/polygonal-numbers.png.) I can do it myself using an ...
12
votes
2answers
651 views

Automatically avoid more than one node when drawing a path

Background Andrew Stacey's answer to Automatically connect nodes without overlapping other nodes or connections presents code to make a path avoid a node by going through a corner of that node ...
10
votes
1answer
715 views

Images off the page in multicols environment

Before my question, some background information. I’ve created an algorithm (not latex) which will generate a catalog for a collection of books dynamically. A user supplies information to query an SQL ...
6
votes
3answers
620 views

Extract document statistics? - How many pages has chapter xy? Count fixmes?

I have a large pdflatex document where each chapter is located in an extra text file and included with \include{chapter3.tex} ... How can I extract the page numbers of each chapter and write them ...
17
votes
2answers
625 views

Is there any package to automatically select font size and margins to optimize pages?

Suppose I am preparing multi-page handouts using LaTeX. I don't care much about the font and margins size (while they are reasonable), but I would like all the pages to be filled, ie. avoid the ...
15
votes
2answers
916 views

Create a LibreOffice spreadsheet from luatex

After reading this amazing answer, I'm wondering if it possible to do the same thing but the other way round, that is create a LibreOffice spreadsheet from luatex, exporting data from the tex file to ...
14
votes
2answers
2k views

Replacement for MiKTeX's texify in TeX Live

I used to use the texify command in MiKTeX on Windows. I would, for example, run a command like: texify --pdf --run-viewer file.tex which, as I understand it, would produce a pdf, automatically ...
34
votes
1answer
815 views

TeX as the basis for data driven document generation system?

I am in the early stages of trying to replace an existing document generation system based on Microsoft Office apps (Word and Excel). The system runs once a year to generate over 300,000 individual ...
44
votes
3answers
5k views

Detecting all pages which contain color

In an larger LaTeX document there are often only some pages with color content (mainly figures) and the remaining ones are only black and white. Because printing costs for color pages are much higher ...
15
votes
3answers
572 views

Mathematical functions inside LaTeX tables

I have several tables where I have tables which may look like this: ------------------------------------- | X | Y | X + Y | X - Y | (X + Y)/2 | ------------------------------------- | | | | ...
14
votes
7answers
536 views

Automatic generation of pages with variable fields

I need to produce dozens of same pages, except for the part that each page has to have a different person's name on it. Imagine it as an exam, where the content is equal for every page, except that I ...