Overleaf

We usually write our papers in LaTeX on Overleaf. With your EPFL email address, you can upgrade to a professional account for free, so you can use Dropbox and GitHub integration, change tracking, private projects with invitations, and more.

Macros

When writing in LaTeX, you should make ample use of macros. Instead of typing the same commands over and over again, define a concise macro once and then reuse it. Not only will this save you time, it will also make it much easier to apply consistent changes quickly: just change the macro definition, and voilà.

Some of the macros that we end up using all the time at dlab are available in dlab_macros.tex, available here. Include this file in all your LaTeX projects by adding a line \input{dlab_macros} right after the \documentclass command. Make sure you become acquainted with the useful macros defined in that file. They will make your life easier!

How to embed fonts

Publishers (e.g., Sheridan, AAAI Press) regularly complain about fonts not being embedded properly in the camera-ready PDF. Usually PDF images are the culprits.

If the plots are made with R, the simplest solution is to use cairo_pdf() instead of pdf().

If you are not using R, you may use the embed_fonts.sh script available here in order to properly embed fonts. You need to run the shell command sh embed_fonts.sh FIG.pdf once for each image (e.g., FIG.pdf) that you want to include in your paper. The script will modify the image by embedding all fonts. Then you should use the modified images for compiling your final version of the paper. Note that you should not just run embed_fonts.sh on the full-paper PDF, but you need to run it on each image separately before making the final full-paper PDF. Otherwise you may get horrible results, with entire pages looking grainy, also when printing the paper on a physical printer.

Writing style

A random list of tips and best practices for writing

This list is incomplete and may be expanded:

  • Words that contain a hyphen (e.g., “government-mandated”) will be split across lines by LaTeX only at the position of the hyphen; consituent words will not be split (e.g., you could not get “govern-“ on line one, and “ment-mandated” on the next). This can often lead to overfull lines – ugh! Instead, use the \hyp command from the hyphenat package (already included in dlab_macros.tex). For instance, instead of government-mandated you should use government\hyp mandated in LaTeX. Yes, it looks ugly in the source code, but can avoid displeasing results in the compiled PDF.
  • Do not flip back and forth between tenses. Stick to either the present tense (“we run the model 5 times”) or the past tense (“we ran the model 5 times”).
  • Don’t make inflated use of capital letters! Do not use title case for section and subsection headings, figure titles and axes, table columns etc. For instance, don’t name your section “Data Collection Procedure”, but “Data collection procedure”. Save title case for the paper title only.
  • Use the Oxford comma. For instance, write “Germany, Austria, and Switzerland”, not “Germany, Austria and Switzerland” (but of course it will still always be “Germany and Austria”, without any comma). In principle, it doesn’t matter if you use the Oxford comma or not, as long as you do it consistently. In practice, it is much easier if we all follow the same rules, especially when multiple people collaborate on the same paper. So always use the Oxford comma.
  • Structure your paper well. Long sections or subsections can become more reader-friendly when you name important paragraphs via the \xhdr command from dlab_macros.tex.
  • If your bibliographic style uses numeric references (e.g., “[1]”), you should not use code such as as shown by \cite{xyz}, since this would lead to the ugly “as shown by [1]” (how would you read this out loud?). Instead, you should write as shown by Smith et al.~\cite{xyz}, or even better (if the \citeauthor command is defined) as shown by \citeauthor{xyz}~\cite{xyz}.
  • References must be in a consistent format. It’s not enough to just copy-paste from Google Scholar. You must personally go over the BibTeX file to make sure all items appear consistently in the PDF. Here is an example of a consistently formatted bibliography. An incomplete list of questions you should ask yourself: Are titles consistently capitalized? Are conference names printed consistently in either abbreviated or full form? Does the same conference/journal always appear under exactly the same name? Are journal/conference names appropriately capitalized? Are page numbers given for all journal papers?