Skip to content

Commit 68d1239

Browse files
authored
Merge pull request #12262 from quarto-dev/chore/pandoc-3.6
Update to Pandoc 3.6.3 and Typst 0.13.0
2 parents 2546027 + 2bc5993 commit 68d1239

File tree

75 files changed

+2100
-1109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2100
-1109
lines changed

configuration

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
export DENO=v1.46.3
1212
# TODO figure out where 0.1.41 apple silicon libs are available
1313
export DENO_DOM=v0.1.41-alpha-artifacts
14-
export PANDOC=3.4
14+
export PANDOC=3.6.3
1515
export DARTSASS=1.85.1
1616
export ESBUILD=0.19.12
17-
export TYPST=0.11.0
17+
export TYPST=0.13.0
1818

1919

2020
# NB: we can't put comments in the same line as export statements because it

dev-docs/feature-format-matrix/qmd-files/css-properties/font-size/document.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ _quarto:
1919
typst:
2020
ensureTypstFileRegexMatches:
2121
-
22-
- 'align\(center\)\[#set text\(size: 6pt\); #table\('
22+
- '#\[\s*#set text\(size: 6pt\); #table\('
2323
- []
2424
---
2525

dev-docs/upgrade-dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Change version numbers in `./configuration` to correspond to new versions.
22

3-
Contact JJ so he uploads the binaries to the S3 bucket.
3+
Contact Carlos so he uploads the binaries to the S3 bucket.
44

55
## Upgrade deno
66

