TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to read about .bst files from Tame the Beast. On page 38, there is this example for a negation function:

{   { #0 }
    { #1 }

I don't understand what #0 and #1 are. Also, in the definition of if on page 33, it requires three arguments I F1 F2, but in the code why are there only two?

share|improve this question
up vote 4 down vote accepted

{#0} and {#1} are equivalent to F1 and F2. And I is the top of the stack before you call not (I is the value to negate). If I is true, if$ executes F1 (here #0, i.e. false). If I is false, if$ executes F2 (here #1, i.e. true).

share|improve this answer
I see, thanks Paul! Are #0 and #1 universal constants in .bst? And are there #2, #3, #4, ...? (I'm asking because I don't see it mentioned anywhere in Tame the Beast.) – Mika H. Dec 4 '12 at 1:24
@MikaH.: # is the prefix for integers (see note 36 p. 32). – Paul Gaborit Dec 4 '12 at 1:40
Ah, I missed that. Thanks! – Mika H. Dec 4 '12 at 2:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.