Home Open Source Classics

About

Open Source Classics is a directory and how-to guide for free and open source programs and resources useful to classicists, as well as a place for musings about the relationship of scholarship to free and open source principles. Continue the conversation at the Open Source Classics Forum and Technology Forum. Have a recommendation for an article? Interested in becoming a contributor? Email the editors.

Login

Open Source Classics
Emacs, AUCTex, and XeLaTeX
Written by Kyle P. Johnson   
Sunday, 03 May 2009 19:36

For those who don't know, Emacs is not your average text editor. On the one hand, it is utterly simple in appearace and function, evoking for me memories of the Commodore 64. On the other hand, Emacs has a multitude of powerful functions for working with code of various sorts. Emacs is extensible, which means that there are extension packages that one can add to the program in order to customize and enhance it. For those using LaTeX, the AUCTeX package is especially useful, as it enables special menus for macros and commands for typing. Configuring Emacs is not difficult if you know exactly what to do.

This posting describes a how to quickly begin composing and compiling TeX–based documents with Emacs.

1) Install Emacs. If possible, I recommend installing the "snapshot" release of GNU Emacs, which I find an improvement over v. 22, including improved Unicode support.

A. If on Ubuntu, enter into the Terminal:

sudo apt-get emacs-snapshot

For installation on other Unix–based systems, find installation information here.

B. On Mac OS X, get Aquamacs or Carbon Emacs. Just download and drag into your Applications folder.

C. On Microsoft Windows, look here for information.

 

2) Install AUCTeX package to Emacs. 

A. On Ubuntu and other Linux systems, download and unarchive AUCTeX. (For more detailed instructions, see "INSTALL" file, within the downloaded folder.) If you unpacked the file to the desktop, in the Terminal, "cd" to:

cd/home/yourname/Desktop/auctex-11.85

[Note: be sure to change "yourname" here to your username.]

Then:

./configure

Then:

make

Then:

sudo make install

Look for a hidden .emacs file in your home folder. (To see hidden files, use "control-H" or in GNOME go to menu "View ––> Show Hidden Files".) If this file does not exist, make one. Into this file, copy and paste the following:

(load "auctex.el" nil t t)

You also need to let Emacs know where to find your TeX installation. If using TeXLive 2008, as I recommend, add the following:

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/texlive/2008/bin/i386-linux"))

    (setq exec-path (append exec-path '("/usr/local/texlive/2008/bin/i386-linux")))

Save and close the .emacs file. Restart Emacs, then open a file ending with a .tex extension and the AUCTeX options should appear.

B. If using Aquamacs or Carbon Emacs, you're in luck – AUCTeX comes pre–installed.

C. I do not have access to a Windows platform, so I can only point one to the Windows directions offered by AUCTeX.

 

3) Configure Emacs to run XeLaTeX. If you are as big a fan of XeLaTeX as I am, then you need to add it to the list of Emacs's commands.

A. On Linux, put the following into your .emacs file, which will make XeLaTeX the default installation:

 ;;set xetex mode in tex/latex
(add-hook 'LaTeX-mode-hook (lambda()
(add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t))
(setq TeX-command-default "XeLaTeX")
(setq TeX-save-query nil)
(setq TeX-show-compilation t)
))

While you are in the .emacs file, add Flyspell, improved spell–checking:
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
Save and close your .emacs file and restart Emacs. Now, to run XeLaTeX, type "control-c, control-c", then return; or go to the menu "Command ––> XeLaTeX".
[Note: if you do not want XeLaTeX to be your default TeX command, follow the directions for for Mac OS X, 3.B., below, only replace the command "%`xelatex --synctex=1%(mode)%' %t" with "%`xelatex%(mode)%' %t".]

B. On Aquamacs or Carbon Emacs, do the following (taken from directions here):

