I am using the IEEE Transactions on Magnetics document class in LYX and am having difficulties with the "Part" section. All other sectioning types (section, subsection, paragraph, etc.) work fine, but when I add a "Part" section and try to view I get the following message:


     {Digital Control}

The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx), type I and the correct spelling (e.g., I\hbox). Otherwise just continue, and I'll forget about whatever was undefined.

Is there something that I can add to my preamble to fix this? Thanks in advance for any help.

  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – jjdb
    Commented May 28, 2017 at 20:16
  • 1
    I can't find any mention of the \part command in the documentation to the IEEEtrans class. So probably it is not implemented for it (as it is the case for \chapter)
    – jjdb
    Commented May 28, 2017 at 20:26
  • I was afraid of that. It's weird that 'Part' appears in the sectioning drop-down menu, but I can't use it. Is there any way to easily implement it? I really like the IEEE format for the type of document I am writing. I would just like to be able to differentiate between two clearly separate parts and have it show in the TOC. Commented Jun 3, 2017 at 23:38

1 Answer 1


Apparently the IEEEtran class has no \part command although is is based on the article class which does.

A possible fix would be to re-include the definitions of the article.cls class file into your document, like:

\newcounter {part}
\renewcommand \thepart {\@Roman\c@part}
   \if@noskipsec \leavevmode \fi
    \ifnum \c@secnumdepth >\m@ne
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \ifnum \c@secnumdepth >\m@ne
       \Large\bfseries \partname\nobreakspace\thepart
     \huge \bfseries #2%
    \vskip 3ex
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \huge \bfseries #1\par}%
     \vskip 3ex
  \ifnum \c@tocdepth >-2\relax
    \addvspace{2.25em \@plus\p@}%
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
       \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par

\title{A way to use the 'Part' command in Latex}                                                                                                                                
\author{John Doe}                                                                                                                                                               
\part{First Part of the Article}                                                                                                                                                
Some text right after the part. Maybe some summary or so. \lipsum[1]                                                                                                            

See that there was no indentation after the part, which just comes after the                                                                                                    
first paragraph of written words.                                                                                                                                               
\section{First section}                                                                                                                                                         
\section{Second section}                                                                                                                                                        
\part{Second Part of the Article}                                                                                                                                               
This part only has a single section.                                                                                                                                            
\section{Last section}                                                                                                                                                          

As I've just c&p'ed the corresponding parts of the code from article.cls, there can still be possible bugs (I actually had to change one or to \newcommand into \renewcommand to get this working, and also to include the code between \makeatletter/\makeatother, where I've probably included more than necessary).

Maybe it would be better to define your own article class instead, and include all the features you like from the IEEEtran.cls file.

  • Damn! Thanks for that! I guess I probably would be better off creating a custom class, I was just hoping to be able to avoid that. Oh well, such is the way of things. I really appreciate your help with this. It'll make creating a custom class much easier! Commented Jun 4, 2017 at 22:12
  • 1
    Best ask for help on how to implement the features for the custom class on this site step-by-step, as I am not 100% sure if everything in the code above is 100% kosher.
    – jjdb
    Commented Jun 5, 2017 at 7:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .