Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!masscomp!think.com!paperboy!hsdndev!husc6!bespin!kochhar From: kochhar@harvard.harvard.EDU (Sandeep Kochhar) Newsgroups: comp.text.tex Subject: Bibtex question Keywords: Keys Message-ID: <6458@husc6.harvard.edu> Date: 19 Apr 91 17:33:04 GMT Sender: news@husc6.harvard.edu Reply-To: kochhar@harvard.harvard.EDU (Sandeep Kochhar) Distribution: usa Organization: Aiken Computation Laboratory, Harvard University Lines: 80 Hi! Here's a (simple?) question for bibtex style-file hackers... I was trying to develop a ".bst" style that would print out as label the citation key as used in the ".bib" file. e.g. @ARTICLE{foobar, ... ... } would produce the command \bibitem[foobar]{foobar} ... in the ".bbl" file. Seemed fairly easy. The original alpha style had the function: FUNCTION {output.bibitem} { newline$ "\bibitem[" write$ label write$ "]{" write$ cite$ write$ "}" write$ newline$ "" before.all 'output.state := } All I did was change the line "label write$" to "cite$ write$", getting: FUNCTION {output.bibitem} { newline$ "\bibitem[" write$ cite$ write$ "]{" write$ cite$ write$ "}" write$ newline$ "" before.all 'output.state := } It worked fine, except for labels that had underscores. These caused latex to choke... e.g. @ARTICLE{foo_bar, ....} would produce \bibitem[foo_bar]{foo_bar}, which upsets latex. I can fix the ".bbl" file by hand to prefix all underscores by a backslash. This pleases latex. However, I'd like to automate this process. Any ideas on how to write a function in bibtex (".bst") to convert the underscores to "backslash-underscore"... (note: purify$ doesn't work since it *removes* the underscore) (Note: I'd heard that there was a keys.bst somewhere, but I can't locate it.... Anyone know?) Thanks -- Sandeep Kochhar Harvard University email: kochhar@harvard.harvard.edu 33 Oxford st. tel: (617) 495-3998 Cambridge, MA 02138 fax: (617) 495-9837