
Meu objetivo é citar diversas fontes até shortauthor
(sem data) e colocar a citação entre parênteses. Como não há \parenciteauthor
comando, defini um que depende do \citeauthor
.
Além disso, desejo excluir essas entradas da lista de referências usando a opção skipbib=true
ou skipbiblist=true
.
Minha abordagem funciona sempre que cito umsolteirofonte. Infelizmente, só consigo fazer com que um desses dois requisitos funcione quando citomúltiplofontes.
Se eu usar a opção skipbiblist=true
, posso citar as duas fontes de uma vez (veja a linha 2 da saída). No entanto, as entradas ainda aparecem na lista de referências. Se eu usar a opção skipbib=true
, as entradas serão omitidas com sucesso da lista de referências. Citar uma única fonte também funciona bem (linha 3 da saída). Mas se eu citar várias fontes de uma vez, os parênteses com a citação ficarão vazios (linha 4 da saída).
Existe uma maneira de atingir os dois requisitos ao mesmo tempo? Por que os parênteses ficam vazios ao usar skipbib=true
?
Esta é a aparência da minha saída:
MEW:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[style=authoryear-icomp,
backend=biber,
bibstyle=authoryear
]{biblatex}
\newcommand{\parenciteauthor}[1]{(\citeauthor{#1})}
\begin{filecontents*}[overwrite]{publist.bib}
@misc{test1,
author = {Author1},
shortauthor = {T1},
title = {Paper 1},
year = {2010},
howpublished = {Paper presented at the meeting of Organization Name, Location},
options = {skipbiblist=true}
}
@misc{test2,
author = {Author2},
shortauthor = {T2},
title = {Paper 2},
year = {2010},
howpublished = {Paper presented at the meeting of Organization Name, Location},
options = {skipbiblist=true}
}
@misc{test3,
author = {Author3},
shortauthor = {T3},
title = {Paper 3},
year = {2010},
howpublished = {Paper presented at the meeting of Organization Name, Location},
options = {skipbib=true}
}
@misc{test4,
author = {Author4},
shortauthor = {T4},
title = {Paper 4},
year = {2010},
howpublished = {Paper presented at the meeting of Organization Name, Location},
options = {skipbib=true}
}
\end{filecontents*}
\addbibresource{publist.bib}
\begin{document}
Cite paper 1 \parenciteauthor{test1} and paper 2 \parenciteauthor{test2}, both with the option skipbiblist=true.
Cite paper 1 and 2 together: \parenciteauthor{test1,test2}. % This is how I want to output to look like. Unfortunately, the sources still show up in the list of references.
Cite paper 3 \parenciteauthor{test3} and paper 4 \parenciteauthor{test4}, both with the option skipbib=true.
Cite paper 3 and 4 together: \parenciteauthor{test3,test4}. % The sources are omitted from the list of references as desired, but the citation does not work.
\printbibliography
\end{document}
Responder1
Atualizar
O bug encontrado aqui foi resolvido na biblatex
v3.18 (22/06/2022). Atualize seu sistema se você ainda encontrar esse problema.
Esse problema não é causado por nenhuma de suas definições. É causado pelo que é indiscutivelmente um bug em biblatex
:https://github.com/plk/biblatex/issues/1225.
Se precisar que as coisas funcionem agora, você pode incluir a correção parahttps://github.com/plk/biblatex/issues/1225do seguinte modo. Lembre-se de excluir o \makeatletter ... \makeatother
bloco assim que biblatex
for atualizado.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[
backend=biber,
style=authoryear-icomp,
]{biblatex}
\makeatletter
\protected\def\blx@bbl@endentry{%
\csuse\blx@bbl@data
\ifcsundef{blx@pref@\the\c@refsection @\abx@field@entrykey}
{}
{\blx@addpageref{\abx@field@entrykey}}%
\nottoggle{blx@setonly}
{}
{\global\toggletrue{blx@addset}%
\toggletrue{blx@skipbib}%
\toggletrue{blx@skipbiblist}%
\toggletrue{blx@skiplab}}%
\expandafter\ifstrequal\expandafter{\blx@dlist@type}{entry}
{\listcsxadd{blx@type@\the\c@refsection @\abx@field@entrytype}{\abx@field@entrykey}%
\ifdef\abx@field@entrysubtype
{\listcsxadd{blx@subt@\the\c@refsection @\abx@field@entrysubtype}{\abx@field@entrykey}}
{}%
\nottoggle{blx@setonly}
{\listcsxadd{blx@dlist@centry@\the\c@refsection @\blx@dlist@name}{\abx@field@entrykey}}
{}%
\nottoggle{blx@skipbib}
{\listcsxadd{blx@dlist@entry@\the\c@refsection @\blx@dlist@name}{\abx@field@entrykey}}
{}}%
{}%
\nottoggle{blx@skipbiblist}
{\expandafter\ifstrequal\expandafter{\blx@dlist@type}{list}
{\blx@bbl@labelfields
\listcsxadd{blx@dlist@\blx@dlist@type @\the\c@refsection @\blx@dlist@name}{\abx@field@entrykey}}
{}}%
{}%
\nottoggle{blx@skiplab}
{\iftoggle{blx@labelnumber}
{\blx@bbl@labelnumber}
{}%
\iftoggle{blx@labelalpha}
{\blx@bbl@labelalpha}
{}%
\iftoggle{blx@labeltitle}
{\blx@bbl@labeltitle}
{}%
\iftoggle{blx@labeltitleyear}
{\blx@bbl@labeltitleyear}
{}%
\iftoggle{blx@labeldateparts}
{\blx@bbl@labeldate}
{}%
\blx@bbl@labelname}
{}%
\blx@bbl@titles
\blx@bbl@hooks
\endgroup}
\makeatother
\newcommand{\parenciteauthor}[1]{(\citeauthor{#1})}
\begin{filecontents*}[overwrite]{\jobname.bib}
@misc{test1,
author = {Author1},
title = {Paper 1},
year = {2010},
options = {skipbiblist=true},
}
@misc{test2,
author = {Author2},
title = {Paper 2},
year = {2010},
options = {skipbiblist=true}
}
@misc{test3,
author = {Author3},
title = {Paper 3},
year = {2010},
options = {skipbib=true}
}
@misc{test4,
author = {Author4},
title = {Paper 4},
year = {2010},
options = {skipbib=true}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
Cite paper 1 \parenciteauthor{test1}
and paper 2 \parenciteauthor{test2}, both with the option skipbiblist=true.
Cite paper 1 and 2 together: \parenciteauthor{test1,test2}.
Cite paper 3 \parenciteauthor{test3} and paper 4 \parenciteauthor{test4},
both with the option skipbib=true.
Cite paper 3 and 4 together: \parenciteauthor{test3,test4}.
\printbibliography
\end{document}
Como mencionei acima, o problema não é causado pelas suas definições, mas
\DeclareCiteCommand{\parenciteauthor}[\mkbibparens]
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\printnames{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}
seria um pouco mais idiomático - embora seja certo que muito mais longo do que
\newcommand{\parenciteauthor}[1]{(\citeauthor{#1})}