Biblatex:需要时参考书目强制标题换行

Biblatex:需要时参考书目强制标题换行

嘿,我最近在我的参考书目中发现了一个问题,但不知怎么就解决不了。当标题太长时就会出现这个问题,但只要标题足够短,它就可以正常处理 URL,如您在第二个示例中看到的那样。

似乎像“[]”这样的符号是由某些东西生成的,并且日志显示段落中有 2x Overfull \hbox(X pt 太宽)。只要我从标题中的 URL 中删除点,它就会像应该的那样自动中断,但它实际上应该看到 URL 太大并自动中断。

生成的 latex 文档

设置:document.tex 和 bib/literature.bib

设置:pdfLatex(使用 biber 和 texindy)

最小示例:

\documentclass[
    11pt,
    a4paper
]{scrreprt}

% add bibliography
\usepackage[style=alphabetic, sorting=anyt]{biblatex}
\addbibresource{bib/literature.bib}

\usepackage[colorlinks, urlcolor=blue]{hyperref}

\begin{document}
    \cite{Gaedke}
    \cite{IOT}

    \printbibliography
\end{document}

文献资料

@online{Gaedke,
    author = {Gaedke, Martin and Heil, Andreas},
    title = {{GET /dgs HTTP/1.1 Host: www.WebComposition.net.}},
    url = {http://www.mendeley.com/research/dgs-http11-host-wwwwebcompositionnet/},
    urldate={2018-08-19}
}
@online{IOT,
    author = {Litzel, Nico },
    title = {Was ist das Internet of Things?},
    url = {https://www.bigdata-insider.de/was-ist-das-internet-of-things-a-590806/},
    urldate={2018-08-19}
}

答案1

的值url会自动换行,但在其他情况下,您必须对其进行适当标记。此外,第一个条目应该是@inproceedings,第二个条目应该有date

\begin{filecontents}{\jobname.bib}
@inproceedings{Gaedke,
    author = {Gaedke, Martin and Heil, Andreas},
    title = {{GET} {/dgs} {HTTP}/1.1 Host: \url{www.WebComposition.net}},
    url = {http://www.mendeley.com/research/dgs-http11-host-wwwwebcompositionnet/},
    urldate={2018-08-19},
    booktitle = {Proceedings of the 42nd Annual Hawaii International Conference on System Sciences},
    date = 2009,
    organization = {HICSS},
}
@online{IOT,
    author = {Litzel, Nico},
    title = {Was ist das Internet of Things?},
    url = {https://www.bigdata-insider.de/was-ist-das-internet-of-things-a-590806/},
    urldate={2018-08-19},
    date = {2016-01-09},
}
\end{filecontents}

\documentclass[11pt, a4paper]{scrreprt}
\usepackage[style=alphabetic, sorting=anyt]{biblatex}
\addbibresource{\jobname.bib}
\usepackage[colorlinks, urlcolor=blue]{hyperref}

\begin{document}
\cite{Gaedke}
\cite{IOT}

\printbibliography
\end{document}

输出

这确实会破坏标题中的 URL,但我们仍然会得到一个坏框,因为 TeX 无法找到进一步分解 URL 的好方法。或者更可能是软件包urlhyperref的版本无法做到这一点。

如果您希望 URL 无论如何都会被破坏,则可以相应地设置惩罚。例如,添加

\setcounter{biburlnumpenalty}{9000}
\setcounter{biburlucpenalty}{9000}
\setcounter{biburllcpenalty}{9000}

生产

替代输出

反而。

\documentclass[11pt, a4paper]{scrreprt}
\usepackage[style=alphabetic, sorting=anyt]{biblatex}
\addbibresource{\jobname.bib}
\usepackage[colorlinks, urlcolor=blue]{hyperref}
\setcounter{biburlnumpenalty}{9000}
\setcounter{biburlucpenalty}{9000}
\setcounter{biburllcpenalty}{9000}
\begin{document}
\cite{Gaedke}
\cite{IOT}

\printbibliography
\end{document}

相关内容