You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为何Overleaf与本地pdflatex编译LaTeX输出不一致?

本地编译LaTeX模板时缩写列表无法显示的解决办法

我在编译LaTeX模板时遇到问题:Overleaf平台编译能正常生成带“缩写列表(List of abbreviations)”的PDF,但本地编译时该内容不显示。主TeX文件最小示例如下:

\documentclass[a4paper, nobind]{unilim} 
\title{Conception}
\author{Ragh}
\hypersetup{pdfauthor = {Rémy BOUCHÉ}, pdftitle = {Thèse de doctorat}}

\makeglossaries
\newacronym{4g}{4G}{Fourth Generation Mobile Radio}

\begin{document}

\setglossarystyle{alttree} 
\renewcommand{\glstreenamebox}[2]{\makebox[#1][r]{#2~~ -- ~~}} 
\renewcommand{\glossarypreamble}{\glsfindwidesttoplevelname[\currentglossary]}

\printglossary[title=List of abbreviations]

\section{Examples}
\gls{4g}

\end{document}

问题原因

本地编译glossaries宏包生成的缩写列表需要多步编译流程,Overleaf会自动完成这些步骤,但本地编译需要手动执行完整流程。

解决步骤

  1. 第一次编译主TeX文件(使用pdflatex或你常用的LaTeX编译器),生成.glo等辅助文件。
  2. 运行makeglossaries命令(针对你的主文件名,比如主文件是thesis.tex,就执行makeglossaries thesis),处理辅助文件生成可被LaTeX调用的 glossary 文件。
  3. 再次编译主TeX文件两次,确保缩写列表和交叉引用都能正确显示。

额外检查

  • 确认本地TeX发行版(TeX Live/MikTeX)已安装glossaries宏包及配套的makeglossaries工具,若未安装需先通过包管理器安装。
  • 若使用TeX编辑器(如TeXstudio),可配置编译链,将makeglossaries加入自动编译流程,避免每次手动执行多步。

内容的提问来源于stack exchange,提问作者Raghvender

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 14:50:09