Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configuration
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
export DENO=v1.41.0
# TODO figure out where 0.1.41 apple silicon libs are available
export DENO_DOM=v0.1.35-alpha-artifacts
export PANDOC=3.2
export PANDOC=3.4
export DARTSASS=1.70.0
export ESBUILD=0.19.12
export TYPST=0.11.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _quarto:
html:
ensureHtmlElements:
-
- 'table.table'
- 'table'
- []
typst:
ensureTypstFileRegexMatches:
Expand Down
6 changes: 4 additions & 2 deletions dev-docs/update-pandoc-checklist.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## Updating the bundled version of Pandoc

- [ ] If needed, ask JJ to upgrade our archives
- [ ] Run `./package/src/quarto-bld update-pandoc PANDOC_VERSION`
Carlos needs to run this:

- [ ] Ensure archives are upgraded
- [ ] Run `AWS_PROFILE=... ./package/src/quarto-bld update-pandoc PANDOC_VERSION`
- [ ] look at `git diff`, specifically for changes in Pandoc templates, and adjust as needed.

## Manual steps
Expand Down
3 changes: 1 addition & 2 deletions src/resources/formats/html/_quarto-rules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ tr.header > th > p:last-of-type {
margin-bottom: 0px;
}

table,
table.table {
table {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
Expand Down
5 changes: 5 additions & 0 deletions src/resources/formats/html/pandoc/html.styles
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ table {
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
$if(table-caption-below)$
caption-side: bottom;
margin-top: 0.75em;
$else$
margin-bottom: 0.75em;
$endif$
}
tbody {
margin-top: 0.5em;
Expand Down
3 changes: 0 additions & 3 deletions src/resources/formats/html/pandoc/html.template
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ $for(header-includes)$
$header-includes$
$endfor$
$if(math)$
$if(mathjax)$
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
$endif$
$math$
$endif$
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ $if(article.funding-statement)$
<funding-statement>$article.funding-statement$</funding-statement>
</funding-group>
$endif$
$if(supplementary-material)$
<supplementary-material>
$supplementary-material$
</supplementary-material>
$endif$
</article-meta>
</front>
<body>
Expand Down
3 changes: 3 additions & 0 deletions src/resources/formats/pdf/pandoc/doc-class.tex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
$if(aspectratio)$
aspectratio=$aspectratio$,
$endif$
$if(babel-lang)$
$babel-lang$,
$endif$
$endif$
$for(classoption)$
$classoption$$sep$,
Expand Down
20 changes: 11 additions & 9 deletions src/resources/formats/pdf/pandoc/graphics.tex
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
$if(graphics)$
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
$endif$
$endif$
38 changes: 23 additions & 15 deletions src/resources/formats/pdf/pandoc/latex.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ $endif$
$if(aspectratio)$
aspectratio=$aspectratio$,
$endif$
$if(babel-lang)$
$babel-lang$,
$endif$
$endif$
$for(classoption)$
$classoption$$sep$,
Expand Down Expand Up @@ -57,13 +60,13 @@ $if(section-titles)$
}
\setbeamertemplate{section page}{
\centering
\begin{beamercolorbox}[sep=12pt,center]{part title}
\begin{beamercolorbox}[sep=12pt,center]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\setbeamertemplate{subsection page}{
\centering
\begin{beamercolorbox}[sep=8pt,center]{part title}
\begin{beamercolorbox}[sep=8pt,center]{subsection title}
\usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
}
Expand Down Expand Up @@ -299,15 +302,17 @@ $endif$
$if(graphics)$
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
$endif$
Expand Down Expand Up @@ -440,13 +445,15 @@ $endfor$
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
$if(selnolig-langs)$
\ifLuaTeX
\usepackage[$for(selnolig-langs)$$it$$sep$,$endfor$]{selnolig} % disable illegal ligatures
\fi
$endif$
$endif$
$for(header-includes)$
$header-includes$
$endfor$
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
$if(dir)$
\ifPDFTeX
\TeXXeTstate=1
Expand Down Expand Up @@ -534,7 +541,7 @@ $if(institute)$
\institute{$for(institute)$$institute$$sep$ \and $endfor$}
$endif$
$if(titlegraphic)$
\titlegraphic{\includegraphics{$titlegraphic$}}
\titlegraphic{\includegraphics$if(titlegraphicoptions)$[$for(titlegraphicoptions)$$titlegraphicoptions$$sep$, $endfor$]$endif${$titlegraphic$}}
$endif$
$if(logo)$
\logo{\includegraphics{$logo$}}
Expand Down Expand Up @@ -571,7 +578,8 @@ $if(beamer)$
$if(toc-title)$
\frametitle{$toc-title$}
$endif$
\tableofcontents[hideallsubsections]
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
\end{frame}
$else$
{
Expand Down
10 changes: 6 additions & 4 deletions src/resources/formats/pdf/pandoc/template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
}
\setbeamertemplate{section page}{
\centering
\begin{beamercolorbox}[sep=12pt,center]{part title}
\begin{beamercolorbox}[sep=12pt,center]{section title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\setbeamertemplate{subsection page}{
\centering
\begin{beamercolorbox}[sep=8pt,center]{part title}
\begin{beamercolorbox}[sep=8pt,center]{subsection title}
\usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
}
Expand Down Expand Up @@ -344,10 +344,12 @@
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
$endif$
$if(selnolig-langs)$
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\usepackage[$for(selnolig-langs)$$it$$sep$,$endfor$]{selnolig} % disable illegal ligatures
\fi
$endif$
$endif$
$if(dir)$
\ifPDFTeX
\TeXXeTstate=1
Expand Down
3 changes: 1 addition & 2 deletions src/resources/formats/pdf/pandoc/title.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
\institute{$for(institute)$$institute$$sep$ \and $endfor$}
$endif$
$if(titlegraphic)$
\titlegraphic{\includegraphics{$titlegraphic$}}
$endif$
\titlegraphic{\includegraphics$if(titlegraphicoptions)$[$for(titlegraphicoptions)$$titlegraphicoptions$$sep$, $endfor$]$endif${$titlegraphic$}}$endif$
$if(logo)$
\logo{\includegraphics{$logo$}}
$endif$
Expand Down
3 changes: 2 additions & 1 deletion src/resources/formats/pdf/pandoc/toc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
$if(toc-title)$
\frametitle{$toc-title$}
$endif$
\tableofcontents[hideallsubsections]
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
\end{frame}
$else$
{
Expand Down
2 changes: 1 addition & 1 deletion src/resources/formats/revealjs/quarto.scss
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ $panel-sidebar-padding: 0.5em;

// https://github.com/quarto-dev/quarto-cli/issues/3380

div.cell-output-display div.pagedtable-wrapper table.table {
div.cell-output-display div.pagedtable-wrapper table {
font-size: 0.6em;
}

Expand Down
3 changes: 3 additions & 0 deletions src/resources/formats/typst/pandoc/quarto/typst-show.typ
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ $if(title-font)$
title-font: ("$title-font$",),
$endif$
$endif$
$if(subtitle)$
subtitle: [$subtitle$],
$endif$
Comment on lines +8 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this addition means we need to add its equivalent in #let article() ?

title: none,
title-font: none,
authors: none,

Also subtitle is not used as no processing is currently done with it. See other comment.

$if(by-author)$
authors: (
$for(by-author)$
Expand Down
18 changes: 17 additions & 1 deletion src/resources/formats/typst/pandoc/template.typst
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
#let content-to-string(content) = {
if content.has("text") {
content.text
} else if content.has("children") {
content.children.map(content-to-string).join("")
} else if content.has("body") {
content-to-string(content.body)
} else if content == [ ] {
" "
}
}
#let conf(
title: none,
subtitle: none,
authors: (),
keywords: (),
date: none,
Expand All @@ -16,7 +28,7 @@
) = {
set document(
title: title,
author: authors.map(author => author.name),
author: authors.map(author => content-to-string(author.name)),
keywords: keywords,
)
set page(
Expand All @@ -34,6 +46,10 @@
if title != none {
align(center)[#block(inset: 2em)[
#text(weight: "bold", size: 1.5em)[#title]
#(if subtitle != none {
parbreak()
text(weight: "bold", size: 1.25em)[#subtitle]
})
]]
}

Expand Down
29 changes: 20 additions & 9 deletions src/resources/formats/typst/pandoc/typst.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,40 @@ $definitions.typst()$
stroke: none
)

#show figure.where(
kind: table
): set figure.caption(position: $if(table-caption-position)$$table-caption-position$$else$top$endif$)

#show figure.where(
kind: image
): set figure.caption(position: $if(figure-caption-position)$$figure-caption-position$$else$bottom$endif$)

$if(template)$
#import "$template$": conf
$else$
$template.typst()$
$endif$

$for(header-includes)$
$header-includes$

$endfor$
#show: doc => conf(
$if(title)$
title: [$title$],
$endif$
$if(subtitle)$
subtitle: [$subtitle$],
$endif$
$if(author)$
authors: (
$for(author)$
$if(author.name)$
( name: "$author.name$",
affiliation: "$author.affiliation$",
email: "$author.email$" ),
( name: [$author.name$],
affiliation: [$author.affiliation$],
email: [$author.email$] ),
$else$
( name: "$author$",
( name: [$author$],
affiliation: "",
email: "" ),
$endif$
Expand All @@ -43,7 +58,7 @@ $if(keywords)$
keywords: ($for(keywords)$$keyword$$sep$,$endfor$),
$endif$
$if(date)$
date: "$date$",
date: [$date$],
$endif$
$if(lang)$
lang: "$lang$",
Expand Down Expand Up @@ -73,10 +88,6 @@ $endif$
doc,
)

$for(header-includes)$
$header-includes$

$endfor$
$for(include-before)$
$include-before$

Expand Down
2 changes: 1 addition & 1 deletion src/resources/lua-types/pandoc/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Generated by hand by inspecting https://github.com/jgm/pandoc/commits/main/doc/lua-filters.md

Up to date to commit https://github.com/jgm/pandoc/commit/928dde57b968066366b567201961dba6441d89e2
Up to date to commit https://github.com/jgm/pandoc/commit/790abcf4147fa2a097b1f29c845182675d90ccc3

TODO:

Expand Down
Loading
Loading