I'm curious about the finishing touches that people put to LaTeX documents. Are there any canonical or special things that people do in finalizing a document?

What I do:

  • Careful proofreading of the document (which I think is the single most important thing to do when finalizing a document).
  • Read through the source file to remove unnecessary stuff and document code by commenting.
  • Read through the .log file and look for warnings, overfull boxes and such.
  • Check the placement of figures.
  • Remove trailing spaces with a tool in gedit (it is made via sed 's/[[:blank:]]*$//').
  • Rename the generated file, like the pdf, to represent it being a final version.
  • Since I use git I usually tag the final version and commit the final pdf.
  • I also sometimes pdfopt my document.
  • 14
    I don't expect one single best answer and like to suggest to turn this into a community wiki. May 28, 2011 at 9:37
  • 6
    Removing trailing spaces is more cosmetic in nature. The line break in the source code is already taken as space and multiple spaces in a row a taken as one. May 28, 2011 at 9:44
  • 5
    I normally only try to influence the line breaking to avoid widows and orphans and the float placement. Of course should the final version by tagged in a VC system if one is used. I would also commit the final PDF. After a while with updated packages, etc. you might get different results. May 28, 2011 at 9:47
  • Thanks for the suggestion of committing the final pdf. I'll add that to the list.
    – N.N.
    May 28, 2011 at 9:50
  • 3
    I would check the placement of figures and that their captions make sense without having to read the body text. May 28, 2011 at 9:52

5 Answers 5

  • Document all manual layout corrections in comments at the top of the document (\looseness, \newpage, \break, etc)
  • put a last-changed-on comment at the top as well
  • make a backup
  • if you are planning long time storage: document what TeX distribution you used, and the macro versions. LaTeX has a \listfiles command for the macro versions I think, but you also may need to remember the executable's version and possibly font and hyphenation patterns file versions.
  • 15
    Waiting until the document is finished is often too late for making a backup. You should have it backed up from the beginning, or even better, use version control. Jul 20, 2012 at 23:19
  • 10
    Using version control does not replace making backups.
    – gerrit
    Oct 10, 2013 at 15:28
  • @gerrit: Well, version control includes a type of backup. But you need to backup the version control repository of course. If you only have it locally you might loose everything if your computer breaks or gets lost. Anyway, backing up using VC is usally very easy. May 9, 2017 at 13:40
  1. Check for Overfull/Underfull boxes
  2. Check the hyphenation
  3. Optimize paragraph breaking
  4. Optimize page breaking if needed (adding \enlargethispage and \pagebreak[3] as needed)

Step 3 and 4 should be repeated as often as needed. :-)

And finally use qpdf (not pdfopt) to get linearized PDF.

  • 2
    How do you check hyphenation? Is there any special reason you use qpdf instead of pdfopt? What is your policy on optimizing page breaking?
    – N.N.
    May 28, 2011 at 10:43
  • 3
    I'm also interested in advantages of qpdf over pdfopt. May 28, 2011 at 12:44
  • 3
    Hyphenation: Manually. I believe CTAN has a script that find's all hyphenated words. pdfopt runs a PDF through ghostscript: It's rendered into PDF. qpdf on the other hand knows about PDF and just fixes the file - there's much less that can go wrong. May 29, 2011 at 10:09
  • 4
    @N.N. You can use findhyph to check hyphenations. See this answer
    – Lev Bishop
    May 29, 2011 at 19:44
  • 1
    See also this answer on qpdf and pdfopt.
    – gerrit
    Oct 10, 2013 at 20:14

In addition to checks and edits already mentioned:

  • I feel that final touches are most important when a document is written by multiple authors. It should be checked by the best writer and the author with the most LaTeX experience.
  • It's often a good idea to replace \today with the actual date in the file.
  • I often introduce \newif\ifdraft to remove comments, \overfullrule and the like from the final version. Obviously I'm setting \draftfalse.
  • Check placement of figures and make sure that their captions make sense without having to read the body text.
  • Setup PDF meta data.
  • I don't do it but might do it some day: the LaTeX source code can be embedded into the PDF.
  • what are the advantages of replacing \today with the fixed date?
    – DQdlM
    May 28, 2011 at 12:54
  • 10
    @KennyPeanuts: If minor changes are applied afterwards, the date will still match the printed/published version. If you don't have that, then there's no real difference. May 28, 2011 at 14:33

(Updated answer including information from the comments)

Remove unwanted ligatures. (Standard LaTeX ligatures are ff, fl, fi, ffl and ffi.). babel offers the shorthand "|, which you can insert in between the ligaturized letters, for most languages but not english (neither italian and norsk). If you're writing in on of these languages, you can either use {} instead, or easily activate the shorthands as described in babel: Adding ngerman' s language shorthands to english as the main document language. For the ligatures, it shouldn't make any difference.

I haven't yet found a comprehensive guide to when ligatures are desired or not, but I do know that you don't want a ligature across the border of two morphemes, i.e. two "morphological units" or somewhat less correct but perhaps more graspable two "semantic units". (Morpheme borders may or often may not coincide with syllable borders; syllables are not the same as morphemes!) I asked a question on this topic at english.sx: When should I not use a ligature in English typesetting?

An example from German: Auflage would usually be compiled with an "fl" ligature. However, it is a compound word that consists of two morphemes: {auf} + {lage}. Thus, the ligature should be suppressed by coding it as Auf"|lage. Similarly with auf"|fallen.

Comparable English examples might be off"|line or stiff"|ly, but I'm not 100% sure on these.

Searching the source code via Ctrl+F & friends makes finding ligatures pretty convenient, and with a little practice, you can determine whether a ligature is necessary or not within a second. For a 200-page book, it might still take you a while. There's a script for German texts that does this job for you: http://ctan.org/tex-archive/support/rmligs or a more recent version at the creator's homepage http://www.j3e.de/ispell/igerman98/dict/.

So if you notice you're de-ligaturizing the same words over and over again, the question Can one (more or less) automatically suppress ligatures for certain words? might be interesting to you. Mico is taking up the challenge of writing a package that avoids undesired ligatures automatically: Any suggestions/requests for features for a new package that allows disabling ligatures for (pre)selected words?

  • 6
    Same effect can be achieved if you insert {} between the offending morphemes. Jun 8, 2011 at 8:39
  • @Martin: I found where I got this sign from: babel. It's the prescribed way of disabling a ligature in many languages. There are some exceptions, though, where "| does something different, e.g. italian and norsk.
    – doncherry
    Aug 14, 2011 at 22:45
  • 1
    The package selnolig is available to prevent ligatures at morphene boundaries.
    – lblb
    Apr 11, 2018 at 19:32
  • Spell check.
  • Have someone else read it for technical correctness.
  • Have someone else read it for editorial (non-technical) correctness.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .