![如何减少小字体单段 biblatex 书目中的行距](https://linux22.com/image/421002/%E5%A6%82%E4%BD%95%E5%87%8F%E5%B0%91%E5%B0%8F%E5%AD%97%E4%BD%93%E5%8D%95%E6%AE%B5%20biblatex%20%E4%B9%A6%E7%9B%AE%E4%B8%AD%E7%9A%84%E8%A1%8C%E8%B7%9D.png)
我正在尝试使用创建一个压缩的单段书目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}
以下是最终的输出,看起来像是单行间距: