Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ All changes included in 1.9:

### `jupyter`

- ([#13582](https://github.com/quarto-dev/quarto-cli/pull/13582)): Fix `application/pdf` and `text/latex` MIME types not being preferred over `image/svg+xml` when rendering Jupyter notebooks to PDF, which caused errors when `rsvg-convert` was not available.
- ([#13748](https://github.com/quarto-dev/quarto-cli/pull/13748)): Fix stdin encoding to UTF-8 on Windows to correctly handle JSON in documents containing non-ASCII characters.
- ([#13936](https://github.com/quarto-dev/quarto-cli/pull/13936)): Add support for q/kdb+ programming language in percent format notebooks and code cell options. (author: @benlubas)
- ([#13936](https://github.com/quarto-dev/quarto-cli/pull/13936)): Fix `isJupyterPercentScript` regex to correctly detect percent scripts with `[raw]` cells and cells not at the start of the file. The regex now properly groups the alternation `(markdown|raw)` and uses multiline mode.
Expand Down
3 changes: 2 additions & 1 deletion src/core/jupyter/display-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export function displayDataMimeType(
kTextHtml,
);
} else if (options.toLatex) {
displayPriority.push(
// latex and pdf should be preferred over the other mime types
displayPriority.unshift(
kTextLatex,
kApplicationPdf,
);
Expand Down
58 changes: 58 additions & 0 deletions tests/docs/smoke-all/2026/03/24/13582.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.10.0"
}
},
"nbformat": 4,
"nbformat_minor": 5,
"cells": [
{
"id": "1",
"cell_type": "raw",
"metadata": {},
"source": [
"---\n",
"title: \"Issue 13582: PDF MIME priority for LaTeX\"\n",
"format: latex\n",
"use-rsvg-convert: false\n",
"execute:\n",
" enabled: false\n",
"_quarto:\n",
" tests:\n",
" latex:\n",
" ensureFileRegexMatches:\n",
" - [\"\\\\\\\\includegraphics[^\\\\n]*\\\\.pdf\"]\n",
" - [\"\\\\\\\\includesvg\"]\n",
"---\n"
]
},
{
"id": "2",
"cell_type": "code",
"metadata": {},
"source": [
"# Synthetic cell: outputs contain both application/pdf and image/svg+xml.\n",
"# With the fix, application/pdf should be preferred for LaTeX output."
],
"outputs": [
{
"output_type": "execute_result",
"execution_count": 1,
"data": {
"application/pdf": "JVBERi0xLjAKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDE+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL01lZGlhQm94WzAgMCAxMDAgMTAwXS9QYXJlbnQgMiAwIFI+PmVuZG9iagp4cmVmCjAgNAowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDkgMDAwMDAgbiAKMDAwMDAwMDA1OCAwMDAwMCBuIAowMDAwMDAwMTE1IDAwMDAwIG4gCnRyYWlsZXI8PC9TaXplIDQvUm9vdCAxIDAgUj4+CnN0YXJ0eHJlZgoxOTAKJSVFT0Y=",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\">\n<rect fill=\"red\" width=\"100\" height=\"100\"/>\n</svg>"
},
"metadata": {}
}
],
"execution_count": 1
}
]
}
Loading