I'm trying to use biblatex to automatically replace words in the booktitle field with their abbreviations (e.g. Proceedings to Proc., Symposium to Symp. etc.). My approach has been to use the \DeclareFieldFormat macro (with a substitution macro courtesy of Multi-substring replace):
\newcommand{\shorten}[1]{%
\saveexpandmode\noexpandarg
\def\x{#1}%
\xStrSubstitute{\x}{Proceedings}{Proc.}[\x]%
\x%
\message{\x}
\restoreexpandmode
}
\newcommand*{\xStrSubstitute}{%
\expandafter\StrSubstitute\expandafter
}
\DeclareFieldFormat[inproceedings]{booktitle}{\shorten{#1}}
The problem is that when the DeclareFieldFormat is run, the argument hasn't yet been expanded to the actual data value, so the argument passed to shorten is actually: \printfield [titlecase]{booktitle}\setunit {\addperiod }\printfield [titlecase]{booksubtitle} (printed by the message call).
Any ideas on how to get the actual booktitle out of biblatex so I can run my macro on it?
booktitlemacro? I also want to do this to thejournalfield in thearticletype. – Joe Jul 11 '17 at 13:00biblatex.defandstandard.bbx. Thebooktitleandjournalmacros are both inbiblatex.def. Let me emphasise again that I would use Biber over string manipulation via\DeclareFieldFormat. – moewe Jul 11 '17 at 13:03