i) Open a .tex buffer
ii) Go to the following LaTeX menu: "LaTeX ––> Customize AUCTeX ––> Extend this Menu"
iii) In this expanded menu, choose "TeX Command ––> "TeX Command List…"
iv) Click on "INS" to create a new entry
v) Name: XeLaTeX
vi) Command: %`xelatex --synctex=1%(mode)%' %t
vii) Click in the "Modes" button and choose "Value Menu ––> Set"
viii) Check the boxes for: LaTeX, ConTeXt, AmSTeX
ix) Save the settings

Now you can run XeLaTeX through the menu "Command ––> XeLaTeX".

C. On a Windows version of Emacs, the directions should be similar to the Mac OS X directions, though I do not know exactly what command shouldbe entered the Command entry when customizing (maybe "%`xelatex%(mode)%' %t").

 4. Learn how to use Emacs. Emacs retains archaic commands for basic operations like copying, cutting, pasting, and saving. For a beginner's tutorial, see here. A major benefit to Aquamacs for Mac OS X is that it comes configured to standard commands, like, "Command-C" for copying.

 
Installing TexLive 2008 on Ubuntu 9.04 (Jaunty Jackalope)
Written by Kyle P. Johnson   
Sunday, 03 May 2009 18:19

There are a number of how–tos and forum entries out there for installing TexLive 2008 and getting it to work on your computer, though in this post I am consolidating and simplifying this information.

Beginning from a clean install of Ubuntu 9.04 (Jaunty Jackalope), I downloaded TexLive 2008 through the automated installer, which this time worked flawlessly (unlike last time I tried it).

After the suite is installed, you must set path, which tells your computer where to find the new software. If you followed the default installation pathway (which I recommend), then enter:

PATH=/usr/local/texlive/2008/bin/i386-linux:$PATH 

Next, you must run a texhash, which isn't functioning normally for some on Jaunty. For me, when I ran "sudo texhash", I got the following error:

texhash: /usr/local/texlive/2008/texmf: directory not writable. Skipping...
texhash: /usr/local/
texlive/2008/texmf-config: directory not writable. Skipping...
texhash: /usr/local/
texlive/2008/texmf-dist: directory not writable. Skipping...
texhash: /usr/local/
texlive/2008/texmf-doc: directory not writable. Skipping...
texhash: /usr/local/
texlive/2008/../texmf-local: directory not writable. Skipping...
texhash: /usr/local/
texlive/2008/texmf-var: directory not writable. Skipping...
texhash: Done.

In order to remedy this problem, I followed some directions that I found here. First, enter:

sudo ln -s /usr/local/texlive/2008/bin/i386-linux/texhash /usr/bin/texhash

then run "sudo texhash". This time, you'll get an error saying that "kpsewhich" cannot be found. Then run:

sudo ln -s /usr/local/texlive/2008/bin/i386-linux/kpsewhich /usr/bin/kpsewhich

Again, run "sudo texhash". You will get an error concerning "kpsestat". Run:

sudo ln -s /usr/local/texlive/2008/bin/i386-linux/kpsewhich /usr/bin/kpsewhich

Repeat this process with "kpseaccess" and a few other unfound items. After a few rounds of this the texhash will run all the way through.

Finally, run one more path, for good measure:

PATH=/usr/local/texlive/2008/bin/i386-linux:$PATH

Opening up a terminal, I was able to confirm that TexLive was properly installed and configured by typing into the Terminal:

xelatex -v

The output should read something like:

XeTeX 3.1415926-2.2-0.999.6 (Web2C 7.5.7)
kpathsea version 3.5.7
Copyright 2008 SIL International.
Kpathsea is copyright 2008 Karl Berry and Olaf Weber.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Kpathsea written by Karl Berry, Olaf Weber, and others.

Compiled with ICU version 3.8.1 [with modifications for XeTeX]
Compiled with zlib version 1.2.3; using 1.2.3
Compiled with FreeType2 version 2.3.7; using 2.3.7
Compiled with fontconfig version 2.3.1; using 2.6.0
Compiled with libpng version 1.2.29; using 1.2.29
Compiled with xpdf version 3.02pl2

Happy TeXing!

 
TexLive 2008 Installation
Written by Kyle P. Johnson   
Monday, 30 March 2009 15:13

