I am trying to adjust the bibliography style of natbib. There I am facing constructs like these:

FUNCTION {emphasize}
{ duplicate$ empty$
    { pop$ "" }
    { "\emph{" swap$ * "}" * }

Which language is it? I'd like to read about it to better understand it. Is there a manual? I found some documents, but none of them covered the concept in detail like the TeXbook does for TeX concepts.

  • 11
    The language has no name and, as far as I know, it's used only for programming bst files.
    – egreg
    Commented Feb 1, 2014 at 19:13
  • 2
    Have you seen e.g. tex.stackexchange.com/questions/107747/… and tex.stackexchange.com/questions/25007/…?
    – Joseph Wright
    Commented Feb 1, 2014 at 19:13
  • Okay; what would you suggest to better understand it? Is there any chance? I am trying to translate some parts to fit German citation styles (like "und" instead of "and", "Auflage" instead of edition" etc.). Is there an easier way?
    – Xiphias
    Commented Feb 1, 2014 at 19:14
  • 3
    texdoc tamethebeast is your friend. Here you can find it online.
    – egreg
    Commented Feb 1, 2014 at 19:16
  • 6
    It has no name, but it's Reverse Polish Notation, also used for decades with HP's awesome calculators. IIRC PostScript uses the same notation. Commented Feb 1, 2014 at 19:23

3 Answers 3


The BibTeX author mentions:

Here's how BibTeX works. It takes as input

  1. an .aux file produced by LaTeX on an earlier run;
  2. a .bst file (the style file), which specifies the general reference-list style and specifies how to format individual entries, and which is written by a style designer (called a wizard throughout this program) in a special-purpose language described in the BibTeX documentation - see the file btxdoc.tex; and
  3. .bib file(s) constituting a database of all reference-list entries the user might ever hope to use.

A "special-purpose language", as described in Designing BibTeX Styles, is a form of "postfix stack language":

Basically the style file is a program, written in an unnamed language, that tells BibTeX how to format the entries that will go in the reference list [..]. This programming language has ten commands [..]. These commands manipulate the language's objects: constants, variables, functions, the stack, and the entry list. (Warning: The terminology [..] chosen for ease of explanation, is slightly different from BibTeX's. For example [..] "variables" and "functions" are both "functions" to BibTeX. [..])

There are two types of functions: built-in ones that BibTeX provides [..] and ones you define using either the MACRO or FUNCTION command.

Your most time-consuming task, as a style designer, will be creating or modifying functions using the FUNCTION command [..].

Another interesting, related read would be Taming the BeaST, which attempts to provide the "B to X of BibTeX" - as complete a reference as possible.

bibtex itself is written in Web (similar to TeX). While we know it as an executable file, the original bibtex.web source is tangled into PASCAL code, and then compiled into a binary executable.


You can make your own BibTeX .bst files by running

latex makebst

which uses merlin.mbs, see here, to generate a .dbj (available here). LaTeX then compiles the .dbj file into a .bst. With this method, the command prompt will ask you a long list of questions to create the custom .bst.

An alternative is to generate .bst files by commenting/uncommenting the appropriate lines in a pre-existing .dbj file, e.g. from here, and then compile it using e.g.

latex imsi.dbj

Some example .bst files are also available on this github repo.


these cases helped me a lot. It's a simple modification in the .bst file. I had to change "and" to "&" and also modify the editor function had ", editor" in it and i changed it to "(Hrsg.)". I am using the natbib package with apalike bibliography style. It works fine for me.

Bibliography: natbib, apa-style and apacite

BibTeX: Apalike using & instead of and

Like they said, its easy to modify with TexShop or any text tool.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .