[OS X TeX] Bibtex: How to check if there's content in the stack?

Niels Kobschätzki n.kobschaetzki at googlemail.com
Sun Mar 11 08:12:05 CET 2007


Hi!

I'm modifying here a bibtex-style thus it fits the needs for my  
faculty. Now I have only one problem

I've added a new translation-field for a translation of the title.
The function for it looks like:

FUNCTION {format.translation}
{translation empty$
   { title empty$
     { "" }
     { "{\glqq}" title * "{\grqq}" * }
   if$
   }
   { write$
       " [" translation * "]" *
       mid.sentence 'output.state :=}
if$
}

(right now I'm not sure if the mid.sentence 'output.state := is  
necessary… I copied it from another function… I'm in the hacking- 
around-state without really knowing what I am doing and fiddling  
around with try'n'error)

If I have now an item which includes a translation everything is  
fine. For items w/out a translation I get the error:
"the literal stack isn't empty for entry <item-name>"

If I do a pop$ after calling format. translation everything works  
fine for items w/out translation but I get an error for items with  
translation:
"You can't pop an empty literal stack for entry <item-name>"

Is there any possibility to check if the stack has an item on top and  
if it has it shall do a pop$, if not it just shall do nothing (skip$  
right?)

Google didn't really help and the documentation and tutorials for  
creating own bibtex-styles is imho quite meager…

Thanks in advance

Niels


------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list