chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
29 stars 4 forks source link

Improve handling of PDFs as source files for includegraphics #167

Open christianp opened 10 months ago

christianp commented 10 months ago

At the moment, if you use a PDF file as the source for \includegraphics, it goes through the LaTeX fallback renderer, which then fails because it can't find the source file - it's not copied to the temp directory that the imager uses.

plasTeX doesn't automatically convert PDFs used as images (see plastex/plastex#276). Our custom renderer and imager can do it, though.

I've spent the day making this happen in the branch pdf-includegraphics. It works, but the figures are displayed too small. I think this is just because pdf2svg uses the same coordinate system as the PDF for its viewbox. I need to use the width option given to \includegraphics.