jeremykidwell.info/public/resources/emacs-starter-kit/index.html
Jeremy Kidwell 13e2fd6e74 first commit
2017-06-26 20:57:02 +01:00

239 lines
14 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,partials=1">
<meta name="description" content="">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1 minimal-ui">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@kidwellj">
<meta name="twitter:title" content="An Emacs Starter Kit for the Social Sciences : jeremykidwell.info">
<meta name="twitter:creator" content="@kidwellj">
<meta name="twitter:description" content="">
<meta name="twitter:image:src" content="">
<meta name="twitter:domain" content="jeremykidwell.info">
<base href="https://jeremykidwell.info/">
<title> An Emacs Starter Kit for the Social Sciences </title>
<link rel="canonical" href="https://jeremykidwell.info/resources/emacs-starter-kit/">
<link href="https://jeremykidwell.info/resources/emacs-starter-kit/index.xml" rel="alternate" type="application/rss+xml" title="An Emacs Starter Kit for the Social Sciences" />
<link rel="stylesheet" href="https://jeremykidwell.info/css/stylesheet-min.css" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript" src="https://use.typekit.com/kpn7wwu.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<link rel="shortcut icon" href="https://jeremykidwell.info/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="https://jeremykidwell.info/apple-touch-icon.png" />
</head>
<body lang="en" itemscope itemtype="http://schema.org/Article">
<div id="topbar">
<div class="wrapper">
<header>
<nav class="navbar">
<ul>
<li><a href="https://jeremykidwell.info/">Jeremy Kidwell</a></li>
<li><span> <a class="" href="https://jeremykidwell.info/publications">Publications </a></span>
<li><span> <a class="" href="https://jeremykidwell.info/resources">Resources </a></span>
<li><span> <a class="" href="https://jeremykidwell.info/teaching">Teaching </a></span>
<li><span> <a class="" href="https://jeremykidwell.info/blog">Blog </a></span>
</ul>
</nav>
</header>
</div>
</div>
<div class="wrapper">
<div class="units-row">
<div class="unit-centered unit-80">
<article class="post" id="content">
<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>
<p>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&rsquo;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&rsquo;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 &ldquo;The package &lsquo;auctex&rsquo; is not available for installation&rdquo;—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&rsquo;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></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&rsquo;s files, for slightly faster loading.
</p></p>
</article>
</div>
</div>
</div>
<hr class="separator">
<div class="wrapper" style="font-size: 0.9em; line-height: 1.05em;">
<div class="units-row units-padding">
<div class="unit-40">
<h3>about</h3>
<figure class="image-left">
<img class="avatar" src="files/misc/jkpic.jpg" height="120" width="120">
</figure>
<p>I am Lecturer in <a href="http://www.birmingham.ac.uk/schools/ptr/index.aspx">Theological Ethics</a> at <a href="http://www.birmingham.ac.uk">the University of Birmingham</a>.</p>
</div>
<div class="unit-30">
<h3>Where</h3>
<ul class="compact fa-ul">
<li><i class="fa-li fa fa-university fa-fw" style="color:#03396c;font-size:80%;padding-top:6px;"></i>Department of Theology and Religous Studies, University of Birmingham, Edgbaston, Birmingham, B15 2TT, UK.</li>
<li><i class="fa-li fa fa-envelope fa-fw" style="color:#03396c;font-size:80%;padding-top:6px;"></i><a href="mailto:j.kidwell@bham.ac.uk">j.kidwell@bham.ac.uk</a></li>
<li><i class="fa-li fa fa-twitter-square fa-fw" style="color:#03396c;font-size:80%;padding-top:6px;"></i><a href="http://twitter.com/kidwellj">@kidwellj</a> on Twitter.</li>
<li><i class="fa-li fa fa-github fa-fw" style="color:#03396c;font-size:80%;padding-top:6px;"></i><a href="http://github.com/kidwellj">On GitHub</a>.</li>
<li><i class=""></li>
</ul>
</div>
<div class="unit-30">
<h3>subscribe</h3>
<p>To receive updates from this site, you can
subscribe to the <a href="https://jeremykidwell.info/index.xml"><i class="fa fa-rss-square" style="color:#03396c;"></i>&nbsp;RSS feed</a> of all updates to the site in an RSS feed reader</p>
<h3>search</h3>
<a id="searchsite">
<form method="get" action="https://duckduckgo.com/">
<input type="search" name="q" maxlength="255" placeholder="Search the site">
<input type="hidden" name="sites" value="jeremykidwell.info"/>
<input type="hidden" name="k7" value="#faf8f8"/>
<input type="hidden" name="kj" value="#b33"/>
<input type="hidden" name="ky" value="#fafafa"/>
<input type="hidden" name="kx" value="b"/>
<input type="hidden" name="ko" value="-1"/>
<input type="hidden" name="k1" value="-1"/>
<input type="submit" value="DuckDuckGo Search" style="visibility: hidden;" /></form></a>
</div>
</div>
</div>
</div>
<footer id="footer">
<section class="wrapper small">Powered by <a href="http://gohugo.io">Hugo</a> and <a href="http://imperavi.com/kube/">Kube</a>. &copy; Jeremy Kidwell 2017&ndash;2017.
</section>
</footer>