Search found 2 matches

by dcnicholls
Mon Oct 19, 2009 7:40 am
Forum: BibTeX, biblatex and biber
Topic: Parsing cite$ to replace "&" with "\&"
Replies: 1
Views: 1702

Parsing cite$ to replace "&" with "\&"

Solved.

It needed the package xstring and a \newcommand macro in the Latex file, called from within Bibtex.

This is what I used in the Latex file:
\newcommand{\ampersandmacro}[1]{%
\IfSubStr{#1}{&}{\StrBefore{#1}{&}\&\StrBehind{#1}{&}}{[#1]}
}
And in the .bst file within the {article} function ...
by dcnicholls
Sun Oct 18, 2009 2:52 pm
Forum: BibTeX, biblatex and biber
Topic: Parsing cite$ to replace "&" with "\&"
Replies: 1
Views: 1702

Parsing cite$ to replace "&" with "\&"

I'm trying to include the cite key in references. It works except when the cite key includes the "&" character - which will occur as the 6th, 7th or 8th character in the some cite key strings. A typical string including '&' is 2006A&A...448..955I Some cite keys (most) do not include an '&'.

The ...