在 BibLaTeX 文本中引用出版商

在 BibLaTeX 文本中引用出版商

假设我有以下数据库:

@book{croyle2014,
title={Public Update for Drought Response: Groundwater Basins with Potential Water Shortages and Gaps in Groundwater Monitoring},
author={Croyle, William and Gutierrez, David and Ericson, Jon and Alemi, Manucher and Mathis, Dane and Scruggs, Mary},
publisher={California Department of Water Resources},
year={2014},
url={http://www.water.ca.gov/waterconditions/docs/Drought_Response-Groundwater_Basins_April30_Final_BC.pdf},
urldate={2016-09-04}
}

我想在我的文章中引用这本书的出版商,也就是加州水资源部。我知道\citeauthor命令,但显然没有\citepublisher,那么我该如何实现呢?

\documentclass{article}
\usepackage{biblatex}
\addbibresource{sources.bib}
\begin{document}

The survey was done by \citepublisher{croyle2014}. %Adjust that so that it works.

\end{document}

答案1

\citelist{croyle2014}{publisher}

有关详细信息和可选参数,请参阅当前手册的第 94 页。

如果你预计会经常使用它,你可以说

\DeclareCiteCommand\citepublisher
  {\boolfalse{citetracker}% supplemented from moewe's answer: https://tex.stackexchange.com/a/207676/
   \boolfalse{pagetracker}}
  {\printlist{publisher}}
  {\multicitedelim}
  {}

[根据 moewe 的建议进行编辑,基于这个答案]

然后写

\citepublisher{}

例如,

\begin{filecontents}{\jobname.bib}
@book{croyle2014,
title={Public Update for Drought Response: Groundwater Basins with Potential Water Shortages and Gaps in Groundwater Monitoring},
author={Croyle, William and Gutierrez, David and Ericson, Jon and Alemi, Manucher and Mathis, Dane and Scruggs, Mary},
publisher={California Department of Water Resources},
year={2014},
url={http://www.water.ca.gov/waterconditions/docs/Drought_Response-Groundwater_Basins_April30_Final_BC.pdf},
urldate={2016-09-04}
}
\end{filecontents}

\documentclass{article}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\DeclareCiteCommand\citepublisher
  {\boolfalse{citetracker}% supplemented from moewe's answer: https://tex.stackexchange.com/a/207676/
   \boolfalse{pagetracker}}
  {\printlist{publisher}}
  {\multicitedelim}
  {}
\begin{document}

The survey was done by \citelist{croyle2014}{publisher}.

\citepublisher{croyle2014}

\end{document}

出版商

这样你就不必记住publisher是 alist还是 a field。当然,如果你想要正确格式化出版商列表,定义将需要更复杂一些,但上面给出了填写详细信息的基本模板。

相关内容