TeX - LaTeX Asked by user1849133 on December 22, 2020
So the problem is that, even when the author list is different, it adds "a" "b" like 2018a and 2018b, if the first author is the same. This problem does not seem to happen if the article type is @techreport instead of @article.
This is the entire code.
% Preview source code
%% LyX 2.3.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
documentclass[english]{article}
usepackage[T1]{fontenc}
usepackage[latin9]{inputenc}
usepackage{geometry}
geometry{verbose,lmargin=3cm,rmargin=3cm}
PassOptionsToPackage{natbib=true}{biblatex}
usepackage{color}
usepackage{babel}
usepackage{setspace}
usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=true]
{hyperref}
hypersetup{
linkcolor=blue, urlcolor=blue, citecolor=blue}
makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
usepackage{amssymb}
usepackage{afterpage}
usepackage{blindtext}
usepackage{graphicx}
usepackage{changepage}
usepackage{afterpage}
usepackage{newunicodechar}
DeclareUnicodeCharacter{FFFD}{?????}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Code for citation in good style
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackage[style=authoryear, uniquename=false, uniquelist=false, maxbibnames=99]{biblatex}
renewbibmacro{in:}{}
usepackage{hyperref}
% Just for demo
ExecuteBibliographyOptions{maxcitenames=1}
DeclareFieldFormat{citehyperref}{%
DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
bibhyperref{#1}}
DeclareFieldFormat{textcitehyperref}{%
DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
bibhyperref{%
#1%
ifbool{cbx:parens}
{bibcloseparenglobalboolfalse{cbx:parens}}
{}}}
savebibmacro{cite}
savebibmacro{textcite}
renewbibmacro*{cite}{%
printtext[citehyperref]{%
restorebibmacro{cite}%
usebibmacro{cite}}}
renewbibmacro*{textcite}{%
ifboolexpr{
( not test {iffieldundef{prenote}} and
test {ifnumequal{value{citecount}}{1}} )
or
( not test {iffieldundef{postnote}} and
test {ifnumequal{value{citecount}}{value{citetotal}}} )
}
{DeclareFieldAlias{textcitehyperref}{noformat}}
{}%
printtext[textcitehyperref]{%
restorebibmacro{textcite}%
usebibmacro{textcite}}}
makeatother
usepackage[style=authoryear]{biblatex}
addbibresource{References_test2.bib}
begin{document}
begin{doublespace}
citet*{suarez2018unintended}
citet*{suarez2018testtesttest}
citet*{last2018test1}
citet*{last2018test2}
end{doublespace}
pagebreak{}
printbibliography
pagebreak
end{document}
And Reference_test2.bib has this.
% Encoding: UTF-8
@techreport{suarez2018unintended,
title={Test1},
author={Su{'a}rez Serrato, Juan Carlos and Einstein, Albert},
year={2018},
institution={Journal1}
}
@techreport{suarez2018testtesttest,
title={Test2},
author={Su{'a}rez Serrato, Juan Carlos},
year={2018},
institution={Journal2}
}
@article{last2018test1,
title={test1},
author={Last, First and Lasttwo, Firsttwo},
journal={Journal1},
year={2018}
}
@article{last2018test2,
title={test2},
author={Last, First and Lasthi, Firsthi and Laster, Firster},
journal={Journal2},
volume={30},
number={2},
pages={47--60},
year={2018}
}
@Comment{jabref-meta: databaseType:bibtex;}
This is an interesting effect. It can be reproduced in the following reduced MWE
documentclass{article}
usepackage[style=authoryear,
maxbibnames=99,
maxcitenames=1,
uniquename=false,
uniquelist=false,
natbib=true]{biblatex}
begin{filecontents}{jobname.bib}
@article{last2018test1,
title = {test1},
author = {Last, First and Lasttwo, Firsttwo},
journal = {Journal1},
year = {2018},
}
@article{last2018test2,
title = {test2},
author = {Last, First and Lasthi, Firsthi and Laster, Firster},
journal = {Journal2},
volume = {30},
number = {2},
pages = {47--60},
year = {2018},
}
end{filecontents}
addbibresource{jobname.bib}
begin{document}
citet*{last2018test1}
citet*{last2018test2}
citet{last2018test1}
citet{last2018test2}
printbibliography
end{document}
Clearly the 'a' and 'b' are not necessary to uniquely identify the entries.
The 'problem' here is the usage of the starred natbib
compatibility command citet*
. In natbib
compatibility mode citet*
produces the output of citet
(textcite
in biblatex
speak) but with the full author list no matter what maxcitenames
says.
Compare that with the output you would get from 'normal' citet
, which is
Here the 'a' and 'b' are necessary to be able to uniquely match the two citations to the bibliography entries.
Depending on the desired output there are several things you can do.
I would probably arrange things so that I don't have to use citet*
all the time. This could be done by dropping the maxcitenames
and uniquelist
options.
documentclass{article}
usepackage[style=authoryear,
maxbibnames=99,
uniquelist=false,
natbib=true]{biblatex}
begin{filecontents}{jobname.bib}
@article{last2018test1,
title = {test1},
author = {Last, First and Lasttwo, Firsttwo},
journal = {Journal1},
year = {2018},
}
@article{last2018test2,
title = {test2},
author = {Last, First and Lasthi, Firsthi and Laster, Firster},
journal = {Journal2},
volume = {30},
number = {2},
pages = {47--60},
year = {2018},
}
end{filecontents}
addbibresource{jobname.bib}
begin{document}
citet*{last2018test1}
citet*{last2018test2}
citet{last2018test1}
citet{last2018test2}
printbibliography
end{document}
But if you want different output, maybe you need slightly different settings.
Answered by moewe on December 22, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP