12

Is there a way to get a list of all encoding/family/series/shape combinations that are actually used in a document that you have the sources of? You know, like the OT1/fvm/m/n strings you get when a particular font is missing.

This is important when you want to change to a commercial font and need to know what weights and variants you actually need to buy. Like: "Do I actually need the demi-bold small caps italics?"

And since many font changes are not done by hand with \emphs and whatnot, things can easily get a little confusing in a longer document.

2
  • Does the list of fonts in Acrobat Reader-> Document Properties->Fonts help?
    – percusse
    Commented May 22, 2012 at 22:18
  • @percusse No, not really. It usually doesn't contain shape and weight information. It's useful when I want to find out what font families are used but that at least I do know of my own documents ;)
    – Christian
    Commented May 22, 2012 at 22:22

1 Answer 1

14

add

\showoutput

to your document, your log file then has lots of stuff like

......\hbox(6.94444+1.94444)x0.0, glue set - 345.0fil
.......\hbox(6.94444+1.94444)x345.0
........\hbox(6.94444+1.94444)x345.0, glue set 290.04158fil
.........\OT1/cmr/m/n/10 G
.........\OT1/cmr/m/n/10 r
.........\OT1/cmr/m/n/10 e
.........\OT1/cmr/m/n/10 e

which you can then filter eg on a bash command line as

$ grep -o   "\\\\[A-Za-z0-9]*/[A-Za-z0-9]*/[A-Za-z0-9]*/[A-Za-z0-9]*/[0-9.]* " abc3.log | sort -u
\OML/cmm/m/it/10 
\OMX/cmex/m/n/5 
\OT1/cmr/bx/n/14.4 
\OT1/cmr/m/n/10 

That is search for all instances of strings of the right form sort them and remove duplicates, revealing I just used four fonts in my test document.

3
  • Thank you, that's exactly what I was searching for! Actually, grep -o "\\\\[A-Za-z0-9]*/[A-Za-z0-9]*/[A-Za-z0-9]*/[A-Za-z0-9]*" abc.log | sort -u will also only find font strings and already get rid of the different sizes so the output is much smaller and can be understood at a glance. grep -o "\\\\[A-Za-z0-9]*/[A-Za-z0-9]*/[A-Za-z0-9]*/[A-Za-z0-9]*/[0-9.]* " abc.log | grep -o "\\\\[A-Za-z0-9]*/[A-Za-z0-9]*/[A-Za-z0-9]*/[A-Za-z0-9]*" | sort -u for the paranoid.
    – Christian
    Commented May 23, 2012 at 9:12
  • Or \\, for some versions of grep, instead of \\\\
    – egreg
    Commented May 23, 2012 at 12:08
  • 2
    @egreg I think it's always just two \ for grep the difference is the command line (which is why I mentioned bash) bash grabs one level of \-quoting before grep sees the string. Commented May 23, 2012 at 12:33

You must log in to answer this question.

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