為什麼 cite 會影響 IEEEtran \markboth 標頭中冒號後的間距?

為什麼 cite 會影響 IEEEtran \markboth 標頭中冒號後的間距?

更新:v5.5中已解決此問題cite

我注意到載入(或不載入)套件會改變標題cite中冒號後的間距\markbothIEEEtran

\documentclass{IEEEtran}
%\usepackage{cite}
\begin{document}
\markboth{: A}{}
: A
\end{document}

差異很微妙,我必須建立兩個 pdf 並在它們之間使用 Alt-Tab 才能看到差異,但它確實存在。

為什麼會這樣,我可以在之前和/或之後做什麼\usepackage{cite}(例如\let\org...\...\let\...\org...)來防止它發生?除了標題之外,我沒有發現 8 頁文件有任何其他差異。

答案1

一個有

....\hbox(0.0+0.0)x0.0
....\OT1/ptm/m/n/7 :
....\glue 2.45004 plus 1.04996 minus 0.84007
....\OT1/ptm/m/n/7 

另一個有

....\hbox(0.0+0.0)x0.0
....\OT1/ptm/m/n/7 :
....\glue 2.87003 plus 2.09991 minus 0.42003
....\OT1/ptm/m/n/7 A

原因是 的空間因子:已經恢復。

這個問題僅影響標題,因為乳膠會根據開始文件時有效的值對標題中的空間因子進行\normalsfcodes標準化。\frenchspacing\nonfrenchspacing

然而,測試乳膠使用的是測試 的空間因子是否.為 1000,但cite由於其自身原因使其變為 1001,因此測試總是失敗,因此 ifcite負載 \normalsfcodes總是設定該\nonfrenchspacing值。

這會影響 IEEEtran,因為它預設為\frenchspacing

最簡單的修復方法是重置\normalsfcodes

\documentclass{IEEEtran}
\usepackage{cite}\AtBeginDocument{\let\normalsfcodes\frenchspacing}
\begin{document}

\markboth{: A}{}
: A
\end{document}

答案2

cite 套件有一個字元列表

\providecommand{\CiteMoveChars}{.,:;}

它在標點符號後移動上標引用,這會產生不良行為。為了防止這種情況,您可以從該清單中刪除冒號:

\documentclass{IEEEtran}
\usepackage{cite}

\providecommand{\CiteMoveChars}{.,;}

\begin{document}
\markboth{: A}{}
: A
\end{document}

或者,使用 package 選項載入套件nomove(與從移動清單中刪除所有初始字元相同):

\documentclass{IEEEtran}
\usepackage[nomove]{cite}

\begin{document}
\markboth{: A}{}
: A
\end{document}

相關內容