为不同的参考书目部分指定左边距 - Biblatex

为不同的参考书目部分指定左边距 - Biblatex

在我的文档中,我使用 打印了各种子参考书目biblatex。由于我引用了一些规范,并希望使用它们的完整编号作为简写,因此左侧的边距非常宽。

是否有可能将这些边距指定为

  • 设置为此子书目中引用简写的最大宽度

  • 设置为手动选择的值。

其中一个选项就足够了。

我的 MWE 如下所示:

\documentclass{article}
\usepackage[style=alphabetic,   % Zitierstil
        maxbibnames=6,          % Anzahl an AUtoren, die in Bibliographie gezeigt werden
        minbibnames=2,
        sorting=anyt,
        backend=biber]{biblatex}

\addbibresource{test.bib}

\begin{document}
\nocite{*}

\printbibheading
\printbibliography[type=book,heading=subbibliography,title=Books]
\printbibliography[type=online,heading=subbibliography,title=Online]

\end{document}

文件中内容如下test.bib

@book{adams,
  author =   {Douglas Adams},
  title =    {The hitchhikers guide to the universe},
  publisher =    {Publisher},
  year =     {2042}
}

@online{myboringexamplewebpage,
  title = {My boring example webpage},
  url = {http://www.example.com},
  author = {{Myself}},
  urldate = {2015-02-04},
  shorthand = {myexamplewebpagefrom2015}
}

此处的在线资源是使用长速记规范的示例。因此,我希望在第一的根据所显示速记的实际宽度,子书目会更小。

在此处输入图片描述

答案1

locallabelwdith选项可以提供帮助。请参阅重置不同书目中的标签和条目之间的间距

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{adams,
  author    = {Douglas Adams},
  title     = {The hitchhikers guide to the universe},
  publisher = {Publisher},
  year      = {2042}
}

@online{myboringexamplewebpage,
  title     = {My boring example webpage},
  url       = {http://www.example.com},
  author    = {{Myself}},
  urldate   = {2015-02-04},
  shorthand = {myexamplewebpagefrom2015}
}
\end{filecontents*}

\usepackage[style=alphabetic,
        maxbibnames=6,
        minbibnames=2,
        sorting=anyt,
        locallabelwidth,
        backend=biber]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}

\printbibheading
\printbibliography[type=book,heading=subbibliography,title=Books]
\printbibliography[type=online,heading=subbibliography,title=Online]
\end{document}

两个具有不同左缩进的参考书目。

答案2

这是“手动选择值”的方法:

在组内设置相关的“标签宽度”。如果您知道所需的“精确”宽度(例如字符串的宽度),[Ada42]则可以使用命令\settowidth;否则\setlength可以使用。

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{adams,
  author =   {Douglas Adams},
  title =    {The hitchhikers guide to the universe},
  publisher =    {Publisher},
  year =     {2042}
}

@online{myboringexamplewebpage,
  title = {My boring example webpage},
  url = {http://www.example.com},
  author = {{Myself}},
  urldate = {2015-02-04},
  shorthand = {myexamplewebpagefrom2015}
}
\end{filecontents*}

\usepackage[style=alphabetic,   % Zitierstil
        maxbibnames=6,          % Anzahl an AUtoren, die in Bibliographie gezeigt werden
        minbibnames=2,
        sorting=anyt,
        backend=biber]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}

\printbibheading
\begingroup
% \labelalphawidth is the relevant value for the 'alphabetic' style
\settowidth\labelalphawidth{[Ada42]}% 
% \setlength\labelalphawidth{4em}% <-- easier to err on the side of caution this way; but make sure it is larger than the largest label...
\printbibliography[type=book,heading=subbibliography,title=Books]
\endgroup
\printbibliography[type=online,heading=subbibliography,title=Online]

\end{document}

相关内容