Last summer I began a series of postings about the use of TeX in classics, namely how to install TeX Live and how to create a basic article. The next step is to look into XeTeX, a new version of TeX which allows for unicode input and, hence, the use of modern fonts. XeTeX is becoming the standard for work in TeX–based input for those working in non–Latin scripts, including Ancient Greek.

 

The latest distribution of XeTeX is included in the latest and most convenient of distributions of TeX in the form of TeX Live 2008. This entry points users on Linux, Mac OS X, and Microsoft Windows operating systems to places to download TeX Live 2008 and where to find simple instructions on installation and configuration.

 

Linux: I obtained TeX Live 2008 on Ubuntu 8.10 (Intrepid Ibex) and following these instructions. In my experience, I had trouble using the "Tex Live installation over the Internet" option because the connection kept getting stalled (due to their connection or mine, I don't know). I ended up downloading the .ISO image, mounting it with Gmount-iso, and installing the software according to TeX Live's Quick Install guide. I have yet to find a program (some recommend Winefish) that I am happy with, so I have been a text editor and Terminal (e.g., pdflatex, xelatex, etc.).

 

Mac OS X: Download and installation on a Mac could not be easier. Go to the nice people at MacTeX, who have made a simple installable bundle. Download and expand the MacTeX.mpkg.zip package, unzip it, mount the image, and use the installer. MacTeX puts a folder in your Applications folder called "TeX", in which you will find TeXShop, a fantastic editor, compiler, and viewer, and BibTeX, a good program for managing bibliographies.

 

Microsoft Windows: For TeX Live on a Microsoft platform, download Tex Live 2008, then follow the general directions, as well Windows-specific directions. Run the installer and hopefully everything will be fine. If you encounter any troubles, try instead MikTeX, which contains a TeX distribution, an easy-to-use installer, and software for editing and compiling TeX documents. Note: MikTeX version 2.7 contains XeTeX version 0.997, several versions older than the most up-to-date XeTeX, version 0.999.6. This older  version will not suffice, I believe, for the more exciting XeTeX example to be offered here at Open Source Classics. There is a new MikTeX on the way (v. 2.8), though, and this may have a newer XeTeX.

 
Collaborative Scholarship with LaTeX and Subversion
Written by Kyle P. Johnson   
Saturday, 14 March 2009 11:33

There is an interesting post and thread at Slashdot about the possibility of using Subversion, open source software for keeping track of versions written by numerous collaborators, with LaTeX, or any file type, for that matter. Some mention the usefulness of Google Docs, others Git, an alternative to Subversion. Microsoft Word has version tracking, I know, though I have always figured that such a feature would render the program near inoperable. Is this people's experience with Word's version tracking?

Any thoughts about a Subversion or Git system on Hephaistos Text? These would seem a better way to keep projects, even those with only a few members, up-to-date and keep collaborators productive. Privacy settings could be set for each project, so that authors could control exactly who can view the work being done.

 
How to Subscribe to an RSS Feed
Written by Kyle P. Johnson   
Friday, 06 March 2009 18:14

This blog has RSS syndication, which allows you to be notified of new content without needing to navigate directly here. There are a number of ways to receive an RSS feed. Here are a few.

For those using Microsoft Windows, try RSSOwl (http://www.rssowl.org/download), a free and open program.

On the Mac, Vienna (http://www.vienna-rss.org/vienna2.php) and RSSOwl is also good native OS X program.

On Linux, I use Liferea. To get it on Ubuntu, just enter into the terminal:

 sudo aptitude install liferea

I feel the need to mention Google Reader (http://reader.google.com), which, while definitely not FOSS, is a very convenient web-based option.

You will know if a website has a feed if there is an orange radio-wave icon in your web browser's location bar. You may click on this icon or copy the blog's URL, then paste it into your new RSS application. Opens Source Classics's RSS feed is located at:

 http://hephaistos-text.org/index.php?option=com_content&view=category&layout=blog&id=40&Itemid=53

 
«StartPrev123NextEnd»

Page 1 of 3