first commit

This commit is contained in:
Jeremy Kidwell 2017-06-26 20:57:02 +01:00
commit 13e2fd6e74
125 changed files with 19943 additions and 0 deletions

70
content/resources/_index.md Executable file
View file

@ -0,0 +1,70 @@
---
type: page
title: "Resources"
---
## Code and Data
<p><em>This page has links to configuration files, templates, and a few other things that might be of use to people who want to write well-formatted social science papers in plain text, with data, figures, and
references.</em></p>
<figure><img src="https://kieranhealy.org/files/misc/workflow-wide-tx.png"><figcaption>The Sausage Factory</figcaption></figure>
<div class="units-row">
<div class="unit-50">
<h4><a href="http://www.kieranhealy.org/files/papers/plain-person-text.pdf">The Plain Person's Guide to Plain Text Social Science</a> &rarr;</h4>
<p>As a beginning graduate student in the social sciences, what sort of software should you use to do your work? More importantly, what principles should guide your choices? This article offers some answers. The short
version is: you should use tools that give you more control over the process of data analysis and writing. I recommend you write prose and code using a good text editor; analyze quantitative data with R or Stata; minimize
error by storing your work in a simple format (plain text is best), and make a habit of documenting what you've done. For data analysis, consider using a format like Rmarkdown and tools like Knitr to make your work more
easily reproducible for your future self. Use Pandoc to turn your plain-text documents into PDF, HTML, or Word files to share with others. Keep your projects in a version control system. Back everything up regularly. Make
your computer work for you by automating as many of these steps as you can. To help you get started, I briefly discuss a drop-in set of useful defaults to get started with Emacs (a powerful, free text-editor). I share
some templates and style files that can get you quickly from plain text to various output formats. And I point to several alternatives, because no humane person should recommend Emacs without presenting some other options
as well. There is a sample <a href="https://github.com/kjhealy/workflow-paper">github repository</a> that contains the <code>.md</code> source file the PDF is created from. This material is also available <a
href="http://plain-text.co">as a website</a> at <code><a href="http://plain-text.co">http://plain-text.co</a></code>.</p>
<h4><a href="/resources/emacs-starter-kit" title="kjhealy/emacs-starter-kit @ GitHub">An Emacs Starter Kit for the Social Sciences</a></h4>
<p>This is a fork of Eric Schulte's <a href="http://github.com/eschulte/emacs-starter-kit/tree">Emacs Starter Kit</a> (itself an offshoot of <a href="http://github.com/eschulte/emacs-starter-kit/tree">Phil Hagelberg's
original</a>) with additional tools included for social scientists, mostly related to writing books or papers in LaTeX and analyzing quantitative data using <a href="http://ess.r-project.org/">ESS</a> and <a
href="http://www.r-project.org/">R</a>. The goal is to provide a drop-in configuration for Emacs that makes it easier to use right from the get-go. If you know about <a href="http://git-scm.com/" title="Git - Fast Version
Control System">Git</a>, <a href="http://github.com/kjhealy/emacs-starter-kit/tree/master" title="kjhealy's emacs-starter-kit at master &mdash; GitHub">you can clone the repository</a>.</p>
<h4><a href="http://vissoc.co">Data Visualization Course Notes</a> &rarr;</h4>
<p>Notes, links, and code from a Data Visualization short-course I taught in the Fall of 2015. The course is focused on the practical presentation of real data, mostly using R's `ggplot2` library. We also read some
material on principles of data visualization, in order to help develop a good working sense of why some graphs and figures work well while others either fail to inform or actively mislead.
</p>
</div>
<div class="unit-50">
<h4><a href="http://github.com/kjhealy/latex-custom-kjh">LaTeX Templates and Styles</a> &rarr;</h4>
<p>A collection of LaTeX style files, templates, and org-mode documents providing some nice layouts for typesetting articles using pdfLaTeX or XeLaTeX. They make a pipeline that lets you begin with an
<code>.org</code> file in Emacs (as set up in the <a href="http://kjhealy.github.com/emacs-starter-kit/">Starter Kit</a>), and go from there to a nice, fully-processed PDF in one step. Or the pieces can be used separately
to set up a <code>.tex</code> file with a nice Article layout.</p>
<h4><a href="https://github.com/kjhealy/pandoc-templates">Pandoc Templates</a> &rarr;</h4>
<p>Some Pandoc templates meant to go in <code>~/.pandoc/templates</code>. Point to them directly with the <code>--template</code> or <code>--css</code> switches as appropriate, and use them with what's provided in <a
href="http://github.com/kjhealy/latex-custom-kjh"><code>latex-custom-kjh</code></a>. Includes a shell script for setting pandoc up to work with the <a href="http://marked2app.com">Marked</a> app, a handy HTML live
previewer for <code>.md</code> files.
</p>
<h4><a href="http://kjhealy.github.com/kjh-vita/">So You Like My Vita</a> &rarr;</h4>
<p>Every few months I get an email asking to see the LaTeX markup that I use to generate my <a href="http://kieranhealy.org/vita.pdf">Curriculum Vitae</a>. So, <a href="http://kjhealy.github.com/kjh-vita/"
title="kjhealy's kjh-vita @ GitHub">here it is</a>. Feel free to adapt it yourself. If you make stylistic modifications, I encourage you to fork the project on GitHub and make them available to others in the same way.</p>
<h4><a href="http://github.com/kjhealy/kieranhealy.hugo/">So You Like My Website</a> &rarr;</h4>
<p>This site is produced using <a href="http://gohugo.io">Hugo</a>, a very fast static site generator, which you can <a href="http://gohugo.io/overview/introduction/">read more about here</a>. I've written about <a
href="http://kieranhealy.org/blog/archives/2014/02/24/powered-by-hugo/">my own experience setting it up</a>, too. The design is borrowed mostly from <a href="http://consequently.org/">Greg Restall</a>. If you want to look
under the bonnet, <a href="http://kjhealy.github.com/kieranhealy.hugo/" title="This website's source">the entire site is on GitHub</a>. Feel free to adapt it yourself. If you make stylistic modifications, I encourage you
to fork the project on GitHub and make them available to others in the same way. You should also change the Google Analytics information in the footer partial, or I will receive analytics information about your site.</p>
<h4><a href="/resources/github/">All GitHub Projects</a></h4>
<p>Here is a <a href="/resources/github/">full list of the various public code and data repositories</a> that I have put on GitHub. They range from the configuration and templating tools listed above to data
visualization exercises and other bits of data analysis, mostly written in R.
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,108 @@
---
type: page
title: "An Emacs Starter Kit for the Social Sciences"
aliases:
- /resources/emacs-starter-kit.html
---
<h2>An Emacs Starter Kit for the Social Sciences</h2>
<p>
To accompany the <a href="http://www.kieranhealy.org/files/misc/workflow-apps.pdf">Choosing Your Workflow Applications</a> paper, here is <a href="https://github.com/kjhealy/emacs-starter-kit">the Emacs Starter Kit for the Social Sciences</a>. It is a version of Phil Hagelberg's <a href="http://github.com/technomancy/emacs-starter-kit/tree">emacs starter kit</a> by way of <a href="http://eschulte.github.com/emacs-starter-kit/" title="Emacs Starter Kit">Eric Schulte's</a> Org-Mode implementation. I've made some further tweaks and added some tools of particular use to social scientists. The starter-kit includes up-to-date versions of <a href="http://ess.r-project.org/">Emacs Speaks Statistics</a>, <a href="http://www.gnu.org/software/auctex/" title="AUCTeX - Sophisticated document creation">AucTeX</a>, <a href="http://philjackson.github.com/magit/" title="It's Magit!">Magit</a>, <a href="http://jblevins.org/projects/markdown-mode/" title="Emacs markdown-mode">Markdown mode</a>, <a href="http://code.google.com/p/yasnippet/" title="yasnippet - Project Hosting on Google Code">Yasnippet</a>, and assorted other useful bits and pieces. It should work immediately on Mac OS X with the current version of Emacs.
</p>
<p>
<a href="http://kieranhealy.org/img/emacs-starter-kit.jpg"><img src="https://kieranhealy.org/img/emacs-starter-kit.jpg" caption="The Obligatory Screenshot, showing the Solarized (Dark) Theme"></a>
</p>
<p>
<a href="http://kieranhealy.org/img/emacs-starter-kit-light.png"><img src="https://kieranhealy.org/img/emacs-starter-kit-light.png" alt="Solarized (Light) Theme. Some other themes are also included."></a>
</p>
<p>
What's the motivation for the starter kit? Emacs is a very powerful editor but it is less useful out-of-the-box than it might be, in part because many convenient settings and modes are not activated by default. The starter kit is a drop-in set of nice default settings. The idea is for you to be able to download GNU Emacs, put the starter kit into <code>~/.emacs.d/</code>, and get to work. If you already use Emacs and have a <code>.emacs</code> file or <code>~/.emacs.d</code> directory, the starter kit is designed to replace them, while leaving a place for you to easily append your own customizations.
</p>
<p>
The starter kit is designed to be used with GNU Emacs. Version 24.4 (released October 2014) or later is required. It will not work with <a href="http://aquamacs.org/" title="Aquamacs: Emacs for Mac OS X">Aquamacs</a> without modification. More detailed commentary and documentation is provided inside the kit's <code>.org</code> files.
</p>
<h2>
Installation Instructions (Mac OS X)
</h2>
<h3>Before you Begin</h3>
<p>If you want to use the tools that the starter-kit works with—LaTeX, R, Git, Pandoc, and all the rest—then you will need to install them on your Mac. The ground floor is Apple's own suite of Developer Tools, which allow you to compile software yourself and include things like Git. The most straightforward way to get these tools is to <strong>install Xcode</strong>. Xcode is what software developers use to write Mac and iOS applications. As such it comes with a bunch of things we are not so interested in, but it makes it easy to install what we do need. It's available <a href="https://developer.apple.com/xcode/">for free via the Mac App Store</a>. Once downloaded, launch Xcode, go to Xcode &#62; Preferences &#62; Downloads and install the <strong>Command Line Tools for Xcode</strong>. At that point you can quit Xcode and never use it again. Alternatively, go to <a href="https://developer.apple.com/">Apple's Developer Site</a>, login with your Apple ID and download the Command Line Tools for Xcode package by itself, without the Xcode application. </p>
<p>If you have used Emacs before and already have a <code>.emacs</code> file or <code>.emacs.d</code> directory, back them up and then delete them. See below for details on how to add customizations to the kit.</p>
<h3>Getting the Starter Kit</h3>
<p>You have two choices. You can <a href="https://github.com/kjhealy/emacs-starter-kit/archive/master.zip">download a <code>.zip</code> file of the kit</a>. This will give you a static snapshot of the most recent version. But if you want to keep up with changes to the kit, you should clone the source code using git rather than simply copying a static version of it. You should be using version control on your plain-text documents anyway, so I recommend this second option.</p>
<h3>
Prerequisites
</h3>
<p>
<strong>0.1 Get Emacs</strong>. The starter kit requires Emacs 24.4 (released October 2014). <a href="http://emacsformacosx.com/" title="GNU Emacs For Mac OS X">Download Emacs here</a>. Alternatively, if you are comfortable with Homebrew, compile and install it.
</p>
<p>
<strong>0.2 Install a Modern TeX Distribution and the Skim PDF reader</strong>. If you are using OS X, <a href="http://www.tug.org/mactex/" title="MacTeX - TeX Users Group">download MacTeX here</a> and install it. The kit is set up to use the <a href="http://skim-app.sourceforge.net">Skim PDF reader</a> to display PDF files created from <code>.tex</code> files. You can use other readers, but will need to modify the setup in the <code>starter-kit-latex.org</code> file.
</p>
<p>
<strong>0.3 Install R and Pandoc</strong>. These are not strictly required for the installation to work, and you can skip this step if you like. But you will probably be using them anyway, if you're not already. If you're doing statistical work you will probably want to use R or Stata. R is free and you can <a href="http://www.r-project.org">download it here</a>. Pandoc is a very useful utility that lets you convert easily between many different forms of plain-text markup (such as Markdown, HTML, LaTeX, and others). <a href="http://johnmacfarlane.net/pandoc/">Get Pandoc here</a>.
</p>
<p>
<strong>0.4 Note your user name</strong> or the name of your computer. If you don't know either, open the Terminal application and do
</p>
<pre>
$ whoami
</pre>
<p>
for your user name and
</p>
<pre>
$ hostname
</pre>
<p>
for the system name. You will need to know your login name to activate the final customization file properly. You can use the system name as well (or instead).
</p>
<h3>
Setup
</h3>
<p>
<strong>1.</strong> If you downloaded a <code>.zip</code> file of the kit, you must uncompress it, move the resulting folder to the top level of your home director and rename it <code>.emacs.d</code>. Assuming the downloaded zip file is in your <code>~/Downloads</code> folder, open a Terminal window and do this:</p>
<pre>
$ cd ~/Downloads
$ unzip emacs-starter-kit-master.zip
$ mv emacs-starter-kit-master ~/.emacs.d
</pre>
Alternatively, if you are using git (the preferred method), then clone the starter kit from github. Open a Terminal window and do this:
</p>
<pre>
$ git clone git://github.com/kjhealy/emacs-starter-kit ~/.emacs.d
</pre>
<p>
<strong>2.</strong> Inside the file <code>kjhealy.org</code>, change the paths to any BibTeX databases as described at the top of that file.
</p>
<p>
<strong>3.</strong> Rename the starter kit's <code>kjhealy.org</code> file to that of <code>%your-username%.org</code> or <code>%your-systemname%.org</code>, based on the information you noted in 0.4 above. This is where you can add in any of your own further customizations to Emacs.
</p>
<p>
<strong>4.</strong> Launch Emacs.
</p>
<p>
When you first start Emacs after installing the starter-kit, it will try to contact several package repositories, so make sure you have an internet connection. The kit will download packages mainly from the official <a href="http://http://elpa.gnu.org" title="Welcome to ELPA">GNU ELPA repository</a> and the <a href="http://melpa.milkbox.net" title="MELPA">MELPA Repo</a>. Each package will be fetched, compiled by Emacs, and stored in the <code>~/.emacs.d</code> directory. This process is sometimes prone to hiccups as packages are fetched from the servers, so please be patient with it. If it doesn't get everything first time around, quit and relaunch Emacs, and it will try again. If the problem persists—especially if you get a message saying "The package 'auctex' is not available for installation"—you can manually install packages as follows. Open Emacs, do <code>M-x list-packages</code> and in the resulting buffer search or scroll down the list to, e.g. Auctex, mark it for installation by pressing <code>i</code> and then install it (or them) by hitting <code>x</code>. With the packages in place, restart Emacs and the starter kit will finish setting itself up. Unfortunately, I can't control these intermittent installation errors. They seem to have something to do with the way Emacs talks to the GNU ELPA package server.
</p>
<p>
<strong>5.</strong> (Optional.) Once Emacs is up and running, do <code>M-x starter-kit-compile</code> to byte-compile the starter-kit's files, for slightly faster loading.
</p>

View file

@ -0,0 +1,10 @@
---
type: page
title: "Code and Data"
---
<h2>Code on GitHub</h2>
<p>These are ordered by most recent commit to the repository.</p>
{{< ghStarred url="https://api.github.com/user/5760/repos?type=public&sort=pushed&user:kjhealy" >}}