
Mi objetivo es citar varias fuentes antes shortauthor
(sin fecha) y poner la cita entre paréntesis. Como no hay ningún \parenciteauthor
comando, he definido uno que se basa en \citeauthor
.
Además, deseo excluir estas entradas de la lista de referencias usando la opción skipbib=true
o skipbiblist=true
.
Mi enfoque funciona siempre que cito unsolterofuente. Desafortunadamente, sólo puedo hacer que uno de estos dos requisitos funcione cuando citomúltiplefuentes.
Si uso la opción skipbiblist=true
, puedo citar ambas fuentes a la vez (ver línea 2 del resultado). Sin embargo, las entradas todavía aparecen en la lista de referencias. Si en cambio uso la opción skipbib=true
, las entradas se omiten exitosamente de la lista de referencias. Citar una sola fuente también funciona bien (línea 3 del resultado). Pero si cito varias fuentes a la vez, los paréntesis con la cita están vacíos (línea 4 del resultado).
¿Hay alguna manera de cumplir ambos requisitos al mismo tiempo? ¿Por qué los paréntesis están vacíos cuando se usa skipbib=true
?
Así es como se ve mi salida:
MAULLAR:
\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}
Respuesta1
Actualizar
El error encontrado aquí se resolvió en biblatex
la v3.18 (22/06/2022). Actualice su sistema si aún encuentra este problema.
Este problema no se debe a ninguna de sus definiciones. Es causado por lo que podría decirse que es un error en biblatex
:https://github.com/plk/biblatex/issues/1225.
Si necesita que todo funcione ahora, puede incluir la solución parahttps://github.com/plk/biblatex/issues/1225como sigue. Recuerde eliminar el \makeatletter ... \makeatother
bloque una vez biblatex
actualizado.
\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 mencioné anteriormente, el problema no se debe en absoluto a sus definiciones, sino
\DeclareCiteCommand{\parenciteauthor}[\mkbibparens]
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\printnames{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}
Sería un poco más idiomático (si bien es cierto que mucho más largo que
\newcommand{\parenciteauthor}[1]{(\citeauthor{#1})}