Relative paths in pdf format #6347
-
DescriptionHello, sorry if this topic was addressed elsewhere, but I couldn't find the answer. DescriptionI have a custom quarto extension, supporting 3 formats (html, reveal js, pdf). In order to introduce users to quarto and give
Example _extensions/custom/_extension.yml quarto-required: ">=1.2.0"
contributes:
formats:
pdf:
include-before-body:
text: |
\thispagestyle{fancy}
\fancyhead{}
\fancyhead[R]{\includegraphics[width=4cm]{_extensions/custom/logo.pdf}} ProblemEach pdf file should contain a logo, bundled in the _extension. Problem is, that with include-before-body option, path to logo Only solution I found was to add new path to docs/_quarto.yml, like this: project:
type: website
execute-dir: project
format:
custom-pdf:
include-before-body:
text: |
\thispagestyle{fancy}
\fancyhead{} % clear all header fields
\fancyhead[R]{\includegraphics[width=4cm]{../_extensions/custom/logo.pdf}} Which overwrites setting in _extension.yml. But this breaks the encapsulation of logo.pdf and if the user of the custom extension creates his own file structure (similar to mine with docs), he will have to change the path himself. Is there any way to set relative path to logo.pdf, which will be independent on the location of .pdf templates? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You probably have to provide your logo as an extension resources, see https://quarto.org/docs/extensions/formats.html#format-resources. You might also want to take a look at the following extension: https://github.com/nmfs-opensci/quarto_titlepages to get inspiration. |
Beta Was this translation helpful? Give feedback.
You probably have to provide your logo as an extension resources, see https://quarto.org/docs/extensions/formats.html#format-resources.
You might also want to take a look at the following extension: https://github.com/nmfs-opensci/quarto_titlepages to get inspiration.