You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/output-formats/pdf-basics.qmd
+65-1Lines changed: 65 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -214,7 +214,71 @@ With fonts with appropriate support, Greek symbols render correctly in headings,
214
214
{.border fig-alt="Screenshot of at PDF displaying the Greek symbol alpha in a heading, main text and code cell."}
215
215
216
216
217
-
217
+
## SVG Images {#svg-images}
218
+
219
+
### Using `rsvg-convert` to convert to PDF
220
+
221
+
Quarto supports rendering of PDF documents that include SVG files, automatically converting them to PDF images if `rsvg-convert` is available on the system path during rendering.
222
+
223
+
You can learn more about installing `librsvg`{spellcheck="false"} (which provides `rsvg-convert`{spellcheck="false"}), see <https://wiki.gnome.org/Projects/LibRsvg>. To install on specific platforms:
224
+
225
+
- On MacOS, use Homebrew: `brew install librsvg`{spellcheck="false"}
226
+
- On Linux, tarballs available at: <https://download.gnome.org/sources/librsvg/>
227
+
- On Windows, install using chocolatey: `choco install rsvg-convert`{spellcheck="false"} or using Scoop:
If you prefer to use Inkscape instead of `rsvg-convert`, you can disable the default conversion by setting `use-rsvg-convert: false`. This will use the [SVG LaTeX package](https://ctan.org/pkg/svg) to include the svg using `\includesvg{}` which uses Inkscape to convert to PDF. This requires some configuration to opt-in:
237
+
238
+
```yaml
239
+
format:
240
+
pdf:
241
+
use-rsvg-convert: false
242
+
pdf-engine-opts: ["-shell-escape"]
243
+
```
244
+
245
+
Note that this configuration requires:
246
+
247
+
- Inkscape to be installed and available on your system PATH
248
+
- The `-shell-escape` option for your LaTeX engine to allow execution of external programs
249
+
- The SVG LaTeX package (automatically included by Quarto)
250
+
251
+
### Platform Considerations
252
+
253
+
The availability and ease of installation for SVG conversion tools varies by platform:
254
+
255
+
- **Linux/macOS:** `rsvg-convert` is typically available through package managers (`librsvg` package). This is the recommended approach for these platforms.
256
+
- **Windows:** Installing `rsvg-convert` is more challenging. While it can be installed via Scoop (as shown above), most Windows users should consider using PNG format for diagrams rather than SVG.
257
+
- **Inkscape:** Available cross-platform but requires the `-shell-escape` configuration. Consider using this only when you specifically need Inkscape's rendering capabilities.
258
+
259
+
For diagram formats, PNG is generally recommended for best compatibility and ease of use. See the @nte-svg-diagram below for more details.
260
+
261
+
::: {#nte-svg-diagram .callout-note}
262
+
## SVG Format for Diagrams
263
+
264
+
When using Mermaid or Graphviz diagrams in PDF documents, the default PNG format is recommended. While SVG output is possible with `mermaid-format: svg`, it requires external tooling:
265
+
266
+
- `rsvg-convert` (default) - See [installation instructions](#svg-images) above
267
+
- Inkscape (alternative) - Requires `use-rsvg-convert: false` and `-shell-escape` configuration
268
+
269
+
SVG format may also have rendering issues such as text clipping in diagrams with multi-line labels. For most users, PNG format provides better compatibility and ease of use. See [Diagrams](/docs/authoring/diagrams.qmd#mermaid-formats) for more information.
270
+
:::
271
+
272
+
## Remote Images
273
+
274
+
You can reference remote images directly using URLs:
0 commit comments