home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.text.tex
- Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!math.fu-berlin.de!news.th-darmstadt.de!news!gerd
- From: gerd@intellektik.informatik.th-darmstadt.de (Gerd Neugebauer)
- Subject: Re: questions about .bst language
- Sender: news@news.th-darmstadt.de (The News System)
- Message-ID: <GERD.92Nov17173044@kim.intellektik.informatik.th-darmstadt.de>
- In-Reply-To: llew@wpi.WPI.EDU's message of 17 Nov 1992 01: 29:50 GMT
- Date: Tue, 17 Nov 1992 17:30:44 GMT
- References: <1e9hueINNqo2@bigboote.WPI.EDU>
- Nntp-Posting-Host: kim.intellektik.informatik.th-darmstadt.de
- Organization: TH Darmstadt
- Lines: 79
-
- >>>>> On 17 Nov 1992 01:29:50 GMT, llew@wpi.WPI.EDU (Lok C. Lew Yan Voon) said:
- In article <1e9hueINNqo2@bigboote.WPI.EDU> llew@wpi.WPI.EDU (Lok C. Lew Yan Voon) writes:
-
- LCLYV> NNTP-Posting-Host: wpi.wpi.edu
-
- LCLYV> i've a slight understanding of the .bst language from reading the
- LCLYV> style files and the doc.
- LCLYV> however, i've a couple of problems.
-
- Maybe you should consider reading the following document:
-
- @Manual{ Patashnik:Designing,
- title = "Designing {\BibTeX} styles",
- author = "Oren Patashnik",
- year = "1988",
- month = jan,
- note = "The part of \BibTeX's documentation that's not meant for
- general users"
- }
-
- It explains a lot. Nevertheless I can give some hints.
-
- The bst language is stack oriented --- like PostScript or Forth.
- Arguments are passed to procedured via the stack and results are placed on
- the stack.
-
- LCLYV> 1. i don't understand a statement like
- LCLYV> { duplicate$ empty$
- LCLYV> can someone try to explain it?
-
- duplicate$ takes the top of stack and duplicates it. I.e. its twice on the
- stack afterwards.
-
- empty$ takes the top of stack and compares it against the empty string.
- It places one of the boolean values 0 or 1 on the stack depending on the
- result.
-
- I am pretty shure that this construct is part of a conditional. I.e. lateron
- you can find a if$.
-
- LCLYV> 2. somewhere else i see
- LCLYV> { ":" * pages
- LCLYV> don't we need 2 variables to the left of '*'? i only see one?
-
- Same trick again. The concatenation operator * takes two arguments
- fron the stack and places the concatenated string back. The arguments
- need not to be given just before the * but can be computed or pushed
- to the stack earlier.
-
- LCLYV> 3. i've been playing around with unsrt.bst and the article functions.
- LCLYV> i need to output pages as, e.g., 1120 instead of 1120-1124.
- LCLYV> i think i only need to modify 2 functions (reproduced below):
- LCLYV> format.pages and/or format.vol.num.pages
- LCLYV> what are the required modifications? i can't see how to access
- LCLYV> the initial page number.
- LCLYV> i occasionally see (e.g. in n.dashify)
- LCLYV> t #1 #1 substring$ "-" =
- LCLYV> so it seems like t starts with "-" (if present). whatever happened
- LCLYV> to the initial page number?
-
- Well, in n.dashify t is defined and used as variable. A loop graps the
- first character until a - is found. This is the place where you want
- to jump in and simply discart the remaining charaters in t. In the
- meantime the top of stack contains the initial string.
-
- It should be rather simple to understand once you have mastered the document
- mentioned above.
-
- Note: the .bst language is as easy as other programming languages once
- you have a (usable) manual.
-
-
-
- --
- ____ ___ __ ___ Gerd Neugebauer
- / / /___) /' ) /___) FG Intellektik, FB Informatik, TH Darmstadt
- (___/- (___ / / (___ Alexanderstr. 10, D-6100 Darmstadt
- _____/_____________________ Phone: (+49) 6151 16-5382
- (____/ Net: gerd@intellektik.informatik.th-darmstadt.de
-