# How can I get a line break in a theorem headline using the ieeeconf class?

This is a follow-up question to this question, as suggested by Ioannis Filippides.

The question is about the fact that a long theorem title may be longer than the column width, and it is not continued on the next line automatically. In the referenced question, it is suggested to load a package such as amsthm. (If this generates an error message, it can be solved as explained in this question.)

The problem is that this approach changes the lay-out (theorem title bold instead of normal, theorem text italic instead of normal) when used with the IEEEconf class. Is there an other way to solve the problem of the long title while maintaining the original lay-out of the IEEEconf class?

MWE:

\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}


Result of the MWE:

Adding \usepackage{amsthm} to the MWE, I obtain the error message

! LaTeX Error: Command \proof already defined.

and I obtain following result where the title is split over 2 lines but the lay-out is changed:

For reference, here's how IEEEconf (re)defines the theorem commands.

%% 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}}}

• I'm not familiar with ieeeconf, and don't know whether it's even compatible with amsthm. However, amsthm does support three different theorem styles, of which the styles definition and remark set the content in ordinary type, and it's also possible to define new theorem styles in which the heading font is changed. See the user documentation: texdoc amsthdoc'. – barbara beeton Feb 25 '20 at 18:38
• I edited the question to include the portion of ieeeconf.cls that concerns theorems. Instead of loading amsthm you can consider modifying the definition of \@opargbegintheorem yourself. Note that currently the theorem header and headline are set as the item label in a trivlist. So the solution could be as simple as moving the (#3) out from under the \item[...] and adjusting the spacing and font family accordingly. – Willie Wong Feb 26 '20 at 15:05

You can adopt the proof environment from amsthm (with slight modifications) and define a theorem style that emulates the (horrible) one in 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)
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep\z@
\trivlist
\item[\hskip2em
\itshape
}{%
\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}


## Original configuration with ieeeconf` (just a shorter title)

• The italic parentheses and following colon look pretty poor. In theorems all punctuation and fences should really be upright. – barbara beeton Feb 26 '20 at 20:52
• @barbarabeeton Unfortunately that’s how IEEE wants it – egreg Feb 26 '20 at 21:35