1

I wonder what tips should we keep in mind to keep a long document lightweight. I've written 3 chapters from my thesis with ~30 figs and some math, and document size is exponentially increasing (10MB for 70pages). I am using CUED Cambridge University template (availabe on GitHub).

On the other hand, I see some much longer documents with heavy graphics that are considerably lighter than mine (e.g. Tikz manual with 1165 page ~9MB, and PGFplots with 500 pags ~8MB).

I draw most of the figures/diagrams with Tikz and PGFPlots in a seperate standalone document. Then, I use \includegraphics to add the compiled PDF to the main document.

P.S: A similar question is asked here, but it does't have a proper answer. Another question seems to work only on files with text (no graphics).

Edit1: I use the default options of the package with the default fonts. The PDF is compiled with pdflatex on a TeXlive2014 or MikTeX2014 distribution. The generated PDF format= PDF-1.5, all Fonts are type 1, many fonts start with NimbusRomNo9L.

antmw1361
  • 1,276
  • What engine are you using? How many fonts are you using, which ones and how? Are you using microtype? Which version PDF are you producing? What format are you producing for the graphics? I tend to use standalone with TiKZ externalisation rather than \includegraphics but I've no idea if that makes any difference. – cfr Mar 15 '15 at 00:04
  • I use pdflatex but I'm not sure about the answers to the other questions. These questions are very technical for me. – antmw1361 Mar 15 '15 at 00:08
  • 1
    Hard to say much without some information. I mean: it is your document, after all. Your PDF viewer can give you some information in the 'Properties' dialogue e.g. PDF version, fonts. But you can surely say which formats the graphics are in and whether you use microtype. If not, add \listfiles before \documentclass and take a look. – cfr Mar 15 '15 at 00:11
  • If I use standalone package to import all figure code (say 100 figures) to the main document, would my compile time increase significantly??? – antmw1361 Mar 15 '15 at 00:13
  • 2
    10MB for 70 pages sounds too much. Do you have small logos with big images or stuff? The easiest thing to do is take your \end{document} command all the way up and move it down slowly and see where it suddenly becomes big. Then you can see what is causing the extra weight – percusse Mar 15 '15 at 00:13
  • @percusse That might work but the class itself is also loading images (logos etc.). But it would certainly determine whether it is the class or the contents of the thesis creating the weight. – cfr Mar 15 '15 at 00:18
  • 1
    Which options are you loading the class with? Or are you using the defaults? How current is your TeX installation? The link you posted is definitely relevant: you're using hyperref, so it will make a difference whether you are getting the latest compression etc. Also, which font option you're using will make a difference. The class is doing some things which are not recommended or are no longer recommended, and is loading some unnecessary/sub-optimal packages... – cfr Mar 15 '15 at 00:22
  • PDF format= PDF-1.5, all Fonts are type 1, many fonts start with NimbusRomNo9L – antmw1361 Mar 15 '15 at 00:22
  • I have TeXLive 2014 at home, and MikTeX 2014 at office. I am using default option, and default fonts. I also modified hyperref to remove borders around the links. – antmw1361 Mar 15 '15 at 00:27
  • Did you try @percusse's suggestion? Re. input code rather than graphics. If you externalise, it will slow compilation the first time you compile a figure or when you've changed it. But then it will use an external image anyway. But I don't know that it would be any lighter - it will depend on the kind of images you are producing already. \pdfminorversion=7 might help but not very much since you are already using 5. You could use print to avoid the hyperref weight. But I'm assuming it is probably the images. – cfr Mar 15 '15 at 00:29
  • And it misuses font commands.... [Do all such classes always do this?] – cfr Mar 15 '15 at 00:30

0 Answers0