使用 biblatex 制作章节标题

使用 biblatex 制作章节标题

使用 MWE 更新:

我正在制作一个用于跟踪项目文章的模板,为此,我想定制 \cite-s 以用于文本和章节标题。我提出了一个粗略的解决方案:

\documentclass[a4paper,13ptmathspec]{scrartcl}
\usepackage{filecontents}
\usepackage{biblatex}


\begin{filecontents}{ref.bib}
@article{szabo2006,
  title = {Phase transition in the collective migration of tissue cells: Experiment and model},
  author = {Szab\'o, B. and Sz\"oll\"osi, G. J. and G\"onci, B. and Jur\'anyi, Zs. and Selmeczi, D. and Vicsek, Tam\'as},
  journal = {Phys. Rev. E},
  volume = {74},
  issue = {6},
  pages = {061908},
  numpages = {5},
  year = {2006},
  month = {Dec},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevE.74.061908},
  url = {http://link.aps.org/doi/10.1103/PhysRevE.74.061908}
}
\end{filecontents}
\addbibresource{ref.bib}
\begin{document}
\section{First section}
I want to be able to modifiy the citing style separatly here (\citeauthor{szabo2006} \citeyear{szabo2006}\cite{szabo2006}).
\section{\citeauthor{szabo2006}:\citetitle{szabo2006}\cite{szabo2006}}
and in the section title. I also don't want the quotes in the section title.

\printbibliography
\end{document}

在此处输入图片描述

我的问题是,我可以使用 newcommand 将多个引用合并为一个命令,但例如,当我将其放在章节标题中时,我想删除标题周围的引号。在我看来,\DeclareCiteCommand 是可行的方法,但我无法使其工作。如何实现这一点?

答案1

\DeclareCiteCommand没那么可怕。第一个和最后一个参数通常只是\usebibmacro{prenote}\usebibmacro{postnote}。第三个参数通常是\multicitedelim。最后第二个参数打印你的引用:

  • \printnames{labelname}给你作者
  • \printfield{labeltitle}标题
  • \printfield{year}那一年

然后,您可以通过等和\addcolon括号宏添加适当的标点符号。以下是几种变体:\addspacebiblatex

示例输出

\documentclass[a4paper,13ptmathspec]{scrartcl}
\usepackage{filecontents}
\usepackage[style=numeric]{biblatex}

\DeclareCiteCommand{\citesect}{\usebibmacro{prenote}}%
{\printnames{labelname}\addcolon\addspace\printfield{labeltitle}%
\addspace\mkbibparens{\printfield{year}}}%
{\multicitedelim}{\usebibmacro{postnote}}

\DeclareCiteCommand{\citesectno}{\usebibmacro{prenote}}%
{\printnames{labelname}\addcolon\addspace\printfield{labeltitle}%
\addspace\mkbibparens{\printfield{year}}\addspace\mkbibbrackets{\usebibmacro{cite}}}%
{\multicitedelim}{\usebibmacro{postnote}}

\begin{filecontents}{ref.bib}
@article{szabo2006,
  title = {Phase transition in the collective migration of tissue cells: Experiment and model},
  author = {Szab\'o, B. and Sz\"oll\"osi, G. J. and G\"onci, B. and Jur\'anyi, Zs. and Selmeczi, D. and Vicsek, Tam\'as},
  journal = {Phys. Rev. E},
  volume = {74},
  issue = {6},
  pages = {061908},
  numpages = {5},
  year = {2006},
  month = {Dec},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevE.74.061908},
  url = {http://link.aps.org/doi/10.1103/PhysRevE.74.061908}
}
\end{filecontents}
\addbibresource{ref.bib}
\begin{document}
\section{First section}
I want to be able to modifiy the citing style separately here
(\citeauthor{szabo2006} \citeyear{szabo2006} \cite{szabo2006}).

\section{\citesect{szabo2006}}
A citation in the section title without quotes.

\section{\citesectno{szabo2006}}
A citation in the section title without quotes and with the citation number.

\printbibliography
\end{document}

相关内容