# Indent every \subsubsection element

I need to indent every \subsubsection element in my thesis.

I think that the solution is something like this

\renewcommand{\subsubsection}{some-magic-here}


but i'm new of Latex and I have no idea in what kind of magic. ;)

Could anyone help me?

• What document class are you using? Jan 13, 2014 at 14:41
• \documentclass[a4paper, 10pt]{article} Jan 13, 2014 at 14:44
• Do you need to indent both the subsubsection header and the associated material (i.e., until a higher-level sectioning header is encountered), or just the header, or just the material? I guess I'm not sure what you mean by "element".
– Mico
Jan 13, 2014 at 14:46
• I need to indent both header of subsubsection and its content. Jan 13, 2014 at 14:47
• @RikyTres It's awful nonetheless. Jan 13, 2014 at 15:00

The result is awful and I can see no reason for wanting this. But the document is yours.

\documentclass{article}
\usepackage{changepage}

\usepackage{lipsum} % just for the example

\newenvironment{subs}

\begin{document}

\section{A section}

\lipsum[1]

\subsection{A subsection}

\lipsum[2]

\begin{subs}
\subsubsection{One}

\lipsum[3]

\subsubsection{Two}

\lipsum[4]

\end{subs}

\lipsum[5]

\end{document}


With the following change, the subsubsection titles will be flush with the left margin. The result is even more awful than before.

\documentclass{article}
\usepackage{changepage}

\usepackage{lipsum} % just for the example

\newenvironment{subs}
\makeatletter
\renewcommand\subsubsection{%
\@startsection{subsubsection}{3}
{-2pc}% <------- The opposite of what we set for subs
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries}}
\makeatother

\begin{document}

\section{A section}

\lipsum[1]

\subsection{A subsection}

\lipsum[2]

\begin{subs}
\subsubsection{One}

\lipsum[3]

\subsubsection{Two}

\lipsum[4]

\end{subs}

\lipsum[5]

\end{document}

• If i want to leave the header of the sub subsection in its position? Jan 13, 2014 at 15:14
• @RikyTres It's even worse. I'll add the code, but not a picture. Jan 13, 2014 at 15:19
• The \adjustwidth seems not working with \titleformat{\subsubsection}[runin], it generates a weird error: "perhaps a missing \item". Nov 8, 2017 at 17:54
• @YanKingYin That’s a very different problem, I believe. Please, ask a new question with all details. Nov 8, 2017 at 17:57
• New question is here: tex.stackexchange.com/questions/400416/… Nov 9, 2017 at 0:13
\documentclass{article}
\usepackage{lipsum}
\makeatletter
\renewcommand\section{\leftskip 0pt\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}}
\renewcommand\subsection{\leftskip 0pt\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries}}
\newcommand\Xsubsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries\leftskip 3ex}}
\renewcommand\subsubsection[1]{\Xsubsubsection{#1}\leftskip 3ex}
\makeatother
\begin{document}
\section{My section}

\lipsum[4]

\subsection{My subsection}

\lipsum[4]

\subsubsection{My subsubsection\label{xxx}}

In subsection \ref{xxx}, we have the indent.

\subsection{Next subsection}

\lipsum[4]

\section{next section}

\lipsum[4]
\end{document}


• I've implemented this, but itemize lists within the subsections are not having the indent. Do you know how to fix that? Apr 16, 2021 at 10:59
• @MosheSteinberg Without more information, it is tough to say. Apr 16, 2021 at 11:53