home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / text / tex / 13217 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.6 KB  |  93 lines

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!math.fu-berlin.de!news.th-darmstadt.de!news!gerd
  3. From: gerd@intellektik.informatik.th-darmstadt.de (Gerd Neugebauer)
  4. Subject: Re: questions about .bst language
  5. Sender: news@news.th-darmstadt.de (The News System)
  6. Message-ID: <GERD.92Nov17173044@kim.intellektik.informatik.th-darmstadt.de>
  7. In-Reply-To: llew@wpi.WPI.EDU's message of 17 Nov 1992 01: 29:50 GMT
  8. Date: Tue, 17 Nov 1992 17:30:44 GMT
  9. References: <1e9hueINNqo2@bigboote.WPI.EDU>
  10. Nntp-Posting-Host: kim.intellektik.informatik.th-darmstadt.de
  11. Organization: TH Darmstadt
  12. Lines: 79
  13.  
  14. >>>>> On 17 Nov 1992 01:29:50 GMT, llew@wpi.WPI.EDU (Lok C. Lew Yan Voon) said:
  15. In article <1e9hueINNqo2@bigboote.WPI.EDU> llew@wpi.WPI.EDU (Lok C. Lew Yan Voon) writes:
  16.  
  17. LCLYV> NNTP-Posting-Host: wpi.wpi.edu
  18.  
  19. LCLYV> i've a slight understanding of the .bst language from reading the
  20. LCLYV> style files and the doc.
  21. LCLYV> however, i've a couple of problems.
  22.  
  23. Maybe you should consider reading the following document:
  24.  
  25. @Manual{ Patashnik:Designing,
  26.   title =     "Designing {\BibTeX} styles",
  27.   author =     "Oren Patashnik",
  28.   year =     "1988",
  29.   month =     jan,
  30.   note =     "The part of \BibTeX's documentation that's not meant for
  31.              general users"
  32. }
  33.  
  34. It explains a lot. Nevertheless I can give some hints.
  35.  
  36. The bst language is stack oriented --- like PostScript or Forth.
  37. Arguments are passed to procedured via the stack and results are placed on 
  38. the stack.
  39.  
  40. LCLYV> 1. i don't understand a statement like
  41. LCLYV>     { duplicate$ empty$
  42. LCLYV> can someone try to explain it?
  43.  
  44. duplicate$ takes the top of stack and duplicates it. I.e. its twice on the 
  45. stack afterwards.
  46.  
  47. empty$ takes the top of stack and compares it against the empty string.
  48. It places one of the boolean values 0 or 1 on the stack depending on the
  49. result.
  50.  
  51. I am pretty shure that this construct is part of a conditional. I.e. lateron 
  52. you can find a if$.
  53.  
  54. LCLYV> 2. somewhere else i see
  55. LCLYV>     { ":" * pages
  56. LCLYV> don't we need 2 variables to the left of '*'? i only see one?
  57.  
  58. Same trick again. The concatenation operator * takes two arguments
  59. fron the stack and places the concatenated string back. The arguments
  60. need not to be given just before the * but can be computed or pushed
  61. to the stack earlier.
  62.  
  63. LCLYV> 3. i've been playing around with unsrt.bst and the article functions.
  64. LCLYV> i need to output pages as, e.g., 1120 instead of 1120-1124.
  65. LCLYV> i think i only need to modify 2 functions (reproduced below):
  66. LCLYV> format.pages and/or format.vol.num.pages
  67. LCLYV> what are the required modifications? i can't see how to access
  68. LCLYV> the initial page number.
  69. LCLYV> i occasionally see (e.g. in n.dashify)
  70. LCLYV>     t #1 #1 substring$ "-" =
  71. LCLYV> so it seems like t starts with "-" (if present). whatever happened
  72. LCLYV> to the initial page number?
  73.  
  74. Well, in n.dashify t is defined and used as variable. A loop graps the
  75. first character until a - is found. This is the place where you want
  76. to jump in and simply discart the remaining charaters in t. In the
  77. meantime the top of stack contains the initial string.
  78.  
  79. It should be rather simple to understand once you have mastered the document
  80. mentioned above.
  81.  
  82. Note: the .bst language is as easy as other programming languages once
  83.       you have a (usable) manual.
  84.  
  85.  
  86.  
  87. --
  88.      ____   ___    __   ___       Gerd Neugebauer
  89.     /   /  /___) /'  ) /___)     FG Intellektik, FB Informatik, TH Darmstadt
  90.    (___/- (___  /   / (___      Alexanderstr. 10, D-6100 Darmstadt
  91.  _____/_____________________   Phone: (+49) 6151 16-5382
  92. (____/                        Net: gerd@intellektik.informatik.th-darmstadt.de
  93.