拆分参考书目页面以避免框过满

拆分参考书目页面以避免框过满

我正在尝试打印参考书目,但“第 XXX-XXX 页”的框太满。我已经审阅了这个答案seqsplit正如提到的ISBN 和其他长数字不起作用,更糟糕的是,它会引发下一个错误:

!Package etoolbox Error: Toggle 'bbx:pageranges' undefined.

这是我的文件

\RequirePackage{fix-cm}
\documentclass[12pt, table, letterpaper]{report}

\usepackage[english,spanish,es-tabla]{babel}
\usepackage[
    letterpaper,
    top = 18mm,
    left = 20mm,
    right= 20mm,
    bottom = 18mm
]{geometry}
\usepackage{fontspec}
\usepackage[hidelinks]{hyperref}
\usepackage[
    thresholdtype=words
]{csquotes}
\usepackage[
    backend=biber,
    style=ieee,
    url=false,
    hyperref=true,
]{biblatex}

\usepackage{xurl}

\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}

\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Times New Roman}
\addbibresource{Bib/References.bib}

\DeclareFieldFormat{url}{%
%  \mkbibacro{URL}\addcolon\space
    \href{#1}{\nolinkurl{\thefield{urlraw}}}}

\begin{document}
    \pagenumbering{gobble}
    \nocite{*}
    \printbibliography[heading=bibintoc]
\end{document}

参考文献.bib

@article{palomino-resendiz_design_2018,
    title = {Design and implementation of a robotic active solar distiller based on a Fresnel concentrator and a photovoltaic system},
    volume = {166},
    issn = {0196-8904},
    url = {https://www.sciencedirect.com/science/article/pii/S0196890418304175},
    doi = {10.1016/j.enconman.2018.04.069},
    abstract = {},
    pages = {637--647},
    journaltitle = {Energy Conversion and Management},
    shortjournal = {Energy Conversion and Management},
    author = {Palomino-Resendiz, S. I. and Flores-Hernández, D. A. and Lozada-Castillo, N. and Guzmán-Vargas, L. and Luviano-Juárez, A.},
    urldate = {2022-03-18},
    date = {2018-06-15},
    langid = {english},
    keywords = {Desalination, Fresnel lens, Photovoltaic system, Robotic solar distiller, Solar energy},
}

@article{kabeel_performance_2022,
    title = {Performance assessment of the hemispherical solar distillers with the extended cylindrical iron fins: An experimental investigation},
    volume = {61},
    issn = {1110-0168},
    url = {https://www.sciencedirect.com/science/article/pii/S1110016822002794},
    doi = {10.1016/j.aej.2022.04.018},
    shorttitle = {Performance assessment of the hemispherical solar distillers with the extended cylindrical iron fins},
    pages = {11149--11157},
    number = {12},
    journaltitle = {Alexandria Engineering Journal},
    shortjournal = {Alexandria Engineering Journal},
    author = {Kabeel, Abd Elnaby and El Hadi Attia, Mohammed and Abdelgaied, Mohamed and Abdullah, A. S. and Bellila, Abdelkader and Abdel-Aziz, Moataz M.},
    urldate = {2022-05-29},
    date = {2022-12-01},
    langid = {english},
    keywords = {Extended cylindrical fins, Hemispherical solar still, Iron fins, Number, Solar energy}
}

在此处输入图片描述

我正在像这样编译我的 LaTeX 代码

xelatex -synctex=1 -interaction=nonstopmode --output-directory=./build --shell-escape %.tex
makeindex -t ./build/%.glg -s ./build/%.ist -o ./build/%.gls ./build/%.glo
makeindex -t ./build/%.alg -s ./build/%.ist -o ./build/%.acr ./build/%.acn
biber --output-directory=./build %
xelatex -synctex=1 -interaction=nonstopmode --output-directory=./build --shell-escape %.tex

编辑

问题似乎是在添加csquotes包时发生的。我逐行删除文件,删除csquotes包后问题就消失了。但问题是我也需要那个包。有什么想法吗?

答案1

换行高度敏感,因此在特定情况下有效的解决方案不一定适用于其他情况,无论它们有多么相似。

根据问题中显示的代码,如果我添加,我可以重现以下溢出框\usepackage{csquotes}

超满框:“第 637-647 页”突出到页边距(大约“47”在文本区域之外)。

在页码较短的情况下,我认为随机拆分页码本身不会产生最佳效果。首先,我会尝试通过重新定义 允许在连字符处换行\bibrangedash。默认情况下spanish.lbx使用连字符,在该处不能换行。

这给了我们

\RequirePackage{fix-cm}
\documentclass[12pt, letterpaper]{report}
\usepackage[
  letterpaper,
  top = 18mm,
  left = 20mm,
  right= 20mm,
  bottom = 18mm,
]{geometry}
\usepackage{fontspec}
\usepackage[english,spanish,es-tabla]{babel}
\usepackage{csquotes}

\usepackage[
  backend=biber,
  style=ieee,
  url=false,
]{biblatex}

\usepackage{xurl}
\usepackage[hidelinks]{hyperref}

\setlength{\parindent}{0pt}
\setlength{\parskip}{1em}

\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Times New Roman}

\DefineBibliographyExtras{spanish}{%
  \protected\def\bibrangedash{-}%
}

\DeclareFieldFormat{url}{%
%  \mkbibacro{URL}\addcolon\space
    \href{#1}{\nolinkurl{\thefield{urlraw}}}}


\begin{filecontents}{\jobname.bib}
@article{palomino-resendiz_design_2018,
  title        = {Design and implementation of a robotic active solar distiller
                  based on a Fresnel concentrator and a photovoltaic system},
  volume       = {166},
  issn         = {0196-8904},
  url          = {https://www.sciencedirect.com/science/article/pii/S0196890418304175},
  doi          = {10.1016/j.enconman.2018.04.069},
  pages        = {637--647},
  journaltitle = {Energy Conversion and Management},
  author       = {Palomino-Resendiz, S. I. and Flores-Hernández, D. A.
                  and Lozada-Castillo, N. and Guzmán-Vargas, L.
                  and Luviano-Juárez, A.},
  urldate      = {2022-03-18},
  date         = {2018-06-15},
  langid       = {english},
}
@article{kabeel_performance_2022,
  title        = {Performance assessment of the hemispherical solar distillers
                  with the extended cylindrical iron fins:
                  An experimental investigation},
  volume       = {61},
  issn         = {1110-0168},
  url          = {https://www.sciencedirect.com/science/article/pii/S1110016822002794},
  doi          = {10.1016/j.aej.2022.04.018},
  pages        = {11149--11157},
  number       = {12},
  journaltitle = {Alexandria Engineering Journal},
  author       = {Kabeel, Abd Elnaby and El Hadi Attia, Mohammed
                  and Abdelgaied, Mohamed and Abdullah, A. S. and Bellila, Abdelkader
                  and Abdel-Aziz, Moataz M.},
  urldate      = {2022-05-29},
  date         = {2022-12-01},
  langid       = {english},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
  \pagenumbering{gobble}
  \nocite{*}
  \printbibliography[heading=bibintoc]
\end{document}

与上文相同的参考书目。这次页码范围在“-”处断开,导致没有文本突出到页边距。

从外观上看,我希望这也能在您的屏幕截图中显示的文档(不是 MWE)中起作用。

就我个人而言,我认为这个seqsplit解决方案有点激进(在任意位置打破数字看起来很奇怪)。如果问题仍然存在,我可能会尝试以下通用解决方案之一如何调整参考书目的换行?,例如\emergencystretch

相关内容