![在 LLNCS 文档中使用 babel 的 \foreignlanguage 时出现奇怪的水平空格](https://linux22.com/image/457715/%E5%9C%A8%20LLNCS%20%E6%96%87%E6%A1%A3%E4%B8%AD%E4%BD%BF%E7%94%A8%20babel%20%E7%9A%84%20%5Cforeignlanguage%20%E6%97%B6%E5%87%BA%E7%8E%B0%E5%A5%87%E6%80%AA%E7%9A%84%E6%B0%B4%E5%B9%B3%E7%A9%BA%E6%A0%BC.png)
这\foreignlanguage
时,它会在外文文本的开头引入奇怪的水平空格(https://ctan.tetaneutral.net/macros/latex/contrib/llncs/llncsdoc.pdf) 类。默认类不会出现此问题article
。
最小可重现示例:
\documentclass{llncs}
\usepackage[main=french,english]{babel}
\begin{document}
Ceci est \foreignlanguage{english}{a test}.
\end{document}
它如何与常规article
类一起呈现:
\documentclass{article}
\usepackage[main=french,english]{babel}
\begin{document}
Ceci est \foreignlanguage{english}{a test}.
\end{document}
除了负空间之外,我还能做些什么来删除该空间吗?
答案1
该类存在错误,并添加了大量虚假空间。重新定义相关内容并报告错误:
\documentclass{llncs}
\usepackage[main=french,english]{babel}
\makeatletter
\def\switcht@albion{%
\def\abstractname{Abstract.}%
\def\ackname{Acknowledgement.}%
\def\andname{and}%
\def\lastandname{\unskip, and}%
\def\appendixname{Appendix}%
\def\chaptername{Chapter}%
\def\claimname{Claim}%
\def\conjecturename{Conjecture}%
\def\contentsname{Table of Contents}%
\def\corollaryname{Corollary}%
\def\definitionname{Definition}%
\def\examplename{Example}%
\def\exercisename{Exercise}%
\def\figurename{Fig.}%
\def\keywordname{{\bf Keywords:}}%
\def\indexname{Index}%
\def\lemmaname{Lemma}%
\def\contriblistname{List of Contributors}%
\def\listfigurename{List of Figures}%
\def\listtablename{List of Tables}%
\def\mailname{{\it Correspondence to\/}:}%
\def\noteaddname{Note added in proof}%
\def\notename{Note}%
\def\partname{Part}%
\def\problemname{Problem}%
\def\proofname{Proof}%
\def\propertyname{Property}%
\def\propositionname{Proposition}%
\def\questionname{Question}%
\def\remarkname{Remark}%
\def\seename{see}%
\def\solutionname{Solution}%
\def\subclassname{{\it Subject Classifications\/}:}%
\def\tablename{Table}%
\def\theoremname{Theorem}}
\makeatother
\begin{document}
Ceci est \foreignlanguage{english}{a test}.
\end{document}
答案2
如果你想避免编辑本地副本,你可以在阅读课程时忽略行尾
\endlinechar=-1
\documentclass{llncs}
\endlinechar=13
\usepackage[main=french,english]{babel}
\begin{document}
Ceci est \foreignlanguage{english}{a test}.
\end{document}