-
Notifications
You must be signed in to change notification settings - Fork 0
/
TCMN_RegionDeps_PDF_Local.Rnw
90 lines (82 loc) · 3.44 KB
/
TCMN_RegionDeps_PDF_Local.Rnw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Template TCMN data sheet version 3
%
% Alberto Sanchez [email protected] Dec 2015
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
%%%%%%%%%%%%%% package declaration %%%%%%%%%%%%%%%%%%%%%
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{This is my name}
\rhead{this is page \thepage}
\cfoot{center of the footer!}
\usepackage[top=0.3in, bottom=0.1in, left=0.5in, right=0.6in]{geometry}
\usepackage{graphicx} % to load images
\usepackage[export]{adjustbox} % add alignment to includegraphics
\usepackage[font=small]{caption}
\usepackage{xcolor} % color text
\usepackage{tabularx} % to adjust table width, etc.
\usepackage{titlesec} % format titles and headers
\usepackage{sectsty} % format sections & subsections
\usepackage{booktabs} % For \toprule, \midrule and \bottomrule
\usepackage{longtable} % add pages for long tables
\usepackage[colorlinks = true,
linkcolor = blue,
urlcolor = blue,
citecolor = blue,
anchorcolor = blue]{hyperref} % to include hyperlinks in the doc
\sectionfont{\fontsize{16}{15}\selectfont\raggedright} % formats title newsletter (section)
\subsectionfont{\fontsize{14}{12}\selectfont\raggedright} % formats title newsletter (section)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BEGIN DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% First page of the overall report with an index of countries included
%World Bank logo and TCMN branding
\begin{figure}
\vspace{-3ex} % move up this figure
\hspace{-7ex} % move left this figure
\includegraphics[width=5cm]{/Users/asanchez3/shinyTCMN/www/wb_logo_background.png}
\end{figure}
\begin{figure}
\begin{minipage}[t]{0.99\textwidth} % top section
\vspace{-30ex}
\hspace{-2ex}
\raggedright{\includegraphics[width=5.5cm,right]{/Users/asanchez3/shinyTCMN/www/TC_snapshots_operations.png}}
\end{minipage}
\end{figure}
\vspace{2ex}
\raggedright{\Large Region: \color{white!30!blue} \textbf{\Large \Sexpr{countryDeps[countryDeps$CMU==couDep,]$Region[1]}}}
\vspace{2ex}
\raggedright{\Large Country Management Unit: \color{white!30!blue} \textbf{\Sexpr{couDep}}}
\vspace{2ex}
\raggedright{\Large Country list:}
\vspace{2ex}
<<countries,echo=FALSE,message=FALSE,cache=FALSE,warning=FALSE>>=
out<-c()
for (c in (filter(countryDeps, CMU == couDep)$CountryCodeISO3)){
couName <- countryNames[countryNames$CountryCodeISO3==c,]$Country
out<- c(out,couName)
}
out <- c(out,"") # add an extra line to avoid weird spacing between the last 2 countries
@
\raggedright{\textbf{\Large \color{white!30!blue}\Sexpr{paste(out, collapse='\\\\\n ')}}}
\vspace{10ex}
\raggedright{\large Visit \href{http://tcdatadev/}{\Large tcdatadev/} for full access to T\&C data and operations}
<<setup,echo=FALSE,message=FALSE,cache=FALSE>>=
# Global chunk options: Cache chunks which source R code
read_chunk("TCMN_portfolio_PDF.R")
#opts_chunk$set(cache=TRUE,autodep=TRUE)
@
%
<<run,echo=FALSE,message=FALSE,cache=FALSE,warning=FALSE>>=
out<-c()
for (c in (filter(countryDeps, CMU == couDep)$CountryCodeISO3)){
couName <- countryNames[countryNames$CountryCodeISO3==c,]$Country
couISO2 <- countries[countries$Country==couName,]$CountryCodeISO2
out<- c(out, knit_child('TCMN_RegionDeps_CHILD_PDF_Local.Rnw',quiet=TRUE))
}
@
\Sexpr{paste(out, collapse='\n')}
%%%%%%%%%%%%%%%% END OF DOCUMENT %%%%%%%%%%%%%%%%%%%
\end{document}