我正在使用经过修改的IEEEtran
类,其中包含计算机学会期刊的模板(发现这里)。
当我制作基本演示的 PDF(使用 Texmaker)时,我注意到子部分的编号渗入了文本:
我找不到与此问题相关的任何内容。我仍在学习 LaTeX,因此我不太清楚这是模板/类的问题还是 Texmaker 的问题。
编辑
以下是用于生成子部分的示例代码:
\documentclass[12pt,journal,compsoc]{IEEEtran}
% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}
\begin{document}
\title{Bare Demo of IEEEtran.cls\\ for Computer Society Journals}
\author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}
John~Doe,~\IEEEmembership{Fellow,~OSA,}
and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space
\IEEEcompsocitemizethanks{\IEEEcompsocthanksitem M. Shell is with the Department
of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta,
GA, 30332.\protect\\
% note need leading \protect in front of \\ to get a newline within \thanks as
% \\ is fragile and will error, could use \hfil\break instead.
E-mail: see http://www.michaelshell.org/contact.html
\IEEEcompsocthanksitem J. Doe and J. Doe are with Anonymous University.}% <-this % stops a space
\thanks{Manuscript received April 19, 2005; revised January 11, 2007.}}
% The paper headers
\markboth{Journal of \LaTeX\ Class Files,~Vol.~6, No.~1, January~2007}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Computer Society Journals}
\IEEEcompsoctitleabstractindextext{%
\begin{abstract}
%\boldmath
The abstract goes here.
\end{abstract}
% Note that keywords are not normally used for peerreview papers.
\begin{IEEEkeywords}
Computer Society, IEEEtran, journal, \LaTeX, paper, template.
\end{IEEEkeywords}}
% make the title area
\maketitle
\section{Introduction}
\IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file''
for IEEE Computer Society journal papers produced under \LaTeX\ using
IEEEtran.cls version 1.7 and later.
% You must have at least 2 lines in the paragraph with the drop letter
% (should never be an issue)
I wish you the best of success.
\hfill mds
\hfill January 11, 2007
\subsection{Subsection Heading Here}
Subsection text here.
\subsubsection{Subsubsection Heading Here}
Subsubsection text here.
% that's all folks
\end{document}
我注意到会议和期刊模板都发生了这种情况。
答案1
您下载的版本IEEEtran.cls
是 CTAN 上可找到的版本的修改版本。
而且它显然是有缺陷的...
它包含以下行
\def\@seccntformat#1{\hb@xt@ 1.4em{\csname the#1dis\endcsname\hss\relax}}
\def\@seccntformatinl#1{\hb@xt@ 1.1em{\csname the#1dis\endcsname\hss\relax}}
\def\@seccntformatch#1{\csname the#1dis\endcsname\hskip 1em\relax}
\ifCLASSOPTIONcompsoc
% compsoc journals need extra spacing
\ifCLASSOPTIONconference\else
\def\@seccntformat#1{\csname the#1dis\endcsname\hskip 1em\relax}
\fi\fi
这是错误的。他们应该
\def\@seccntformat#1{\hb@xt@ 1.4em{\csname the#1dis\endcsname\hss\relax}}
\def\@seccntformatinl#1{\hb@xt@ 1.1em{\csname the#1dis\endcsname\hss\relax}}
\def\@seccntformatch#1{\csname the#1dis\endcsname\hskip 1em\relax}
\ifCLASSOPTIONcompsoc
% compsoc journals need extra spacing
\ifCLASSOPTIONconference\else
\def\@seccntformat#1{\csname the#1dis\endcsname\hskip 1em\relax}
\def\@seccntformatinl#1{\csname the#1dis\endcsname\hskip 1em\relax}
\fi\fi
你应该报告这个错误。
解决方法是,您可以在之前添加以下几行\begin{document}
\makeatletter
\def\@seccntformatinl#1{\csname the#1dis\endcsname\hskip 1em\relax}
\makeatother
MWE(摘自bare_jrnl_compsoc.tex
模板)
\documentclass[12pt,journal,compsoc]{IEEEtran}
% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}
\makeatletter
\def\@seccntformatinl#1{\csname the#1dis\endcsname\hskip 1em\relax}
\makeatother
\begin{document}
\title{Bare Demo of IEEEtran.cls\\ for Computer Society Journals}
\author{Michael~Shell,~\IEEEmembership{Member,~IEEE,}
John~Doe,~\IEEEmembership{Fellow,~OSA,}
and~Jane~Doe,~\IEEEmembership{Life~Fellow,~IEEE}% <-this % stops a space
\IEEEcompsocitemizethanks{\IEEEcompsocthanksitem M. Shell is with the Department
of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta,
GA, 30332.\protect\\
% note need leading \protect in front of \\ to get a newline within \thanks as
% \\ is fragile and will error, could use \hfil\break instead.
E-mail: see http://www.michaelshell.org/contact.html
\IEEEcompsocthanksitem J. Doe and J. Doe are with Anonymous University.}% <-this % stops a space
\thanks{Manuscript received April 19, 2005; revised January 11, 2007.}}
% The paper headers
\markboth{Journal of \LaTeX\ Class Files,~Vol.~6, No.~1, January~2007}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Computer Society Journals}
\IEEEcompsoctitleabstractindextext{%
\begin{abstract}
%\boldmath
The abstract goes here.
\end{abstract}
% Note that keywords are not normally used for peerreview papers.
\begin{IEEEkeywords}
Computer Society, IEEEtran, journal, \LaTeX, paper, template.
\end{IEEEkeywords}}
% make the title area
\maketitle
\section{Introduction}
\IEEEPARstart{T}{his} demo file is intended to serve as a ``starter file''
for IEEE Computer Society journal papers produced under \LaTeX\ using
IEEEtran.cls version 1.7 and later.
% You must have at least 2 lines in the paragraph with the drop letter
% (should never be an issue)
I wish you the best of success.
\hfill mds
\hfill January 11, 2007
\subsection{Subsection Heading Here}
Subsection text here.
\subsubsection{Subsubsection Heading Here}
Subsubsection text here.
% that's all folks
\end{document}
输出:
我不知道IEEEtran.cls
您下载的修改版与 CTAN 上的官方修改版有何不同,但您可以删除您下载的修改版,并在您的 TeX 发行版中使用官方修改版,这样就完全没有这个问题了。