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