Playing around with markdown, LaTeX, making pretty reports April 22, 2016
Why not use Word or Google Docs?
Why not use Word or Google Docs?
- Easier - Never take your fingers off the keyboard
- Focus on content, not layout
- Better integration with code or charts
- Push it to and edit on GitHub
- Free, open-source, anyone can use and edit without proprietary software
- Easily export to pdf, html, etc.
What's a markup language?
-- From Wikipedia:
A markup language is a system for annotating a document in a way that is syntactically distinguishable from the text. The idea and terminology evolved from the "marking up" of paper manuscripts, i.e., the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts.
Like HTML (Hyper Text Markup Language)!
Markdown vs LaTeX
|John Gruber||Donald Knuth|
|Supports HTML tags||Based on TeX|
|Math not really supported||All the Greek all the Time|
Markdown In Action
The *quick* brown fox, jumped **over** the lazy [dog](https://en.wikipedia.org/wiki/Dog).
The quick brown fox, jumped over the lazy dog.
# H1 ## H2 ### H3
|Pipes | Make | It| Easy| |--|--|--| |See | how| easy| it is?|
|Pipes | Make | It| Easy| |---|---|---| |See | how| easy| it is?|
If you can't make it good, at least make it look good. - Bill Gates
You can do in-line stuff `like this` or you can do blocks like this:
You can do in-line stuff
like this or you can do blocks like this:
def make_report(adjective): if adjective == 'ugly': print('Use word!') if adjective == 'pretty': print('Use Markdown, silly!) make_report(pretty) 'Use Markdown, silly!
~~strikethrough~~ * List * More List * This List is Forever 1. Numbers 3. Are 5. All 6. Screwed 8. Up 44. But it still works!
- More List
- This List is Forever
- But it still works!
Github also supports emojis like
All of the tools!
- R Markdown
- Overleaf for LaTeX. Allows doc sharing, requires sign up.
- ShareLaTeX for LaTeX. Also requires sign up.
No Sign Up:
Requires Sign Up:
Still more tools!
Web and General Text Editing
Don't forget! You can always use your favorite text editor! I use Atom, but [Sublime Text](sublime text) supports Markdown too. Emacs has out of the box LaTeX integration.
There are lots of paid ones too, but why use those when you can use free and open-source?
Now let's make something!
Try using your own editor, Makodo, Swipe, or R Markdown to generate a report or deck. We'll share at the end!
Come up with your own idea, or check out these iPython Notebooks for inspiration and example code/text to report on or present:
Don't forget to use:
- Headings, Tables, Code Insert, Quotes
If you feel like it, try inserting:
- An Equation, A Picture, Footnotes, HTML Snippets, Horizontal Rules
Or if you are super into it:
- Create your own HTML template or find another one to integrate with it
- More Markdown Tools
- Ghost's Complete Guide to Markdown
- Markdown Tutorial
- Markdown Cheatsheet
- R Markdown Cheatsheet and
- The (Not So) Short Introduction to LaTeX2e
- Comprehensive LaTeX Symbol List
- I stole info from Markdown, Latex, Etc.
- Good example of using pandoc in a reporting workflow by Kieran Healy with a howto
- [Datacamp R Markdown] Tutorial (https://www.datacamp.com/community/blog/r-markdown-tutorial-reproducible-reporting-in-r)