TransWikia.com

footcite equals texcite with special format (parenthesis around year and given name initials)

TeX - LaTeX Asked by Michael Schmitz on February 12, 2021

I need to use a special footcite and textcite format for my master thesis. They should both look like

Cite with footnote and textcite.footnote{Vgl. textcite{A01}, S. 23.}
Cite with footcite.footcite[Vgl.][S. 23]{A01}

enter image description here

I tried different solutions for the initials in footcite, but they would corrupt the output of textcite. Here is the version without the initials.

enter image description here

Minimal working example:

documentclass{article}
usepackage[utf8]{inputenc}

usepackage[
backend=biber,
bibencoding=utf8,
style=ext-authoryear,
giveninits=true,
dashed=false,
doi=false,
date=year,
isbn=false,
uniquename=init]{biblatex}
usepackage{filecontents}

begin{filecontents}{jobname.bib}
@article{A01,        
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
  journaltitle = {A Journal},
  volume = {1},
  number = {1},
}
end{filecontents}
addbibresource{jobname.bib}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% footnotestyle format
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Parathenthesis around year in footcite
DeclareInnerCiteDelims{footcite}{bibopenparen}{bibcloseparen}

% indentation
usepackage[hang,bottom,stable]{footmisc}
setlength{footnotemargin}{5mm}
interfootnotelinepenalty=10000 

% given name initials for footcite and textcite
% ???

begin{document}
Cite with footnote and textcite.footnote{Vgl. textcite{A01}, S. 23.}
Cite with footcite.footcite[Vgl.][S. 23]{A01}
printbibliography
end{document}

One Answer

You can modify the labelname name format. The original definition can be found in biblatex.def (ll. 955-981 in v3.16). (Cf. also How to include first initials when using authoryear referencing format (harvard) with biblatex?)

documentclass[ngerman]{article}
usepackage[T1]{fontenc}
usepackage{babel}
usepackage{csquotes}

usepackage[
  backend=biber,
  style=ext-authoryear,
  giveninits=true,
  uniquename=init,
  dashed=false,
  date=year,
  doi=false,
  isbn=false,
]{biblatex}

addbibresource{biblatex-examples.bib}

DeclareInnerCiteDelims{footcite}{bibopenparen}{bibcloseparen}
DeclareInnerCiteDelims{cite}{bibopenparen}{bibcloseparen}

DeclareNameFormat{labelname}{%
  ifnumvalue{uniquename}<2
    usebibmacro{name:family-given}
      {namepartfamily}
      {namepartgiveni}
      {namepartprefix}
      {namepartsuffix}%
  else
    usebibmacro{name:family-given}
      {namepartfamily}
      {namepartgiven}
      {namepartprefix}
      {namepartsuffix}%
  fi
  usebibmacro{name:andothers}}

begin{document}
Cite with foonote and textcite.footnote{Cite[Vgl.][23]{nussbaum},
  and much more text.}
Cite with footcite.footcite[Vgl.][23]{nussbaum}
printbibliography
end{document}

Vgl. Nussbaum, M. (1978), S. 23//Vgl. Nussbaum, M. (1978), S. 23


I wouldn't use textcite here because you don't want its placement of pre- and postnote. But you can easily repurpose cite for that job.

In the example I would definitely prefer

 footcite[Vgl.][23]{nussbaum}

over

 footnote{Cite[Vgl.][23]{nussbaum}.}

but if you include additional text (as in the MWE), it may make sense to use the latter form.

Correct answer by moewe on February 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP