Skip to content

Commit 9792cd1

Browse files
committed
Add tests with raw table env using optional position or not
1 parent 7058d8b commit 9792cd1

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Crossref Raw LaTeX table including table env
3+
format: latex
4+
_quarto:
5+
tests:
6+
latex:
7+
ensureFileRegexMatches:
8+
- ['\n\\begin\{table\}\n', 'See Table~\\ref\{tbl-mod\}']
9+
- []
10+
---
11+
12+
`\begin{table}` should be catched and remove as Quarto does add its own
13+
14+
```{=latex}
15+
\begin{table}
16+
\caption{\label{tbl-mod} no title}
17+
\centering
18+
\begin{tabular}{lc}
19+
\tabularnewline \midrule \midrule
20+
Dependent Variable: & disp\\
21+
Model: & (1)\\
22+
\midrule
23+
\emph{Variables}\\
24+
Constant & 580.9$^{***}$\\
25+
& (41.74)\\
26+
mpg & -17.43$^{***}$\\
27+
& (1.993)\\
28+
\midrule
29+
\emph{Fit statistics}\\
30+
Observations & 32\\
31+
R$^2$ & 0.71834\\
32+
Adjusted R$^2$ & 0.70895\\
33+
\midrule \midrule
34+
\multicolumn{2}{l}{\emph{IID standard-errors in parentheses}}\\
35+
\multicolumn{2}{l}{\emph{Signif. Codes: ***: 0.01, **: 0.05, *: 0.1}}\\
36+
\end{tabular}
37+
\end{table}
38+
```
39+
40+
See @tbl-mod
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Crossref Raw LaTeX table including table env with position
3+
format: latex
4+
_quarto:
5+
tests:
6+
latex:
7+
ensureFileRegexMatches:
8+
- ['\n\\begin\{table\}\n', 'See Table~\\ref\{tbl-mod\}']
9+
- ['\[htbp\]']
10+
---
11+
12+
`\begin{table}` should be catched and remove as Quarto does add its own, including when option position are used.
13+
14+
```{=latex}
15+
\begin{table}[htbp]
16+
\caption{\label{tbl-mod} no title}
17+
\centering
18+
\begin{tabular}{lc}
19+
\tabularnewline \midrule \midrule
20+
Dependent Variable: & disp\\
21+
Model: & (1)\\
22+
\midrule
23+
\emph{Variables}\\
24+
Constant & 580.9$^{***}$\\
25+
& (41.74)\\
26+
mpg & -17.43$^{***}$\\
27+
& (1.993)\\
28+
\midrule
29+
\emph{Fit statistics}\\
30+
Observations & 32\\
31+
R$^2$ & 0.71834\\
32+
Adjusted R$^2$ & 0.70895\\
33+
\midrule \midrule
34+
\multicolumn{2}{l}{\emph{IID standard-errors in parentheses}}\\
35+
\multicolumn{2}{l}{\emph{Signif. Codes: ***: 0.01, **: 0.05, *: 0.1}}\\
36+
\end{tabular}
37+
\end{table}
38+
```
39+
40+
See @tbl-mod

0 commit comments

Comments
 (0)