我是 LaTeX 的新手,对此有一些疑问biblatex
。
对于我的论文,参考书目部分将有“主要来源”和“次要来源”。缩写仅适用于这些主要来源。当我第一次引用它们时,我只需要简短的标题,但当我第二次引用文本时,我需要让简写开始发挥作用。
因此,我想知道如何使用\citetitle
才能享受的功能shorthandintro
?我从这里学到了(bibtex 中引用的自定义缩写),而第二种解决方案仅适用于\cite
。但是,我想要的是引用书名(简称),并加上“此后 xxx”,下次只引用首字母缩略词。
例如:
- 在一段话中:Manusmṛti(以下简称 MS)...从 MS 中我们知道......
- 在参考书目中:主要来源:[MS] Manusmṛti 和 Manubhāṣya。由...编辑次要来源:Karl, M. (1987)。如何引用某物。牛津。
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{filecontents}
\usepackage[backend=biber,
citestyle=authoryear,
bibstyle=alphabetic,
sorting=nty,
citetracker=true]{biblatex}
\begin{filecontents*}{\jobname.bib}
@book{ms32,
editor = {XXX},
title = {MS in wonderland with others and so on},
shorttitle = MS in wonderland
year = {1932},
publisher = {YYY},
shorthand = {MS},
keywords = {Primary},
}
@book{Karl87,
author = {Mark Karl},
title = {How to cite something},
year = {1987},
publisher = {Oxford},
keywords = {Secondary},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\newbibmacro*{longcite}{%
\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:lable}%
\setunit{\addspace}}
{\printnames{labelname}%
\setunit{\nameyeardelim}}%
\usebibmacro{cite:labelyear+extrayear}}
%Can I make some changes here, so \citetitle also works?
\renewbibmacro*{cite:title}{%
\ifciteseen
{\iffieldundef{shorthand}
{\usebibmacro{longcite}}
{\usebibmacro{cite:shorthand}}}
{\usebibmacro{longcite}
\usebibmacro{shorthandintro}}}
\begin{document}
This is found in \citetitle{ms32} (the short title "MS in wonderland" is shown here). Something else... and cite again but use the acronym MS, \cite{ms32} works perfectly as showing only the MS.
To cite a secondary source, \textcite[36]{Karl87}.
\printbibliography[keyword={Primary},title={Primary Sources}]
\printbibliography[keyword={Secondary},title={Secondary Sources}]
\end{document}
答案1
如果我们可以假设某个条目有一个shorthand
字段当且仅当它是主要来源,我建议采用以下方法。
我们不再按关键字过滤,而是使用 bibcheck 建议的biblatex:从主要参考书目中排除简写条目用shorthand
s 过滤条目。要打印shorthand
s,我们可以使用\printshorthand
s。
options = {useeditor=false},
请注意,如果您不希望编辑器显示在shorthand
相关作品列表中的标题之前,则可以获得更好的结果。
\documentclass[12pt]{article}
\usepackage[
backend=biber,
style=authoryear,
citetracker=true,
]{biblatex}
\defbibcheck{noshorthand}{%
\iffieldundef{shorthand}{}{\skipentry}%
}
\newbibmacro*{normalcite}{%
\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}}
{\printnames{labelname}%
\setunit{\printdelim{nameyeardelim}}}%
\usebibmacro{cite:labeldate+extradate}}
\renewbibmacro*{cite}{%
\iffieldundef{shorthand}
{\usebibmacro{normalcite}}
{\ifciteseen
{\usebibmacro{cite:shorthand}}
{\usebibmacro{cite:label}%
\usebibmacro{shorthandintro}}}}
\begin{filecontents*}{\jobname.bib}
@book{ms32,
editor = {XXX},
title = {MS in wonderland with others and so on},
shorttitle = {MS in wonderland},
year = {1932},
publisher = {YYY},
shorthand = {MS},
keywords = {Primary},
options = {useeditor=false},
}
@book{Karl87,
author = {Mark Karl},
title = {How to cite something},
year = {1987},
publisher = {Oxford},
keywords = {Secondary},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
Lorem \cite{ms32}
ipsum \cite{ms32}
dolor \textcite[36]{Karl87}.
\printshorthands[title={Primary Sources}]
\printbibliography[check=noshorthand, title={Secondary Sources}]
\end{document}