# Section and text left indentation

My MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{showframe}
\usepackage{lipsum}

\usepackage{geometry}
\geometry{paper=a4paper}
\geometry{bindingoffset=1.5cm,hmargin={1.5cm,1.5cm},vmargin={1cm,1cm}}
\geometry{includefoot=false}

\begin{document}
\section{Section}
\lipsum[1-1]
\subsection{Subsection}
\lipsum[1-1]
\subsubsection{Subsubsection}
\lipsum[1-1]
\end{document}


text output: (bindingoffset 1.5cm + left margin 1.5cm; 3cm total left margin)

desired output:

Is possible to make section and text under sections/subsections etc indented by 2 cm?

edit With @Bernard help: Is possible to move numbering left; like in my desired output?

EDIT 2 (also related to question Combining two macros) Using @Bernard, @ereg and @Henri Menke code and @cfr advice.

CODE

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}

\usepackage[showframe]{geometry}
\geometry{paper=a4paper}
\geometry{bindingoffset=1.5cm,hmargin={3.5cm,1.5cm},vmargin={1cm,1cm}}
\geometry{includefoot=false}
\usepackage{changepage}
\usepackage{titlesec}
\usepackage{etoolbox}
\usepackage[ampersand]{easylist}
\usepackage{xcolor}

\renewcommand{\listfigurename}{\hfill \textit{List of Figures}}     %%List of figures name change
\renewcommand{\listtablename}{\hfill \textit{List of Tables}}       %%List of tables name change
\newcommand\tocloflot{%
\clearpage
\tableofcontents
\clearpage
\csname phantomsection\endcsname
\listoffigures
\clearpage
\csname phantomsection\endcsname
\listoftables
\clearpage
}

\titleformat{\section}{\Large\bfseries}{\parbox{2cm}{\thesection}}{-0.5pt}{}
\titleformat{\subsection}{\large\bfseries}{\parbox{2cm}{\thesubsection}}{-0.5pt}{}
\titleformat{\subsubsection}{\normalsize\bfseries}{\parbox{2cm}{\thesubsubsection}}{-0.5pt}{}
\titlespacing*{\section}{-2cm}{0.6cm}{0.6cm}
\titlespacing*{\subsection}{-2cm}{0.4cm}{0.4cm}
\titlespacing*{\subsubsection}{-2cm}{0.2cm}{0.2cm}

