---
title: "Even better template"
author: "David M. Kaplan"
date: "3/19/2020"
output: 
  pdf_document:
    number_sections: yes
    keep_tex: yes
    df_print: kable
bibliography: refs.bib
csl: dmk-format.csl # Use my own homegrown CSL format
header-includes:
  - \usepackage[tablesfirst]{endfloat}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

```{r}
# # Uncomment to automatically update .bib file
# download.file(
#   "http://127.0.0.1:23119/better-bibtex/collection?/1/projects//authoring-pubs-rmd.biblatex",
#   "refs.bib")
```

# Figure with caption

Section cross-reference: Section \ref{figure-with-caption}.

```{r pressure, fig.cap="\\label{fig:a_fig}A figure caption."}
plot(pressure)
```

Figure cross-reference: Fig. \ref{fig:a_fig}.

# Better table with caption

```{r table}
df = data.frame(id=1:5,res=letters[1:5])
knitr::kable(df,caption="\\label{tab:a_tab}Table caption")
```

Table cross-reference: Table \ref{tab:a_tab}.

# Equations

An inline equation: $E_k = \frac{1}{2} m v^2$.

A display equation:

\begin{equation}
\frac{d\tilde{p}}{dx} \bigg|_{x_{\nu,\text{infl}}} = -\frac{\nu}{\alpha} \frac{1}{\nu+1} \left( \frac{\nu}{\nu+1} \right)^{\nu} = -\frac{1}{\alpha} \left( \frac{\nu}{\nu+1} \right)^\nu
\label{eq:a_eq}
\end{equation}

Equation cross-reference: Eq. \ref{eq:a_eq}.

# Citations

Here are some citations [@BeckensteinerDriverstrendscatch2020; @MeynardTestingmethodsspecies2019; @Snouck-HurgronjeFishingfloatingobjects2018]. @KaplanUncertaintyempiricalestimates2017 showed many important things.

# References

