参考点的垂直错位

参考点的垂直错位

在我的参考文献中,每个名字的书写都出现了奇怪的垂直错位,例如: 在此处输入图片描述

我真的不知道为什么会发生这种情况......

MWE(.cls文件)

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{solutionclass}[2023/03/03 My Custom LaTeX Class for exercise solutions]

\LoadClass[a4paper, twoside, 11pt]{book}

\RequirePackage[portuguese, english]{babel} 
\RequirePackage[utf8]{inputenc} 
\RequirePackage[T1]{fontenc} 
\RequirePackage[backend    = biber, 
            style      = ext-authoryear-comp,
            sorting    = nyvt, 
            backref    = false,
            articlein  = false,
            uniquename = true,
            doi        = true, 
            dashed     = false]{biblatex}
\addbibresource{bib.bib}
\DeclareFieldFormat[article,periodical]{volume}{\mkbibbold{#1}}

\AtEndDocument{%
    \clearpage
    \pagestyle{fancy}
    \markboth{\textsc{References}}{\textsc{References}}
    \printbibliography[heading=bibintoc, title=References]
} 

MWE(.bib文件)

@book{Choquet-BruhatGR,
    title = {General Relativity and the Einstein Equations},
    author = {Choquet-Bruhat, Yvonne},
    date = {2009},
    volume = {I},
    publisher = {Oxford University Press},
    location = {Oxford}
}

@book{Choquet-BruhatGR2,
    title = {Introduction to general relativity, black holes, and cosmology},
    author = {Choquet-Bruhat, Yvonne},
    date = {2015},
    volume = {I},
    publisher = {Oxford University Press},
    location = {Oxford}
}

答案1

假设标准设置,你的参考书目排版为两端对齐的文本- 就像文档其余部分的普通文本一样。这意味着 TeX 会尝试使所有行在右边距均匀相接。这与左对齐文本相反,左对齐文本在右边距上不均匀相接,并且看起来更“参差不齐”。

对齐主要通过稍微扩大或压缩行中空格的宽度来实现。这正是您在屏幕截图中显示的效果。由于这些行中排版的文本不同,并且具有不同的自然宽度,因此 TeX 必须压缩/扩大空格以补偿不同的宽度并使行尾很好地衔接。

\documentclass[a4paper, 11pt, british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear, dashed=false]{biblatex}

\begin{filecontents}{\jobname.bib}
@book{Choquet-BruhatGR,
  title     = {General Relativity and the {Einstein} Equations},
  author    = {Choquet-Bruhat, Yvonne},
  date      = {2009},
  volume    = {I},
  publisher = {Oxford University Press},
  location  = {Oxford},
}
@book{Choquet-BruhatGR2,
  title     = {Introduction to General Relativity, Black Holes, and Cosmology},
  author    = {Choquet-Bruhat, Yvonne},
  date      = {2015},
  volume    = {I},
  publisher = {Oxford University Press},
  location  = {Oxford},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson,Choquet-BruhatGR,Choquet-BruhatGR2}

\printbibliography
\end{document}

合理的书目

如果你放弃对齐,你仍然可以得到相同的空间。但当然,那时你甚至不再有右边缘。这在参考书目中可能实际上不是太糟糕,因为大多数条目本来就不那么长。

\documentclass[a4paper, 11pt, british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{ragged2e}
\usepackage[backend=biber, style=authoryear, dashed=false]{biblatex}

\begin{filecontents}{\jobname.bib}
@book{Choquet-BruhatGR,
  title     = {General Relativity and the {Einstein} Equations},
  author    = {Choquet-Bruhat, Yvonne},
  date      = {2009},
  volume    = {I},
  publisher = {Oxford University Press},
  location  = {Oxford},
}
@book{Choquet-BruhatGR2,
  title     = {Introduction to General Relativity, Black Holes, and Cosmology},
  author    = {Choquet-Bruhat, Yvonne},
  date      = {2015},
  volume    = {I},
  publisher = {Oxford University Press},
  location  = {Oxford},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson,Choquet-BruhatGR,Choquet-BruhatGR2}

\begingroup
\RaggedRight
\printbibliography
\endgroup
\end{document}

Raggedright 书目

相关内容