# How to write a book using IEEEtran template?

I am compiling a longish project report which should go in the IEEEtran format. Since the document runs into 100+ pages, we felt it is better to write it like a thesis than a research paper. Basically, we want to break it down into several chapters.

However, as per my understanding, the \chapter environment is available only in document type report (and perhaps scrreprt). IEEEtran format, on the other hand, is meant for research articles which are broken down in several 'sections', but not 'chapters'. I am unable to make chapters work in it.

How do I acommplish the needful?

• Why does this require to go in the IEEEtran format? It is a matter of appearance just because you like it and you will publish it only as a PDF or it is required by a publisher? I ask this because the answer changes. – Astrinus Jun 11 '15 at 7:27
• @Astrinus It is a report for a funded project. The format is prescribed by our funding agency. – pnp Jun 11 '15 at 7:56
• What should you provide? The PDF or the LaTeX source? – Astrinus Jun 11 '15 at 7:59
• @Astrinus Just the PDF – pnp Jun 11 '15 at 7:59
• Ok, then you can borrow from report or book document classes the macros \chapter and \l@chapter and all their dipendencies. – Astrinus Jun 11 '15 at 8:02

Try to insert this in the preamble (not tested, so maybe it will mess all up):

\makeatletter

\newcounter{chapter}

\ifCLASSOPTIONcompsoc
\def\thechapter{\arabic{chapter}}
\ifCLASSOPTIONconference% compsoc conference
\def\thechapterdis{\thechapter.}
\else% compsoc not conferencs
\def\thechapterdis{\thechapter.}
\fi
\else
\def\thechapter{\Roman{chapter}}
\def\thechapterdis{\thechapter.}
\fi

\def\tableofcontents{\chapter*{\contentsname}\@starttoc{toc}}
\def\listoffigures{\chapter*{\listfigurename}\@starttoc{lof}}
\def\listoftables{\chapter*{\listtablename}\@starttoc{lot}}

\def\thebibliography#1{\chapter*{\refname}%
% V1.6 add some rubber space here and provide a command trigger
\footnotesize\vskip 0.3\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\itemsep \IEEEbibitemsep\relax
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\let\@IEEElatexbibitem\bibitem%
\def\bibitem{\@IEEEbibitemprefix\@IEEElatexbibitem}%
\def\newblock{\hskip .11em plus .33em minus .07em}%
% originally:
%   \sloppy\clubpenalty4000\widowpenalty4000%
% by adding the \interlinepenalty here, we make it more
% difficult, but not impossible, for LaTeX to break within a reference.
% IEEE almost never breaks a reference (but they do it more often with
% technotes). You may get an underfull vbox warning around the bibliography,
% but the final result will be much more like what IEEE will publish.
% MDS 11/2000
\ifCLASSOPTIONtechnote\sloppy\clubpenalty4000\widowpenalty4000\interlinepenalty100%
\else\sloppy\clubpenalty4000\widowpenalty4000\interlinepenalty500\fi%
\sfcode\.=1000\relax}
\let\endthebibliography=\endlist

\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
{\protect\numberline{\thechapter}#1}%
\else
\fi
\else
\fi
\chaptermark{#1}%
\if@twocolumn
\else
\fi}
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\def\@schapter#1{\if@twocolumn
\else
\fi}
\vspace*{50\p@}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries  #1\par\nobreak
\vskip 40\p@
}}

\newcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries

I copied some code from book.cls and adapted some of che code of IEEEtran.cls to use chapters rather than section`s.