Skip to content

Commit

Permalink
Merge pull request #269 from Crunch-io/broken-babel-tests
Browse files Browse the repository at this point in the history
Fixing a problem with babel related tests
  • Loading branch information
1beb authored Aug 16, 2024
2 parents ab5e384 + eba99cf commit de63e40
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion R/writeLatex.R
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ latexDocHead <- function(theme, title, subtitle, banner = NULL) {
"includeheadfoot"
),
usepackage("array"),
usepackage("babel", "english"),
usepackage("babel"), # , "english"
"\\newcolumntype{B}[2]{>{#1\\hspace{0pt}\\arraybackslash}b{#2}}",
"\\setlength{\\parindent}{0pt}",
usepackage("color", "dvipsnames"),
Expand Down
2 changes: 1 addition & 1 deletion inst/codebook_latex_wrap.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
\usepackage[top=0.6in, bottom=0.6in, left=1in, right=1in, includeheadfoot]{geometry}
\usepackage{array}
\usepackage[english]{babel}
\usepackage{babel}
\newcolumntype{B}[2]{>{#1\hspace{0pt}\arraybackslash}b{#2}}
\setlength{\parindent}{0pt}
\usepackage[dvipsnames]{color}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/ref/tabbook1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
\usepackage{booktabs, dcolumn, longtable}
\usepackage[top=0.6in, bottom=0.6in, left=0.5in, right=0.5in, includeheadfoot]{geometry}
\usepackage{array}
\usepackage[english]{babel}
\usepackage{babel}
\newcolumntype{B}[2]{>{#1\hspace{0pt}\arraybackslash}b{#2}}
\setlength{\parindent}{0pt}
\usepackage[dvipsnames]{color}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/ref/topline1.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
\usepackage{booktabs, dcolumn, longtable}
\usepackage[top=0.6in, bottom=0.6in, left=1in, right=1in, includeheadfoot]{geometry}
\usepackage{array}
\usepackage[english]{babel}
\usepackage{babel}
\newcolumntype{B}[2]{>{#1\hspace{0pt}\arraybackslash}b{#2}}
\setlength{\parindent}{0pt}
\usepackage[dvipsnames]{color}
Expand Down
10 changes: 5 additions & 5 deletions vignettes/Edgar-Anderson-s-Iris-Data.tex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
\usepackage[top=0.6in, bottom=0.6in, left=1in, right=1in, includeheadfoot]{geometry}
\usepackage{array}
\usepackage[english]{babel}
\usepackage{babel}
\newcolumntype{B}[2]{>{#1\hspace{0pt}\arraybackslash}b{#2}}
\setlength{\parindent}{0pt}
\usepackage[dvipsnames]{color}
Expand Down Expand Up @@ -77,8 +77,8 @@
\vspace{.25in}

\begin{longtable}[l]{ll}
Sample & The irises of the Gaspe Peninsula \\
Conducted & 1935 \\
Sample & The irises of the Gaspe Peninsula \\
Conducted & 1935 \\
\end{longtable}
This famous (Fisher's or Anderson's) iris data set gives the measurements in centimeters of the variables sepal length and width and petal length and width, respectively, for 50 flowers from each of 3 species of iris. The species are Iris setosa, versicolor, and virginica.

Expand All @@ -96,7 +96,7 @@
\vskip 0.10in
The length of the flower's sepal
\addcontentsline{lot}{table}{\parbox{1.8in}{\ttfamily{Sepal.Length}} Sepal Length}
\vskip 0.10in\end{absolutelynopagebreak}
\vskip 0.10in\end{absolutelynopagebreak}
\begin{longtable}[l]{cccccc}
\toprule
{Mean} & {SD} & {Min} & {Max} & {n} & {Missing}\\
Expand All @@ -115,7 +115,7 @@
\vskip 0.10in
The iris species
\addcontentsline{lot}{table}{\parbox{1.8in}{\ttfamily{Species}} Iris Species}
\vskip 0.10in\end{absolutelynopagebreak}
\vskip 0.10in\end{absolutelynopagebreak}
\begin{longtable}[l]{JlK}
\toprule
{Code} & {Label} & {Count}\\
Expand Down
24 changes: 12 additions & 12 deletions vignettes/Example-dataset.tex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
\usepackage[top=0.6in, bottom=0.6in, left=1in, right=1in, includeheadfoot]{geometry}
\usepackage{array}
\usepackage[english]{babel}
\usepackage{babel}
\newcolumntype{B}[2]{>{#1\hspace{0pt}\arraybackslash}b{#2}}
\setlength{\parindent}{0pt}
\usepackage[dvipsnames]{color}
Expand Down Expand Up @@ -77,10 +77,10 @@
\vspace{.25in}

\begin{longtable}[l]{ll}
Sample & US Voting Adults \\
Conducted & Feb 2021 - Mar 2021 \\
Sample & US Voting Adults \\
Conducted & Feb 2021 - Mar 2021 \\
\end{longtable}
You can enter arbitrary \textbf{\emph{tex}} in the preamble, but it must be double escaped.
You can enter arbitrary \textbf{\emph{tex}} in the preamble, but it must be double escaped.


\renewcommand{\listtablename}{Table of Contents}
Expand All @@ -97,17 +97,17 @@
\addcontentsline{lot}{table}{\parbox{1.8in}{\ttfamily{allpets}} All pets owned}
\vskip 0.10in
\emph{This is a note, usually describing a sub-sample}
\vskip 0.10in\end{absolutelynopagebreak}
\vskip 0.10in\end{absolutelynopagebreak}
\begin{longtable}[l]{>{}ll}
\toprule
\multicolumn{2}{c}{Rows} \\
\cmidrule(l{3pt}r{3pt}){1-2}
{Variable} & {Label}\\
\midrule
\ttfamily{allpets\_1} & Cat\\

\ttfamily{allpets\_2} & Dog\\

\ttfamily{allpets\_3} & Bird\\
\bottomrule
\end{longtable}\end{absolutelynopagebreak}
Expand All @@ -120,11 +120,11 @@
{Code} & {Label}\\
\midrule
1 & selected\\

2 & not selected\\

8 & skipped\\

9 & not asked\\
\bottomrule
\end{longtable}\end{absolutelynopagebreak}
Expand All @@ -137,9 +137,9 @@
{Variable} & {1} & {2} & {8} & {9}\\
\midrule
\ttfamily{allpets\_1} & 1 & 2 & 3 & 4\\

\ttfamily{allpets\_2} & 4 & 1 & 3 & 2\\

\ttfamily{allpets\_3} & 4 & 4 & 1 & 1\\
\bottomrule
\end{longtable}\end{absolutelynopagebreak}
Expand Down

0 comments on commit de63e40

Please sign in to comment.