~bjoern/advice/latex

Tracking only source files / removing auxiliary files
Students unfamiliar with writing LaTeX papers often make mistakes in first setting up their repository. In particular, many times intermediate files (.aux,.log,.synctex.gz, etc) end up in the repository where they don't belong. If you are using git, you need to first add a .gitignore file to your repo that lists these intermediate file extensions. Then remove files from the repo that are now .gitignored.

Commenting and anonymity macros
We use a standard set of macros to add comments into our documents. See inputmacros.tex. For example, I would add comments with \bjoern{Here is my comment}. Edit this file to add all author names and place it into your main latex source directory for the paper. Include it before your \begin{document} line with \input{inputmacros}. Rendering of comments in the PDF can be globally turned on using \toggletrue{comments} and off using \togglefalse{comments}, found near the head of the file.

There's also a toggle for anonymous submission - \toggletrue{anonymous}. You can then write text that appropriately anonymizes certain information like this:

We recruited students from \iftoggle{anonymous}
{ %if anonymous is true
  our institution
}{
  %else - non-anonymous:
  UC Berkeley
}. 
We also use this pattern for the author block. The file also redefines lists to use less whitespace.

Use one files for each major section
E.g., introduction.tex, methods.tex, results.tex. This reduces confusion in collaborative writing who is working on which section, especially as the deadline approaches. Include these with \input{introduction} etc. (note, no file extension needed - .tex is implied).

Image conventions

  • Create a /figures subdirectory and place images there. Make sure you also save an editable version of each figure (e.g., .ai if Illustrator; .psd for Photoshop, etc.) so collaborators can update figures when necessary.
  • Create .pdf figures where possible, especially if the figure includes text, so the text is rendered crisply. For raster images, use at least 300 pixels-per-inch (ppi).
  • Make figures span the whole column (or 2 columns) - do not use the ACM template's width=0.9\columnwidth (use width=1.0\columnwidth instead).
  • Place figures at the top or bottom of the page, not inline with a paragraph, unless you have a really strong reason for doing so. E.g., use placement modifiers: \figure[t] or \figure[b] (or \figure*[t] for two-column layouts).