我的问题与以下讨论有关: 如何将参考书目的缩写纳入简写列表?
请考虑此代码:
\documentclass{article}
\usepackage{fontspec}
\usepackage[style=authoryear]{biblatex}
\begin{filecontents}{\jobname.bib}
@ARTICLE{test1,
AUTHOR = {John Smith},
TITLE = {A Tremendously Interesting Opinion},
SHORTTITLE = {TIP},
JOURNALTITLE = {Journal of Tremendously Interesting Opinions},
SHORTJOURNAL = {JTIO},
VOLUME = {1},
NUMBER = {1},
YEAR = {1950},
KEYWORDS = {important},
}
@ARTICLE{test2,
AUTHOR = {John Tumble},
TITLE = {A Tremendously Interesting Idea},
SHORTTITLE = {ABITLONGERSHORTTITLE},
JOURNALTITLE = {Journal of Tremendously Interesting Ideas},
VOLUME = {1},
NUMBER = {1},
YEAR = {1960},
}
@BOOK{book1,
AUTHOR = {Peter Johnson},
TITLE = {A Tremendously Interesting Title of Book One},
SHORTTITLE = {ATIT},
TRANSLATOR = {John Smith},
ORIGLANGUAGE = {german},
VOLUME = {1},
LOCATION = {London},
PUBLISHER = {Publisher},
YEAR = {1950},
KEYWORDS = {important},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
%\printbiblist[title={Abbreviations}]{shorttitle}
\printbiblist[title={Abbreviations of Important Publications},keyword=important]{shorttitle}
\printbibliography
\end{document}
结果是:
我的问题:
是否可以告诉 biber
\printbiblist
在缩写列表(等同于“参考文献”下的列表)中打印完整的书目描述,而不是缩短的版本?如您所见,表格中的缩写和书目描述之间有一个很大的空白。这是因为文章的
test2
较长SHORTTITLE
。显然应用了过滤器后处理书目列表。是否可以避免这种行为,并根据实际显示的缩写来格式化表格?
谢谢你!
答案1
1号可以很快解决
\DeclareBibliographyDriver{shorttitle}{\usedriver{}{\thefield{entrytype}}\finentry}
2号locallabelwidth
可以通过选项(3.11 版新增)解决biblatex
。如果将选项设置为,true
则仅使用当前书目(列表)中的条目来确定标签宽度。
\printbiblist[title={Abbreviations of Important Publications}, keyword=important, locallabelwidth]{shorttitle}
然后给出所需的输出。
答案2
好的。我意识到我没有这样做biblatex-sbl
(我想要一个来自多个字段的缩写组合列表。)但我认为我仍然通过修改biblatex
内部的几个宏找到了解决您问题的方法。我认为不会有任何副作用,但它相当具体地针对您的问题,而不是通用的。试试这个:
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{test1,
AUTHOR = {John Smith},
TITLE = {A Tremendously Interesting Opinion},
SHORTTITLE = {TIP},
JOURNALTITLE = {Journal of Tremendously Interesting Opinions},
SHORTJOURNAL = {JTIO},
VOLUME = {1},
NUMBER = {1},
YEAR = {1950},
KEYWORDS = {important},
}
@ARTICLE{test2,
AUTHOR = {John Tumble},
TITLE = {A Tremendously Interesting Idea},
SHORTTITLE = {ABITLONGERSHORTTITLE},
JOURNALTITLE = {Journal of Tremendously Interesting Ideas},
VOLUME = {1},
NUMBER = {1},
YEAR = {1960},
}
@BOOK{book1,
AUTHOR = {Peter Johnson},
TITLE = {A Tremendously Interesting Title of Book One},
SHORTTITLE = {ATIT},
TRANSLATOR = {John Smith},
ORIGLANGUAGE = {german},
VOLUME = {1},
LOCATION = {London},
PUBLISHER = {Publisher},
YEAR = {1950},
KEYWORDS = {important},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\pagestyle{empty}
% Print complete bibliographic information in list of abbreviations
\DeclareBibliographyDriver{shorttitle}{\usedriver{}{\thefield{entrytype}}\finentry}
\makeatletter
% Make new importantlabelwidth lengths
\def\do#1{\expandafter\newlength\expandafter{\csname important#1width\endcsname}}
\abx@dolabelfields
% Redefine \blx@bbl@labelfields to also calculate important widths
\def\blx@bbl@labelfields{%
\def\do##1{%
\ifcsundef{abx@field@##1}
{}
{% calculate label widths
\blx@setlabwidth{\csname ##1width\endcsname}{%
\csuse{abx@ffd@*@##1width}{\csname abx@field@##1\endcsname}}%
% calculate important label widths
\ifkeyword{important}
{\blx@setlabwidth{\csname important##1width\endcsname}{%
\csuse{abx@ffd@*@important##1width}{\csname abx@field@##1\endcsname}}}
{}}}%
\abx@dolabelfields}
\makeatother
% New bibliography environment to print the important shorttitles
% This is modified from the standard shorthand bibenvironment
\defbibenvironment{importantshorttitle}
{\list
{\printfield[shorthandwidth]{shorttitle}}
{\setlength{\labelwidth}{\importantshorttitlewidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\renewcommand*{\makelabel}[1]{##1\hss}}}
{\endlist}
{\item}
\begin{document}
\nocite{*}
\printbiblist[title={Abbreviations}]{shorttitle}
\printbiblist[title={Abbreviations of Important
Publications},keyword=important,env=importantshorttitle]{shorttitle}
\printbibliography
\end{document}