Debian Codegraph @

texmf-dist/doc/latex/amnestyreport/sample.tex

raw
1 \documentclass[
2 freefonts, nologo]{amnestyreport}
3 \usepackage{color}
4 \usepackage{fancyvrb}
5 \newcommand{\VerbBar}{|}
6 \newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
7 \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
8 % Add ',fontsize=\small' for more characters per line
9 \usepackage{framed}
10 \definecolor{shadecolor}{RGB}{248,248,248}
11 \newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
12 \newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}}
13 \newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
14 \newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
15 \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
16 \newcommand{\BuiltInTok}[1]{#1}
17 \newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
18 \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
19 \newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
20 \newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
21 \newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
22 \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
23 \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
24 \newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
25 \newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}}
26 \newcommand{\ExtensionTok}[1]{#1}
27 \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
28 \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
29 \newcommand{\ImportTok}[1]{#1}
30 \newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
31 \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
32 \newcommand{\NormalTok}[1]{#1}
33 \newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
34 \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
35 \newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
36 \newcommand{\RegionMarkerTok}[1]{#1}
37 \newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
38 \newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
39 \newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
40 \newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
41 \newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
42 \newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
43 \renewcommand{\thesection}{\Alph{section}}
44 \usepackage{booktabs}
45 \usepackage{longtable}
46 \usepackage{array}
47 \usepackage{multirow}
48 \usepackage{wrapfig}
49 \usepackage{float}
50 \usepackage{colortbl}
51 \usepackage{pdflscape}
52 \usepackage{tabu}
53 \usepackage{threeparttable}
54 \usepackage{threeparttablex}
55 \usepackage[normalem]{ulem}
56 \usepackage{makecell}
57 \usepackage{xcolor}
58 \title{RMarkdown report example}
59 \subtitle{An example report for Amnesty output}
60 \titleimage{BoschFragment}
61 \titleimagecaption{The Garden of Earthly Delights is the modern title
62 given to a triptych oil painting on oak panel painted by the Early
63 Netherlandish master Hieronymus Bosch, between 1490 and 1510, when Bosch
64 was between 40 and 60 years old. It has been housed in the Museo del
65 Prado in Madrid, Spain since 1939.\\
66 \textcopyright{} Image: Public domain.\\
67 \textcopyright{} Caption: Wikipedia contributors, 2023, released under
68 Creative Commons Attribution-ShareAlike License 4.0}
69 \copyrightyear{2023}
70 \firstpublicationyear{2022}
71 \reportindex{ABXC/AAAA/2022}
72 \blurb{This sample output of Rmarkdown with TeX shows the general
73 commands and options of the amnestyinternational TeX class. It is based
74 on the text by Jule Krueger.}
75
76 \addbibresource{examplereferences.bib}
77
78 \begin{document}
79 \frontmatter
80 \maketitle
81
82
83 \tableofcontents
84 \mainmatter
85
86 \begin{AmnestyGlossary}[10em]
87 Commute &
88 Commute means to replace a punishment, usually a death sentence, with a less severe one. For example, Amnesty called for the USA to commute to time served the 35-year jail sentence of whistleblower Chelsea Manning, who had been arrested after leaking classified government material
89 \\
90 Crimes against humanity &
91 When certain acts---including murder, torture and slavery---form part of a widespread attack on a civilian population by a state or organization. Unlike war crimes, they can take place at times of peace as well as during conflict. The Rwandan genocide of 1994 is one example of a crime against humanity.
92 \\
93 Extrajudicial executions &
94 Unlawful killings ordered by a government, or committed with its knowledge and support. They can be carried out by the military, police, or by civilians working with government forces. For example, Hamas forces in Gaza committed serious human rights abuses, including extrajudicial executions, torture and abductions, during the 2014 Gaza/Israel conflict.
95 \\
96 Freedom of expression &
97 The right to seek, receive and share information and ideas, without fear or interference. It is closely linked with freedom of association (the right to meet with anyone you choose, for example, to form and join clubs, societies or trade unions) and the right to take part in a peaceful assembly, such as a demonstration or public meeting.
98 \\
99 Immunity (from prosecution) &
100 Allows an accused person to avoid prosecution for a crime because of their job or office. Amnesty International is opposed to immunity. For example, Amnesty has called for the rejection of immunity in the Central African Republic so that people who committed crimes during conflict there are brought to justice.
101 \\
102 Impunity &
103 Impunity is when people who have committed crimes avoid punishment. For example, there is a ‘culture of impunity’ among police in the Philippines, who are able to torture people without fear of being punished. Amnesty calls for these people to be tried and sentenced fairly, according to the law.
104 \\
105 Prisoner of conscience &
106 A prisoner of conscience is someone who is imprisoned because of who they are (sexual orientation, ethnic, national or social origin, language, birth, colour, sex or economic status) or their religious, political or other beliefs, and who hasn’t used or advocated violence. For example, Dr Mohammed al-Roken is a current prisoner of conscience in the United Arab Emirates, jailed for 10 years following a deeply unfair trial.
107 \\
108 War crimes &
109 War crimes are serious crimes committed during armed conflicts, which could include murdering prisoners of war, killing hostages, torture and destroying towns and villages. A recent example is in the Ukraine, where there is overwhelming evidence of ongoing war crimes, including torture and summary killings of prisoners.
110 \\
111 \end{AmnestyGlossary}
112
113 From
114 \url{https://www.amnesty.org/en/latest/campaigns/2015/07/beginners-guide-human-rights-jargon/}
115
116 \clearpage
117
118 \section*{Introduction}\label{introduction}
119 \addcontentsline{toc}{section}{Introduction}
120
121 In this document we discuss the use of \texttt{amnestyreport.cls}, and
122 accompanying \texttt{R} package \& \texttt{pandoc} template for writing
123 Amnesty International Reports.
124
125 You can either use an \texttt{Rnw} file with \LaTeX~syntax, or an
126 \texttt{Rmd} file with R Markdown syntax. In both cases you need:
127
128 \begin{itemize}
129 \tightlist
130 \item
131 The \LaTeX~class file \texttt{amnestyreport.cls},
132 \item
133 A properly installed \texttt{R} package \texttt{amnestyreportR},
134 \item
135 Optionally Amnesty International fonts and logo (see below).
136 \end{itemize}
137
138 If you use R Markdown syntax rather than \LaTeX~syntax, you also need
139
140 \begin{itemize}
141 \tightlist
142 \item
143 The \texttt{pandoc} template \texttt{amnestytemplate.tex}
144 \end{itemize}
145
146 \subsection*{A note about the fonts and
147 logos}\label{a-note-about-the-fonts-and-logos}
148 \addcontentsline{toc}{subsection}{A note about the fonts and logos}
149
150 If you have an established relationship with Amnesty International, you
151 may use their fonts and logos in your report. You need to install the
152 fonts, and the file with the logo (rename it to
153 \texttt{Amnesty\_logo.png}). Otherwise you need the options
154 \texttt{freefonts,\ nologo} in your preamble for \LaTeX~or the line
155 \texttt{classoption:\ freefonts,\ nologo} in the RMD preamble.
156
157 \subsection*{Rmd premable example}\label{rmd-premable-example}
158 \addcontentsline{toc}{subsection}{Rmd premable example}
159
160 If you use Rmd, you need to specify in your preamble that
161
162 \begin{itemize}
163 \tightlist
164 \item
165 You are using the template \texttt{amnestytemplate.tex} rather than
166 the generic \texttt{pandoc} template;
167 \item
168 You are using \texttt{xelatex} (or \texttt{lualatex}) rather than a
169 8-bit engine \texttt{podflatex}.
170 \end{itemize}
171
172 For example this file has the following preamble:
173
174 \begin{verbatim}
175 ---
176 title: "RMarkdown report example"
177 subtitle: "An example report for Amnesty output"
178 titleimage: "BoschFragment"
179 titleimagecaption: "The Garden of Earthly Delights is the modern title
180 given to a triptych oil painting on oak panel painted by the Early
181 Netherlandish master Hieronymus Bosch, between 1490 and 1510, when
182 Bosch was between 40 and 60 years old. It has been housed in the
183 Museo del Prado in Madrid, Spain since 1939.\n\n
184 \\textcopyright{} Image: Public domain.\n\n
185 \\textcopyright{} Caption: Wikipedia contributors, 2023, released
186 under Creative Commons Attribution-ShareAlike License 4.0"
187 copyrightyear: 2023
188 firstpublicationyear: 2022
189 reportindex: ABXC/AAAA/2022
190 blurb: "This sample output of Rmarkdown with TeX shows the general
191 commands and options of the amnestyinternational TeX class. It is based
192 on the text by Jule Krueger."
193
194 output:
195 pdf_document:
196 template: amnestytemplate.tex
197 latex_engine: xelatex
198 toc: true
199 keep_tex: true
200 citation_package: natbib
201 classoption: freefonts, nologo
202 header-includes:
203 - \renewcommand{\thesection}{\Alph{section}}
204 bibliography: "examplereferences.bib"
205 ---
206 \end{verbatim}
207
208 \clearpage
209
210 \section{\texorpdfstring{Cross-references and bibliography
211 \label{cross-ref}}{Cross-references and bibliography }}\label{cross-references-and-bibliography}
212
213 You can use the standard \LaTeX~and R Markdown facilities for
214 references.
215
216 The package uses \texttt{biblatex} with the \texttt{bibtex} backend for
217 citations to provide footnote citations,
218 \citep[See][]{SecondRef2022}\textsuperscript{,}\citep[See
219 also][12]{FirstRef2023} and \citep[23]{FirstRef2023}. However, due to
220 idiosyncrasies of \texttt{pandoc} we need to specify \texttt{natbib} as
221 the citation engine in the preamble. Never mind biblatex warnings during
222 the processing.
223
224 Below in \autoref{sec:figures_tables} we show the examples of tables and
225 figures provided by the package.
226
227 \section{\texorpdfstring{Figures and tables
228 \label{sec:figures_tables}}{Figures and tables }}\label{figures-and-tables}
229
230 \subsection{Inline expressions}\label{inline-expressions}
231
232 Irises are beautiful flowers that come in different types, shapes and
233 sizes. In this report, we look at different species of irises in terms
234 of petal
235 size.\footnote{This is how you can add a footnote. Some footnotes are very long, and some are several lines log, but this is OK. Just make sure the indentation is right.}
236
237 We define the variable \texttt{N\_iris} and use it inline in the
238 following example:
239
240 \begin{Shaded}
241 \begin{Highlighting}[]
242 \NormalTok{N\_iris }\OtherTok{\textless{}{-}} \FunctionTok{nrow}\NormalTok{(iris)}
243 \end{Highlighting}
244 \end{Shaded}
245
246 There are a total of 150 (coded as
247 \texttt{`}\texttt{r N\_iris}\texttt{`}) iris flower specimen in the
248 built-in \textbf{iris} data.
249
250 \subsection{A table}\label{a-table}
251
252 Here is an example of a table using \texttt{kable} package and
253 \texttt{amnesty\_table} function:
254
255 \begin{Shaded}
256 \begin{Highlighting}[]
257 \NormalTok{iris }\SpecialCharTok{\%\textgreater{}\%}
258 \FunctionTok{count}\NormalTok{(Species) }\SpecialCharTok{\%\textgreater{}\%}
259 \FunctionTok{mutate}\NormalTok{(}\AttributeTok{percent =}\NormalTok{ n}\SpecialCharTok{/}\FunctionTok{sum}\NormalTok{(n)}\SpecialCharTok{*}\DecValTok{100}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
260 \FunctionTok{bind\_rows}\NormalTok{(}\FunctionTok{summarise}\NormalTok{(., }\FunctionTok{across}\NormalTok{(}\FunctionTok{where}\NormalTok{(is.numeric), sum),}
261 \FunctionTok{across}\NormalTok{(}\FunctionTok{where}\NormalTok{(is.factor), }\SpecialCharTok{\textasciitilde{}}\StringTok{\textquotesingle{}Total\textquotesingle{}}\NormalTok{))) }\SpecialCharTok{\%\textgreater{}\%}
262 \FunctionTok{amnesty\_table}\NormalTok{(}\AttributeTok{row.names =} \ConstantTok{FALSE}\NormalTok{,}
263 \AttributeTok{align =} \StringTok{"lrr"}\NormalTok{,}
264 \AttributeTok{caption=}\StringTok{"}\SpecialCharTok{\textbackslash{}\textbackslash{}}\StringTok{label\{tab:species\}}
265 \StringTok{ Frequency distribution of iris species."}\NormalTok{,}
266 \AttributeTok{position=}\StringTok{"!ht"}\NormalTok{,}
267 \AttributeTok{col.names =} \FunctionTok{c}\NormalTok{(}\StringTok{"Species"}\NormalTok{, }\StringTok{"Number of species"}\NormalTok{, }\StringTok{"(\%)"}\NormalTok{),}
268 \AttributeTok{digits=}\DecValTok{2}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%}
269 \NormalTok{ kableExtra}\SpecialCharTok{::}\FunctionTok{row\_spec}\NormalTok{(}\DecValTok{4}\NormalTok{, }\AttributeTok{bold=}\ConstantTok{TRUE}\NormalTok{)}
270 \end{Highlighting}
271 \end{Shaded}
272
273 We can typeset it with sideways caption using
274 \texttt{\textbackslash{}sideTableCaptions}: \sideTableCaptions
275
276 \begin{table}[!ht]
277
278 \caption{\label{tab:example_table}\label{tab:species}
279 Frequency distribution of iris species.}
280 \centering
281 \begin{tabular}[t]{lrr}
282 \toprule
283 \textbf{Species} & \textbf{Number of species} & \textbf{(\%)}\\
284 \midrule
285 setosa & 50 & 33.33\\
286 versicolor & 50 & 33.33\\
287 virginica & 50 & 33.33\\
288 \textbf{Total} & \textbf{150} & \textbf{100.00}\\
289 \bottomrule
290 \end{tabular}
291 \end{table}
292
293 Alternatively, we can typeset it with normal captions using
294 \texttt{\textbackslash{}normalTableCaptions}: \normalTableCaptions
295
296 \begin{table}[!ht]
297
298 \caption{\label{tab:example_table_1}\label{tab:species1}
299 Frequency distribution of iris species.}
300 \centering
301 \begin{tabular}[t]{lrr}
302 \toprule
303 \textbf{Species} & \textbf{Number of species} & \textbf{(\%)}\\
304 \midrule
305 setosa & 50 & 33.33\\
306 versicolor & 50 & 33.33\\
307 virginica & 50 & 33.33\\
308 \textbf{Total} & \textbf{150} & \textbf{100.00}\\
309 \bottomrule
310 \end{tabular}
311 \end{table}
312
313 \FloatBarrier
314
315 \subsection{Figures}\label{figures}
316
317 Normally the figures are prepared in separate \LaTeX~runs. This might be
318 very slow, so you may want to use the draft mode for the editing runs.
319 Before making the figures, you need to issue the \texttt{R} command
320 \texttt{setup\_amnesty\_plots(options=...,\ draft=...)}. The
321 \texttt{options} are those that are passed to \LaTeX~class; if you do
322 not have Amnesty International fonts, use \texttt{freefonts}. The
323 \texttt{draft} can be either \texttt{TRUE} or \texttt{FALSE} (for quick
324 plots). For example
325
326 \begin{Shaded}
327 \begin{Highlighting}[]
328 \FunctionTok{setup\_amnesty\_plots}\NormalTok{() }\CommentTok{\# You have Amnesty fonts and logo}
329 \FunctionTok{setup\_amnesty\_plots}\NormalTok{(}\AttributeTok{options=}\StringTok{\textquotesingle{}freefonts, nologo\textquotesingle{}}\NormalTok{) }\CommentTok{\# No Amnesty fonts}
330 \FunctionTok{setup\_amnesty\_plots}\NormalTok{(}\AttributeTok{draft=}\ConstantTok{TRUE}\NormalTok{) }\CommentTok{\# Draft mode}
331 \end{Highlighting}
332 \end{Shaded}
333
334 We are using the \textit{ggplot2} package to make an example figure from
335 the built-in iris data. As can be seen in
336 \autoref{fig:species-petal-size}, the virginica species of iris has the
337 largest petal size in comparison to the other two iris species. Note
338 that it is recommended to use both color and line shape to convey the
339 same information for the benefit of color blind users.
340
341 \begin{figure}
342
343 {\centering \includegraphics{sample_files/figure-latex/species-petal-size-1}
344
345 }
346
347 \caption{Distribution of petal length and petal width, by iris species.}\label{fig:species-petal-size}
348 \end{figure}
349
350 We use viridis scale optimized for color blind users both for the
351 discrete (\autoref{fig:species-petal-size}) and continuous
352 (\autoref{fig:petal-size-sepal-size}) scales. We also use
353 \texttt{\textbackslash{}sideFigureCaptions} to typeset the caption on
354 the side \sideFigureCaptions
355
356 \begin{figure}
357
358 {\centering \includegraphics{sample_files/figure-latex/petal-size-sepal-size-1}
359
360 }
361
362 \caption{Distribution of petal and sepal sizes}\label{fig:petal-size-sepal-size}
363 \end{figure}
364
365 \clearpage
366
367 \section{Other typographic features}\label{other-typographic-features}
368
369 \subsection{A subsection heading}\label{a-subsection-heading}
370
371 \subsubsection{A subsubsection heading}\label{a-subsubsection-heading}
372
373 \paragraph{A subsubsubsection heading}\label{a-subsubsubsection-heading}
374
375 We have line break after a subsubsubsection heading as Amnesty style
376 requires.
377
378 \paragraph{Type of iris species
379 (Species)}\label{type-of-iris-species-species}
380
381 This variable indicates the different botanical types of iris species.
382
383 \begin{description}
384 \item[\textbf{setosa:}] The iris belongs to the botanical species of setosa.
385 \item[\textbf{versicolor:}] The iris belongs to the botanical species of versicolor.
386 \item[\textbf{virginica:}] The iris belongs to the botanical species of virginica.
387 \end{description}
388
389 An example of a quotation.
390
391 \begin{quote}
392 All human beings are born free and equal in dignity and rights. They are
393 endowed with reason and conscience and should act towards one another in
394 a spirit of brotherhood.
395
396 \attribution{Universal Declaration of Human Rights}
397 \end{quote}
398
399 \backmatter
400 \end{document}