Skip to content

Update doc on partials to include new LaTeX and Beamer partials available in 1.7 #1645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Apr 29, 2025

This is the documentation update I needed to ship for 1.7

Do we want to add to the highlight ? I know the blog post is up but maybe we can still add to it.

Otherwise, I was thinking about doing a dedicated blog post.

https://deploy-preview-1645.quarto.org/docs/journals/templates.html#latex-partials

@cderv cderv requested a review from cwickham April 29, 2025 13:29
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing file in freezer it seems when I rendered incrementally the page using Quarto pre-release

Copy link
Contributor

🚀 Deployed on https://deploy-preview-1645.quarto.org

@github-actions github-actions bot temporarily deployed to pull request April 29, 2025 13:35 Inactive
@cscheid
Copy link
Collaborator

cscheid commented Apr 29, 2025

I think it should be ok for us to update the blog post.

Copy link
Collaborator

@cwickham cwickham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. A few wording edits and re-ordering suggestions in the comments.

Can you draft a paragraph for the highlights (and same for blog) and I can review before we merge this all in?

Comment on lines +32 to +63
pandoc.tex

: This includes configuration for most pandoc feature like text highlighting, tables, graphics, tight lists, citations, and header includes. In general, this partial must always be included within your custom template. In some circumstances, you may know that certain capabilities will not be needed, so you this partial is further composed of the following partials, which could be used if sensible:


::: {style="margin-left: 2em;"}

tables.tex

: Provides configuration for the output of tables, table captioning, and footnotes within tables.

graphics.tex

: Provides image scaling and placement configuration.

citations.tex

: When using CSL references, provides configuration and commands for outputting the bibliography.

babel-lang.tex

: When `lang` option is used, provides configuration and command for babel support and other language related LaTeX configuration.

tightlist.tex

: Provides the tight list command.

biblio-config.tex

: Provides natbib or biblatex configurations. Instead of providing an empty partial to opt-out those configurations (e.g. for a custom format where a specific documentclass handles it already), use `biblio-config: false` for your document configuration.

:::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the indentation to provide context that these partials are used inside pandoc.tex.
Should we also nest pandoc.tex under common.latex, since that is where it is used?

@@ -0,0 +1,99 @@
Since Quarto 1.7 providing Pandoc 3.6.3, there are two sets of partials: Quarto's specific partials and Pandoc's partials. The source directory contains both:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Since Quarto 1.7 providing Pandoc 3.6.3, there are two sets of partials: Quarto's specific partials and Pandoc's partials. The source directory contains both:
Starting with Quarto 1.7, which provides Pandoc 3.6.3, there are two sets of partials: those specific to Quarto and those inherited from Pandoc. The source directory contains:

@@ -0,0 +1,99 @@
Since Quarto 1.7 providing Pandoc 3.6.3, there are two sets of partials: Quarto's specific partials and Pandoc's partials. The source directory contains both:

- partials with `.latex` extension are the one inherited from Pandoc,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- partials with `.latex` extension are the one inherited from Pandoc,
- partials with `.latex` extension that are inherited from Pandoc,

Since Quarto 1.7 providing Pandoc 3.6.3, there are two sets of partials: Quarto's specific partials and Pandoc's partials. The source directory contains both:

- partials with `.latex` extension are the one inherited from Pandoc,
- partials with `.tex` extension are the one provided by Quarto directly to offer more granular customization.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- partials with `.tex` extension are the one provided by Quarto directly to offer more granular customization.
- partials with `.tex` extension that are provided by Quarto directly for more granular customization.

- partials with `.latex` extension are the one inherited from Pandoc,
- partials with `.tex` extension are the one provided by Quarto directly to offer more granular customization.

Quarto's partials and main template are based upon original template and partials from Pandoc - a copy of the file is kept in our source as reference when it was modified to fit Quarto's organization. Those files are: `latex.template` for the main template used as `template.tex` containing all the partials, and `latex.common` for the original version of `common.latex` as the original partial from Pandoc is tweaked to support Quarto's more specific partials.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this paragraph should move to after the list of all the partials. I.e. it's about some files you might see in the source code, but aren't available for replacement.

Suggested change
Quarto's partials and main template are based upon original template and partials from Pandoc - a copy of the file is kept in our source as reference when it was modified to fit Quarto's organization. Those files are: `latex.template` for the main template used as `template.tex` containing all the partials, and `latex.common` for the original version of `common.latex` as the original partial from Pandoc is tweaked to support Quarto's more specific partials.
A copy of some of Pandoc's original files are also kept in Quarto's source as a reference. These files are: `latex.template`, the main template used as `template.tex` containing all the partials; and `latex.common` the original version of `common.latex`, which is tweaked to support Quarto's more specific partials.


hypersetup.latex

: Contains `\hypersetup` command configuration.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: Contains `\hypersetup` command configuration.
: Contains the `\hypersetup` command configuration.

@@ -64,7 +64,9 @@ format:

When Quarto renders a document with a partial, it will use the built in template but replace a portion of the template with the provided partial. In the above case, the LaTeX title will be replaced with the implementation provided as the partial, while the rest of the built in template will be used.

Note that the name of the partial files is important. You choose which portion of the template to replace by providing a partial with that name. You can see the list of partials available in [HTML Partials] and [LaTeX Partials] below.
Note that the name of the partial files is important. You choose which portion of the template to replace by providing a partial with that name. Providing an empty file as a partial is a way to opt out some insertion without modifying the whole main template.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note that the name of the partial files is important. You choose which portion of the template to replace by providing a partial with that name. Providing an empty file as a partial is a way to opt out some insertion without modifying the whole main template.
The name of the partial file is important. You choose which portion of the template to replace by providing a partial with that name. Providing an empty file as a partial is a way to opt out of some features without modifying the whole main template.

Note that the name of the partial files is important. You choose which portion of the template to replace by providing a partial with that name. You can see the list of partials available in [HTML Partials] and [LaTeX Partials] below.
Note that the name of the partial files is important. You choose which portion of the template to replace by providing a partial with that name. Providing an empty file as a partial is a way to opt out some insertion without modifying the whole main template.

You can see the list of partials available for each format below: [LaTeX Partials], [Typst Partials], [HTML Partials] and [Revealjs Partials].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we agreed we'd use explicit links in the docs. Also, add Beamer here.


: Provides the tight list command.
See the [full source code](https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/formats/pdf/pandoc/template.tex) for the Quarto LaTeX template to see how these partials are invoked by default.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this belongs near the top of the list of partials. We might also mention that the partials are listed in the order in which they are included in template.tex.


See the [full source code](https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/formats/pdf/pandoc/template.tex) for the Quarto LaTeX template to see how these partials are invoked by default.
See the [full source code](https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/formats/beamer/pandoc/template.tex) for the Quarto Beamer template to see how these partials are invoked by default.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment applies here. Move this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants