我希望建立一个速记列表,其中还包含使用的缩写里面书目(我特别考虑的是短期刊领域)。
请考虑以下示例:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}
\usepackage[backend=biber,style=authoryear]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Lutzeier1983,
Author = {Peter Rolf Lutzeier},
Journal = {Zeitschrift f{\"u}r Sprachwissenschaft},
Shortjournal = {ZfS},
Pages = {45-71},
Shorttitle = {Wortfelder},
Title = {Wortfelder als Ma{\ss}stab f{\"u}r Interpretationen an Beispielen des Feldes der Stimmungen im Deutschen},
Volume = {2},
Year = {1983},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Lutzeier1983}
\printshorthands
\printbibliography
\end{document}
我希望 biblatex 能建立简写列表自动地通过使用字段 journal 和 shortjournal。我怎样才能告诉 biblatex 以与字段 shorthand 类似的方式处理字段 shortjournal?
我能想到的唯一可能性是手动添加类似
@book{AbkZfS,
Options = {skipbib=true},
Shorthand = {ZfS},
Title = {Zeitschrift f{\"u}r Sprachwissenschaft}}
到 bib 文件和命令
\nocite{AbkZfS}
到 tex 文件。有没有更方便的方式来获取包括“Zfs = Zeitschrift f{\"u}r Sprachwissenschaft”这样的行的速记列表?
谢谢你!
答案1
从 biblatex 2.9/biber 1.9 开始,这成为可能。使用 biber 时,整个\printshorthands
功能都经过了修订和推广。所有详细信息都在 PDF 手册中,并且 biblatex 附带了一个新的示例文件 (92-bibliographylists.tex)。\printshorthands
现在根据这个新系统实施。下面是一个例子。
\documentclass{article}
\usepackage{fontspec}
\usepackage[style=authoryear]{biblatex}
\begin{filecontents}{\jobname.bib}
@ARTICLE{test1,
AUTHOR = {John Smith},
TITLE = {A Tremendously Interesting Opinion},
SHORTHAND = {JSTIP},
SHORTTITLE = {TIP},
JOURNALTITLE = {Journal of Tremendously Interesting Opinions},
SHORTJOURNAL = {JTIO},
VOLUME = {1},
NUMBER = {1},
YEAR = {1947}
}
@ARTICLE{test2,
AUTHOR = {John Tumble},
TITLE = {A Tremendously Interesting Idea},
SHORTHAND = {JSTII},
SHORTTITLE = {TII},
JOURNALTITLE = {Journal of Tremendously Interesting Ideas},
SHORTJOURNAL = {JTII},
VOLUME = {1},
NUMBER = {1},
YEAR = {1946}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\DeclareBibliographyDriver{shortjournal}{%
\printfield{journaltitle}}
\DeclareBibliographyDriver{shorttitle}{%
\printfield{title}}
\begin{document}
\nocite{*}
\printshorthands% With biber, just an alias for \printbiblist{shorthand}
\printbiblist[title={Journal Shorthands}]{shortjournal}
\printbiblist[title={Title Shorthands}]{shorttitle}
\printbibliography
\end{document}
其结果是:
如果您需要确保任何此类列表都有唯一的键,bibcheck
则会自动创建一个并以列表命名,因此如果您在同一个日记帐中有多个具有相同的条目shortjournaltitle
,那么您会得到重复的条目,并且可以使用以下方法解决此问题:
\let\sjnames\relax
\defbibcheck{shortjournal}{%
\xifinlist{\thefield{shortjournal}}\sjnames
{\skipentry}
{\listxadd\sjnames{\thefield{shortjournal}}}}
答案2
考虑到 PLK 的评论,这里有一个您可以暂时使用的解决方法。遗憾的是,期刊标题的简写仍然需要指定为单独的条目(类型customa
),但它会为您调用\nocite
。
该解决方案还允许您省略journaltitle
带有字段article
的条目shortjournal
。可以使用 恢复长标题\entrydata
。下面用 Muller 的文章演示了这一点。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[german]{babel}
\usepackage[style=authoryear,sorting=nty]{biblatex}
\DeclareBibliographyDriver{customa}{%
\printfield{title}%
\nopunct}
\AtEveryCitekey{%
\iffieldundef{shortjournal}
{}
{\nocite{\thefield{shortjournal}}}}
\renewbibmacro*{journal}{%
\iffieldundef{shortjournal}
{\iffieldundef{journaltitle}
{}
{\printtext[journaltitle]{%
\printfield[titlecase]{journaltitle}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{journalsubtitle}}}}
{\printfield{shortjournal}}}
\newbibmacro*{journal:long}{%
\iffieldundef{journaltitle}
{\iffieldundef{shortjournal}
{}
{\entrydata{\thefield{shortjournal}}
{\printtext[journaltitle]{\printfield[titlecase]{title}}}}}
{\printtext[journaltitle]{\printfield[titlecase]{journaltitle}}}}
\AtBeginShorthands{%
\renewbibmacro*{journal}{\usebibmacro{journal:long}}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@customa{WMQ,
Shorthand = {WMQ},
Title = {William and Mary Quarterly}}
@customa{ZfS,
Shorthand = {ZfS},
Title = {Zeitschrift f{\"u}r Sprachwissenschaft}}
@customa{ZHF,
Shorthand = {ZHF},
Title = {Zeitschrift für historische Forschung}}
@article{Muller,
Author = {J{\"o}rn M{\"u}ller},
Shorthand = {Ergon},
Shortjournal = {ZHF},
Pages = {513-542},
Title = {Ergon und eudaimonia},
Volume = {57,4},
Year = {2003}}
@book{companion,
Author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
Title = {The LaTeX Companion},
Edition = {1},
Publisher = {Addison-Wesley},
Location = {Reading, Mass.},
Year = {1994}}
@article{Reese,
Author = {Reese, Trevor R.},
Title = {Georgia in Anglo-Spanish Diplomacy, 1736-1739},
Journaltitle = {William and Mary Quarterly},
Shortjournal = {WMQ},
Volume = {15},
Series = {3},
Date = {1958},
Pages = {168--190}}
@article{Lutzeier,
Author = {Peter Rolf Lutzeier},
Shorthand = {PRL},
Journal = {Zeitschrift f{\"u}r Sprachwissenschaft},
Shortjournal = {ZfS},
Pages = {45-71},
Shorttitle = {Wortfelder},
Title = {Wortfelder als Ma{\ss}stab f{\"u}r Interpretationen an
Beispielen des Feldes der Stimmungen im Deutschen},
Volume = {2},
Year = {1983}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{companion,Muller,Lutzeier,Reese}
\printshorthands
\printbibliography[nottype=customa]
\end{document}