Prefer text/latex and application/pdf mime types when rendering latex#13582
Prefer text/latex and application/pdf mime types when rendering latex#13582jkrumbiegel wants to merge 2 commits intoquarto-dev:mainfrom
text/latex and application/pdf mime types when rendering latex#13582Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
I can help you with that. Quarto structures its before- and after-engine files so that you can take the .ipynb (or keep-md) output of an engine and call With that said, I wonder if At the same time, I think you should be able to figure out how to make |
|
Ok I've added the ability to set |
|
@cscheid could you help me with the testing issues I noted above? Would be great to get this sorted :) |
|
@jkrumbiegel I am just adding some tests related to rsvg-convert presence in #13661 So possibly this will help here.
To clarify, we don't have
Using |
|
@cderv The issue was that from the images available in the ipynb, SVG was preferred over PDF when rendering LaTeX. But this would only be noticeable if the required conversion via rsvg-convert failed. So without involvement of rsvg-convert at all, the test would somehow have to show that PDF was picked for the final render, what pandoc receives. But I'm not sure how that could be done. |
|
@cderv friendly bump :) |
…TeX output When rendering Jupyter notebooks to PDF/LaTeX, the MIME type priority queue appended text/latex and application/pdf at the end, causing image/svg+xml to be selected instead. This led to errors when rsvg-convert was not available. Fix by using unshift() to place these types at the front of the priority queue.
Pre-rendered .ipynb with both application/pdf and image/svg+xml outputs. Renders to latex format with use-rsvg-convert: false and verifies that \includegraphics with .pdf is used (not \includesvg).
007ee49 to
80ba9f7
Compare
|
Ok, I've had another go at this with Claude, removed the (nonessential) parts that belong in the julia extension now, and added a test file that I confirmed locally to fail without the code changes. Maybe this can still make it into 1.9 then, given it's such a small change. |
|
one more bump :) |
|
Thanks. i'll take a look |
Currently, rendering a qmd which creates a CairoMakie plot to pdf via LaTeX can error if
rsvg-convertis not available on the path.An example qmd for this is
Now I was wondering how this could happen if CairoMakie is able to produce both svg and pdf outputs. I would have expected this error to only appear when only svg was available. However, I confirmed that with default settings, the julia engine sends back svg, pdf and png within the jupyter notebook JSON.
I then checked why the pdf output was apparently ignored and I noticed that the
text/latexandapplication/pdfMIME types were added to the end of the priority queue for latex, which meant that any other MIME type would take priority. I've fixed this by changingpushtounshiftfollowing the earlier entry for markdown.I'll need some help in adding a simple test for this, having rsvg-convert on the PATH will hide the problem.
Checklist
I have (if applicable):