Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

FUNCTION {not}
{   { #0 }
    { #1 }
  if$
}

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
    
Welcome to TeX.sx! –  Kurt Dec 4 '12 at 1:34

1 Answer 1

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
1  
@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

 
discard

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.