Skip to content

relative path in includegraphics not working #54

@amael-ls

Description

@amael-ls

Description

Hello,

In this stackoverflow post, it is shown that the command includegraphics will fail in a TikZ picture when using relative path rather than absolute. This is because the image is created in a temporary folder that does not have access to the included file relatively. Would it be possible to change this feature?

MWE

Here is an example that shows the problem:

---
title: "A tikz test"
pdf-engine: lualatex
keep-tex: true
filters:
  - diagram
diagram:
  engine:
    tikz:
      execpath: lualatex
      header-includes:
        \usepackage{graphicx}
format:
  pdf:
    include-in-header:
      - text: |
          \usepackage{graphicx}
          \usepackage{tikz}
---

## Test section

See @fig-test below.

::: {#fig-test}

```tikz
\begin{tikzpicture}
    \node (orig) at (0, 0) {\includegraphics{figTest.png}};
\end{tikzpicture}
```

A test figure

:::

Expected

A pdf with the figure figTest.png included.

Happening

LaTeX Warning: File `figTest.png' not found on input line 7.
! Package luatex.def Error: File `figTest.png' not found: using draft setting.

Many thanks for making it possible to use TikZ in Quarto!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions