Overleaf编译报错:\Hy@babelnormalise多余}及pdfTeX错误求助
Argument of \Hy@babelnormalise has an extra }及pdfTeX错误 错误分析
从编译日志来看,核心问题出在表格目录文件(output.lot)的超链接代码中:
- PubMed链接里的
\relax导致\Hy@babelnormalise命令解析出错,出现多余的}匹配问题; - 进而触发垂直模式下无法执行
\pdfendlink的pdfTeX错误; - 回滚版本后错误未消除,大概率是Overleaf未自动清理旧的辅助文件(如
.lot、.aux),残留了错误代码。
解决步骤
- 清理辅助文件重新编译:在Overleaf左上角点击「Menu」,选择「Recompile from scratch」,强制删除所有旧辅助文件后重新编译。也可手动删除项目中的
.aux、.lot、.lof、.toc、.out等文件。 - 修正超链接代码:检查表格标题中的PubMed链接,移除多余的
\relax,确保URL格式正确。例如将错误写法:
修改为:\href{https://pubmed.ncbi.nlm.nih.gov/?term=\relax}{...}
若URL包含特殊字符,可使用\href{https://pubmed.ncbi.nlm.nih.gov/?term=}{...}\detokenize包裹URL部分避免解析冲突:\href{\detokenize{https://pubmed.ncbi.nlm.nih.gov/?term=your-search-term}}{PubMed链接} - 检查包加载顺序:确保
hyperref包在babel包之后加载,避免两者冲突:\usepackage[english]{babel} \usepackage{hyperref} - 临时应急方案:若需快速编译,可临时关闭超链接显示,添加参数:
或暂时注释掉表格标题中的超链接代码,先完成编译再逐步排查。\usepackage[hidelinks]{hyperref}
错误日志详情
Argument of \Hy@babelnormalise has an extra }.
output.lot, 6
\par
l.6 ...nih.gov/?term=\relax }}{2}{table.caption.8}
%
I've run across a}' that doesn't seem to match anything. For example,\def\a#1{...}' and\a}' would produce this error. If you simply proceed now, the\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your}' was spurious, just type2' and it will go away.Runaway argument?
https://pubmed.ncbi.nlm.nih.gov/?term=\relax
! Paragraph ended before \Hy@babelnormalise was complete.
\par
l.6 ...nih.gov/?term=\relax }}{2}{table.caption.8}
%
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.pdfTeX error (ext1): \pdfendlink cannot be used in vertical mode.
main.tex, 6
\close@pdflink ...\Hy@VerboseLinkStop \pdfendlinkl.6 ...nih.gov/?term=\relax }}{2}{table.caption.8}
%
内容的提问来源于stack exchange,提问作者Lou

