如何使用 ieeeconf 类在定理标题中获取换行符?

如何使用 ieeeconf 类在定理标题中获取换行符?

这是这个问题,正如 Ioannis Filippides 所建议的那样。

问题是关于一个较长的定理标题可能比列宽长,并且不会自动延续到下一行。在引用的问题中,建议加载诸如 之类的包amsthm。(如果这会产生错误消息,可以按照中的说明解决。这个问题

问题是,这种方法在与课程一起使用时会改变布局(定理标题粗体而不是正常,定理文本斜体而不是正常)IEEEconf。有没有其他方法可以解决标题过长的问题,同时保持课程的原始布局IEEEconf

梅威瑟:

\documentclass[a4paper, 12pt]{ieeeconf}
\usepackage{lipsum}
\newtheorem{theorem}{Theorem}
\begin{document}
Hello, see my nice theorem below.
\begin{theorem}[A title that is too long so it stretches outside the column]
\lipsum[1]
\end{theorem}
\end{document}

MWE 的结果:

在此处输入图片描述

添加\usepackage{amsthm}到 MWE 后,我收到错误消息

! LaTeX Error: Command \proof already defined.

我得到以下结果,其中标题分为两行,但布局发生了变化:

在此处输入图片描述


作为参考,以下是 IEEEconf 如何(重新)定义定理命令。

%% ENVIRONMENTS
% "box" symbols at end of proofs
\def\QEDclosed{\mbox{\rule[0pt]{1.3ex}{1.3ex}}} % for a filled box
% V1.6 some journals use an open box instead that will just fit around a closed one
\def\QEDopen{{\setlength{\fboxsep}{0pt}\setlength{\fboxrule}{0.2pt}\fbox{\rule[0pt]{0pt}{1.3ex}\rule[0pt]{1.3ex}{0pt}}}}
\def\QED{\QEDclosed} % default to closed

\def\proof{\noindent\hspace{2em}{\itshape Proof: }}
\def\endproof{\hspace*{\fill}~\QED\par\endtrivlist\unskip}
%\itemindent is set to \z@ by list, so define new temporary variable
\newdimen\@IEEEtmpitemindent
\def\@begintheorem#1#2{\@IEEEtmpitemindent\itemindent\topsep 0pt\rmfamily\trivlist%
    \item[\hskip \labelsep{\indent\itshape #1\ #2:}]\itemindent\@IEEEtmpitemindent}
\def\@opargbegintheorem#1#2#3{\@IEEEtmpitemindent\itemindent\topsep 0pt\rmfamily \trivlist%
% V1.6 IEEE is back to using () around theorem names which are also in italics
% Thanks to Christian Peel for reporting this.
    \item[\hskip\labelsep{\indent\itshape #1\ #2\ (#3):}]\itemindent\@IEEEtmpitemindent}
\def\@endtheorem{\endtrivlist\unskip}

% V1.6
% display command for the section the theorem is in - so that \thesection
% is not used as this will be in Roman numerals when we want arabic.
% LaTeX2e uses \def\@thmcounter#1{\noexpand\arabic{#1}} for the theorem number
% (second part) display and \def\@thmcountersep{.} as a separator.
\def\@IEEEthmcounterin#1{\arabic{#1}}
% redefine the #1#2[#3] form of newtheorem to use a hook to \@IEEEthmcounterin
\def\@xnthm#1#2[#3]{%
  \expandafter\@ifdefinable\csname #1\endcsname
    {\@definecounter{#1}\@newctr{#1}[#3]%
     \expandafter\xdef\csname the#1\endcsname{%
     \noexpand\@IEEEthmcounterin{#3}\@thmcountersep\@thmcounter{#1}}%
     \global\@namedef{#1}{\@thm{#1}{#2}}%
     \global\@namedef{end#1}{\@endtheorem}}}

答案1

您可以采用proof来自的环境amsthm(稍作修改)并定义一个模拟中(可怕的)定理风格ieeeconf

\documentclass[a4paper, 12pt]{ieeeconf}

\usepackage{lipsum} % for mock text

\let\proof\relax\let\endproof\relax
\usepackage{amsthm}

\newtheoremstyle{ieeeconf}
  {0pt}   % ABOVESPACE
  {0pt}   % BELOWSPACE
  {\normalfont}  % BODYFONT
  {\parindent}       % INDENT (empty value is the same as 0pt)
  {\itshape} % HEADFONT
  {:}         % HEADPUNCT
  { } % HEADSPACE
  {\thmname{#1} \thmnumber{#2}\thmnote{ (#3)}} % CUSTOM-HEAD-SPEC
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
  \pushQED{\qed}%
  \normalfont \topsep\z@
  \trivlist
  \item[\hskip2em
        \itshape
    #1\@addpunct{:}]\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatletter
\renewcommand{\qedsymbol}{\rule[0pt]{1.3ex}{1.3ex}}
\theoremstyle{ieeeconf}

\newtheorem{theorem}{Theorem}

\begin{document}

Hello, see my nice theorem below.

\begin{theorem}[A title]% that is too long so it stretches outside the column]
\lipsum[1][1-3]
\end{theorem}
\begin{proof}
\lipsum[2][1-4]
\end{proof}

\lipsum[3][1-3]

\end{document}

修复后的输出

在此处输入图片描述

原始配置ieeeconf(仅是较短的标题)

在此处输入图片描述

相关内容