我正在使用 xelatex、biblatex 和 biber
当我用 制作参考书目时\printbibliography
,它可能会因为首字母或卷号等常见元素而断行(见下面的示例)。
我希望在 Vol.~1 和所有其他类似内容中有一个不间断的空格,例如“no. 2”
像在 bib 文件中设置这样的解决方案volume={Vol.~1}
不是我想要的,因为它会使打印区域溢出,并且不太可能手动重写所有条目
我是 LaTeX 新手。有简单的解决方案吗?
更新:MWE
以下是针对我的问题的 MWE。我特意从标题中删除了一些字符,以便您可以看到它的样子
\documentclass{article}
\usepackage[
backend=biber,
maxcitenames=3,
style=gost-numeric,
]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{manning2008introduction,
title={Introduction to informati},
author={Manning, Christopher D and Raghavan, Prabhakar and Sch{\"u}tze, Hinrich},
volume={1},
publisher={Cambridge university press Cambridge}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{manning2008introduction}
\printbibliography
\end{document}
结果
答案1
缩写的 bibstring 后biblatex-gost
使用命令\addabbrvspace
进行间距。
此间距使用abbrvpenalty
惩罚,描述biblatex.def
为
% The counter 'abbrvpenalty' holds the penalty used in short or
% abbreviated bibliography strings. For example, a linebreak in
% expressions such as "et al." or "ed. by" is unfortunate, but should
% still be possible to prevent overfull boxes. We use TeX's
% \hyphenpenalty (normally 50) as the default value. The idea is
% making TeX treat the whole expression as if it were a single,
% hyphenatable word as far as line-breaking is concerned. If you
% dislike such linebreaks, use a higher value. If you do not mind
% them at all, set this counter to zero. If you want to suppress them
% unconditionally, set it to 10000.
\defcounter{abbrvpenalty}{\hyphenpenalty}
所以你可以设置\defcounter{abbrvpenalty}{10000}
(这在你的例子中很有帮助,较小的值似乎没有任何好处)。
但是,如果您不同意这是 的情况abbrvpenalty
(通常\addabbrvspace
似乎只在一个字符串中使用,例如et\addabbrvspace al\adddot
),您可能更喜欢这里的标准\addnbspace
(即~
,或其精简版本\addnbthinspace
),那么您需要重新定义gost-standard.bbx
的定义,如下所示
\DeclareFieldFormat*{volume}{%
\iffieldnum{volume}
{\ifbibstring{volume}
{\bibstring{volume}\addnbspace#1}
{}}
{\ifcapital{\MakeCapital{#1}}{#1}\isdot}}
\DeclareFieldFormat[article,periodical]{volume}{%
\ifbibstring{volume}
{\bibstring{jourvol}\addnbspace#1}
{}}
平均能量损失
\documentclass{article}
\usepackage[
backend=biber,
maxcitenames=3,
style=gost-numeric,
]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{manning2008introduction,
title={Introduction to informati},
author={Manning, Christopher D. and Raghavan, Prabhakar and Sch{\"u}tze, Hinrich},
volume={1},
publisher={Cambridge University Press},
location = {Cambridge},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\DeclareFieldFormat*{volume}{%
\iffieldnum{volume}
{\ifbibstring{volume}
{\bibstring{volume}\addnbspace#1}
{}}
{\ifcapital{\MakeCapital{#1}}{#1}\isdot}}
\DeclareFieldFormat[article,periodical]{volume}{%
\ifbibstring{volume}
{\bibstring{jourvol}\addnbspace#1}
{}}
\begin{document}
\nocite{manning2008introduction}
\printbibliography
\end{document}