
我正在嘗試列印我的參考書目,但“第 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}
.
在頁碼相當短的情況下,我認為隨機分解頁碼本身不會產生最佳結果。第一步,我將嘗試透過重新定義 來允許在連字號處換行\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
。