Skip to content

Commit 2cb5f09

Browse files
committed
New test for valign=bottom
1 parent 95b81c6 commit 2cb5f09

File tree

3 files changed

+304
-1
lines changed

3 files changed

+304
-1
lines changed

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We run several type of tests
66

77
- Unit tests, located in `unit/` folder
88
- Integration tests, located in `integration/` folder
9-
- smoke tests localed in `smoke` folder
9+
- smoke tests located in `smoke` folder
1010

1111
Tests are run in our CI workflow on GHA at each commit, and for each PR.
1212

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: "Untitled"
3+
format: latex
4+
execute:
5+
warning: false
6+
_quarto:
7+
tests:
8+
latex:
9+
ensureSnapshotMatches: true
10+
---
11+
12+
```{r}
13+
#| label: tbl-tables
14+
#| tbl-cap: "Tables"
15+
#| tbl-subcap:
16+
#| - cars
17+
#| - pressure
18+
#| layout-ncol: 2
19+
#| layout-valign: bottom
20+
21+
library(knitr)
22+
kable(head(cars))
23+
kable(head(pressure))
24+
```
25+
26+
See @tbl-tables for examples. In particular, @tbl-tables-2.
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
% Options for packages loaded elsewhere
2+
% Options for packages loaded elsewhere
3+
\PassOptionsToPackage{unicode}{hyperref}
4+
\PassOptionsToPackage{hyphens}{url}
5+
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
6+
%
7+
\documentclass[
8+
letterpaper,
9+
DIV=11,
10+
numbers=noendperiod]{scrartcl}
11+
\usepackage{xcolor}
12+
\usepackage{amsmath,amssymb}
13+
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
14+
\usepackage{iftex}
15+
\ifPDFTeX
16+
\usepackage[T1]{fontenc}
17+
\usepackage[utf8]{inputenc}
18+
\usepackage{textcomp} % provide euro and other symbols
19+
\else % if luatex or xetex
20+
\usepackage{unicode-math} % this also loads fontspec
21+
\defaultfontfeatures{Scale=MatchLowercase}
22+
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
23+
\fi
24+
\usepackage{lmodern}
25+
\ifPDFTeX\else
26+
% xetex/luatex font selection
27+
\fi
28+
% Use upquote if available, for straight quotes in verbatim environments
29+
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
30+
\IfFileExists{microtype.sty}{% use microtype if available
31+
\usepackage[]{microtype}
32+
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
33+
}{}
34+
\makeatletter
35+
\@ifundefined{KOMAClassName}{% if non-KOMA class
36+
\IfFileExists{parskip.sty}{%
37+
\usepackage{parskip}
38+
}{% else
39+
\setlength{\parindent}{0pt}
40+
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
41+
}{% if KOMA class
42+
\KOMAoptions{parskip=half}}
43+
\makeatother
44+
% Make \paragraph and \subparagraph free-standing
45+
\makeatletter
46+
\ifx\paragraph\undefined\else
47+
\let\oldparagraph\paragraph
48+
\renewcommand{\paragraph}{
49+
\@ifstar
50+
\xxxParagraphStar
51+
\xxxParagraphNoStar
52+
}
53+
\newcommand{\xxxParagraphStar}[1]{\oldparagraph*{#1}\mbox{}}
54+
\newcommand{\xxxParagraphNoStar}[1]{\oldparagraph{#1}\mbox{}}
55+
\fi
56+
\ifx\subparagraph\undefined\else
57+
\let\oldsubparagraph\subparagraph
58+
\renewcommand{\subparagraph}{
59+
\@ifstar
60+
\xxxSubParagraphStar
61+
\xxxSubParagraphNoStar
62+
}
63+
\newcommand{\xxxSubParagraphStar}[1]{\oldsubparagraph*{#1}\mbox{}}
64+
\newcommand{\xxxSubParagraphNoStar}[1]{\oldsubparagraph{#1}\mbox{}}
65+
\fi
66+
\makeatother
67+
68+
\usepackage{color}
69+
\usepackage{fancyvrb}
70+
\newcommand{\VerbBar}{|}
71+
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
72+
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
73+
% Add ',fontsize=\small' for more characters per line
74+
\usepackage{framed}
75+
\definecolor{shadecolor}{RGB}{241,243,245}
76+
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
77+
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
78+
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
79+
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.40,0.45,0.13}{#1}}
80+
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
81+
\newcommand{\BuiltInTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
82+
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
83+
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
84+
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
85+
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
86+
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{\textbf{#1}}}
87+
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
88+
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
89+
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
90+
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
91+
\newcommand{\ExtensionTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
92+
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
93+
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.28,0.35,0.67}{#1}}
94+
\newcommand{\ImportTok}[1]{\textcolor[rgb]{0.00,0.46,0.62}{#1}}
95+
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
96+
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{\textbf{#1}}}
97+
\newcommand{\NormalTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
98+
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
99+
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
100+
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
101+
\newcommand{\RegionMarkerTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
102+
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
103+
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
104+
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
105+
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.07,0.07,0.07}{#1}}
106+
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
107+
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
108+
109+
\usepackage{longtable,booktabs,array}
110+
\usepackage{calc} % for calculating minipage widths
111+
% Correct order of tables after \paragraph or \subparagraph
112+
\usepackage{etoolbox}
113+
\makeatletter
114+
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
115+
\makeatother
116+
% Allow footnotes in longtable head/foot
117+
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
118+
\makesavenoteenv{longtable}
119+
\usepackage{graphicx}
120+
\makeatletter
121+
\newsavebox\pandoc@box
122+
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
123+
\sbox\pandoc@box{#1}%
124+
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
125+
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
126+
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
127+
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
128+
\else\usebox{\pandoc@box}%
129+
\fi%
130+
}
131+
% Set default figure placement to htbp
132+
\def\fps@figure{htbp}
133+
\makeatother
134+
135+
136+
137+
138+
139+
\setlength{\emergencystretch}{3em} % prevent overfull lines
140+
141+
\providecommand{\tightlist}{%
142+
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
143+
144+
145+
146+
147+
148+
149+
\KOMAoption{captions}{tableheading}
150+
\makeatletter
151+
\@ifpackageloaded{caption}{}{\usepackage{caption}}
152+
\AtBeginDocument{%
153+
\ifdefined\contentsname
154+
\renewcommand*\contentsname{Table of contents}
155+
\else
156+
\newcommand\contentsname{Table of contents}
157+
\fi
158+
\ifdefined\listfigurename
159+
\renewcommand*\listfigurename{List of Figures}
160+
\else
161+
\newcommand\listfigurename{List of Figures}
162+
\fi
163+
\ifdefined\listtablename
164+
\renewcommand*\listtablename{List of Tables}
165+
\else
166+
\newcommand\listtablename{List of Tables}
167+
\fi
168+
\ifdefined\figurename
169+
\renewcommand*\figurename{Figure}
170+
\else
171+
\newcommand\figurename{Figure}
172+
\fi
173+
\ifdefined\tablename
174+
\renewcommand*\tablename{Table}
175+
\else
176+
\newcommand\tablename{Table}
177+
\fi
178+
}
179+
\@ifpackageloaded{float}{}{\usepackage{float}}
180+
\floatstyle{ruled}
181+
\@ifundefined{c@chapter}{\newfloat{codelisting}{h}{lop}}{\newfloat{codelisting}{h}{lop}[chapter]}
182+
\floatname{codelisting}{Listing}
183+
\newcommand*\listoflistings{\listof{codelisting}{List of Listings}}
184+
\makeatother
185+
\makeatletter
186+
\makeatother
187+
\makeatletter
188+
\@ifpackageloaded{caption}{}{\usepackage{caption}}
189+
\@ifpackageloaded{subcaption}{}{\usepackage{subcaption}}
190+
\makeatother
191+
\usepackage{bookmark}
192+
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
193+
\urlstyle{same}
194+
\hypersetup{
195+
pdftitle={Untitled},
196+
colorlinks=true,
197+
linkcolor={blue},
198+
filecolor={Maroon},
199+
citecolor={Blue},
200+
urlcolor={Blue},
201+
pdfcreator={LaTeX via pandoc}}
202+
203+
204+
\title{Untitled}
205+
\author{}
206+
\date{}
207+
\begin{document}
208+
\maketitle
209+
210+
211+
\begin{Shaded}
212+
\begin{Highlighting}[]
213+
\FunctionTok{library}\NormalTok{(knitr)}
214+
\FunctionTok{kable}\NormalTok{(}\FunctionTok{head}\NormalTok{(cars))}
215+
\FunctionTok{kable}\NormalTok{(}\FunctionTok{head}\NormalTok{(pressure))}
216+
\end{Highlighting}
217+
\end{Shaded}
218+
219+
\begin{table}
220+
221+
\caption{\label{tbl-tables}Tables}
222+
223+
\begin{minipage}[b]{0.50\linewidth}
224+
225+
\subcaption{\label{tbl-tables-1}cars}
226+
227+
\centering{
228+
229+
\begin{tabular}{rr}
230+
\toprule
231+
speed & dist\\
232+
\midrule
233+
4 & 2\\
234+
4 & 10\\
235+
7 & 4\\
236+
7 & 22\\
237+
8 & 16\\
238+
9 & 10\\
239+
\bottomrule
240+
\end{tabular}
241+
242+
}
243+
244+
\end{minipage}%
245+
%
246+
\begin{minipage}[b]{0.50\linewidth}
247+
248+
\subcaption{\label{tbl-tables-2}pressure}
249+
250+
\centering{
251+
252+
\begin{tabular}{rr}
253+
\toprule
254+
temperature & pressure\\
255+
\midrule
256+
0 & 0.0002\\
257+
20 & 0.0012\\
258+
40 & 0.0060\\
259+
60 & 0.0300\\
260+
80 & 0.0900\\
261+
100 & 0.2700\\
262+
\bottomrule
263+
\end{tabular}
264+
265+
}
266+
267+
\end{minipage}%
268+
269+
\end{table}%
270+
271+
See Table~\ref{tbl-tables} for examples. In particular,
272+
Table~\ref{tbl-tables-2}.
273+
274+
275+
276+
277+
\end{document}

0 commit comments

Comments
 (0)