I have a set of one-page documents written in LaTex.

The same file compiled in LuaLaTeX is about 23 times larger than when it is complied using XeLaTex (about 641 KB vs 28 kb). I tried with a couple of difference fonts, and the LuaLaTeX compiled PDF was always significantly larger than the one made with XeLaTeX.

The anyone know the cause if this difference in output file size?

  • 3
    Maybe the one does not include the fonts directly but the other one does? Also check for the PDF version and compression level. May 4 '12 at 20:00
  • Different compression levels do not make up such a big difference. And does TeX ever produce a PDF without fonts? That would be crazy.
    – topskip
    May 4 '12 at 20:31
  • 2
    See File size difference between xelatex and pdflatex - LuaLaTeX behaves like pdfTeX. May 4 '12 at 21:16
  • 1
    @PatrickGundlach: What do I as a traditional pdflatex user know about this crazy xelatex and what it does with fonts? ;-) May 4 '12 at 21:29
  • @MartinScharrer True. And it is merely a strong hope that no TeX engine ever produces PDFs without embedding all fonts.
    – topskip
    May 5 '12 at 8:54

This is because LuaTeX embeds Type1 fonts whereas XeTeX uses Type1C fonts. Type1C fonts are compact fonts (CFF). See my answer on Why does pdflatex produce bigger output files than latex+dvipdfm? for more details.

$ pdffonts onepage-lualatex.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
KBBDIF+CMR10                         Type 1            yes yes no       4  0

$ pdffonts onepage-xelatex.pdf
name                                 type              emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
WEDQOW+CMR10                         Type 1C           yes yes no       4  0


$ ls -lh onepage-lualatex.pdf onepage-xelatex.pdf
-rw-r--r-- 1 patrick staff  17K  4. Mai 22:10 onepage-lualatex.pdf
-rw-rw-rw- 1 patrick staff 4,9K  4. Mai 22:08 onepage-xelatex.pdf
  • This makes sense. I think I understand the difference, though I'm not sure what advantage Type 1 would then have over Type 1C. Is is relatively trivial to get LuaLaTeX to use Type 1C? File size is important for our current TeX usage. May 7 '12 at 13:34
  • @Scribblemacher I don't know if it is possible at all to get LuaTeX to write Type1C files. If file size is important, then you might try to use a built in font and don't include any. (Ask a new question ;-))
    – topskip
    May 9 '12 at 8:11
  • New question posted here May 9 '12 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.