Commit 56798d88 authored by ab604's avatar ab604
Browse files

update font spec and add equation example

parent d2dbc0ac
# Introduction {#intro} # Introduction {#intro}
Background and introduction chapter Background and introduction chapter
\ No newline at end of file
Equation \@ref(eq:binom) is an example of how to make a referenced equation:
\begin{equation}
f\left(k\right) = \binom{n}{k} p^k\left(1-p\right)^{n-k}
(\#eq:binom)
\end{equation}
\ No newline at end of file
# First Results {#results-1} # First Results {#results-1}
First results chapter. First results chapter with Figure \@ref(fig:fig1-chunk).
(ref:mpg-plot) Car engine size versus fuel efficiency. The mpg data contains observations collected by the US Environmental Protection Agency on 38 models of car. (ref:mpg-plot) Car engine size versus fuel efficiency. The mpg data contains observations collected by the US Environmental Protection Agency on 38 models of car.
```{r mpg,echo=FALSE,fig.cap ='(ref:mpg-plot)', fig.scap='Car engine size versus fuel efficiency',out.extra='',fig.align='center',cache=TRUE,warning=FALSE,fig.pos="H"} ```{r fig1-chunk,echo=FALSE,fig.cap ='(ref:mpg-plot)', fig.scap='Car engine size versus fuel efficiency',out.extra='',fig.align='center',cache=TRUE,warning=FALSE,fig.pos="H"}
ggplot(data = mpg) + ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy, color = class)) geom_point(mapping = aes(x = displ, y = hwy, color = class))
``` ```
\ No newline at end of file
> **Notes** The caption comes from the text following `(ref:fig1-caption)` and
this has to be all one line like so:
>`(ref:mpg-plot) Car engine size versus fuel efficiency. The mpg data contains observations collected by the US Environmental Protection Agency on 38 models of car.`
> Whilst the reference number to the figure itself comes from
the code chunk name `fig1-chunk` inside the referencing syntax `\@ref(fig:fig1-chunk)`.
\ No newline at end of file
bookdown::pdf_book: bookdown::pdf_book:
latex_engine: xelatex latex_engine: pdflatex
includes: includes:
in_header: tex-files/preamble.tex in_header: tex-files/preamble.tex
keep_tex: yes keep_tex: yes
......
% Peamble - load all the packages % Peamble - load all the packages
\usepackage[none]{hyphenat} \usepackage[none]{hyphenat}
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs \usepackage[utf8]{inputenc} % For greek letters and othe unicode symbols
\usepackage[default,osfigures,scale=0.95]{opensans} % Open sans font \usepackage[scaled]{berasans} % Sans font
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage{lmodern} \usepackage{lmodern}
\usepackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text \usepackage{lettrine} % The lettrine is the first enlarged letter at the beginning of the text
\usepackage{appendix} \usepackage{appendix}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment