TeX - LaTeX Asked by Frank Breitling on May 11, 2021
I am looking for a way to always list one specific author in references with many authors, when the number of authors to show is limited and abbreviated by et al.
For example
These are the relevant papers:
fullcite{paper1}
fullcite{paper2}
should result in
These are the relevant papers:
Author, A., ..., Alwaysthisauthor, X., ..., et al.
Buthor, B., ..., Alwaysthisauthor, X., ..., et al.
As requested a minimal example is below:
documentclass{article}
usepackage{filecontents}
usepackage[backend=biber,natbib]{biblatex}
begin{filecontents}{jobname.bib}
@INPROCEEDINGS{2001AIPC..569..163C,
author = {{Cheshkov}, S. and {Tajima}, T. and {Chiu}, C. and {Breitling}, F. },
title = "{Emittance control in Laser Wakefield Accelerator}",
booktitle = {American Institute of Physics Conference Series},
year = 2001,
volume = 569,
month = may,
pages = {163-176},
}
@ARTICLE{2001RScI...72.1339B,
author = {{Breitling}, F. and {Weigel}, R.~S. and {Downer}, M.~C. and
{Tajima}, T.},
title = "{Laser pointing stabilization and control in the
submicroradian regime with neural networks}",
journal = {Review of Scientific Instruments},
year = 2001,
month = feb,
volume = 72,
pages = {1339-1342},
}
end{filecontents}
addbibresource{jobname.bib}
begin{document}
nocite{*}
printbibliography
end{document}
Results in
References
F. Breitling et al. “Laser pointing stabilization and control in the
submicro-radian regime with neural networks”. In: Review of Scientific
Instruments 72 (Feb. 2001), pp. 1339–1342.S. Cheshkov et al. “Emittance control in Laser Wakefield Accelerator”.
In: American Institute of Physics Conference Series. Vol. 569. May 2001,
pp. 163–176.
But I need the name Breitling to always appear explicitly also if the author list is truncated with et al.
The following is adapted for biblatex
>= 3.3 from my answer to Excluding one certain author from [et al.].
In order to make this solution work you will need the hash of your name, see Highlight an author in bibliography using biblatex allowing bibliography style to format it for details on how to retrieve the hash for specific names from the .bbl
file.
If you wrap your name into braces, the hash for F. {Breitling}
/{Breitling}, F.
is 3f71afbcde39f096d711d45fa2c17bc7
.
documentclass[british]{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{babel}
usepackage{csquotes}
usepackage[style=authoryear, backend=biber, maxnames=999]{biblatex}
begin{filecontents*}{jobname.bib}
@INPROCEEDINGS{2001AIPC..569..163C,
author = {{Cheshkov}, S. and {Tajima}, T. and {Chiu}, C. and {Breitling}, F. },
title = "{Emittance control in Laser Wakefield Accelerator}",
booktitle = {American Institute of Physics Conference Series},
year = 2001,
volume = 569,
month = may,
pages = {163-176},
}
@ARTICLE{2001RScI...72.1339B,
author = {{Breitling}, F. and {Weigel}, R.~S. and {Downer}, M.~C. and
{Tajima}, T.},
title = "{Laser pointing stabilization and control in the
submicroradian regime with neural networks}",
journal = {Review of Scientific Instruments},
year = 2001,
month = feb,
volume = 72,
pages = {1339-1342},
}
end{filecontents*}
addbibresource{jobname.bib}
newcounter{namesnotimportant}
newtoggle{ellipsis}
DeclareNameFormat{given-family-etal}{%
ifnumcomp{value{listcount}}{=}{1}
{setcounter{namesnotimportant}{0}%
globaltoggletrue{ellipsis}}
{}%
ifboolexpr{test {ifnumcomp{value{listcount}}{=}{1}}
or test {ifnumcomp{value{listtotal}}{=}{2}}}
{ifgiveninits
{usebibmacro{name:given-family}
{namepartfamily}
{namepartgiveni}
{namepartprefix}
{namepartsuffix}}
{usebibmacro{name:given-family}
{namepartfamily}
{namepartgiven}
{namepartprefix}
{namepartsuffix}}}%
{iffieldequalstr{hash}{3f71afbcde39f096d711d45fa2c17bc7}%% <----- put the correct hash here
{globaltoggletrue{ellipsis}%
ifgiveninits
{usebibmacro{name:given-family}
{namepartfamily}
{namepartgiveni}
{namepartprefix}
{namepartsuffix}}
{usebibmacro{name:given-family}
{namepartfamily}
{namepartgiven}
{namepartprefix}
{namepartsuffix}}}%
{stepcounter{namesnotimportant}%
iftoggle{ellipsis}
{addcommaspacetextellipsisglobaltogglefalse{ellipsis}isdot}
{}}}%
ifnumcomp{value{namesnotimportant}}{>}{0}
{globaltoggletrue{abx@bool@morecurrentname}}
{}%
ifboolexpr{
test {ifnumequal{value{listcount}}{value{liststop}}}
and
test ifmorenames
}
{andothersdelimbibstring{andothers}}
{}}
DeclareNameAlias{sortname}{given-family-etal}
DeclareNameAlias{author}{given-family-etal}
DeclareNameAlias{editor}{given-family-etal}
DeclareNameAlias{translator}{given-family-etal}
begin{document}
nocite{*}
printbibliography
end{document}
you thus get
If you only want this special format for fullcite
, move the four DeclareNameAlias
lines into the pre-code hook of usedriver
in DeclareCiteCommand{fullcite}
like so
DeclareCiteCommand{fullcite}
{usebibmacro{prenote}}
{usedriver
{DeclareNameAlias{sortname}{given-family-etal}%
DeclareNameAlias{author}{given-family-etal}%
DeclareNameAlias{editor}{given-family-etal}%
DeclareNameAlias{translator}{given-family-etal}}
{thefield{entrytype}}}
{multicitedelim}
{usebibmacro{postnote}}
If you want to define a special command for that so that you can use 'normal' fullcite
and the new name format simultaneously, you could define a starred fullcite*
via
DeclareCiteCommand*{fullcite}
{usebibmacro{prenote}}
{usedriver
{DeclareNameAlias{sortname}{given-family-etal}%
DeclareNameAlias{author}{given-family-etal}%
DeclareNameAlias{editor}{given-family-etal}%
DeclareNameAlias{translator}{given-family-etal}}
{thefield{entrytype}}}
{multicitedelim}
{usebibmacro{postnote}}
instead.
If you want to 'filter' several names (additionally also, say {Tajima}, T.
), you can combine the hash comparisons into one ifboolexpr
. Just use
ifboolexpr{test {iffieldequalstr{hash}{f9c1127a739dfe7ad337f89c98aebf51}}
or
test {iffieldequalstr{hash}{67bbebbc19c3d65d07202eac52047d5e}}}%% <----- put the correct hash here
instead of iffieldequalstr{hash}{f9c1127a739dfe7ad337f89c98aebf51}
in DeclareNameFormat{given-family-etal}
:
DeclareNameFormat{given-family-etal}{%
ifnumcomp{value{listcount}}{=}{1}
{setcounter{namesnotimportant}{0}%
globaltoggletrue{ellipsis}}
{}%
ifboolexpr{test {ifnumcomp{value{listcount}}{=}{1}}
or test {ifnumcomp{value{listtotal}}{=}{2}}}
{ifgiveninits
{usebibmacro{name:given-family}
{namepartfamily}
{namepartgiveni}
{namepartprefix}
{namepartsuffix}}
{usebibmacro{name:given-family}
{namepartfamily}
{namepartgiven}
{namepartprefix}
{namepartsuffix}}}%
{ifboolexpr{test {iffieldequalstr{hash}{f9c1127a739dfe7ad337f89c98aebf51}}
or
test {iffieldequalstr{hash}{67bbebbc19c3d65d07202eac52047d5e}}}%% <----- put the correct hash here
{globaltoggletrue{ellipsis}%
ifgiveninits
{usebibmacro{name:given-family}
{namepartfamily}
{namepartgiveni}
{namepartprefix}
{namepartsuffix}}
{usebibmacro{name:given-family}
{namepartfamily}
{namepartgiven}
{namepartprefix}
{namepartsuffix}}}%
{stepcounter{namesnotimportant}%
iftoggle{ellipsis}
{addcommaspacetextellipsisglobaltogglefalse{ellipsis}isdot}
{}}}%
ifnumcomp{value{namesnotimportant}}{>}{0}
{globaltoggletrue{abx@bool@morecurrentname}}
{}%
ifboolexpr{
test {ifnumequal{value{listcount}}{value{liststop}}}
and
test ifmorenames
}
{andothersdelimbibstring{andothers}}
{}}
Correct answer by moewe on May 11, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP