0

I want to arrange my section and subsection as follows:

  1. Section

1.1 Subsection

1.1.1 subsubsection

1.1.2 subsubsection

1.2 subsection

2.Section

3.Section


My Latex file is below. Kindly suggest how to arrange section and subsection in my LaTeX file in accordance with the example above.

\documentclass[conference]{IEEEtran}

\usepackage{graphicx}

\usepackage{bm}

\usepackage{xurl}  %%%%%%%%%%%%%%%%

\usepackage{amsfonts,amssymb,amsmath,amsthm}

\usepackage{algorithmic,algorithm}

\usepackage[sort,compress]{cite}

%%\usepackage{subfigure} % deprecated -- don't use it!

%\usepackage{fixltx2e}

\usepackage{multirow}

\usepackage{tabulary}

\usepackage{color}

%%\usepackage{epstopdf}

\usepackage{pifont}

\usepackage{float}

\usepackage{booktabs,chemformula}

\usepackage{makecell}

\usepackage{longtable}

\usepackage{xtab}

\usepackage{lipsum}

\usepackage[utf8]{inputenc}

\usepackage{enumitem}

\newlist{abbrv}{itemize}{1}

\setlist[abbrv,1]{label=,labelwidth=1in,align=parleft,itemsep=0.1\baselineskip,leftmargin=!}

\renewcommand{\thesection}{\arabic{section}\Roman{subsection}}

\renewcommand{\thesubsection}{\thesection}


\usepackage{tabularx}

\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}

\begin{document}

\title{Security in Optical network}

\section{Introduction} \label{sec:intro}

\subsection{Energetic Attacks (EA)}

\subsubsection{In-band Jamming Attack}

\paragraph{In-band Jamming Attack}

\end{document}

The above file generates the following output which is not equal to the above one enter image description here enter image description here

2
  • 1
    Welcome to TeX.SX! Do you use the IEEEtran document class because you currently write a paper you intend to sumbit to them? If so, do not change the template. If you use the documentclass for something different, you might want to consider switching to a different documentclass instead.
    – leandriis
    Nov 27, 2020 at 19:40
  • 2
    You are renewcommanding \thesection and \thesubsection to very strange values. And I'm not convinced that your commands would give the output you show.
    – Teepeemm
    Nov 27, 2020 at 19:44

1 Answer 1

2

I tried texdoc IEEEtran but got Error: unknown Metadata type '???' so I don't know what that class does. However, using the article class instead the following changes the sectional numbering system as you say you want.

% secnumbersprob.tex  SE 572644

%\documentclass[conference]{IEEEtran}
\documentclass{article}

\usepackage{graphicx}

\usepackage{bm}

\usepackage{xurl}  %%%%%%%%%%%%%%%%

\usepackage{amsfonts,amssymb,amsmath,amsthm}

\usepackage{algorithmic,algorithm}

\usepackage[sort,compress]{cite}

%%\usepackage{subfigure} % deprecated -- don't use it!

%\usepackage{fixltx2e}

\usepackage{multirow}

\usepackage{tabulary}

\usepackage{color}

%%\usepackage{epstopdf}

\usepackage{pifont}

\usepackage{float}

\usepackage{booktabs,chemformula}

\usepackage{makecell}

\usepackage{longtable}

\usepackage{xtab}

\usepackage{lipsum}

\usepackage[utf8]{inputenc}

\usepackage{enumitem}

\newlist{abbrv}{itemize}{1}

\setlist[abbrv,1]{label=,labelwidth=1in,align=parleft,itemsep=0.1\baselineskip,leftmargin=!}

%\renewcommand{\thesection}{\arabic{section}\Roman{subsection}}
%\renewcommand{\thesubsection}{\thesection}
\renewcommand{\thesection}{\arabic{section}.}
\renewcommand{\thesubsection}{\thesection\arabic{subsection}}


\usepackage{tabularx}

\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}

\begin{document}

\title{Security in Optical network}

\section{Introduction} \label{sec:intro}

\subsection{Energetic Attacks (EA)}

\subsubsection{In-band Jamming Attack}

\paragraph{In-band Jamming Attack}

\end{document}

It seems that IEEEtran doesn't want the numbering scheme to be changed. I haven't spent time deleting all your code that has nothing to do with your problem. Your attempted change to the numbering scheme has nothing to do with what you are after.

If you are going to submit your document to the IEEE for publication then do not change the look that they want; if you do so they will most likely reject your submission.

You must log in to answer this question.

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