Archives: LaTeX

Bibbreviate: a Python package for BibTeX journal abbreviations

Journal abbreviations and BibTeX drive me nuts.  Some journals demand that you submit manuscripts with abbreviated journal titles in the bibliography, while others want fully spelled-out names.  The only solution that I’m aware of is to keep two .bib files, one with abbreviate names and one without.  However, this means keeping two .bib files up to date, and I don’t know how people do that without tearing their hair out.  This got so annoying that I finally wrote a Python script to use the JabRef abbreviations lists to flip back and forth as needed.  That way, I can keep one master .bib file and abbreviate it when I need to.

The results aren’t always perfect, but they do cut out 90+% of the find-and-replace work needed to handle a journal that asks for abbreviate titles.  If you need that too, you can download the package from pypi, or grab it from my GitHub repo.  Fixes and feature additions are welcome, so feel free to fork it and send a pull request!

Fixing HieroTeX on OS X Lion.

I have some weird hobbies, including puttering with ancient languages.  As part of that, I’d like to be able to typeset Egyptian hieroglyphic (not ‘hieroglyphics':  pet peeve of mine.  Hieroglyphic is the language, hieroglyphs are the characters;  saying ‘hieroglyphics’ is like saying ‘I speak Frenchs’) in LaTeX using TeXShop for OS X.  There’s a great package for doing this, HieroTeX, and TeXShop actually comes with clear and usable instructions for installing it to work on a Mac (see the instructions in ~/Library/TeXShop/Engines/Inactive/Hiero).  Unfortunately, there’s one problem:  HieroTeX, as it is currently compiled and distributed, is a PowerPC application that requires Rosetta to run.  Since Lion has been removed from Lion, the first time you try to typeset anything using TeXShop and HieroTeX, the process will fail with a pop-up telling you that the executable file sesh is no longer supported because it is a PowerPC application.

I’ve managed to recompile the sesh executable from source on a Lion machine.  If you’re running TeXShop on Lion, this may help you.

Here’s how to fix this.  The short version:

  2. Download from here, and unzip the file (let’s say onto your Desktop).
  3. Place the new sesh into /usr/texbin (you will likely be asked for your admin password):   cd ~/Desktop; sudo cp sesh /usr/texbin

This isn’t guaranteed to work at all, but I’ve tested it with TeXShop 3.06 running on Lion (10.7.2).  Lion should be the only version of OS X that requires this fix (I think).

The long way is to recompile sesh from source yourself.  If you want to do that, you’ll need to grab the source from here.  Get the file called HieroTex.tar.gz and unzip it.  It will create a source tree with the sesh source in the Seshnesu subdirectory.  To make it, use make sesh (or muck with the variables in HieroTex/ first, but it worked for me without changes).  Unfortunately, trying to compile the unmodified source will fail because the code uses malloc.h, which is outdated and won’t be found on Lion.  To fix this, grep the source files and replace every instance of #import <malloc.h> with #import <stdlib.h>, unless it has already been imported elsewhere in the file, in which case just delete the malloc line.  It should compile now, and you can move it to the texbin directory as above.  After that, TeXShop should successfully typeset HieroTeX.  A word of warning:  the first round of typesetting after installing HieroTeX and replacing sesh will take forever as the fonts get sorted out.  Just go get yourself a drink and wait.  If you like, here’s a simple file to test the install that I got from the HieroTeX manual:

A1 end{hieroglyph}

If this file is successfully typeset by TeXShop, you’re up and running!