{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

101
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 ...
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 ...
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 ...
42
votes
5answers
2k views

Automated Newspaper Layout (with TeX and abroad)

Update: I'd like to revive (and revise) this question a bit because there have been some recent developments, and furthermore I would be happy to encourage some up-to-date discussion. I'm thinking ...
34
votes
1answer
820 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 ...
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 ...
32
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 ...
31
votes
1answer
974 views

Questions on designing a dynamic database of exercises

Almost all packages to handle exercises allow us to attach/retrieve meta-data to/from each exercise. Some things one might want when handling exercises are: Filter exercises according to their ...
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 ...
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)
24
votes
4answers
607 views

Smart parentheses?

Is there a way of smartly nesting parentheses and square brackets (in text mode), so that LaTeX detects nesting relations and typesets them accordingly? I'm thinking in something like csquotes does ...
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 ...
22
votes
3answers
504 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
4answers
749 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 ...
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, ...
21
votes
0answers
413 views

Documenting on code revisions

I have made modifications to a few files of a C++ program. I would like to document on these changes in a nice LaTeX report, by showing exactly what I modified and explaining why I did so. Since ...
20
votes
1answer
888 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 ...
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 ...
18
votes
4answers
450 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 ...
18
votes
2answers
1k views

Repeated slides in beamer

I have about 200 JPEG files that I need to include in a PDF document, one JPEG per page (i.e. 200 pages + intro slide). The following code successfully does this with one JPEG. ...
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} ...
18
votes
2answers
2k views

Find optimal figure size to fit two images on one page

I often encounter a situation where I would like to fit two or three figures on one page. I define my figures as follows: \begin{figure}[htpb] \centering ...
17
votes
2answers
487 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 ...
17
votes
1answer
1k views

Automatic newspaper creation in LaTeX

This is a very general question about LaTeX, asked by a 100% newbie! I'm trying to figure out if it's feasible to build an automatic newspaper creation engine, and if LaTeX can help in this field. ...
17
votes
1answer
353 views

Optimal arrangement of pictures/boxes in a page

Does anybody come up with a way to automatically arrange a few figures or boxes in a larger rectangle or page? Here it is a real world example: One is producing a beamer presentation. One has 4 or 5 ...
17
votes
1answer
144 views

Floats shortly after they have been \ref-erenced; Warn otherwise

In my thesis I have a many floating figures which I then reference using \ref. I use flafter to ensure that they do not appear before they are defined in the source code (See Force floats to be ...
17
votes
2answers
626 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 ...
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 ...
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
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})} ...
16
votes
2answers
502 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 ...
16
votes
1answer
996 views

texify or latexmk?

MiKTeX 2.9 comes with both and they apparently do the same thing. I was wondering what the difference between them is (if any) and which one is preferable for large documents.
15
votes
3answers
693 views

Shortcuts for code in latex

I am tired of writing \frac{\partial something}{\partial something_else}. Can I automate it by defining some sort of shortcut to it, so that when I write \p(x)(y) it will transform to \frac{\partial ...
15
votes
3answers
573 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 | ------------------------------------- | | | | ...
15
votes
2answers
923 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 ...
15
votes
4answers
330 views

Using the filename in the document?

I have a bunch of documents called wk01.tex wk02.tex and so on up to (eventually) 20. These are weekly handouts for a course I TA. Currently, each document starts with a \def\classweek{5} or whatever. ...
15
votes
2answers
613 views

Predictive mode: Only auto-complete LaTeX keywords

I typeset documents in French, and I don't really need auto-completion of the words that I type. I do, however, love the completions features that Predictive mode offers for LaTeX commands. Is there ...
14
votes
7answers
537 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 ...
14
votes
2answers
577 views

draw colored world/US map in LaTeX

I'm trying to draw maps similar to these in a LaTeX pdf document: I want to auto-generate them from a list of pairs (country,color) to determine the colors. I have found the package pst-map2dII ...
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{}?
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 ...
13
votes
2answers
782 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} ...
13
votes
4answers
338 views

Automatically remove page number in one-page documents

I find LaTeX's choice of putting a page number in one-page documents stylistically odd, so I would like to suppress that behavior. I've previously done this manually, but it would be better to not ...
13
votes
2answers
247 views

Persuading (la)tex “silently to go beyond the envelope of 'good taste' ” to avoid an overfull hbox

My understanding, based on reading this website, is that (la)tex performs at most three passes when trying to typeset a paragraph: one based on \pretolerance, one based on \tolerance, and one based on ...
13
votes
6answers
852 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 ...
12
votes
3answers
339 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
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 ...
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
2answers
655 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 ...