1

I'm working on a big LyX document and I've added a build script capable of converting assets from many formats (Inkscape SVG, PlantUML, QCAD DXF) to PDF. This improved a lot the time needed to generate the PDF: although LyX has the feature of adding converters and configuring cache, I work in many machines and whenever I pull the project, LyX create a temp dir and convert all of the images.

In my solution, I use a fixed (not temporary) dir for cached images, and check the modified timestamp on the source files to convert things only when needed. There's an auxiliary SQLite file for helping with this.

However, I ended up standardizing everything to PDF (including PNG and JPG). Since LaTeX reads these raster images direcly, Would it be faster to (i) use them or (ii) their PDF counterparts?

Thanks in advance.

3
  • 3
    png is the slowest (usually) pdf and jpg can essentially be included as-is so if you are targetting pdf as the document format they should usually be more or less the same. Feb 6, 2021 at 16:08
  • 2
    @DavidCarlisle It depends on the PNG file. If some conditions are met, the inclusion is fast, because the image data are just copied. This is marked with (PNG copy) in the .log file of the pdfTeX run. Otherwise (alpha channel, ...) the image data are decoded and encoded, which is a much slower process than just copying. Feb 6, 2021 at 18:00
  • @HeikoOberdiek ah yes I should have known that (I knew it once but clearly not earlier today:-) Feb 6, 2021 at 18:11

1 Answer 1

3

David Carlisle's comment is exactly the answer I was hoping to get:

png is the slowest (usually) pdf and jpg can essentially be included as-is so if you are targetting pdf as the document format they should usually be more or less the same.

1
  • 2
    Note Heiko's comment under the question Feb 6, 2021 at 18:12

You must log in to answer this question.

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