Rmarkdown

A Grad Student's Guide to Pandoc: Part Three - Importing from Word

This is a post in a series of posts about using pandoc to convert between markdown, latex, word, and pdf. It should stand on its own, but you may want to go though the posts sequentially. Intro OK, you have installed pandoc to convert your markdown or latex file to docx and sent it off to your adviser for comments. Now they send that file back, with comments in the word document and changes made using Word’s “track changes” feature.

A Grad Student's Guide to Pandoc: Part Two - Exporting to Word

This is a post in a series of posts about using pandoc to convert between r/markdown, latex, word, and pdf. It should stand on its own, but you may want to go though the posts sequentially. Even though word processors are stupid, MS Word’s ubiquity means that occasionally I have to convert a latex or markdown document to a docx file for a colleague who insists on using Word’s “comments” feature or for submission to a journal that doesn’t accept pdfs (though thankfully, the vast majority do today).

A Grad Student's Guide to Pandoc - Part One

I’m all the time asked something along the lines of “Hey, you taught me markdown/latex, but my adviser wants to give me comments in Word. How can I make that happen?” The answer, unfortunately, is a little complicated. The best way to do this is to use pandoc, an absolutely wonderful program that converts between all kinds of markup formats (including between markdown, latex, and docx documents).1 Pandoc is very powerful, but a little overwhelming, especially if you aren’t used to working with command line applications.

Combining Code and Writing

Combining code and the document that you’re writing is called “literate programming”. It’s one of the best practices associated with reproducible research, which is a hot topic in political science and other disciplines. This post isn’t about why you should do this, it’s just about how to do it. I’m going to talk about how to combine R code with markdown via rmarkdown and LaTeX via knitr. There are other ways of doing this (such as org-mode in emacs), so this isn’t supposed to be a comprehensive guide to all of the ways of doing this.

Emacs with LaTeX for Academic Writing

Having a super powerful text editor can make your life much easier. There are quite a few out there, but there’s only that can do it all: Emacs. In this post, I’ll outline how to get started with emacs. There are plenty of tutorials out there, but I’d say that the best way to learn is just to jump in. Thus, I will not spend a whole lot of time describing what M-x does (the answer is everything).