diff options
Diffstat (limited to 'macros/latex/contrib/amnestyreport/sample.tex')
-rw-r--r-- | macros/latex/contrib/amnestyreport/sample.tex | 299 |
1 files changed, 240 insertions, 59 deletions
diff --git a/macros/latex/contrib/amnestyreport/sample.tex b/macros/latex/contrib/amnestyreport/sample.tex index ff6dcb2f23..a72d70fd8e 100644 --- a/macros/latex/contrib/amnestyreport/sample.tex +++ b/macros/latex/contrib/amnestyreport/sample.tex @@ -1,5 +1,45 @@ \documentclass[ -]{amnestyreport} + freefonts, nologo]{amnestyreport} +\usepackage{color} +\usepackage{fancyvrb} +\newcommand{\VerbBar}{|} +\newcommand{\VERB}{\Verb[commandchars=\\\{\}]} +\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} +% Add ',fontsize=\small' for more characters per line +\usepackage{framed} +\definecolor{shadecolor}{RGB}{248,248,248} +\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}} +\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}} +\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}} +\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\BuiltInTok}[1]{#1} +\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} +\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}} +\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}} +\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}} +\newcommand{\ExtensionTok}[1]{#1} +\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}} +\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\ImportTok}[1]{#1} +\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} +\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}} +\newcommand{\NormalTok}[1]{#1} +\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}} +\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}} +\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}} +\newcommand{\RegionMarkerTok}[1]{#1} +\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}} +\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}} +\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}} +\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}} \renewcommand{\thesection}{\Alph{section}} \usepackage{booktabs} \usepackage{longtable} @@ -75,65 +115,188 @@ From \clearpage -\section*{Introduction to the -appendix}\label{introduction-to-the-appendix} -\addcontentsline{toc}{section}{Introduction to the appendix} - -This appendix accompanies the Amnesty International report ``\emph{Some -Amnesty Report Title}''. The report used an innovative mixed-methods -research approach to capture the experiences of survivors of violence -from multiple perspectives. The mixed-methods approach involved -interviews with survivors and experts; desk research, including reviews -of existing literature -\citep[See][]{SecondRef2022}\textsuperscript{,}\citep[See -also][p.12]{FirstRef2023} and media articles -\citep[p.~23]{FirstRef2023}; formal requests to relevant officials for -public information access; and quantitative analysis of a representative -sample of court judgments. - -This appendix provides more detail on each aspect of the quantitative -research methodology, in-depth empirical analysis of the judgment data, -and a codebook that describes the manual coding procedure employed. The -data that Amnesty International extracted from these cases on judgments, -defendants and victims is publicly available at \url{https://data.link}. - -\autoref{sec:methodology} describes how court decisions on ~violence -were identified and selected for analysis. \autoref{sec:results} -analyses the data from the judgments. Empirical analysis was performed -using the R programming language for statistical computing. -\autoref{sec:codebook} explains the rules used to manually code data -from judgments (codebooks) as well as the data available to the public. +\section*{Introduction}\label{introduction} +\addcontentsline{toc}{section}{Introduction} + +In this document we discuss the use of \texttt{amnestyreport.cls}, and +accompanying \texttt{R} package \& \texttt{pandoc} template for writing +Amnesty International Reports. + +You can either use an \texttt{Rnw} file with \LaTeX~syntax, or an +\texttt{Rmd} file with R Markdown syntax. In both cases you need: + +\begin{itemize} +\tightlist +\item + The \LaTeX~class file \texttt{amnestyreport.cls}, +\item + A properly installed \texttt{R} package \texttt{amnestyreportR}, +\item + Optionally Amnesty International fonts and logo (see below). +\end{itemize} + +If you use R Markdown syntax rather than \LaTeX~syntax, you also need + +\begin{itemize} +\tightlist +\item + The \texttt{pandoc} template \texttt{amnestytemplate.tex} +\end{itemize} + +\subsection*{A note about the fonts and +logos}\label{a-note-about-the-fonts-and-logos} +\addcontentsline{toc}{subsection}{A note about the fonts and logos} + +If you have an established relationship with Amnesty International, you +may use their fonts and logos in your report. You need to install the +fonts, and the file with the logo (rename it to +\texttt{Amnesty\_logo.png}). Otherwise you need the options +\texttt{freefonts,\ nologo} in your preamble for \LaTeX~or the line +\texttt{classoption:\ freefonts,\ nologo} in the RMD preamble. + +\subsection*{Rmd premable example}\label{rmd-premable-example} +\addcontentsline{toc}{subsection}{Rmd premable example} + +If you use Rmd, you need to specify in your preamble that + +\begin{itemize} +\tightlist +\item + You are using the template \texttt{amnestytemplate.tex} rather than + the generic \texttt{pandoc} template; +\item + You are using \texttt{xelatex} (or \texttt{lualatex}) rather than a + 8-bit engine \texttt{podflatex}. +\end{itemize} + +For example this file has the following preamble: + +\begin{verbatim} +--- +title: "RMarkdown report example" +subtitle: "An example report for Amnesty output" +titleimage: "BoschFragment" +titleimagecaption: "The Garden of Earthly Delights is the modern title +given to a triptych oil painting on oak panel painted by the Early +Netherlandish master Hieronymus Bosch, between 1490 and 1510, when +Bosch was between 40 and 60 years old. It has been housed in the +Museo del Prado in Madrid, Spain since 1939.\n\n +\\textcopyright{} Image: Public domain.\n\n +\\textcopyright{} Caption: Wikipedia contributors, 2023, released +under Creative Commons Attribution-ShareAlike License 4.0" +copyrightyear: 2023 +firstpublicationyear: 2022 +reportindex: ABXC/AAAA/2022 +blurb: "This sample output of Rmarkdown with TeX shows the general +commands and options of the amnestyinternational TeX class. It is based +on the text by Jule Krueger." + +output: + pdf_document: + template: amnestytemplate.tex + latex_engine: xelatex + toc: true + keep_tex: true + citation_package: natbib +classoption: freefonts, nologo +header-includes: + - \renewcommand{\thesection}{\Alph{section}} +bibliography: "examplereferences.bib" +--- +\end{verbatim} \clearpage -\section{\texorpdfstring{Research methodology -\label{sec:methodology}}{Research methodology }}\label{research-methodology} +\section{\texorpdfstring{Cross-references and bibliography +\label{cross-ref}}{Cross-references and bibliography }}\label{cross-references-and-bibliography} + +You can use the standard \LaTeX~and R Markdown facilities for +references. + +The package uses \texttt{biblatex} with the \texttt{bibtex} backend for +citations to provide footnote citations, +\citep[See][]{SecondRef2022}\textsuperscript{,}\citep[See +also][12]{FirstRef2023} and \citep[23]{FirstRef2023}. However, due to +idiosyncrasies of \texttt{pandoc} we need to specify \texttt{natbib} as +the citation engine in the preamble. Never mind biblatex warnings during +the processing. -This section describes the steps taken in the research methodology. We -are using the R built-in iris data to compute an example table and -figure in \autoref{sec:results} below. \clearpage +Below in \autoref{sec:figures_tables} we show the examples of tables and +figures provided by the package. -\section{\texorpdfstring{Empirical analysis -\label{sec:results}}{Empirical analysis }}\label{empirical-analysis} +\section{\texorpdfstring{Figures and tables +\label{sec:figures_tables}}{Figures and tables }}\label{figures-and-tables} -This section conducts the empirical analysis and results. Irises are -beautiful flowers that come in different types, shapes and sizes. In -this report, we look at different species of irises in terms of petal +\subsection{Inline expressions}\label{inline-expressions} + +Irises are beautiful flowers that come in different types, shapes and +sizes. In this report, we look at different species of irises in terms +of petal 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.} -There are a total of 150 iris flower specimen in the built-in -\textbf{iris} data. +We define the variable \texttt{N\_iris} and use it inline in the +following example: + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{N\_iris }\OtherTok{\textless{}{-}} \FunctionTok{nrow}\NormalTok{(iris)} +\end{Highlighting} +\end{Shaded} + +There are a total of 150 (coded as +\texttt{`}\texttt{r N\_iris}\texttt{`}) iris flower specimen in the +built-in \textbf{iris} data. + +\subsection{A table}\label{a-table} + +Here is an example of a table using \texttt{kable} package and +\texttt{amnesty\_table} function: + +\begin{Shaded} +\begin{Highlighting}[] +\NormalTok{iris }\SpecialCharTok{\%\textgreater{}\%} + \FunctionTok{count}\NormalTok{(Species) }\SpecialCharTok{\%\textgreater{}\%} + \FunctionTok{mutate}\NormalTok{(}\AttributeTok{percent =}\NormalTok{ n}\SpecialCharTok{/}\FunctionTok{sum}\NormalTok{(n)}\SpecialCharTok{*}\DecValTok{100}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%} + \FunctionTok{bind\_rows}\NormalTok{(}\FunctionTok{summarise}\NormalTok{(., }\FunctionTok{across}\NormalTok{(}\FunctionTok{where}\NormalTok{(is.numeric), sum),} + \FunctionTok{across}\NormalTok{(}\FunctionTok{where}\NormalTok{(is.factor), }\SpecialCharTok{\textasciitilde{}}\StringTok{\textquotesingle{}Total\textquotesingle{}}\NormalTok{))) }\SpecialCharTok{\%\textgreater{}\%} + \FunctionTok{amnesty\_table}\NormalTok{(}\AttributeTok{row.names =} \ConstantTok{FALSE}\NormalTok{,} + \AttributeTok{align =} \StringTok{"lrr"}\NormalTok{,} + \AttributeTok{caption=}\StringTok{"}\SpecialCharTok{\textbackslash{}\textbackslash{}}\StringTok{label\{tab:species\}} +\StringTok{ Frequency distribution of iris species."}\NormalTok{,} + \AttributeTok{position=}\StringTok{"!ht"}\NormalTok{,} + \AttributeTok{col.names =} \FunctionTok{c}\NormalTok{(}\StringTok{"Species"}\NormalTok{, }\StringTok{"Number of species"}\NormalTok{, }\StringTok{"(\%)"}\NormalTok{),} + \AttributeTok{digits=}\DecValTok{2}\NormalTok{) }\SpecialCharTok{\%\textgreater{}\%} +\NormalTok{ kableExtra}\SpecialCharTok{::}\FunctionTok{row\_spec}\NormalTok{(}\DecValTok{4}\NormalTok{, }\AttributeTok{bold=}\ConstantTok{TRUE}\NormalTok{)} +\end{Highlighting} +\end{Shaded} + +We can typeset it with sideways caption using +\texttt{\textbackslash{}sideTableCaptions}: \sideTableCaptions + +\begin{table}[!ht] -\subsection{Subsection with a table -example}\label{subsection-with-a-table-example} +\caption{\label{tab:example_table}\label{tab:species} + Frequency distribution of iris species.} +\centering +\begin{tabular}[t]{lrr} +\toprule +\textbf{Species} & \textbf{Number of species} & \textbf{(\%)}\\ +\midrule +setosa & 50 & 33.33\\ +versicolor & 50 & 33.33\\ +virginica & 50 & 33.33\\ +\textbf{Total} & \textbf{150} & \textbf{100.00}\\ +\bottomrule +\end{tabular} +\end{table} -We are make an example table from the built-in \textit{iris} data (see -\autoref{tab:species}). The \emph{kableExtra} package is used to -emphasize the last line +Alternatively, we can typeset it with normal captions using +\texttt{\textbackslash{}normalTableCaptions}: \normalTableCaptions \begin{table}[!ht] -\caption{\label{tab:make an example table from iris data}\label{tab:species}Frequency distribution of iris species.} +\caption{\label{tab:example_table_1}\label{tab:species1} + Frequency distribution of iris species.} \centering \begin{tabular}[t]{lrr} \toprule @@ -146,10 +309,27 @@ virginica & 50 & 33.33\\ \bottomrule \end{tabular} \end{table} + \FloatBarrier -\subsection{Subsection with a figure -example}\label{subsection-with-a-figure-example} +\subsection{Figures}\label{figures} + +Normally the figures are prepared in separate \LaTeX~runs. This might be +very slow, so you may want to use the draft mode for the editing runs. +Before making the figures, you need to issue the \texttt{R} command +\texttt{setup\_amnesty\_plots(options=...,\ draft=...)}. The +\texttt{options} are those that are passed to \LaTeX~class; if you do +not have Amnesty International fonts, use \texttt{freefonts}. The +\texttt{draft} can be either \texttt{TRUE} or \texttt{FALSE} (for quick +plots). For example + +\begin{Shaded} +\begin{Highlighting}[] +\FunctionTok{setup\_amnesty\_plots}\NormalTok{() }\CommentTok{\# You have Amnesty fonts and logo} +\FunctionTok{setup\_amnesty\_plots}\NormalTok{(}\AttributeTok{options=}\StringTok{\textquotesingle{}freefonts, nologo\textquotesingle{}}\NormalTok{) }\CommentTok{\# No Amnesty fonts} +\FunctionTok{setup\_amnesty\_plots}\NormalTok{(}\AttributeTok{draft=}\ConstantTok{TRUE}\NormalTok{) }\CommentTok{\# Draft mode} +\end{Highlighting} +\end{Shaded} We are using the \textit{ggplot2} package to make an example figure from the built-in iris data. As can be seen in @@ -160,30 +340,31 @@ same information for the benefit of color blind users. \begin{figure} -{\centering \includegraphics{sample_files/figure-latex/make an example figure from iris data-1} +{\centering \includegraphics{sample_files/figure-latex/species-petal-size-1} } -\caption{\label{fig:species-petal-size}Distribution of petal length and petal width, by iris species.}\label{fig:make an example figure from iris data} +\caption{Distribution of petal length and petal width, by iris species.}\label{fig:species-petal-size} \end{figure} We use viridis scale optimized for color blind users both for the discrete (\autoref{fig:species-petal-size}) and continuous -(\autoref{fig:petal-size-sepal-size}) scales. +(\autoref{fig:petal-size-sepal-size}) scales. We also use +\texttt{\textbackslash{}sideFigureCaptions} to typeset the caption on +the side \sideFigureCaptions \begin{figure} -{\centering \includegraphics{sample_files/figure-latex/unnamed-chunk-1-1} +{\centering \includegraphics{sample_files/figure-latex/petal-size-sepal-size-1} } -\caption{\label{fig:petal-size-sepal-size}Distribution of petal and sepal sizes}\label{fig:unnamed-chunk-1} +\caption{Distribution of petal and sepal sizes}\label{fig:petal-size-sepal-size} \end{figure} \clearpage -\section{\texorpdfstring{Data and codebooks -\label{sec:codebook}}{Data and codebooks }}\label{data-and-codebooks} +\section{Other typographic features}\label{other-typographic-features} \subsection{A subsection heading}\label{a-subsection-heading} @@ -191,8 +372,8 @@ discrete (\autoref{fig:species-petal-size}) and continuous \paragraph{A subsubsubsection heading}\label{a-subsubsubsection-heading} -The custom formatting does add a line break after a subsubsubsection -heading as Amnesty style requires. +We have line break after a subsubsubsection heading as Amnesty style +requires. \paragraph{Type of iris species (Species)}\label{type-of-iris-species-species} @@ -205,7 +386,7 @@ This variable indicates the different botanical types of iris species. \item[\textbf{virginica:}] The iris belongs to the botanical species of virginica. \end{description} -An example of a quotation +An example of a quotation. \begin{quote} All human beings are born free and equal in dignity and rights. They are |