Where is the right place for Biblatex redefinitions?
kzstatis at gmail.com
kzstatis at gmail.com
Wed Sep 28 09:21:07 UTC 2022
>I need to apply some renewcommands to the standard ext-biblatex-verbose-trad3 style
>
>% specific settings:
>\DeclareFieldFormat{biblabeldate}{#1}
>\DeclareDelimFormat[bib]{nameyeardelim}{\addperiod\space}
>\DeclareFieldFormat{issuedate}{#1}
>\renewcommand*{\volnumdatedelim}{\addcomma\space}
>\renewcommand{\newunitpunct}{\addcomma\space}
>\renewcommand*{\locpubdelim}{\addcoma\space}
>
>If I put them in the preamble, they seem to be taken into account in the pdf, but they cause a lot of error warnings (sequences of "undefined" >and "already defined") and I would like to avoid that, since my document is very long and I might miss other error warnings.
>My question is: Is there a better way of inserting these lines? Before the bibliography in TeX code? Or where?
When you make a pdf, LyX first exports the lyx file to latex. It places the \usepackage for biblatex after the document specific preamble. So when pdflatex sees your preamble settings, it does not know yet biblatex and its commands, such as biblabeldate.
This may be solved by enclosing your specific settings in \AtEndPreamble{…}, for which you need the package etoolbox:
\usepackage{etoolbox}
\AtEndPreamble{%
\DeclareFieldFormat{biblabeldate}{#1}
\DeclareDelimFormat[bib]{nameyeardelim}{\addperiod\space}
\DeclareFieldFormat{issuedate}{#1}
\renewcommand*{\volnumdatedelim}{\addcomma\space}
\renewcommand{\newunitpunct}{\addcomma\space}
\renewcommand*{\locpubdelim}{\addcoma\space}
}
This ensures that your specific settings are read at the very end of the preamble, when biblatex has already been read.
Kees
More information about the lyx-users
mailing list