Optimising very large image files
Overly large image files, or image files using inappropriate file formats, can significantly prolong the compilation process and potentially cause compile timeouts. This help article outlines some suggestions on handling large image files, and for choosing appropriate image file formats.
For large image files (where each is >1MB in size), we recommend that raster images (including raster PDF images) be resized, say to 1200px wide or high, so that the file sizes are smaller. You can do this with an image manipulation program; or if you're using ImageMagick, you can use the convert command. On MacOS, the sips -Z command is very useful.
Photographic images saved as .png can also result in very large file sizes: .jpg is usually a much more space-efficient format for photographs. Line drawings, plots and diagrams are better saved as .png or .pdf, in general. .pdf images can also compile faster compared to .png files if their file sizes are comparable, as the compile process then doesn't need to call libpng.
In the case of .eps images, we recommend that they be converted to .pdf, as the PDF format often results in a smaller file size while maintaining the vector nature of line drawings. The epstopdf command is handy; you'll need to have GhostScript installed as well.
If you must use .eps images in your project, sometimes the .eps file is unnecessarily large due to a glitch/mis-config with the application that exported them. You can try to modify the export settings; or try just re-processing the file with GhostScript and compare the file sizes:
gs -o outputfile.eps -sDEVICE=epswrite originalfile.eps
If you'd like to shave off some compile/render time while working on your document, you can turn on "draft" mode to make your compilation faster, by writing \documentclass[draft]{…} in your document class declaration. By not rendering the images into the PDF (and a couple of other things), the "draft" option can often help reduce compilation time, which is useful when working on large documents.
You can also turn on/off the graphics for a specific part of the project that you're working on:
\setkeys{Gin}{draft=false}
...any \includegraphics here will be rendered in full glory, so that
you can check the images in this part of the document..
\setkeys{Gin}{draft}
...any \includegraphics here will just be displayed as a blank frame.
Overleaf guides
- Overleaf user documentation
- Overleaf group administration
- Overleaf Commons administration
- Overleaf on-premises
LaTeX basics
- Creating your first LaTeX document
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
References and citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Fonts
Presentations
Commands
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class