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}
\addbibresource{biblatex-examples.bib}
\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*{\introcitepunct}{\quad}
\renewcommand*{\mkbibnamefamily}{\textsc}
\DeclareFieldFormat*{title}{\mkbibemph{#1}}
\DeclareFieldFormat*{citetitle}{\mkbibemph{#1}}
\DeclareFieldFormat{journaltitle}{#1}
\setlength{\bibitemsep}{0.5\baselineskip}
\addbibresource{biblatex-examples.bib}
\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
.