# paragraph indentation does not work

I am writing my master's thesis on Latex with TeXShop Version 3.88 on macOS Sierra. Anyone could help me as to why none of my paragraphs are indented, please?

MWE:

\documentclass[a4paper, 11pt]{article}
\usepackage{tikz}
\usepackage{cite}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath, nccmath, amsfonts, amssymb, amsthm}
\usepackage{color}
\usepackage{array}
\usepackage{listings}
\usepackage{booktabs}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{trfsigns}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{datetime}
\usepackage{multirow}
\usepackage{placeins}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage{relsize}
\usepackage{comment}
\usepackage{Macros_SCF}
\usepackage{mathrsfs}
\usepackage[toc]{glossaries}
\usepackage{indentfirst}

\includecomment{Graphics}

\titleformat{\section}{\normalfont\large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\paragraph}{\normalfont\bfseries}{\theparagraph}{}{}
\titlespacing{\section}{0pt}{6pt}{6pt}
\titlespacing{\subsection}{0pt}{3pt}{3pt}
\titlespacing{\paragraph}{0pt}{3pt}{-1pt}

\newcolumntype{Y}{>{\centering\arraybackslash}X}

\setlength{\columnsep}{0.7cm}

\newlength{\mytocsep}
\setlength{\mytocsep}{1.5em}
{\titlerule*[0.5pc]{-}\contentspage}
\section*{#1}}

\begin{document}

\setlength\parindent{30pt}

\section{Introduction}

\begin{flushleft}
\subsection{first subsection}
\end{flushleft}

\begin{flushleft}
This is the first paragraph. This is the first paragraph. This is the first paragraph.

\indent
This is the second paragraph, which should be indented but is not.
This is the second paragraph, which should be indented but is not.
This is the second paragraph, which should be indented but is not.
\end{flushleft}

\end{document}

• Use \raggedright rather than the flushleft environment. Specify it before setting the value of \parindent. Nov 9, 2017 at 14:08
• i want every paragraph to be flushed to the left, except for the first line of every paragraph, which should be indented (not sure if that is what you are asking). Nov 9, 2017 at 14:10
• It should look like this: ...\raggedright \setlength\parindent{30pt} \begin{document} \section{Introduction} \subsection{first subsection} This is the first paragraph. This is the first paragraph. This is the first paragraph. This is the second paragraph, which should be indented but is not. This is the second paragraph, which should be indented but is not. This is the second paragraph, which should be indented but is not. \end{document} Nov 9, 2017 at 14:13
• OK so the problem was, I had a bunch of stuff between \raggedright \setlength\parindent{30pt} and the beginning of the section so it didn't work at all. When putting it right before the section it works with the indents, but now i have to put \noindent before every first paragraph or it will be indented. This is totally fine as long as the other paragraphs are indented. Thank you very much ! Nov 9, 2017 at 14:29
• unrelated but I would not use \usepackage[ansinew]{inputenc} use a standard encoding (ansinew is not from ANSI:-) preferably [utf8] or if you want a single byte encoding, use [latin1] Nov 9, 2017 at 14:31

By default latex does not indent after section headings but you had over-ridden that with \titlespacing commands, The \titlespacing* form keeps the default behaviour of not indenting, so

\documentclass[a4paper, 11pt]{article}
\usepackage{tikz}
\usepackage{cite}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath, nccmath, amsfonts, amssymb, amsthm}
\usepackage{color}
\usepackage{array}
\usepackage{listings}
\usepackage{booktabs}
\usepackage{titlesec}
\usepackage{titletoc}
\usepackage{trfsigns}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{datetime}
\usepackage{multirow}
\usepackage{placeins}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage{relsize}
\usepackage{comment}
% not availaible\usepackage{Macros_SCF}
\usepackage{mathrsfs}
\usepackage[toc]{glossaries}

\includecomment{Graphics}

\titleformat{\section}{\normalfont\large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\paragraph}{\normalfont\bfseries}{\theparagraph}{}{}
\titlespacing*{\section}{0pt}{6pt}{6pt}
\titlespacing*{\subsection}{0pt}{3pt}{3pt}
\titlespacing*{\paragraph}{0pt}{3pt}{-1pt}

\newcolumntype{Y}{>{\centering\arraybackslash}X}

\setlength{\columnsep}{0.7cm}

\newlength{\mytocsep}
\setlength{\mytocsep}{1.5em}
{\titlerule*[0.5pc]{-}\contentspage}
\section*{#1}}

\setlength\parindent{30pt}

\begin{document}

\section{Introduction}

\subsection{first subsection}

This is the first paragraph. This is the first paragraph. This is the first paragraph.

This is the second paragraph, which should be indented but is not.
This is the second paragraph, which should be indented but is not.

\end{document}

• Thanks David, now it works how I wanted. Have a good day :) Nov 9, 2017 at 14:49