README.md 4.55 KB
Newer Older
lorenzwalthert's avatar
lorenzwalthert committed
1
2
3
4
5
6
7
8

<!-- README.md is generated from README.Rmd. Please edit that file -->

# A few words from the authors

This repository is a bookdown template, derived from the LaTeX template
from the semiar for statistics, ETH Zurich.

lorenzwalthert's avatar
lorenzwalthert committed
9
10
11
**How bookdown works**

bookdown in general works as follows:
lorenzwalthert's avatar
lorenzwalthert committed
12
13
14
15
16
17

  - use knitr to convert Rmd to markdown.
  - use pandoc to convert markdown to latex, pdf, word, html books (with
    featuers like font size, background selection, full text search
    etc), epub.

lorenzwalthert's avatar
lorenzwalthert committed
18
19
20
21
22
23
24
The basic workflow is as follows:

  - Change a source file: In our template, the source of the body of the
    thesis is under `./rmd/`. For example, change `02-features.Rmd`
  - Re-compile the book using Cmd + Shift + B (for build) on a Mac and
    Ctrl + Shift + B on Windows / Linux.

lorenzwalthert's avatar
lorenzwalthert committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
**Why using bookdown**

The advantages of using bookdown instead of plain LaTeX are, in the eyes
of the creator of this template.

  - Generalization. Not just latex or PDF output, but any output
    supported by Pandoc.
  - The best of two worlds. Use intuitive markdown syntax where
    possible, use the full power of LaTeX syntax where needed. This
    includes a real-time latex equation previewer in RStudio, bibtex
    reference, LaTeX cross-, text- and figure reference.
  - It’s native R. Integrate R code and R output in your writing has
    never been easier than with bookdown. You can also use other
    languages supported by knitr such as python, stan etc.

**How this template works**

lorenzwalthert's avatar
lorenzwalthert committed
42
43
There are different directories in this template. We canuse the bash
command tee to show the output
lorenzwalthert's avatar
lorenzwalthert committed
44
45

``` bash
lorenzwalthert's avatar
lorenzwalthert committed
46
tree -d -L 2 --charset unicode
lorenzwalthert's avatar
lorenzwalthert committed
47
#> .
lorenzwalthert's avatar
lorenzwalthert committed
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#> |-- _book
#> |   |-- figures
#> |   |-- libs
#> |   |-- man
#> |   `-- thesis_SfS_files
#> |-- _bookdown_files
#> |   `-- thesis_SfS_files
#> |-- bib
#> |-- figure
#> |-- figures
#> |-- images
#> |   `-- auto
#> |-- pdf
#> |-- rmd
#> |-- style
#> `-- tex
lorenzwalthert's avatar
lorenzwalthert committed
64
#> 
lorenzwalthert's avatar
lorenzwalthert committed
65
#> 16 directories
lorenzwalthert's avatar
lorenzwalthert committed
66
67
```

lorenzwalthert's avatar
lorenzwalthert committed
68
69
  - \_book: Contains the compiled book, e.g. a PDF or html version.
  - \_bib: Contains BibTeX reference data bases.
lorenzwalthert's avatar
lorenzwalthert committed
70
71
  - figure: Contains figures you created from your (R) code in the rmd
    source.
lorenzwalthert's avatar
lorenzwalthert committed
72
73
74
  - images: Put images you want to include in your thesis in this
    folder.
  - pdf: Put PDFs you want to include in your thesis in this folder.
lorenzwalthert's avatar
lorenzwalthert committed
75
76
77
78
  - rmd: The source folder of thesis. When you build a book, the
    following happens: By default, all rmd files in this folder get
    merged into one big rmd file, according to their name. We suggest to
    use one file per chapter. Then, the file containing all the rmd
lorenzwalthert's avatar
lorenzwalthert committed
79
    sources will get processed by knitr and later by Pandoc.
lorenzwalthert's avatar
lorenzwalthert committed
80
81
82
83
84
85
86
87
  - style: Latex .sty files. Taken from the sfs LaTeX template.
  - tex: All tex data, most importantly, the sfs LaTeX template itself.
    Note that the abstract, preface, epilogue, summary, notation are
    still in tex, i.e. you need to change these files if you want the
    PDF output to change. This will **not** affect the html output. You
    can create chapters that show up in a particular output and not in
    the other forms as shown in `rmd/99-references.Rmd`.

lorenzwalthert's avatar
lorenzwalthert committed
88
89
90
Furthermore, we want to highlight a few files in the root directory of
the project:

lorenzwalthert's avatar
lorenzwalthert committed
91
  - DESCRIPTION: You can use it to declare dependent packages of your
lorenzwalthert's avatar
lorenzwalthert committed
92
93
    thesis in the `Imports:` field. If someone want’s to rebuild you
    thesis from scratch, the can use `remotes::install_deps()` to
lorenzwalthert's avatar
lorenzwalthert committed
94
    satisfy all R package dependencies.
lorenzwalthert's avatar
lorenzwalthert committed
95
96
97
98
99
100
  - index.R: Contains a YAML header where a few important variables are
    defined. You can also put markdown below the HEADER.
  - README.(R)md This document.
  - thesis-template-bookdown.Rproj: An RStudio project. We recommend
    using RStudio for authoring your master thesis with bookdown.

lorenzwalthert's avatar
lorenzwalthert committed
101
102
103
104
This is obviously a very short introduction to the template and it is in
no way comprehensive. To learn more about bookdown, we encourage the
reader to have a look at the [bookdown
guide](https://bookdown.org/yihui/bookdown/) as well as searching
lorenzwalthert's avatar
lorenzwalthert committed
105
through stack overflow / Google for particular questions. In addition,
lorenzwalthert's avatar
lorenzwalthert committed
106
107
108
109
inspect the different files in this repo, in particular the ones in the
rmd directory to develop a deeper understanding of the template.

As of early 2018, this template is still in alpha testing phase, so you
lorenzwalthert's avatar
lorenzwalthert committed
110
may experience unexpected behavior. Please file an issue on the git
lorenzwalthert's avatar
lorenzwalthert committed
111
112
113
114
115
116
117
118
119
repository where you have obtained the source of this template in case
you are stuck for some time with a problem or if you found a solution to
a problem you believe others are likely to encounter in the future. We
want to make sure that students working this template have a great
experience writing their master thesis.

Best,

Nicola Gnecco and Lorenz Walthert