In my view, the “old ways” that are powerful magic include:
Command line
Text files
Editing text in a terminal
Combining all of them
The easiest way to handle text files is to use a text editor
These are programs to view and edit text files
They use a monospaced font, like Courier
Each letter has the same width
Since each letter has the same size, text editor use color
The color depends on the role of each text
For example, headings can be in red color
The color is not in the file. The editor puts colors
These work with Markdown and other formats
code.visualstudio.com
atom.io
rstudio.com/products/rstudio/download/
All are good. We use VSCode
typora.io
markdownpad.com
markdownmonster.west-wind.com
stackedit.io
dillinger.io
draftin.com
jbt.github.io/markdown-editor/
Free
nothing to pay
you can do whatever you want
Never get obsolete
We want to identify the meaning, not the shapes
The key idea is to describe what things are, not how they look
Describe the role of text, not the “looks”
Separate style from structure
There are several markup languages that encode the structure of a text document
Markdown is a widely used markup language
Same philosophy as LaTeX, but simpler
The text file can be read and understood easily
It can be transformed into other formats
Used in R, Python, Julia (Jupyter), in GitHub, and many other modern platforms
“The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible.
“The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.”
John Gruber https://daringfireball.net/projects/markdown/
Compiling is transforming from Markdown to other format
There are many different Markdown compilers
Many people make their own compiler, and they expand the original idea
Unfortunately, they are not always 100% compatible
There is not yet an official standard
Recommendation: pandoc
(if you have RStudio, you have Pandoc)
If you need to convert files from one markup format into another, pandoc is your swiss-army knife
Pandoc can convert between many formats, including
Text files
It is easy to write tables in Markdown
It is easy to write lists
Can be used for slides
Handles BiBTeX references
The first paragraph.
Another paragraph
The first paragraph.
Another paragraph
# Header 1
## Header 2
### Header 3
#### Header 4
Header 1
Header 2
Header 3
Header 4
+ Item 1
+ Item 2
+ Item 2a
+ Item 2b
- Item 1
- Item 2
- Item 2a
- Item 2b
Sub-lists are indented by 4 spaces
1. Item 1
1. Item 2
1. Item 3
1. Item 3a
1. Item 3b
- Item 1
- Item 2
- Item 3
- Item 3a
- Item 3b
You have to indicate the web address of the image
![optional text](http://example.com/logo.png)
or the name of a file in the same directory
![optional text](images/logo.png)
![optional text](images/logo.pn)
There are several formats. The easiest one is this
| | sample | dose | time | agent |
|--------|----------|------|--------|------------------|
| 1 | GSM91440 | low | 5 min | caffeine |
| 2 | GSM91893 | low | 5 min | caffeine |
| 3 | GSM91428 | low | 5 min | calcofluor white |
| 4 | GSM91881 | low | 5 min | calcofluor white |
sample | dose | time | agent | |
---|---|---|---|---|
1 | GSM91440 | low | 5 min | caffeine |
2 | GSM91893 | low | 5 min | caffeine |
3 | GSM91428 | low | 5 min | calcofluor white |
4 | GSM91881 | low | 5 min | calcofluor white |
There are some VSCode plug-ins that can make tables for you
Or you can make them in R using knitr
or
pander
libraries
A good alternative is this website:
Programs are usually written in a monospaced font.
That is, all letters have the same width.
```
this <- is.computer(code) {
# comment
}
```
this <- is.computer(code) {
# comment
}
You can indicate the language, and get colors
```r
this <- is.computer(code) {
# comment
}
```
There are hundreds of citation styles
Life is too short to sort references manually
There are many tools to manage your references
Pandoc can do it for you
References are stored in a separate text file, in BiBTeX format
@book{ RyderCarroll3260,
title = "The Bullet Journal Method: Track Your Past, Order Your Present, Plan Your Future",
author = "Ryder Carroll",
year = "2018",
month = "Oct",
publisher = "HarperCollins Publishers" }
@article{Annesley2010c,
author = {Annesley, Thomas M.},
doi = {10.1373/clinchem.2010.150060},
issn = {00099147},
journal = {Clinical Chemistry},
number = {8},
pages = {1229--1233},
pmid = {20551381},
title = {{Put your best figure forward: Line graphs and scattergrams}},
volume = {56},
year = {2010} }
[@RyderCarroll3260]
becomes (Carroll
2018)[@RyderCarroll3260, pp. 33-35, 38-39]
becomes
(Carroll 2018,
33–35, 38–39).[@RyderCarroll3260; @Annesley2010c]
becomes
(Carroll 2018; Annesley
2010).@RyderCarroll3260 [p. 33] says …
becomes Carroll (2018, 33)
says …We need two things
pandoc --citeproc --bibliography=references.bib input.md -o output.pdf
Next class we will do it better
Many tools can create BiBTeX files for you
For your weekend