1

I need to make all the section levels to begin at the same position on the left of the page. I need something like this

1 Introduction

1.1 Subsection Heading Here

1.1.1 Subsubsection heading here

I use the following code:

\documentclass[12pt,journal,onecolumn]{IEEEtran}

%----------------
\usepackage{titlesec}

\titleformat{\section} 
{\normalfont\Large\bfseries}{\makebox[30pt][l]{\thesection}}{0pt}{} 

\titleformat{\subsection} 
{\normalfont\large\bfseries}{\makebox[30pt][l]{\thesubsection}}{0pt}{}

\titleformat{\subsubsection} 
{\normalfont\large\bfseries}{\makebox[30pt][l]{\thesubsubsection}}{0pt}{}

%----------------
\begin{document}

\section{Introduction}
This demo file is intended to serve as a ``starter file''
for IEEE journal papers produced under \LaTeX\ using
IEEEtran.cls version 1.8b and later.

\subsection{Subsection Heading Here}
Subsection text here.

\subsubsection{Subsubsection Heading Here}
Subsubsection text here.

\section{Conclusion}
The conclusion goes here.
\end{document}

Instead after running the code the sections are shown as enter image description here

The commands:

\titleformat{\section} 
{\normalfont\Large\bfseries}{\makebox[30pt][l]{\thesection}}{0pt}{} 

\titleformat{\subsection} 
{\normalfont\large\bfseries}{\makebox[30pt][l]{\thesubsection}}{0pt}{}

achieve what I want. However this is not the case for the command of the subsubsection:

\titleformat{\subsubsection} 
{\normalfont\large\bfseries}{\makebox[30pt][l]{\thesubsubsection}}{0pt}{}
3
  • Welcome to TeX.SX! If you are using the IEEEtran class to prepare a paper that is going to be submitted to an IEEE journal, you should not modify the way the class behaves (i.e., you should leave the section titles alone). Otherwise, why go with the IEEE class to begin with and not with the article class that behaves the way you want to? Indeed, the IEEEtran class does not provide that many advantages with respect to the article class if the goal is not a paper submission.
    – KersouMan
    Nov 28, 2022 at 15:05
  • Hi @KersouMan. I need to write in a single column with IEEE style referencing. This is why I chose the IEEEtran class. Nov 28, 2022 at 15:08
  • Technically, you can obtain IEEE referencing with any class by just adding the lines \bibliographystyle{IEEEtran} and \bibliography{<the name of you .bib file without the .bib at the end>} at the end of your document (or wherever you want to have your references). Then, the article class does the rest without needing to temper too much with the properties
    – KersouMan
    Nov 28, 2022 at 15:11

1 Answer 1

0

I see no reason for using IEEEtran.

Anyway, you need to change the representation of the counters and also the spacing parameters for \subsubsection. Also 30pt is too short.

\documentclass[12pt,journal,onecolumn]{IEEEtran}

%----------------
\let\subparagraph\paragraph % avoid a warning
\usepackage{titlesec}

\titleformat{\section} 
  {\normalfont\Large\bfseries}
  {\makebox[40pt][l]{\thesection}}
  {0pt}
  {} 

\titleformat{\subsection} 
  {\normalfont\large\bfseries}
  {\makebox[40pt][l]{\thesubsection}}
  {0pt}
  {}

\titleformat{\subsubsection} 
  {\normalfont\large\bfseries}
  {\makebox[40pt][l]{\thesubsubsection}}
  {0pt}
  {}

\titlespacing{\subsubsection}
  {0pt}
  {1ex plus 0.3ex minus 0.1ex}
  {0.5ex plus 0.1ex minus 0.1ex}

\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}


%----------------
\begin{document}

\section{Introduction}
This demo file is intended to serve as a ``starter file''
for IEEE journal papers produced under \LaTeX\ using
IEEEtran.cls version 1.8b and later.

\subsection{Subsection Heading Here}
Subsection text here.

\subsubsection{Subsubsection Heading Here}
Subsubsection text here.

\section{Conclusion}
The conclusion goes here.
\end{document}

enter image description here

You must log in to answer this question.

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