From ddf5a7fa7ed5b21193a5bc92d98b681d5fa182a6 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Thu, 1 Jul 2021 17:34:11 -0400 Subject: [PATCH] update latex tips --- content/blog/20070522-latex-tips.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/content/blog/20070522-latex-tips.md b/content/blog/20070522-latex-tips.md index d1a08e3..e949d22 100644 --- a/content/blog/20070522-latex-tips.md +++ b/content/blog/20070522-latex-tips.md @@ -1,12 +1,14 @@ # LaTeX Tips -*Posted: 2007-05-22* +*Posted 2007-05-22; updated 2021-07-01.* + +Note that these instructions are over a decade old. Some things may have changed since then. :) ## Embedding fonts in PDFs To check whether fonts are embedded, use `pdffonts`, which is included with `xpdf`. `pdffonts` gives output that looks like this: -``` +```text $ pdffonts paper.pdf name type emb sub uni object ID ------------------------------------ ------------ --- --- --- --------- @@ -19,9 +21,14 @@ You want `emb` to be `yes` for all fonts (and possibly `sub` as well; also, all `pdftexDownloadBase14 true` -If it's set to `false`, change it to `true`, then run `update-updmap` as root. Remake the PDF; if it still has non-embedded fonts, your figures are probably to blame. Check your PDF figures and make sure their fonts are embedded (using the `pdffonts` command). For anything that doesn't have embedded fonts, you can try the following magical invocation (all on one line): +If it's set to `false`, change it to `true`, then run `update-updmap` as root. Remake the PDF; if it still has non-embedded fonts, your figures are probably to blame. Check your PDF figures and make sure their fonts are embedded (using the `pdffonts` command). For anything that doesn't have embedded fonts, you can try the following magical invocation: -```gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=figures/Mprime-new.pdf -f figures/Mprime.pdf``` +``` +gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \ +-sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer \ +-dCompatibilityLevel=1.4 -dMaxSubsetPct=100 -dSubsetFonts=true \ +-dEmbedAllFonts=true -sOutputFile=figures/Mprime-new.pdf -f figures/Mprime.pdf +``` This creates a file `figures/Mprime-new.pdf` that is hopefully identical to the input file `figures/Mprime.pdf`, except that the fonts are embedded. Run `pdffonts` on it to check.