news/changelog-1.7.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ All changes included in 1.7:
5959
- ([#11835](https://github.com/quarto-dev/quarto-cli/issues/11835)): Take markdown structure into account when detecting minimum heading level.
6060
- ([#11903](https://github.com/quarto-dev/quarto-cli/issues/11903)): `crossref` configuration like `fig-title` or `tbl-title` now correctly supports multi word values, e.g. `fig-title: 'Supplementary Figure'`.
6161
- ([#11878](https://github.com/quarto-dev/quarto-cli/issues/11878), [#12085](https://github.com/quarto-dev/quarto-cli/issues/12085)): Correctly fixup raw LaTeX table having an unexpected table env with options (e.g `\begin{table}[!ht]`) to be handled as crossref table.
62+
- Update to Pandoc's LaTeX template following Pandoc 3.6.3 support:
63+
- `format: beamer` now uses its own template. The main template for latex does not use `$if(beamer)$` anymore, and the new template for beamer uses the same partials as latex one.
64+
- Improved Babel support:
65+
- New `babeloptions` variable in the template to allow for more flexible Babel options.
66+
- `doc-class.tex` Quarto's partial has been updated as Babel options have been moved to `documentclass` definition in `doc-class.tex` Quarto's partial.
67+
- New partials available for `format: latex` and `format: beamer`:
68+
- Pandoc now uses partials for its latex templates, and they are available through `template-partials`. Pandoc's partials uses `.latex` extension: `passoptions.latex`, `common.latex`, `font-settings.latex`, `fonts.latex`, `hypersetup.latex`, `after-header-includes.latex`
69+
- New Quarto partials: `babel-lang.tex`, `biblio-config.tex`. Quarto's partials uses `.tex` extension.
70+
- BREAKING CHANGE for templates authors: `common.latex` does now uses `pandoc.tex` partial from Quarto, which include now part of the content that was in main `template.tex`. If you modify `pandoc.tex` as part of a custom format, it should be updated to new content.
71+
72+
## `jats` format
73+
74+
- Update to Pandoc's template following Pandoc 3.6.3 support:
75+
- `article.jats_publishing` partials now support `author.roles`
6276

6377
## `revealjs` format
6478

package/src/common/update-pandoc.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ async function writePandocTemplates(
198198
);
199199
const latexOutdir = join(formatSrcDir, "pdf", "pandoc");
200200
const revealOutdir = join(formatSrcDir, "revealjs", "pandoc");
201+
const beamerOutdir = join(formatSrcDir, "beamer", "pandoc");
201202
const asciidocOutdir = join(formatSrcDir, "asciidoc", "pandoc");
202203
const typstOutdir = join(formatSrcDir, "typst", "pandoc");
203204

@@ -219,13 +220,31 @@ async function writePandocTemplates(
219220
],
220221
[latexOutdir]: [
221222
{ from: "default.latex", to: "latex.template" },
223+
// Template we need to tweak
224+
{ from: "common.latex", to: "latex.common" },
225+
// Template kept unchanged
226+
{ from: "after-header-includes.latex" },
227+
{ from: "hypersetup.latex" },
228+
{ from: "font-settings.latex" },
229+
{ from: "fonts.latex" },
230+
{ from: "passoptions.latex" },
231+
],
232+
[beamerOutdir]: [
233+
{ from: "default.beamer", to: "beamer.template" },
234+
// Template we need to tweak
235+
{ from: "common.latex", to: "latex.common" },
236+
// Template kept unchanged
237+
{ from: "after-header-includes.latex" },
238+
{ from: "hypersetup.latex" },
239+
{ from: "font-settings.latex" },
240+
{ from: "fonts.latex" },
241+
{ from: "passoptions.latex" },
222242
],
223243
[asciidocOutdir]: [
224244
{ from: "default.asciidoc", to: "asciidoc.template" },
225245
],
226246
[typstOutdir]: [
227247
{ from: "default.typst", to: "typst.template" },
228-
{ from: "definitions.typst" },
229248
{ from: "template.typst" }
230249
]
231250
};

src/format/pdf/format-pdf.ts

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,12 @@ function createPdfFormat(
232232
}
233233

234234
// Provide a custom template for this format
235-
const partialNames = [
235+
// Partials can be the one from Quarto division
236+
const partialNamesQuarto: string[] = [
237+
"babel-lang",
236238
"before-bib",
237239
"biblio",
240+
"biblio-config",
238241
"citations",
239242
"doc-class",
240243
"graphics",
@@ -247,12 +250,38 @@ function createPdfFormat(
247250
"title",
248251
"toc",
249252
];
250-
extras.templateContext = {
251-
template: formatResourcePath("pdf", "pandoc/template.tex"),
252-
partials: partialNames.map((name) => {
253-
return formatResourcePath("pdf", `pandoc/${name}.tex`);
254-
}),
253+
// or the one from Pandoc division (since Pandoc 3.6.3)
254+
const partialNamesPandoc: string[] = [
255+
"after-header-includes",
256+
"common",
257+
"font-settings",
258+
"fonts",
259+
"hypersetup",
260+
"passoptions",
261+
];
262+
263+
const createTemplateContext = function (
264+
to: string,
265+
partialNamesQuarto: string[],
266+
partialNamesPandoc: string[],
267+
) {
268+
return {
269+
template: formatResourcePath(to, "pandoc/template.tex"),
270+
partials: [
271+
...partialNamesQuarto.map((name) => {
272+
return formatResourcePath(to, `pandoc/${name}.tex`);
273+
}),
274+
...partialNamesPandoc.map((name) => {
275+
return formatResourcePath(to, `pandoc/${name}.latex`);
276+
}),
277+
],
278+
};
255279
};
280+
extras.templateContext = createTemplateContext(
281+
displayName === "Beamer" ? "beamer" : "pdf",
282+
partialNamesQuarto,
283+
partialNamesPandoc,
284+
);
256285

257286
// Don't shift the headings if we see any H1s (we can't shift up any longer)
258287
const hasLevelOneHeadings = await hasL1Headings(markdown);

src/resources/extensions/quarto/docusaurus/docusaurus.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ end, function(node)
139139
start.content:insert(pandoc.RawInline("markdown", "]\n"))
140140
admonition:insert(start)
141141
else
142-
admonition:insert(pandoc.RawBlock("markdown", "\n:::" .. node.type))
142+
admonition:insert(pandoc.RawBlock("markdown", ":::" .. node.type))
143143
end
144144
local content = node.content
145145
if type(content) == "table" then

src/resources/filters/customnodes/callout.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function _callout_main()
224224
return
225225
end
226226
included_font_awesome = true
227-
quarto.doc.include_text("in-header", "#import \"@preview/fontawesome:0.1.0\": *")
227+
quarto.doc.include_text("in-header", "#import \"@preview/fontawesome:0.5.0\": *")
228228
end
229229

230230
_quarto.ast.add_renderer("Callout", function(_)

src/resources/filters/customnodes/floatreftarget.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ end, function(float)
10261026
local caption_location = cap_location(float)
10271027

10281028
local open_block = pandoc.RawBlock("markdown", "<div id=\"" .. float.identifier .. "\">\n")
1029-
local close_block = pandoc.RawBlock("markdown", "\n</div>")
1029+
local close_block = pandoc.RawBlock("markdown", "</div>")
10301030
local result = pandoc.Blocks({open_block})
10311031
local insert_content = function()
10321032
if pandoc.utils.type(float.content) == "Block" then
@@ -1051,6 +1051,7 @@ end, function(float)
10511051
insert_content()
10521052
result:insert(pandoc.RawBlock("markdown", "\n"))
10531053
insert_caption()
1054+
result:insert(pandoc.RawBlock("markdown", "\n"))
10541055
result:insert(close_block)
10551056
end
10561057
return result

src/resources/filters/customnodes/theorem.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ local letted_typst_theorem = {}
9393
local function ensure_typst_theorems(reftype)
9494
if not included_typst_theorems then
9595
included_typst_theorems = true
96-
quarto.doc.include_text("in-header", "#import \"@preview/ctheorems:1.1.0\": *")
96+
quarto.doc.include_text("in-header", "#import \"@preview/ctheorems:1.1.3\": *")
9797
quarto.doc.include_text("in-header", "#show: thmrules")
9898
end
9999
if not letted_typst_theorem[reftype] then

0 commit comments

Comments
 (0)