AUTHOREA
Log in
Sign Up
Browse Preprints
LOG IN
SIGN UP
this is for holding javascript data
test_table
/
header.tex
\usepackage{multirow} \usepackage{fullpage} \usepackage[table,dvipsnames]{xcolor} \usepackage{xspace} \usepackage{listings} \usepackage{pifont} \lstset{ % backgroundcolor=\color{white}, % choose the background color basicstyle=\footnotesize, % size of fonts used for the code breaklines=true, % automatic line breaking only at whitespace captionpos=b, % sets the caption-position to bottom commentstyle=\color{OliveGreen}, % comment style keywordstyle=\color{BlueViolet}, % keyword style stringstyle=\color{black}, % string literal style language=[AlLaTeX]TeX, % Set your language (you can change the language for each code-block optionally) frame=lrtb, % xleftmargin=\fboxsep, % xrightmargin=-\fboxsep, % moretexcs={lstset,color,colorlet, cellcolor, newcolumntype, columncolor, rowcolor, multirow, xspace, LaTeX, TeX}, } \def\authorea{\href{http://en.wikipedia.org/wiki/Authorea}{Authorea}\xspace} \def\latexml{\href{https://en.wikipedia.org/wiki/LaTeXML}{LaTeXML}\xspace} \def\latex{\href{https://en.wikipedia.org/wiki/LaTeX}{\LaTeX}\xspace} \usepackage{latexml,lxRDFa} \def\onlyHTML#1{\iflatexml #1\fi} \def\onlyPDF#1{\iflatexml\else #1\fi} % style \usepackage[T1]{fontenc} \renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif % paragraph \setlength{\parindent}{0em} \setlength{\parskip}{0.5em} \renewcommand{\baselinestretch}{1.0} % borders \usepackage[left=4cm, right=2.5cm, top=1.5cm, bottom=1.5cm, includeheadfoot, asymmetric, headheight=1cm, headsep=5mm, twoside]{geometry} % spacing around headers \onlyPDF{\usepackage{titlesec}} \onlyPDF{\titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}} \onlyPDF{\titlespacing\subsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}} \onlyPDF{\titlespacing\subsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}} %%% TABLE FORMAT \usepackage{tabularx} \def\tabularxcolumn#1{m{#1}} \usepackage{hhline} % Define some custom colors \colorlet{FreshGray}{gray!20!white} \colorlet{FreshGreen}{green!20!white} % Define shorthand macros for coloring individual cells \def\no{\cellcolor{FreshGray}} \def\task{\cellcolor{FreshGreen}} \def\nocell{\cellcolor{FreshGray}} % A new column type, adding a FreshGray background to the centered type \newcolumntype{g}{>{\columncolor{FreshGray}}c} \newcolumntype{G}{>{\columncolor{FreshGray}}X} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcommand{\cellbox}[2][c]{% \begin{tabular}[#1]{@{}l@{}}#2\end{tabular}} % header and footer \pagestyle{empty} \usepackage{fancyhdr} \usepackage{rotating} \makeatletter \def\title#1{\gdef\@title{#1}\gdef\THETITLE{#1}} \makeatother \pagestyle{fancy} \fancyhead[RO,LE]{\THETITLE} \fancyhead[RE,LO]{} \fancyfoot[RO,LE]{\thepage} \fancyfoot[C]{} % repeat (got lost on the way...) \setlength{\parindent}{0pt} % redefine maketitle to avoid title + authors \makeatletter \usepackage{natbib} \bibliographystyle{plain} \def\maketitle{% \par} \makeatother %---------------------------------------------------------------------------------------- % GENERAL TABLE STYLE %---------------------------------------------------------------------------------------- \usepackage{setspace} \usepackage{array} \newcolumntype{C}[1]{>{\centering\let\newline\\\onlyPDF{\arraybackslash}\hspace{0pt}}m{#1}} \usepackage{latexml,lxRDFa} \def\onlyHTML#1{\iflatexml #1\fi} \def\onlyPDF#1{\iflatexml\else #1\fi} %---------------------------------------------------------------------------------------- % LEGAL TABLE %---------------------------------------------------------------------------------------- % define single rows programmatically \newcommand\legaltable[7]{% \begin{center} \begin{tabularx}{13cm}{ r X l} \hline 1& Research on human subjects and/or human materials & #1 \\ & \textit{If applicable:} A copy of the required approval of the & \\ & responsible ethics committee is included with the proposal. & #2 \\ \hline 2& Clinical trials & #3\\ \hline 3& Experiments involving vertebrates & #4\\ \hline 4& Experiments involving recombinant DNA & #5\\ \hline 5& Research involving embryonic stem cells & #6\\ 6& Research concerning the Convention on Biological Diversity & #7\\ \end{tabularx} \end{center} } %---------------------------------------------------------------------------------------- % FUNDS REQUESTED TABLE %---------------------------------------------------------------------------------------- % -- STAFF --------------------------------------------------------- \newcommand\fundsaddstaff[2]{% \gdef\position{#1}% \gdef\length{#2}% \fundsaddstaffcontinued } \newcounter{fundssinglestaff} \newcounter{fundstotalstaff} \newcounter{fundstotalstafffirst} \newcounter{fundstotalstaffsecond} \newcounter{fundstotalstaffthird} \newcounter{fundstotalstafffourth} \newcommand\fundsaddstaffcontinued[8]{% \setcounter{fundssinglestaff}{0} \addtocounter{fundssinglestaff}{#2} \addtocounter{fundssinglestaff}{#4} \addtocounter{fundssinglestaff}{#6} \addtocounter{fundssinglestaff}{#8} \addtocounter{fundstotalstafffirst}{#2} \addtocounter{fundstotalstaffsecond}{#4} \addtocounter{fundstotalstaffthird}{#6} \addtocounter{fundstotalstafffourth}{#8} \addtocounter{fundstotalstaff}{\thefundssinglestaff} \cellbox{\position \\ (\length)} & #1 & #2 & #3 & #4 & #5 & #6 & #7 & #8 & \thefundssinglestaff \tabularnewline \hline } \newcommand\fundsstaffsum{% Sum & \nocell -& \thefundstotalstafffirst & \nocell -& \thefundstotalstaffsecond & \nocell -& \thefundstotalstaffthird & \nocell -& \thefundstotalstafffourth & \textbf{\thefundstotalstaff} \tabularnewline \hline } % -- DIRECT COST --------------------------------------------------------- \newcommand\fundsdirectcosts{% \multicolumn{10}{|c|}{\nocell} \\ \hline \rowcolor{FreshGray} \textbf{Direct costs} & \multicolumn{2}{|c|}{Sum} & \multicolumn{2}{|c|}{Sum} & \multicolumn{2}{|c|}{Sum} & \multicolumn{2}{|c|}{Sum} & {Total (Eur)} \tabularnewline \hline } \newcounter{fundssingledirect} \newcounter{fundstotaldirect} \newcounter{fundstotaldirectfirst} \newcounter{fundstotaldirectsecond} \newcounter{fundstotaldirectthird} \newcounter{fundstotaldirectfourth} \newcommand\fundsaddcost[5]{% \setcounter{fundssinglemajor}{0} \addtocounter{fundssingledirect}{#2} \addtocounter{fundssingledirect}{#3} \addtocounter{fundssingledirect}{#4} \addtocounter{fundssingledirect}{#5} \addtocounter{fundstotaldirectfirst}{#2} \addtocounter{fundstotaldirectsecond}{#3} \addtocounter{fundstotaldirectthird}{#4} \addtocounter{fundstotaldirectfourth}{#5} \addtocounter{fundstotaldirect}{\thefundssingledirect} {#1} & \multicolumn{2}{|c|}{#2} & \multicolumn{2}{|c|}{#3} & \multicolumn{2}{|c|}{#4} & \multicolumn{2}{|c|}{#5} & \thefundssingledirect \tabularnewline \hline } \newcommand\fundsdirectsum{% Sum & \multicolumn{2}{|c|}{\thefundstotaldirectfirst} & \multicolumn{2}{|c|}{\thefundstotaldirectsecond} & \multicolumn{2}{|c|}{\thefundstotaldirectthird} & \multicolumn{2}{|c|}{\thefundstotaldirectfourth} & {\textbf{\thefundstotaldirect}}\\ \hline \multicolumn{10}{|c|}{\nocell} \\ \hline } % -- MAJOR EQUIPMENT --------------------------------------------------------- \newcounter{fundssinglemajor} \newcounter{fundstotalmajor} \newcounter{fundstotalmajorfirst} \newcounter{fundstotalmajorsecond} \newcounter{fundstotalmajorthird} \newcounter{fundstotalmajorfourth} \newcommand\fundsaddmajor[5]{% \setcounter{fundssinglemajor}{0} \addtocounter{fundssinglemajor}{#2} \addtocounter{fundssinglemajor}{#3} \addtocounter{fundssinglemajor}{#4} \addtocounter{fundssinglemajor}{#5} \addtocounter{fundstotalmajorfirst}{#2} \addtocounter{fundstotalmajorsecond}{#3} \addtocounter{fundstotalmajorthird}{#4} \addtocounter{fundstotalmajorfourth}{#5} \addtocounter{fundstotalmajor}{\thefundssinglemajor} {#1} & \multicolumn{2}{|c|}{#2} & \multicolumn{2}{|c|}{#3} & \multicolumn{2}{|c|}{#4} & \multicolumn{2}{|c|}{#5} & \thefundssinglemajor \tabularnewline \hline } \newcommand\fundsmajorsum{% Sum & \multicolumn{2}{|c|}{\thefundstotalmajorfirst} & \multicolumn{2}{|c|}{\thefundstotalmajorsecond} & \multicolumn{2}{|c|}{\thefundstotalmajorthird} & \multicolumn{2}{|c|}{\thefundstotalmajorfourth} & {\textbf{\thefundstotalmajor}}\\ \hline \multicolumn{10}{|c|}{\nocell} \\ \hline } \newcommand\fundsmajorcosts{% \multicolumn{10}{|c|}{\nocell} \\ \hline \rowcolor{FreshGray} \textbf{Major Equipment} & \multicolumn{2}{|c|}{Sum} & \multicolumn{2}{|c|}{Sum} & \multicolumn{2}{|c|}{Sum} & \multicolumn{2}{|c|}{Sum} & {Total (Eur)} \tabularnewline \hline } % -- TOTAL & ENVIRONMENT --------------------------------------------------------- \newcounter{fundstotal} \newcounter{fundstotalfirst} \newcounter{fundstotalsecond} \newcounter{fundstotalthird} \newcounter{fundstotalfourth} \newcommand\fundstotalsum{% \addtocounter{fundstotal}{\thefundstotalstaff} \addtocounter{fundstotal}{\thefundstotaldirect} \addtocounter{fundstotal}{\thefundstotalmajor} \addtocounter{fundstotalfirst}{\thefundstotaldirectfirst} \addtocounter{fundstotalfirst}{\thefundstotalstafffirst} \addtocounter{fundstotalfirst}{\thefundstotalmajorfirst} \addtocounter{fundstotalsecond}{\thefundstotaldirectsecond} \addtocounter{fundstotalsecond}{\thefundstotalstaffsecond} \addtocounter{fundstotalsecond}{\thefundstotalmajorsecond} \addtocounter{fundstotalthird}{\thefundstotaldirectthird} \addtocounter{fundstotalthird}{\thefundstotalstaffthird} \addtocounter{fundstotalthird}{\thefundstotalmajorthird} \addtocounter{fundstotalfourth}{\thefundstotaldirectfourth} \addtocounter{fundstotalfourth}{\thefundstotalstafffourth} \addtocounter{fundstotalfourth}{\thefundstotalmajorfourth} %\rowcolor{FreshGray} \no\textbf{Total Sum} & \multicolumn{2}{|c|}{\no\thefundstotalfirst} & \multicolumn{2}{|c|}{\no\thefundstotalsecond} & \multicolumn{2}{|c|}{\no\thefundstotalthird} & \multicolumn{2}{|c|}{\no\thefundstotalfourth} & \no{\textbf{\thefundstotal}} \tabularnewline } \newenvironment{funds} {\small\tabularx{\textwidth}{ |G|c|c|c|c|c|c|c|c|c| } \hline \rowcolor{FreshGray} & \multicolumn{2}{|c|}{2017} & \multicolumn{2}{|c|}{2018} & \multicolumn{2}{|c|}{2019} & \multicolumn{2}{|c|}{2020} & {Total (Eur)} \\ \hline \rowcolor{FreshGray} \textbf{Staff} & \# & Sum & \# & Sum & \# & Sum & \# & Sum & Sum \\ \hline} {\hline\endtabularx} %---------------------------------------------------------------------------------------- % DIRECT COST TABLE %---------------------------------------------------------------------------------------- \newcounter{directtotalfirst} \newcounter{directtotalsecond} \newcounter{directtotalthird} \newcounter{directtotalfourth} \newcommand\directaddexisting[5]{% \addtocounter{directtotalfirst}{#2} \addtocounter{directtotalsecond}{#3} \addtocounter{directtotalthird}{#4} \addtocounter{directtotalfourth}{#5} \no \cellbox{#1} & #2 & #3 & #4 & #5 \\ \hline } \newcommand\directsumexisting{% \hhline{|-|-|-|-|-|} \multicolumn{5}{|c|}{\no} \\ \hhline{|-|-|-|-|-|} \multicolumn{1}{|l|}{\no Sum of existing resources} & \thedirecttotalfirst & \thedirecttotalsecond & \thedirecttotalthird & \thedirecttotalfourth \\ } \newcommand\directaddrequested[4]{% \hline \no Requested funding & #1 & #2 & #3 & #4 \\ } \newenvironment{direct} {% \tabularx{\textwidth}{ |X|c|c|c|c| } %\cline{2-6} \hhline{~-|-|-|-|} \multicolumn{1}{l|}{} &\no 2017 &\no 2018 &\no 2019 &\no 2020\\ \hline } {% \hline % we need the following hack for equal cell widths \multicolumn{1}{l}{} & \multicolumn{1}{l}{{\color{white} white space}} & \multicolumn{1}{l}{{\color{white} white space}} & \multicolumn{1}{l}{{\color{white} white space}} & \multicolumn{1}{l}{{\color{white} white space}} \\ \endtabularx } %---------------------------------------------------------------------------------------- % SINGLE DIRECT COST TABLE %---------------------------------------------------------------------------------------- \newcommand\singledirectadd[3]{% { #1 } & #2 & #3 \\ \hline } \newenvironment{singledirect} {% \tabularx{\textwidth}{ |X|l|X| } \hline } {\endtabularx} %---------------------------------------------------------------------------------------- % CONTACTS %---------------------------------------------------------------------------------------- \newenvironment{contact}{\begin{itemize}}{\end{itemize}}