如何减少小字体单段 biblatex 书目中的行距

如何减少小字体单段 biblatex 书目中的行距

我正在尝试使用创建一个压缩的单段书目biblatex,就像这个答案。我还想让字体比文档的主字体小一点。我通过设置来实现这一点\bibfont;然而,这会产生看起来像双倍行距的东西,但我只想要单倍行距。我认为

\renewcommand*{\bibfont}{\fontsize{5pt}{7pt}\selectfont}

会处理这个问题,因为\fontsize应该也设置该\baselineskip值。有人知道为什么我在参考书目中有这么大的行距吗?我怎样才能将此间距减小到看起来像正常的单倍行距?

\begin{filecontents*}{\jobname.bib}
@article{a1,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201--204},
  year = {1999},
}
@article{a2,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201--204},
  year = {2000},
}
@article{a3,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201--204},
  year = {2001},
}
@article{a4,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201--204},
  year = {2002},
}
@article{a5,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201--204},
  year = {2003},
}
\end{filecontents*}
\documentclass{article}

\usepackage[american]{babel}

\usepackage{csquotes}

\usepackage[backend=biber,
  style=authoryear-comp,
  maxcitenames=2,
  maxnames=1,
  minnames=1,
  firstinits=true]{biblatex}

\addbibresource{\jobname.bib}

\renewcommand*{\bibfont}{\fontsize{5pt}{7pt}\selectfont}

\defbibenvironment{bibliography}
  {}
  {}
  {\addspace}

\begin{document}

\nocite{*}
\printbibliography

\end{document}

该图显示了参考书目条目之间的较大间距

答案1

问题是,如果在参考书目环境中没有结束水平模式,则 的值\baselineskip将恢复为文档中其他地方的值。这将在这个答案在环境中使用较小字体时减少行距

\endgraf您可以通过输入<end code>以下命令来结束段落(即结束水平模式并强制将材料分成几行)\defbibenvironment

\defbibenvironment{bibliography}
  {}
  {\endgraf}
  {\addspace}

你必须使用\endgraf在这里使用 而不是\par,否则会出错(请参阅何时使用 \par 比 \endgraf 更好?讨论\par和之间的区别\endgraf)。

以下是完整的 MWE:

\begin{filecontents*}{\jobname.bib}
@article{a1,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201-204},
  year = {1999},
}
@article{a2,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201-204},
  year = {2000},
}
@article{a3,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201-204},
  year = {2001},
}
@article{a4,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201-204},
  year = {2002},
}
@article{a5,
  author = {Smith, Jane},
  journal = {Nature},
  volume = {7},
  pages = {201-204},
  year = {2003},
}
\end{filecontents*}
\documentclass{article}

\usepackage[american]{babel}

\usepackage{csquotes}

\usepackage[backend=biber,
  style=authoryear-comp,
  maxcitenames=2,
  maxnames=1,
  minnames=1,
  firstinits=true]{biblatex}

\addbibresource{\jobname.bib}

\renewcommand*{\bibfont}{\fontsize{5pt}{7pt}\selectfont}

\defbibenvironment{bibliography}
  {}
  {\endgraf}
  {\addspace}

\begin{document}

\nocite{*}
\printbibliography

\end{document}

以下是最终的输出,看起来像是单行间距:

在此处输入图片描述

相关内容