How to make your personal LaTeX bibliography style

In orderBiBTeX Logo to create your personal BibTeX style all you have to do is open your terminal (OS X) or command line (Windows) and type in the following line:

latex makebst

To run the command you have to hit Enter once. Immediately, a bunch of text lines should appear on your terminal, just like the following excerpt:

christophs-macbook-air:~ christophgarms$ latex makebst
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
restricted \write18 enabled.
entering extended mode
(/usr/local/texlive/2012/texmf-dist/tex/latex/custom-bib/makebst.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,
welsh, loaded.
***********************************
* This is Make Bibliography Style *
***********************************
It makes up a docstrip batch job to produce
a customized .bst file for running with BibTeX
Do you want a description of the usage? (NO)

\yn=

So what happens is that this terminal program (Makebst) will ask you a whole lot of questions regarding your aspired personal .bst file. As you can see, the first question is if you want to have a description of its usage. To answer just type in a “y” for Yes (I know you know that) or an “n” for No, thanks. To confirm always hit Enter.

Important to know is that Makebst offers a default setting for most of the questions. Therefor if you come across a question where you don’t know how to answer, just hit Enter and the program will use its default setting for the respective issue. The first example where I always use “just Enter” is question No. 2. Makebst will ask you to enter the name of the master file. No idea :)

In question three you have to set the name of your final .bst file. That’s important! After that the program starts to ask more detailed questions about your style, for example…

STYLE OF CITATIONS:
(*) Numerical as in standard LaTeX
(a) Author-year with some non-standard interface
(b) Alpha style, Jon90 or JWB90 for single or multiple authors
(o) Alpha style, Jon90 even for multiple authors
(f) Alpha style, Jones90 (full name of first author)
(c) Cite key (special for listing contents of bib file)
Select:

\ans=

I hope you get the idea by now. From my experience, (*) is the default, so you can also hit Enter instead. Finally, after you have answered all 75 questions (own count) about your personalized BibTeX style, the last question will look like this:

Finished!!
Batch job written to file `yourstyle.dbj’
Shall I now run this batch job? (NO)

\yn=

If you answer Yes, which I recommend, the programm will run the .dbj file to create your customized .bst file. No means just keeping the .djb file for further editing and later running. You will find the created files in your file structure under something like “harddrive/users/yourusername/yourstyle.bst”.

Done. Have fun applying your own style to your next thesis or whatever. Special credits for this article go to jbumueller.com. As far as I know, this tutorial works for all standard LaTeX distributions. When writing this article, I used MacTeX but I’ve also successfully created .bst files on standard MiKTeX distributions before.

How to apply Sublime Text 2 and Skim to MacTeX on Mountain Lion

LaTeX is a very powerful platform for creating/writing professional documents. It is widely used in scientific context for writing papers and exams mostly because of it’s robustness when it comes to typesetting large documents. This is a short abstract on my experiences setting up LaTex with my favorite text editor Sublime Text 2 on Mac.

The first task is to download and install the MacTeX Package. The download is available on the MacTeX Users Group website under http://www.tug.org/mactex/. The regular MacTeX download file is about 2 GB big. After completing the download, just run the installer and follow the regular instructions to install the package. I strongly recommend to always install the latest or 2nd to latest version of MacTeX.

Next step is to choose an editor to work with. There’s tons of software out there to create full LaTeX documents. The MacTex package includes the open source program TeXShop. Others, like Latexian, LaTeXiT, or TexMaker are easily find and freely downloadable. This tutorial, however, focuses on the editor Sublime Text 2 (ST2) available under http://www.sublimetext.com/2. ST2 is available for free as a test-version without functional limitations or a time limit. If you start using ST2 on a regular basis, I recommend to purchase a license in order to support further development of ST2. Download ST2 and run the installer. ST2 supports all major syntaxes including LaTeX, BibTeX, etc.

In order to enjoy the full power of ST2 you need to install a couple of extra tools.

Strongly recommandable is the open source extension Package Control. Will Bonds “full featured package manager” enables users to find and install available add-ons directly in ST2. It also keeps everything up to date installing new versions automatically. It is important to read the instructions available at Package Control’s website carefully. In my humble opinion, an awesome package!

To open Package Control in ST2 hit cdm+shift+p. The Sublime Command Palette will open and you can browse all options including the newly installed Package Control items like ‘Install Package’. There you will find lots of add-ons like iTodo, jQuery bundle, WordCount, or LaTeXTools.

Package Control

ST2 Command Palette - Package Control options

In order to see the result of your LaTeX code you need to have a PDF viewer. There’s tons of good stuff out there – for this tutorial please install Skim the usual way.

At the heart of this tutorial stands the installation of the LaTexTools package. To simplify working with LaTeX documents in ST2 LaTexTools is the main package you need to install. It enables, for example, compiling of your LaTeX source via hotkey, showing a logfile with warnings and errors, as well as launching the Skim PDF viewer at the current cursor position. Just find and install LaTexTools easily via Package Control.

Finally, you should now be able to compile your .tex code using hotkey cmd+b. The Skim editor will open and jump to the pdf spot of the corresponding cursor position in ST2.

Hint: Right after everything was set and seemed to work fine, I started trying to edited different existing .tex documents. Surprisingly, Skim would not open automatically when compiling (command + b) certain documents. My first thoughts were rotating about errors in the LaTexTools package or missing statements in the .tex file as the problem only occured in some documents. Turns out after consulting miscellaneous google hits it’s a language specific problem. I’m from Germany and we have those strange characters with two dots on top called “Umlaute”. Skim does not show up when compiling documents that are located in folders which contain one or more Umlaute (ä,ü,ö) in the folder name. After changing the folders everything just works great!