I have defined an "extendedof" relation type for my biblatex file, used to relate extended versions of works to their original published version. To do so, I added the lines below to the preamble of my latex file:
\NewBibliographyString{extendedof}
\DefineBibliographyStrings{english}{extendedof={Extended version of},}
\DeclareFieldFormat{relatedstring:extendedof}{#1\addcolon\addspace}
\DeclareFieldFormat{related:extendedof}{\mkbibparens{#1}}
\newbibmacro*{related:extendedof}[1]{\entrydata*{#1}{\iffieldundef{journaltitle}{\iffieldundef{maintitle}{\printfield[title:hook]{booktitle}}{\printfield[title:hook]{maintitle}}\newunit\newblock\usebibmacro{byeditor+others}\newunit\newblock\printfield{edition}\newunit\iffieldundef{volume}{}{\printfield{volume}\printfield{part}}\newunit\newblock\usebibmacro{series+number}\newunit\newblock\printfield{note}\newunit\newblock\usebibmacro{publisher+location+date}\newunit\newblock\usebibmacro{chapter+pages}}{\usebibmacro{author/editor}\newunit\newblock\usebibmacro{title}\newunit\newblock\renewbibmacro*{journal}{\printfield[title:hook]{journaltitle}}\usebibmacro{journal+issuetitle}\newunit\newblock\usebibmacro{byeditor+others}\newunit\newblock\usebibmacro{note+pages}}}}
It works. The catch is that I use a single master library/biblatex file across all of my papers, and I would rather not have to manually add the above to each latex document I edit. Is there any way to include the above directly into the biblatex file to make it portable? I tried wrapping each line in @Preamble{"..."}
and adding it to the biblatex file as so:
@Preamble{"\NewBibliographyString{extendedof}"}
@Preamble{"\DefineBibliographyStrings{english}{extendedof={Extended version of},}"}
@Preamble{"\DeclareFieldFormat{relatedstring:extendedof}{#1\addcolon\addspace}"}
@Preamble{"\newbibmacro*{related:extendedof}[1]{\entrydata*{#1}{\iffieldundef{journaltitle}{\iffieldundef{maintitle}{\printfield[title:hook]{booktitle}}{\printfield[title:hook]{maintitle}}\newunit\newblock\usebibmacro{byeditor+others}\newunit\newblock\printfield{edition}\newunit\iffieldundef{volume}{}{\printfield{volume}\printfield{part}}\newunit\newblock\usebibmacro{series+number}\newunit\newblock\printfield{note}\newunit\newblock\usebibmacro{publisher+location+date}\newunit\newblock\usebibmacro{chapter+pages}}{\usebibmacro{author/editor}\newunit\newblock\usebibmacro{title}\newunit\newblock\renewbibmacro*{journal}{\printfield[title:hook]{journaltitle}}\usebibmacro{journal+issuetitle}\newunit\newblock\usebibmacro{byeditor+others}\newunit\newblock\usebibmacro{note+pages}}}}"}
This has most of the desired effect, except that the bibliography string extendedof
does not seem to take effect. I do, however, get the following in the .bbl
file:
\preamble{%
\NewBibliographyString{extendedof}%
\DefineBibliographyStrings{english}{extendedof={Extended version of},}%
\DeclareFieldFormat{relatedstring:extendedof}{#1\addcolon\addspace}%
\newbibmacro*{related:extendedof}[1]{\entrydata*{#1}{\iffieldundef{journaltitle}{\iffieldundef{maintitle}{\printfield[title:hook]{booktitle}}{\printfield[title:hook]{maintitle}}\newunit\newblock\usebibmacro{byeditor+others}\newunit\newblock\printfield{edition}\newunit\iffieldundef{volume}{}{\printfield{volume}\printfield{part}}\newunit\newblock\usebibmacro{series+number}\newunit\newblock\printfield{note}\newunit\newblock\usebibmacro{publisher+location+date}\newunit\newblock\usebibmacro{chapter+pages}}{\usebibmacro{author/editor}\newunit\newblock\usebibmacro{title}\newunit\newblock\renewbibmacro*{journal}{\printfield[title:hook]{journaltitle}}\usebibmacro{journal+issuetitle}\newunit\newblock\usebibmacro{byeditor+others}\newunit\newblock\usebibmacro{note+pages}}}}%
}