Skip to content

Commit 2b3d6fc

Browse files
committed
Fix layout-valign tests to match positional argument in minipage
Convert snapshot tests (8354, 9109) to ensureLatexFileRegexMatches and update 7262 regex to expect [b] position. Add center alignment test coverage.
1 parent b942a52 commit 2b3d6fc

6 files changed

Lines changed: 47 additions & 564 deletions

File tree

tests/docs/smoke-all/2023/11/02/7262.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ _quarto:
1010
# Verify outer figure environment wraps the layout
1111
- '\\begin\{figure\}[\s\S]*\\begin\{minipage\}'
1212
# Verify two minipages with equal width
13-
- '\\begin\{minipage\}\{0\.50\\linewidth\}'
13+
- '\\begin\{minipage\}\[b\]\{0\.50\\linewidth\}'
1414
# Verify figure[H] inside first minipage with caption and label
15-
- '\\begin\{minipage\}[\s\S]*\\begin\{figure\}\[H\][\s\S]*\\caption\{\\label\{fig-example\}Figure caption\}'
15+
- '\\begin\{minipage\}\[b\][\s\S]*\\begin\{figure\}\[H\][\s\S]*\\caption\{\\label\{fig-example\}Figure caption\}'
1616
# Verify longtable (NOT wrapped in table environment) inside second minipage
17-
- '\\begin\{minipage\}\{0\.50\\linewidth\}[\s\S]*\\begin\{longtable\}'
17+
- '\\begin\{minipage\}\[b\]\{0\.50\\linewidth\}[\s\S]*\\begin\{longtable\}'
1818
# Verify table caption with label
1919
- '\\caption\{\\label\{tbl-example\}Table caption\}'
2020
# Verify minipage ends before outer figure ends

tests/docs/smoke-all/2024/01/19/8354.qmd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
title: "Untitled"
3-
format: latex
3+
format:
4+
pdf:
5+
keep-tex: true
46
execute:
57
warning: false
68
_quarto:
79
tests:
8-
latex:
9-
ensureSnapshotMatches: true
10+
pdf:
11+
ensureLatexFileRegexMatches:
12+
- ['\\begin\{minipage\}\[t\]\{0\.50\\linewidth\}']
13+
- []
1014
---
1115

1216
```{r}

tests/docs/smoke-all/2024/01/19/8354.tex.snapshot

Lines changed: 0 additions & 278 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "Untitled"
3+
format:
4+
pdf:
5+
keep-tex: true
6+
execute:
7+
warning: false
8+
_quarto:
9+
tests:
10+
pdf:
11+
ensureLatexFileRegexMatches:
12+
- ['\\begin\{minipage\}\[c\]\{0\.50\\linewidth\}']
13+
- []
14+
---
15+
16+
```{r}
17+
#| label: tbl-tables
18+
#| tbl-cap: "Tables"
19+
#| tbl-subcap:
20+
#| - cars
21+
#| - pressure
22+
#| layout-ncol: 2
23+
#| layout-valign: center
24+
25+
library(knitr)
26+
kable(head(cars))
27+
kable(head(pressure))
28+
```
29+
30+
See @tbl-tables for examples. In particular, @tbl-tables-2.

tests/docs/smoke-all/2025/11/08/9109.qmd

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
title: "Untitled"
3-
format: latex
3+
format:
4+
pdf:
5+
keep-tex: true
46
execute:
57
warning: false
68
_quarto:
79
tests:
8-
latex:
9-
ensureSnapshotMatches: true
10+
pdf:
11+
ensureLatexFileRegexMatches:
12+
- ['\\begin\{minipage\}\[b\]\{0\.50\\linewidth\}']
13+
- []
1014
---
1115

1216
```{r}

0 commit comments

Comments
 (0)