User Tools

Site Tools


projects:workgroups:notes_on_writing_text_for_the_book

This is an old revision of the document!


Notes on writing text for the Book of OHDSI

General layout of a chapter:

  • Introduction
  • Theory
  • Practice
  • [Advanced topics]
  • Exercises

Keep in mind:

  • Hyperlinks should show the actual URL, so that a printed copy would still have a readable link.
  • Tables and figures should be designed with small screens in mind.
  • Keep filename extensions in lower case, so 'figure.png', not 'figure.PNG'.
  • Only use alphanumeric characters in labels. So not '```{r figure_1}' but '```{r figure1}'.
  • Tables and lists only render correctly if they have an empty line in front of them.
  • Extra rows in the boob.bib file (not used in the text) are not a problem.

Editing the Book

It is highly recommended to use R-Studio to edit the Book of OHDSI. If you haven't done so already, make sure to install:

  1. R

Once installed, run install.packages(“bookdown”) in R to install the bookdown package.

To start editing the book, first fork the TheBookOfOhdsi repo. Then clone the fork using RStudio.

You can build the entire book in RStudio in the Build tab (top right panel). Alternatively, you can build a preview just of your chapter using the preview_chapter() command in R.

After making your edits, commit and push them to your forked repository. From there, you can create a pull-request to the main repository.

Generic Markdown syntax

An overview of basic Markdown syntax can be found here.

Adding figures

Please add figure files to a subfolder of the images folder. The subfolder should have the same name as the chapter Rmd file.

In the chapter, you can include a figure using the following piece of text:

```{r figure1, fig.cap='The prediction problem',echo=FALSE, out.width='100%'}
knitr::include_graphics("images/PatientLevelPrediction/Figure1.png")
```

Here, figure1 is the label that can be used to reference the figure. You furthermore must specify a caption and the path to the figure file.

You can reference the figure in your text for example using Figure \@ref(fig:figure1) shows ….

Adding literature references

To add literature references to your chapter, two steps are needed:

  1. Add citation information to the book.bib file
  2. Reference the citation in your text.

Adding citation information

Citations should be provided in BibTeX format. There are two ways to get BibTeX formatted citations:

  • Using TexMed, a BibTeX interface for PubMed
  • Reference managers such as Zotero will also allow you to export to BibTeX.

Note that there is only one boob.bib file for the entire book.

Referencing in text

The first field in the BibTeX in its label, and this label can be used to reference the citation. This can be done with and without square brackets. For example, As proposed by @reps2018 will render to `As proposed by Reps et al. (2018)`, while As proposed elsewhere [@reps2018] will render to `As proposed elsewhere (Reps et al. 2018)`

projects/workgroups/notes_on_writing_text_for_the_book.1552471915.txt.gz · Last modified: 2019/03/13 10:11 by schuemie