我正在寻找一种解决方案来重置 biblatex 书目中标签和条目块之间的间距,但直到现在我还没有找到方法。
我的文档中有两个不同的参考书目。一个用于具有相当长键的标准,另一个用于具有 labelalpha 键的标准定义的所有其他内容。
自动计算的键和条目块之间的间距对于符合标准的参考书目来说是可以的,但会导致其他条目的参考书目中出现很大的空白。
有没有办法重新设置参考书目之间的间距,以便可以自动适应不同参考书目的需求?
以下是 MWE:
\documentclass{article}
\begin{filecontents}{Biblio.bib}
@standard{ASI1234_1,
year = {1999},
title = {somethings special in the world, that has to be defined},
urldate = {2012-09-10},
number = {1234-1},
date = {1999-04},
type = {ASI BZN},
version = {1999-04},
organization = {{ASI BZN}}
}
@book{Asendorpf15,
author = {Asendorpf, Jens B.},
year = {2015},
title = {Persönlichkeitspsychologie für Bachelor},
edition = {3., aktualisierte Auflage},
publisher = {{Springer Berlin Heidelberg}},
isbn = {978-3-662-46454-0},
language = {ger},
location = {Berlin, Heidelberg, s.l.},
series = {Springer-Lehrbuch},
doi = {10.1007/978-3-662-46454-0}
}
\end{filecontents}
%%Definition einer Normenklasse für Biblatex
\begin{filecontents}{standards.dbx}
%Modifikation für Normen in Biblatex
\DeclareDatamodelEntryfields[standard]{number,type}
\end{filecontents}
%Pakete für das Literaturverzeichnis mit BibLatex und Einstellung
\usepackage[
style=alphabetic,
% style=draft,
backend=biber,
datamodel=standards]{biblatex}
\addbibresource{Biblio.bib}
\DefineBibliographyStrings{ngerman}{andothers={et\addabbrvspace al\adddot}} %et al. statt u.a.
%\DefineBibliographyStrings{ngerman}{and={\&}} % und zu & machen
\renewcommand*{\labelalphaothers}{} %Zeichen für mehrere Authoren in Abkürzung löschen
%Label für Standard
\DeclareLabelalphaTemplate[standard]{
\labelelement{ %
\field{type} %
} %
\labelelement{ %
\field{number} %
} %
\labelelement{ %
\literal{:} %
} %
\labelelement{ %
\field{year} %
} %
} %
%Eintrag Bibliographie
\DeclareBibliographyDriver{standard}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printfield{type}%
\setunit{\addspace}\newblock%
\printfield{number}%
\setunit{\addcolon}\newblock%
\printfield{year}%
\iffieldundef{month}{%
\setunit{\addspace}\newblock}%
{\setunit{\addperiod}}%
\printfield{month} %
\setunit*{\addspace}\newblock %
\usebibmacro{title}%
\usebibmacro{finentry}}
\begin{document}
Blablablabba \textcite{ASI1234_1} Blababab \textcite{Asendorpf15}
\printbibliography[type=standard,title=Standards]
\printbibliography[nottype=standard]
\end{document}
答案1
这是 3.11 版引入的功能
biblatex
:https://github.com/plk/biblatex/pull/723。您可以使用locallabelwidth=true
全局选项来全局启用此功能,或者通过将选项\printbibliography
直接传递给该命令来本地启用特定的书目。查看旧版本的编辑历史。
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@standard{ASI1234_1,
year = {1999},
title = {somethings special in the world, that has to be defined},
urldate = {2012-09-10},
number = {1234-1},
date = {1999-04},
type = {ASI BZN},
version = {1999-04},
organization = {{ASI BZN}}
}
@book{Asendorpf15,
author = {Asendorpf, Jens B.},
year = {2015},
title = {Persönlichkeitspsychologie für Bachelor},
edition = {3., aktualisierte Auflage},
publisher = {{Springer Berlin Heidelberg}},
isbn = {978-3-662-46454-0},
language = {ger},
location = {Berlin, Heidelberg, s.l.},
series = {Springer-Lehrbuch},
doi = {10.1007/978-3-662-46454-0}
}
\end{filecontents}
\begin{filecontents}{standards.dbx}
\DeclareDatamodelEntryfields[standard]{number,type}
\end{filecontents}
\usepackage[
style=alphabetic,
backend=biber,
locallabelwidth,
datamodel=standards]{biblatex}
\addbibresource{\jobname.bib}
\DefineBibliographyStrings{ngerman}{andothers={et\addabbrvspace al\adddot}}
\renewcommand*{\labelalphaothers}{}
\DeclareLabelalphaTemplate[standard]{
\labelelement{ %
\field{type} %
} %
\labelelement{ %
\field{number} %
} %
\labelelement{ %
\literal{:} %
} %
\labelelement{ %
\field{year} %
} %
} %
\DeclareBibliographyDriver{standard}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\printfield{type}%
\setunit{\addspace}\newblock%
\printfield{number}%
\setunit{\addcolon}\newblock%
\printfield{year}%
\iffieldundef{month}{%
\setunit{\addspace}\newblock}%
{\setunit{\addperiod}}%
\printfield{month} %
\setunit*{\addspace}\newblock %
\usebibmacro{title}%
\usebibmacro{finentry}}
\begin{document}
Blablablabba \textcite{ASI1234_1} Blababab \textcite{Asendorpf15}
\printbibliography[type=standard,title=Standards]
\printbibliography[nottype=standard]
\end{document}