#+TITLE: Sharp Report Template
#+AUTHOR: Ivan Hanigan
#+email: ivan.hanigan@anu.edu.au
#+LaTeX_CLASS: article
#+LaTeX_CLASS_OPTIONS: [a4paper]
#+LaTeX_HEADER: \usepackage{amssymb,amsmath}
#+LaTeX_HEADER: \usepackage{fancyhdr} %For headers and footers
#+LaTeX_HEADER: \pagestyle{fancy} %For headers and footers
#+LaTeX_HEADER: \usepackage{lastpage} %For getting page x of y
#+LaTeX_HEADER: \usepackage{float} %Allows the figures to be positioned and formatted nicely
#+LaTeX_HEADER: \floatstyle{boxed} %using this
#+LaTeX_HEADER: \restylefloat{figure} %and this command
#+LaTeX_HEADER: \usepackage{url} %Formatting of yrls
#+LaTeX_HEADER: \lhead{ivanhanigan.github.com}
#+LaTeX_HEADER: \chead{}
#+LaTeX_HEADER: \rhead{\today}
#+LaTeX_HEADER: \lfoot{Draft}
#+LaTeX_HEADER: \cfoot{}
#+LaTeX_HEADER: \rfoot{\thepage\ of \pageref{LastPage}}
#+LATEX: \tableofcontents
* Introduction
This is a sharp looking report template I got from an R blogger \cite{Bull2011}.
The pages after the first page have a nice looking header, footer and page number.
\clearpage
* Section 1
In the Org file you can see some hidden R code that computes a linear regression and returns the results shown in Table \ref{ATable}.
\input{ATable.tex}
\clearpage
*** COMMENT some-code
#+name:some-code
#+begin_src R :session *R* :tangle no :exports none :eval yes
#### name:some-code ####
x<-rnorm(100,10,5)
y<-rnorm(100,20,15)
fit <- lm(y~x)
library(xtable)
sink("ATable.tex")
xtable(fit, caption="Example Table",digits=4,table.placement="H",label="ATable")
sink()
#+end_src
#+RESULTS: some-code
* References
\bibliographystyle{apalike}
\bibliography{/home/ivan_hanigan/references/library}