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 39, there is this example for a multiplication function:

INTEGERS { a b }

  ’a := %% we store the first value
  ’b := %% we store the second value

  b #0 < %% We remember the sign of b, and
    {#-1 #0 b - ’b :=} %% then consider its absolute value.
    {#1} %%

why are there b's that are not preceded by a '? Shouldn't all b's refer to the same b, the b that was declared inside INTEGERS, and should be preceded by a '?

share|improve this question
up vote 4 down vote accepted

The syntax of BibTeX is such that

#1 'a :=

is an assignment, with the variable named a being set to the value 1, while

a #1 =

is a comparison, with the value of the variable a inserted and compared to 1.

BibTeX is a stack language, so more generally 'a leaves the name of the variable on the stack while just a leaves the value on the stack.

share|improve this answer

The line {#-1 #0 b - ’b :=} means: set the value of the variable whose name is 'b to the value of obtained by the operation where the value of one of the operand is b (the value currently stored by the variable 'b.

share|improve this answer
So b refers to the value of the variable whose name is 'b. Is that right? – Mika H. Dec 4 '12 at 4:49
Yes, it is correct – Guido Dec 4 '12 at 7:41

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.