Biber 和 \printbiblist{shorttitle}:過濾器和縮短的書目描述的問題

Biber 和 \printbiblist{shorttitle}:過濾器和縮短的書目描述的問題

我的問題與此討論相關: 如何將參考書目縮寫放入速記清單中?

請考慮此程式碼:

\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}

產生這個:

在此輸入影像描述

我的問題:

  1. 是否可以告訴 biber's\printbiblist 在縮寫列表中列印完整的參考文獻描述(等於“參考文獻”下的參考文獻描述),而不是縮寫版本?

  2. 正如您所看到的,表中縮寫和參考文獻描述之間有一個很大的空白。這是因為文章test2較長SHORTTITLE。顯然應用了過濾器處理聖經清單。是否可以避免這種行為,並根據實際顯示的縮寫來格式化表格?

謝謝你!

答案1

1號可以很快解決

\DeclareBibliographyDriver{shorttitle}{\usedriver{}{\thefiel‌​d{entrytype}}\finent‌​ry}

2號可以透過選項解決locallabelwidthbiblatex3.11 中新增)。如果該選項設定為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}

微量元素

相關內容