[Tex/LaTex] Paragraph indentation

indentationparagraphs

I am trying to get TeX to indent every new paragraph, but have not been successful after trying many different preambles.

Currently, this is my preamble:

\documentclass[12pt]{article}
\usepackage[left=1.5in, right=1in, top=1in, bottom=1.0in]{geometry}
%\usepackage[indentafter]{titlesec}
\usepackage{sectsty}
\usepackage{indentfirst}
%\title{Sections and Chapters}
   %\date{ }
%\setlength{\parident}{10ex}
\linespread{1.7}
\allsectionsfont{\sffamily}
\sectionfont{\fontsize{12}{12}\sffamily}
\subsectionfont{\fontsize{12}{12}\sffamily}
\raggedright

\makeatletter
\renewcommand\section{ 
  \@startsection {section}{1}{\z@}% 
                 {23pt}% 
                 {23pt}% 
                 {\normalsize\sffamily}} 
\renewcommand\subsection{ 
  \@startsection {subsection}{1}{\z@}% 
                 {23pt}% 
                 {23pt}% 
                 {\normalsize\sffamily}} 
\renewcommand\subsubsection{ 
  \@startsection {subsubsection}{1}{\z@}% 
                 {23pt}% 
                 {23pt}% 
                 {\normalfont\normalsize\sffamily}} 
\makeatother
\makeatletter
    \renewcommand\thesection   {\@Roman\c@section .}
    \renewcommand\thesubsection   {{\hspace{2em}}\@Alph\c@subsection .}
    \renewcommand\thesubsubsection   {{\hspace{2em}}\@arabic\c@subsubsection .}
\makeatother

\begin{document}

Does any one have any suggestions?

Best Answer

You issue \raggedright, which is defined as (in latex.ltx):

\def\raggedright{%
  \let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip
  \leftskip\z@skip
  \parindent\z@}

The last line of \raggedright sets \parindent to 0pt. As such, you need to set to to suit your needs. For example, you could use

enter image description here

\documentclass{article}
\usepackage{lipsum}
\makeatletter
\setlength{\@tempdima}{\parindent}% Save \parindent
\raggedright
\setlength{\parindent}{\@tempdima}% Restore \parindent
\makeatother
\begin{document}

\lipsum[1]

\end{document}
Related Question