From 3484a2c18a549d064627f057f34e2c71e9f1bf40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Thu, 20 Jul 2023 22:49:05 +0200 Subject: [PATCH 1/2] fix: extension embedding example --- docs/extensions/_formats-common.qmd | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/extensions/_formats-common.qmd b/docs/extensions/_formats-common.qmd index bcc7863fd..ace9933a4 100644 --- a/docs/extensions/_formats-common.qmd +++ b/docs/extensions/_formats-common.qmd @@ -56,12 +56,29 @@ contributes: In some cases format extensions will want to make use of other extensions. This is permitted, but adding extensions for use within a custom format must be done with a special command line flag to ensure they are embedded correctly. +``` {.bash filename="Terminal"} +quarto create extension format:pdf myformat +quarto add quarto-ext/fancy-text --embed myformat +``` + For example, here we want to make the [fancy-text](https://github.com/quarto-ext/fancy-text) extension (which provides special formatting for the words {{< latex >}} and {{< bibtex >}}) available for users of the [jss](https://github.com/quarto-journals/jss) custom format: ``` {.bash filename="Terminal"} -quarto add quarto-ext/fancy-text --embed quarto-journals/jss +quarto add quarto-ext/fancy-text --embed jss +``` + +This will produce the following output: + +``` {.bash filename="Output"} +quarto-journals/jss +└── _extensions + └── jss + ├── _extensions + │ └── quarto-ext + │ └── fancy-text + └── partials ``` -This will add the `quarto-ext/fancy-text` extension into the `quarto-journals/jss` extension in the `_extensions` folder. By embedding an extension you make it available without creating the potential for conflict with other versions of the extension that uses might already have installed. +This will add the `quarto-ext/fancy-text` extension into the `jss` extension in the `_extensions` folder. By embedding an extension you make it available without creating the potential for conflict with other versions of the extension that uses might already have installed. [^_formats-common-1]: This is most common in the the case of PDF based formats which have a secondary step of converting the LaTeX produced by Pandoc into a PDF. If there are files that are referenced indirectly by the LaTeX, they will need to be discoverable and should typically be copied into the same directory that contains the LaTeX input. From 6c2eb33c2b6e3bcc95d2e590ea61dea22f3b8a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Fri, 21 Jul 2023 17:08:19 +0200 Subject: [PATCH 2/2] fix: add cd command before embedding extension Co-authored-by: Christophe Dervieux --- docs/extensions/_formats-common.qmd | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/extensions/_formats-common.qmd b/docs/extensions/_formats-common.qmd index ace9933a4..130194fbb 100644 --- a/docs/extensions/_formats-common.qmd +++ b/docs/extensions/_formats-common.qmd @@ -58,6 +58,7 @@ In some cases format extensions will want to make use of other extensions. This ``` {.bash filename="Terminal"} quarto create extension format:pdf myformat +cd myformat quarto add quarto-ext/fancy-text --embed myformat ```