我如何指示 \fullcite 使用 maxbibnames 而不是 maxcitenames?

我如何指示 \fullcite 使用 maxbibnames 而不是 maxcitenames?

在我的博士论文中,我包括了附录文件清单自动生成参考文献。我过去使用 来生成参考文献\bibentry,但现在我改用 biblatex 并\fullcite希望它能起到同等作用。唉,\fullcite使用maxcitenames来决定作者的数量;我希望它使用maxbibnames以便打印的作者数量与参考书目中的数量相同。

\documentclass{article}
\usepackage[maxbibnames=99,maxcitenames=1]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A. and Buthor, B. and Cuthor, C. and Duthor, D.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
This is by \textcite{A01}, or, more completely:
\fullcite{A01}.

\printbibliography
\end{document}

期望效果:

This is by Author et al. [1], or, more completely, A. Author, B. Buthor, C. Cuthor, and D. Duthor, Alpha, 2001

实际效果:

生成的文件

如何使用 中的或类似命令获取包含所有作者(或maxbibnames作者编号)的完整引文?如果我更改,那么也会受到影响,而这并不是我想要的。\fullcitebiblatexmaxcitenamesAuthor et al. [1]

我所有的\fullcite出现都集中在文档中不使用其他引用命令的一部分,因此暂时改变的解决方案maxcitenames对我来说是可以接受的。

答案1

您可以更改的定义\fullcite\footfullcite引用宏,以便它们在本地使用的值maxbibnames

\documentclass{article}
\usepackage[maxbibnames=99,maxcitenames=1]{biblatex}
\makeatletter
\DeclareCiteCommand{\fullcite}
  {\defcounter{maxnames}{\blx@maxbibnames}%
    \usebibmacro{prenote}}
  {\usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\DeclareCiteCommand{\footfullcite}[\mkbibfootnote]
  {\defcounter{maxnames}{\blx@maxbibnames}%
    \usebibmacro{prenote}}
  {\usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\makeatother
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A. and Buthor, B. and Cuthor, C. and Duthor, D.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
This is by \textcite{A01}, or, more completely:
\fullcite{A01}.

\printbibliography
\end{document}

在此处输入图片描述

答案2

创建一个新命令:

\newcommand{\printpublication}[1]{\AtNextCite{\defcounter{maxnames}{99}}\fullcite{#1}}

或者\fullcite全局修改:

\preto\fullcite{\AtNextCite{\defcounter{maxnames}{99}}}

梅威瑟:

\documentclass{article}
\usepackage[maxbibnames=99,maxcitenames=1]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A. and Buthor, B. and Cuthor, C. and Duthor, D.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}
\addbibresource{\jobname.bib}


\preto\fullcite{\AtNextCite{\defcounter{maxnames}{99}}}

\begin{document}
This is by \textcite{A01}, or, more completely:
\fullcite{A01}.

\printbibliography
\end{document}

在此处输入图片描述

答案3

这也是通过本地重置来做到这一点的方法\blx@maxcitenames。使用跟踪,可以看到:

...
\blx@resetdata ->\let \blx@saved@do \do \let \do \blx@imc@clearname \abx@doname
s \let \do \blx@imc@clearlist \abx@dolists \let \do \blx@imc@clearfield \abx@do
fields \do {options}\do {labeltitle}\do {labelyear}\do {labelmonth}\do {labelda
y}\do {datelabelsource}\abx@dointernalfields \def \do ##1{\togglefalse {abx@boo
l@##1}}\abx@dobooleans \let \do \blx@saved@do \c@citecounter \z@ \iftoggle {blx
@bibliography} {\c@maxnames \blx@maxbibnames \relax \c@minnames \blx@minbibname
s \relax } {\c@maxnames \blx@maxcitenames \relax \c@minnames \blx@mincitenames 
\relax }\c@maxitems \blx@maxitems \relax \c@minitems \blx@minitems \relax 

因此,可以暂时将切换设置blx@bibliography为 true(在本地范围内):最终会使用\blx@maxbibnames- 或者,可以暂时(在本地范围内)将“计数器”设置\blx@maxcitenames为 99;注意\blx@maxcitenames这不是实际的\newcount\newcounter,它是一个“仅仅”的命令。

下面的示例临时/本地将其设置\blx@maxcitenames为 99,输入应该确认该更改不会影响全局范围;输出与接受的答案相同。

\documentclass{article}
\usepackage[maxbibnames=99,maxcitenames=1]{biblatex}
\usepackage{filecontents}
\usepackage{trace}
\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A. and Buthor, B. and Cuthor, C. and Duthor, D.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}


This is by \textcite{A01}, or, more completely:
\makeatletter%
\typeout{blx@maxcitenames: \blx@maxcitenames}%
\bgroup% start local scope group
  % \advance\blx@maxcitenames 2\relax % cannot: not a count!
  \def\blx@maxcitenames{99}%
  \makeatother%
  % \traceon % if tracing is desired
  \fullcite{A01}.
  % \traceoff
\egroup%

\makeatletter
\typeout{blx@maxcitenames: \blx@maxcitenames}
\makeatother

\printbibliography
\end{document}

相关内容