防止 Biblatex/biber 中的参考书目条目中间出现分页符和列中断

防止 Biblatex/biber 中的参考书目条目中间出现分页符和列中断

使用biblatexbiber是否有任何方法可以防止在项目中出现分页符/分栏符?下图显示参考书目项目在列尾和页面尾都被拆分。我发现设置可以block=npar解决这个问题,但也通过在各个条目中插入换行符来重新格式化参考书目。

如何保护参考书目条目免受参考书目内的分页和分栏影响?

如您所见,条目被拆分成多列和多页,看起来都不太好。此外,如图所示,分页后也会出现一些问题:LaTeX 将一个大条目拆分成两列。我希望 LaTeX 将两个条目输入到同一列中。

我已添加 MWE 和一张来自我实际工作的图片。

\RequirePackage{filecontents} 
 \begin{filecontents}{jobname.bib}
  @article{DoeA,
  title={The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog},
  author={Doe, John and Bar, Foo and Bob, Joe and Kid, Billy The and Lucky, Luke and Kong, King},
  journal={Journal A of supposed excellence and uncomfortably long titles to make this example work. },
  year={2001}
  }
    @article{DoeB,
  title={The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog},
  author={Doe, John and Bar, Foo and Bob, Joe and Kid, Billy The and Lucky, Luke and Kong, King},
  journal={Journal B of supposed excellence and uncomfortably long titles to make this example work. },
  year={2001}
  }
    @article{DoeC,
  title={The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog},
  author={Doe, John and Bar, Foo and Bob, Joe and Kid, Billy The and Lucky, Luke and Kong, King},
  journal={Journal C of supposed excellence and uncomfortably long titles to make this example work. },
  year={2001}
  }

  @article{Genius02,
  title={Title B},
  author={Genius, Evil and Vader, Darth},
  journal={Journal B},
  year={2002}

}
\end{filecontents}
\documentclass[10pt]{article}

\usepackage{multicol}
  \usepackage[left=2.1cm,right=1.4cm,top=23.5cm,bottom=2cm]{geometry}%Etter mal fra npprj


  \usepackage[backend=bibtex]{biblatex}
    \addbibresource{jobname.bib}

\begin{document}
\begin{multicols}{2}
  \nocite{DoeA,DoeB,DoeC,Genius02}

\printbibliography
\end{multicols}
\end{document}

在此处输入图片描述

答案1

您的问题是您需要将不同惩罚的值更改为10000(不允许)。

最简单的方法是用包etoolbox和命令修补相关命令\patchcmd{\command-to-be-patched}{search-code}{replace-code}{sucess}{failure}(请参阅注释!):

\usepackage{etoolbox}  % <============================ to patch penaltys
\patchcmd{\thebibliography}{\clubpenalty4000}{\clubpenalty10000}{}{}     % no orphans
\patchcmd{\thebibliography}{\widowpenalty4000}{\widowpenalty10000}{}{}   % no widows
\patchcmd{\bibsetup}{\interlinepenalty=5000}{\interlinepenalty=10000}{}{} % no break of entry

因此,有了这个完整的 MWE

\RequirePackage{filecontents} 
\begin{filecontents}{\jobname.bib}
@article{DoeA,
  title={The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog},
  author={Doe, John and Bar, Foo and Bob, Joe and Kid, Billy The and Lucky, Luke and Kong, King},
  journal={Journal A of supposed excellence and uncomfortably long titles to make this example work. },
  year={2001},
}
@article{DoeB,
  title={The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog},
  author={Doe, John and Bar, Foo and Bob, Joe and Kid, Billy The and Lucky, Luke and Kong, King},
  journal={Journal B of supposed excellence and uncomfortably long titles to make this example work. },
  year={2001}
}
@article{DoeC,
  title={The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog},
  author={Doe, John and Bar, Foo and Bob, Joe and Kid, Billy The and Lucky, Luke and Kong, King},
  journal={Journal C of supposed excellence and uncomfortably long titles to make this example work. },
  year={2001},
}
@article{Genius02,
  title={Title B},
  author={Genius, Evil and Vader, Darth},
  journal={Journal B},
  year={2002},
}
\end{filecontents}


\documentclass[10pt]{article}

\usepackage{multicol}
\usepackage[left=2.1cm,right=1.4cm,top=23.5cm,bottom=2cm]{geometry}

\usepackage[backend=bibtex]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{showframe} % <========================= to show typing area!
\usepackage{etoolbox}  % <============================ to patch penaltys
\patchcmd{\thebibliography}{\clubpenalty4000}{\clubpenalty10000}{}{}     % no orphans
\patchcmd{\thebibliography}{\widowpenalty4000}{\widowpenalty10000}{}{}   % no widows
\patchcmd{\bibsetup}{\interlinepenalty=5000}{\interlinepenalty=10000}{}{} % no break of entry


\begin{document}
\begin{multicols}{2}
\nocite{DoeA,DoeB,DoeC,Genius02}

\printbibliography
\end{multicols}
\end{document}

您会得到以下结果(我使用包showframe来可视化生成的打字区域):

显示的 pdf 第一页

相关内容