6

I want to customize a BibTeX style file (.bst), where there is the following function for unpublished works:

FUNCTION {format.howpublished.address.year}
{ howpublished empty$
    { address empty$
        { "No address in " cite$ warning$ }
        { " \apyformat {" oaddress.opublisher.oyear.format address "}" * }
       if$
    }
    { address empty$
        { "There's only a howpublished (no address) in " cite$ * warning$ " \apyformat {" oaddress.opublisher.oyear.format howpublished * "}" * }
        { " \apyformat {" oaddress.opublisher.oyear.format address * "\bpubaddr {} " * howpublished "}" * * }
       if$
    }
    if$
}

I want to change the string "No address in" to another string using the german umlauts ('ö', 'ä' and 'ü'). But simply typing an umlaut results in compilation errors. How to do this?

6

Well, you can't easily use " in a string in a .bst file. One way is to use the function int.to.chr$. Easiest would be to define a command \myumlaut in the bibliography preamble.

Your original function begin.bib might look like this:

FUNCTION {begin.bib}
{ preamble$ empty$
    'skip$
    { preamble$ write$ newline$ }
  if$
  "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
    write$ newline$
  "\begin{thebibliography}{"  longest.label  * "}" *
    write$ newline$
}

and you modify it to this:

FUNCTION {begin.bib}
{ preamble$ empty$
    'skip$
    { preamble$ write$ newline$ }
  if$
  "\let\myumlaut\" #34 int.to.chr$ *
    write$ newline$
  "\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
    write$ newline$
  "\begin{thebibliography}{"  longest.label  * "}" *
    write$ newline$
}

Now, you can write schöne as sch\myumlaut{o}ne.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.