Debian Codegraph @

vignettes/share/preamble.tex

raw
1 \documentclass[11pt,x11names,english]{article}
2 \usepackage{amsmath,amsthm}
3 \usepackage[round]{natbib}
4 \usepackage{babel}
5 \usepackage[autolanguage]{numprint}
6 \usepackage[noae]{Sweave}
7 \usepackage{framed}
8 \usepackage{booktabs}
9 \usepackage[shortlabels]{enumitem}
10
11 %% Fonts
12 \usepackage[babel=true]{microtype}
13 \usepackage{fontenc}
14 \usepackage{unicode-math}
15 \setmainfont{STIXTwoText}
16 [
17 Extension = .otf,
18 UprightFont = *-Regular,
19 BoldFont = *-SemiBold,
20 ItalicFont = *-Italic,
21 BoldItalicFont = *-SemiBoldItalic,
22 Scale = 1,
23 Ligatures = TeX
24 ]
25 \setmathfont{STIXTwoMath-Regular}
26 [
27 Extension = .otf,
28 Scale = 1,
29 bold-style = TeX
30 ]
31 \usepackage[book,medium,proportional,lining,scale=0.92]{FiraSans}
32 \usepackage[medium,lining,scale=0.90]{FiraMono}
33
34 %% Colors
35 \usepackage{xcolor}
36 \definecolor{link}{rgb}{0,0.4,0.6} % internal links
37 \definecolor{url}{rgb}{0.6,0,0} % external links
38 \definecolor{citation}{rgb}{0,0.5,0} % citations
39 \definecolor{codebg}{named}{LightYellow1} % R code background
40
41 %% Hyperlinks
42 \usepackage{hyperref}
43 \hypersetup{%
44 pdfauthor={Vincent Goulet},
45 colorlinks = {true},
46 linktocpage = {true},
47 urlcolor = {url},
48 linkcolor = {link},
49 citecolor = {citation},
50 pdfpagemode = {UseOutlines},
51 pdfstartview = {Fit},
52 bookmarksopen = {true},
53 bookmarksnumbered = {true},
54 bookmarksdepth = {subsubsection}}
55
56 %% Help for \autoref
57 \def\exampleautorefname{Example}
58
59 %% Sweave Sinput and Soutput environments reinitialized to remove
60 %% default configuration. Space between input and output blocks also
61 %% reduced.
62 \DefineVerbatimEnvironment{Sinput}{Verbatim}{}
63 \DefineVerbatimEnvironment{Soutput}{Verbatim}{}
64 \fvset{listparameters={\setlength{\topsep}{0pt}}}
65
66 %% Environment Schunk redefined as an hybrid of environments
67 %% snugshade* and leftbar of framed.sty.
68 \makeatletter
69 \renewenvironment{Schunk}{%
70 \setlength{\topsep}{1pt}
71 \def\FrameCommand##1{\hskip\@totalleftmargin
72 \vrule width 2pt\colorbox{codebg}{\hspace{3pt}##1}%
73 % There is no \@totalrightmargin, so:
74 \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
75 \MakeFramed {\advance\hsize-\width
76 \@totalleftmargin\z@ \linewidth\hsize
77 \advance\labelsep\fboxsep
78 \@setminipage}%
79 }{\par\unskip\@minipagefalse\endMakeFramed}
80 \makeatother
81
82 %% Flush left enumerate environment.
83 \setlist[enumerate]{leftmargin=*,align=left}
84
85 %% Example environment
86 \theoremstyle{definition}
87 \newtheorem{example}{Example}
88 \theoremstyle{remark}
89 \newtheorem{rem}{Remark}
90
91 %% New math commands
92 \newcommand{\E}[1]{E[ #1 ]}
93 \newcommand{\VAR}[1]{\mathrm{Var} [ #1 ]}
94 \newcommand{\LAS}{\mathrm{LAS}}
95 \newcommand{\D}{\displaystyle}
96 \newcommand{\pt}{{\scriptscriptstyle \Sigma}}
97 \newcommand{\mat}[1]{\symbf{#1}}
98
99 %% New styling commands similar to those of RJournal.sty
100 \newcommand{\pkg}[1]{\textbf{#1}}
101 \newcommand{\code}[1]{\texttt{#1}}
102 \newcommand{\samp}[1]{{`\normalfont\texttt{#1}'}}
103 \newcommand{\file}[1]{{`\normalfont\textsf{#1}'}}
104
105 \bibliographystyle{plainnat}