\def\defineEasylist#1#2{\expandafter\def\csname
Easylist@style@#1\endcsname{\NewList(#2)}}
\def\Easylist{\futurelet\next\doEasylist}
\def\doEasylist{\ifx[\next\expandafter\doEasylistone\else\expandafter
\doEasylistnop\fi}
\def\doEasylistone[#1]
{\begin{easylist}\if\relax\detokenize{#1}\relax\else\csname
Easylist@style@#1\endcsname\fi}
\def\doEasylistnop{\begin{easylist}\NewList}
\def\endEasylist{\end{easylist}}

\defineEasylist{lowercasestyle}
{Numbers=l,Hang=true,FinalSpace=0.2cm,Align=fixed,
Margin1=0.5cm,Margin2=1.5cm,Margin3=2.5cm,Margin4=3.5cm,
Margin5=4.5cm,Margin6=5.5cm,Margin7=6.5cm,Space=0.15cm,Space*=0.15cm}

\defineEasylist{uppercasestyle}
{Numbers=L,Hang=true,FinalSpace=0.2cm,Align=fixed,
Margin1=0.5cm,Margin2=1.5cm,Margin3=2.5cm,Margin4=3.5cm,
Margin5=4.5cm,Margin6=5.5cm,Margin7=6.5cm,Space=0.15cm,Space*=0.15cm}

\defineEasylist{romanlowercasestyle}
{Numbers=r,Hang=true,FinalSpace=0.2cm,Align=fixed,
Margin1=0.5cm,Margin2=1.5cm,Margin3=2.5cm,Margin4=3.5cm,
Margin5=4.5cm,Margin6=5.5cm,Margin7=6.5cm,Space=0.15cm,Space*=0.15cm}

\defineEasylist{romanuppercasestyle}
{Numbers=R,Hang=true,FinalSpace=0.2cm,Align=fixed,
Margin1=0.5cm,Margin2=1.5cm,Margin3=2.5cm,Margin4=3.5cm,
Margin5=4.5cm,Margin6=5.5cm,Margin7=6.5cm,Space=0.15cm,Space*=0.15cm}

\defineEasylist{bullet}{Hide=100,Hang=true,FinalSpace=0.5cm,Align=fixed,
Margin1=0.5cm,Margin2=1.5cm,Margin3=2.5cm,Margin4=3.5cm,
Margin5=4.5cm,Margin6=5.5cm,Margin7=6.5cm,Space=0.15cm,Space*=0.15cm,
Style1*=\textbullet\hspace{0.25cm},Style2*=$\circ$\hspace{0.25cm},
Style3*=$\star$\hspace{0.25cm},Style4*=$\mp$\hspace{0.25cm}}

\begin{document}
\tocloflot
\section{Section Section Section Section Section Section Section Section Section}
\lipsum[1]

\begin{Easylist}[bullet]
& dog
&& cat
&&& rabbit
\end{Easylist}
\par\bigskip
\begin{Easylist}[lowercasestyle]
& dog
&& cat
&&& rabbit
\end{Easylist}
\par\bigskip
\begin{Easylist}[romanuppercasestyle]
& dog
&& cat
&&& rabbit
\end{Easylist}
\par\bigskip
\begin{Easylist}[romanlowercasestyle]
& dog
&& cat
&&& rabbit
\end{Easylist}

\subsection{Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section}
\lipsum[1]
\subsubsection{Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section}
\lipsum[1]

\end{document}


• Could you post a full, yet minimal code that produces your output? With the code you show, all texts should start at the left margin, so there must be something else. – Bernard Jul 17 '18 at 8:27
• @Bernard This black rectangle is a page border, not page margins (just info). Text is starting as I defined 3cm from left margin. I want to add 2 cm indentation as shown in desired output. My MWE is page margin settings which I post + some random text. In my original document I have page borders and table in header. – Beginner Jul 17 '18 at 8:38
• Oh! I see now. Did you try \begin{adjustwidth{2cm}{} ... \end{adjustwidth}, from changepage? – Bernard Jul 17 '18 at 8:47
• @Bernard I have posted my MWE + output with \begin{adjustwidth{2cm}{} ... \end{adjustwidth}; Is it possible to move numbering to the left, as shown at desired output? Thank you! – Beginner Jul 17 '18 at 9:16

Here is a solution with the adjustwidth environment from changepage and \titlespacing fromtitlesec. The latter command takes 3 arguments: a first argument to increase or decrease the left margin, the other two for the vertical spacing before and after the title. I incorporated this command at the very beginning of the adjustwidth environment, so as to not interfere with the general settings of the document. If this has to be repeated several times in your document, you may consider declaring these modifications in your preamble, with \AtBeginEnvironment{adjustwidth}{...}.

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}

\usepackage[showframe]{geometry}
\geometry{paper=a4paper}
\geometry{bindingoffset=1.5cm,hmargin={1.5cm,1.5cm},vmargin={1cm,1cm}}
\geometry{includefoot=false}
\usepackage{changepage}
\usepackage{titlesec}

\begin{document}

\lipsum[11]
\titleformat{\section}{\Large\bfseries}{\parbox{2cm}{\thesection}}{-0.5pt}{}
\titleformat{\subsection}{\large\bfseries}{\parbox{2cm}{\thesubsection}}{-0.5pt}{}
\titleformat{\subsubsection}{\normalsize\bfseries}{\parbox{2cm}{\thesubsubsection}}{-0.5pt}{}
\titlespacing{\section}{-2cm}{*3.5}{*2.}
\titlespacing{\subsection}{-2cm}{*3.25}{*1.5}
\titlespacing{\subsubsection}{-2cm}{*3.25}{*1.5}
\section{Section}
\lipsum[1]
\subsection{Subsection}
\lipsum[1]
\subsubsection{Subsubsection}
\lipsum[1]

\end{document}


Edit 1 :

Here is a code with the modifications using titlesec in the preamble:

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}

\usepackage[showframe]{geometry}
\geometry{paper=a4paper}
\geometry{bindingoffset=1.5cm,hmargin={1.5cm,1.5cm},vmargin={1cm,1cm}}
\geometry{includefoot=false}
\usepackage{changepage}
\usepackage{titlesec}
\usepackage{etoolbox}
\titleformat{\section}{\Large\bfseries}{\parbox{2cm}{\thesection}}{-0.5pt}{}
\titleformat{\subsection}{\large\bfseries}{\parbox{2cm}{\thesubsection}}{-0.5pt}{}
\titleformat{\subsubsection}{\normalsize\bfseries}{\parbox{2cm}{\thesubsubsection}}{-0.5pt}{}
\titlespacing*{\section}{-2cm}{*3.5}{*2.}
\titlespacing*{\subsection}{-2cm}{*3.25}{*1.5}
\titlespacing*{\subsubsection}{-2cm}{*3.25}{*1.5}
}

\begin{document}

\lipsum[11]
\section{Section}
\lipsum[1]
\subsection{Subsection}
\lipsum[1]
\subsubsection{Subsubsection}
\lipsum[1]

\end{document}


Edit 2:

If have titles that fit on more than one line, and you want them to hang 2cm from the left margin, replace the last (empty) argument of \titleformat with a \parbox, like this:

\titleformat{\section}{\Large\bfseries}{\parbox[t]{2cm}{\thesection}}{-0.5pt}{\parbox[t]{\dimexpr\textwidth-2cm}}


and similarly for sub and subsubsections.

• first of all, thank you. We had a little bit of missunderstanding, is it possible that numbering (1, 1.1, 1.1.1, etc.) from section/subsection/etc.. is aligned at left margin and data from section/subsection/etc.. is aligned with text (2cm from margin) ? Thank you in advance. :) – Beginner Jul 17 '18 at 10:39
• @Beginner: Done! – Bernard Jul 17 '18 at 11:14
• @Beginner: I've added a variant code for \titleformat which does what you want, if I've well understood. – Bernard Jul 18 '18 at 14:46
• @Beginner: *n denotes a length of n ex, with a certain amount of stretchability/shrinkability (see more details at the top of p.5 of the documentation). – Bernard Jul 20 '18 at 8:38
• It's hard to say without seeing the code you used. This is probably linked to the list parameters. Perhaps you should post a new question, with the relevant code. – Bernard Jul 20 '18 at 9:26