Skip to content

Commit 3f260eb

Browse files
authored
Fall back to bottom captions for margin in beamer, slides, dashboards (#15379)
`cap-location: margin` needs a margin column, and beamer, the HTML slide formats and dashboards have none. Beamer failed to compile with `Environment figure* undefined` because the margin caption loads `sidenotes`; the other formats kept the caption in flow instead. These formats now fall back to `bottom` and print one warning per document. - Apply the fallback to the document options, to a `cap-location="margin"` attribute on a figure or table, and to the `fig-cap-location` and `tbl-cap-location` knitr chunk options. - Offer `top` and `bottom` in front matter completion for every format, and `margin` only where it is supported. Validation still accepts `margin` everywhere. Fixes #15378
1 parent 43fdcd7 commit 3f260eb

14 files changed

Lines changed: 620 additions & 84 deletions

‎news/changelog-1.12.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ All changes included in 1.12:
3232
- ([#12649](https://github.com/quarto-dev/quarto-cli/issues/12649)): Fix name particles such as `de` or `van` missing from author names in title blocks and JATS output.
3333
- ([#15344](https://github.com/quarto-dev/quarto-cli/pull/15344)): A Div with an id that starts with a heading now renders as that heading's section, which takes the Div's classes, so CSS such as `div.myclass > section` no longer matches. Quarto keeps the heading id on the section, so crossrefs and table of contents links still target the heading; in beamer, DocBook, ConTeXt, AsciiDoc and revealjs the Div's id is no longer written.
3434
- ([#15371](https://github.com/quarto-dev/quarto-cli/issues/15371)): Fix authors written with only a given name being dropped from the title block and JATS output, or getting the given name repeated as the family name in JATS.
35+
- ([#15378](https://github.com/quarto-dev/quarto-cli/issues/15378)): Fix `cap-location: margin` failing to compile in beamer and being ignored in revealjs and dashboards. Formats without a margin column now place the caption at the bottom and print a warning.
3536

3637
### `html`
3738

‎src/resources/editor/tools/vs-code.mjs‎

Lines changed: 90 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8070,17 +8070,39 @@ var init_yaml_intelligence_resources = __esm({
80708070
"document-layout"
80718071
],
80728072
formats: [
8073-
"$html-doc",
8074-
"latex",
8075-
"pdf",
8073+
"$html-files",
8074+
"$pdf-all",
80768075
"typst"
80778076
]
80788077
},
80798078
schema: {
8080-
enum: [
8081-
"top",
8082-
"bottom",
8083-
"margin"
8079+
anyOf: [
8080+
{
8081+
enum: [
8082+
"top",
8083+
"bottom",
8084+
"margin"
8085+
],
8086+
completions: [
8087+
"top",
8088+
"bottom"
8089+
]
8090+
},
8091+
{
8092+
enum: {
8093+
values: [
8094+
"margin"
8095+
],
8096+
tags: {
8097+
formats: [
8098+
"$html-doc",
8099+
"latex",
8100+
"pdf",
8101+
"typst"
8102+
]
8103+
}
8104+
}
8105+
}
80848106
]
80858107
},
80868108
default: "bottom",
@@ -8094,17 +8116,39 @@ var init_yaml_intelligence_resources = __esm({
80948116
"document-figures"
80958117
],
80968118
formats: [
8097-
"$html-doc",
8098-
"latex",
8099-
"pdf",
8119+
"$html-files",
8120+
"$pdf-all",
81008121
"typst"
81018122
]
81028123
},
81038124
schema: {
8104-
enum: [
8105-
"top",
8106-
"bottom",
8107-
"margin"
8125+
anyOf: [
8126+
{
8127+
enum: [
8128+
"top",
8129+
"bottom",
8130+
"margin"
8131+
],
8132+
completions: [
8133+
"top",
8134+
"bottom"
8135+
]
8136+
},
8137+
{
8138+
enum: {
8139+
values: [
8140+
"margin"
8141+
],
8142+
tags: {
8143+
formats: [
8144+
"$html-doc",
8145+
"latex",
8146+
"pdf",
8147+
"typst"
8148+
]
8149+
}
8150+
}
8151+
}
81088152
]
81098153
},
81108154
default: "bottom",
@@ -8118,17 +8162,39 @@ var init_yaml_intelligence_resources = __esm({
81188162
"document-tables"
81198163
],
81208164
formats: [
8121-
"$html-doc",
8122-
"latex",
8123-
"pdf",
8165+
"$html-files",
8166+
"$pdf-all",
81248167
"typst"
81258168
]
81268169
},
81278170
schema: {
8128-
enum: [
8129-
"top",
8130-
"bottom",
8131-
"margin"
8171+
anyOf: [
8172+
{
8173+
enum: [
8174+
"top",
8175+
"bottom",
8176+
"margin"
8177+
],
8178+
completions: [
8179+
"top",
8180+
"bottom"
8181+
]
8182+
},
8183+
{
8184+
enum: {
8185+
values: [
8186+
"margin"
8187+
],
8188+
tags: {
8189+
formats: [
8190+
"$html-doc",
8191+
"latex",
8192+
"pdf",
8193+
"typst"
8194+
]
8195+
}
8196+
}
8197+
}
81328198
]
81338199
},
81348200
default: "top",
@@ -25917,12 +25983,12 @@ var init_yaml_intelligence_resources = __esm({
2591725983
mermaid: "%%"
2591825984
},
2591925985
"handlers/mermaid/schema.yml": {
25920-
_internalId: 227695,
25986+
_internalId: 229192,
2592125987
type: "object",
2592225988
description: "be an object",
2592325989
properties: {
2592425990
"mermaid-format": {
25925-
_internalId: 227687,
25991+
_internalId: 229184,
2592625992
type: "enum",
2592725993
enum: [
2592825994
"png",
@@ -25938,7 +26004,7 @@ var init_yaml_intelligence_resources = __esm({
2593826004
exhaustiveCompletions: true
2593926005
},
2594026006
theme: {
25941-
_internalId: 227694,
26007+
_internalId: 229191,
2594226008
type: "anyOf",
2594326009
anyOf: [
2594426010
{

‎src/resources/editor/tools/yaml/all-schema-definitions.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎src/resources/editor/tools/yaml/web-worker.js‎

Lines changed: 90 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)