1

How can I enable firstinits=true for in text citation, but write full name in bibliography? I use biblatex with biber backend. Here is a MWE:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@BOOK{KandR, AUTHOR={Kernighan, Brian},TITLE={{The C Programming Language Second Edition}},YEAR={1988},}
\end{filecontents*}

\documentclass{article} 
\usepackage[backend=biber,style=authortitle,firstinits=false,citestyle=verbose-ibid]{biblatex}
\addbibresource{\jobname.bib}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}

\begin{document} 

Hello \footcite{KandR}. How are you?

\printbibliography 
\end{document} 

I get: Kerningham, Brian

In \footcite I want to have only first initial, while leaving the full name in \printbibliography

moewe
  • 175,683
andc
  • 941
  • 6
  • 15

1 Answers1

1

You can use

\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {\DeclareNameAlias{sortname}{labelname-revinit}}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\DeclareNameFormat{labelname-revinit}{%
  \ifnum\value{uniquename}<2%
    \ifuseprefix
      {\usebibmacro{name:last-first}{#1}{#4}{#5}{#8}}
      {\usebibmacro{name:last-first}{#1}{#4}{#6}{#8}}%
  \else
    \usebibmacro{name:last-first}{#1}{#3}{#5}{#7}%
  \fi
  \usebibmacro{name:andothers}}

Together with uniquename=full this allows us to print the initials if possible and the full name if needed for disambiguation. If you don't set uniquename=full, you will always get initials even if that could possibly cause confusion between two authors with the same last name.

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@BOOK{KandR, AUTHOR={Kernighan, Brian},TITLE={{The C Programming Language Second Edition}},YEAR={1988},}

@BOOK{utha, AUTHOR={Uthor, Anne},TITLE={Lorem},YEAR={1990},}
@BOOK{uthb, AUTHOR={Uthor, Beatrix},TITLE={Ipsum},YEAR={1991},}

@BOOK{wrm, AUTHOR={Riter, William},TITLE={Dolor},YEAR={1992},}
@BOOK{wrd, AUTHOR={Riter, Willard},TITLE={Sit},YEAR={1993},}
\end{filecontents*}

\documentclass{article} 
\usepackage[backend=biber,firstinits=false,style=verbose-ibid, uniquename=full]{biblatex}
\addbibresource{\jobname.bib}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}


\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {\DeclareNameAlias{sortname}{labelname-revinit}}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\DeclareNameFormat{labelname-revinit}{%
  \ifnum\value{uniquename}<2%
    \ifuseprefix
      {\usebibmacro{name:last-first}{#1}{#4}{#5}{#8}}
      {\usebibmacro{name:last-first}{#1}{#4}{#6}{#8}}%
  \else
    \usebibmacro{name:last-first}{#1}{#3}{#5}{#7}%
  \fi
  \usebibmacro{name:andothers}}

\begin{document} 

Hello \footcite{KandR}. How\footcite{utha,uthb} are you\footcite{wrm,wrd}?

\printbibliography 
\end{document} 

enter image description here

moewe
  • 175,683
  • 1
    Note that style=authortitle, citestyle=verbose-ibid and style=verbose-ibid do the same thing but the last is shorter and arguably easier to understand. – moewe Sep 08 '15 at 10:23