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
{{ message }}
Repository navigation
Path to include code file differs depending on output format e.g. HTML or PDF #4
To get code highlighting in HTML AND PDF I have to include the code file with different path:
`
::: {.content-visible when-format="html"}
```{.c include="../code/test.c"}
```
:::
::: {.content-visible when-format="pdf"}
```{.c include="./code/test.c"}
```
:::
`
On this way I get the code highlighting in html and pdf.
I attached the complete test project. GBSSG_Skripte_030_Physik.zip
Quarto Version: 1.2.334 with installed include-code-files extension.
I found the same issue when rendering HTML and MS.
I have to hard code the absolute path in include-code-filters.lua in order to make it work in both formats:
Activity
drriguz commentedon Mar 11, 2023
I found the same issue when rendering HTML and MS.
I have to hard code the absolute path in include-code-filters.lua in order to make it work in both formats:
Can we get the project root path? I did not find any kind of api or environment variables.
allefeld commentedon Mar 10, 2024
I just searched for that myself, and as far as I can tell, this is not exposed by Quarto.
cderv commentedon Mar 11, 2024
There is
quarto.project.directoryThis is still something we need to document
It was only mentioned in Changelog for
1.2https://github.com/quarto-dev/quarto-cli/blob/4b0bbb9709044ff26deb3833a06aa99dc69836f2/news/changelog-1.2.md?plain=1#L31-L38
You could use that to tweak the lua extension code
This will work only in Project. We need to probably go to the root issue here in Quarto CLI:
Lua code working directory (
pandoc.system.get_working_directory()) is not the same for HTML and PDF rendering...This is unexpected to me. 🤔