# Biblatex: Brackets around the author in bibliography, author-year, DeclareFielFormat

I just can't solve my problem. I want that in the Bibliography the authors are put in one [.........] bracket, like e.g. the dinat format does it. (Is not available since I am using Biblatex)

\usepackage[
backend=biber,
style=authoryear-icomp,
]{biblatex}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}

\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{#1}
\setlength{\bibitemsep}{0.5\baselineskip}

\DeclareListFormat{author}{\mkbibbrackets{#1}}     (*)


Thats my approach, but (*) does not cause any differences.

Thank you for taking your time.

From biblatex 3.12 onwards, you can use \DeclareNameWrapperFormat and \DeclareListWrapperFormat to formt the complete output of a (name) list field (\DeclareNameFormat and \DeclareListFormat only format a single item). See https://github.com/plk/biblatex/issues/754 and https://github.com/plk/biblatex/pull/829.

So if you want to print the author (or editor and translator in author position) in square brackets, you can simply use

\DeclareNameWrapperFormat{sortname}{\mkbibbrackets{#1}}


In full

\documentclass{article}

\usepackage[
backend=biber,
style=authoryear-icomp,
]{biblatex}

\renewcommand*{\mkbibnamefamily}{\textsc}
\DeclareNameWrapperFormat{sortname}{\mkbibbrackets{#1}}

\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{#1}

\setlength{\bibitemsep}{0.5\baselineskip}

\begin{document}
\autocite{sigfridsson}
\printbibliography
\end{document}


Since you mention dinat in your question, I suspect you actually want something slightly different. We can try and recreate the bibliography format of dinat, which introduces each entry with an author-year label, with biblatex-ext.

\documentclass{article}

\usepackage[
backend=biber,
citestyle=ext-authoryear-icomp,
bibstyle=ext-authortitle,
sorting=nyt,
introcite=plain,
]{biblatex}

\DeclareFieldFormat{bbx@introcite}{\mkbibbrackets{#1}}
\DeclareDelimAlias*[bbx@introcite]{nameyeardelim}[parencite]{nameyeardelim}
\UndeclareInnerCiteDelims{bbx@introcite}

\renewcommand*{\mkbibnamefamily}{\textsc}

\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{#1}

\setlength{\bibitemsep}{0.5\baselineskip}

\begin{document}
\autocite{sigfridsson}
\printbibliography
\end{document}


You can read more about introcite in the biblatex-ext documentation (pp. 15-19).

If you prefer square brackets for \parencite/\autocite, have a look at \DeclareOuterCiteDelims.

The

\DeclareListFormat{author}{\mkbibbrackets{#1}}


had no effect, since author is a name list, whose format needs to be set up with \DeclarNameFormat (and \DeclareNameWrapperFormat). Declarations using the incorrect field type (\DeclareListFormat{author} and \DeclareFieldFormat{author}) are silently ignored.

\DeclareNameFormat{author}{\mkbibbrackets{#1}}


would not have been ignored, but would not have produced the desired output, either, since name formats are quite special and don't work with the usual #1.

• I had to make an update to the latest TeXLive, but this was nothing bad at all. Thank you for Your detailed answer! Fabulous! (This verifies that this very solution does work on the latest software) – cruiser0223 Jun 30 at 15:35

For old versions of biblatex (< v3.12, as for example used in overleaf) one can add the \mkbibbrackets to the author macro:

\documentclass{article}

\usepackage[
backend=biber,
style=authoryear-icomp,
]{biblatex}
\renewcommand*{\mkbibnamefamily}[1]{\textsc{#1}}

\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{#1}
\setlength{\bibitemsep}{0.5\baselineskip}

\renewbibmacro*{author}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\usebibmacro{bbx:savehash}%
\mkbibbrackets{\printnames{author}}%
\iffieldundef{authortype}
{\setunit{\printdelim{nameyeardelim}}}
{\setunit{\printdelim{authortypedelim}}}}%
\iffieldundef{authortype}
{}
{\usebibmacro{authorstrg}%
\setunit{\printdelim{nameyeardelim}}}}%
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\setunit*{\printdelim{nonameyeardelim}}}%

\begin{document}

\cite{sigfridsson}
\printbibliography

\end{document}


• With a current version of biblatex (at least v3.12, in particular the system run on Overleaf is much too old for that), the code block could simply be replaced with \DeclareNameWrapperFormat{author}{\mkbibbrackets{#1}}, though I would use \DeclareNameWrapperFormat{sortname}{\mkbibbrackets{#1}}, so that editors and translators in the same position are treated the same way. – moewe Jun 30 at 10:19
• @moewe I think it would be good if you would post this as an answer. I made clear that my one is for old systems – user191948 Jun 30 at 10:23
• If you have a modern system and can verify that the code I suggested works I would be happy if you included it in your answer. – moewe Jun 30 at 10:24
• @moewe Unfortunately I currently don't have access to an up-to-date installation. I would be happy to see your answer – user191948 Jun 30 at 10:26
• OK, in that case I will write an answer. – moewe Jun 30 at 10:27