1

In the code below I am getting indent after second paragraph, but not after first paragraph, can anyone tell me what is the reason and how can I correct this? Below is the code given:

{\bfseries{1. Introduction}\\}
\ Diffuse ........\\ %%% first oaragraph

\ second paragraph\\ %%% Second paragraph
Abhinav Gupta
  • 131
  • 1
  • 1
  • 4
  • First of, this is not how you do headlines, secondly you should never ever have the need to use \\ in the text. So basically you are doing it wrong. Please explain know mare detail what is it you are trying and what you are expecting the output to be – daleif Sep 07 '15 at 06:09
  • Output format I want : Introduction (bold), one line gap; indent and first paragraph starts. similarly after first para finishes, one line gap and second para starts after indent. – Abhinav Gupta Sep 07 '15 at 06:16
  • That does not tell us anything. – daleif Sep 07 '15 at 06:17
  • daleif is right that this is really not how we use LaTeX. Also \bfseries is a declaration, so we use {\bfseries foo} or \textbf{foo}. However, LaTeX can be overwhelming to a beginner. You're not the first to make mistakes like these and you certainly won't be the last. You should get yourself a good beginner's guide: http://tex.stackexchange.com/questions/11/what-are-good-learning-resources-for-a-latex-beginner. The number one rule, though, is do not hard code visual formatting features like 1. or (generally) a hard line break or (in this case anyway) an explicit space – Au101 Sep 07 '15 at 16:49

2 Answers2

8

Example for a document with a numbered section title and three paragraphs:

\documentclass{article}

\begin{document}

\section{Introduction}

Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
libero, nonummy eget, consectetuer id, vulputate a, magna. Donec
vehicula augue eu neque. Pellentesque habitant morbi tristique
senectus et netus et malesuada fames ac turpis egestas. Mauris ut
leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna
fringilla ultrices.

Phasellus eu tellus sit amet tortor gravida
placerat. Integer sapien est, iaculis in, pretium quis, viverra ac,
nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus.
Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla.
Curabitur auctor semper nulla. Donec varius orci eget risus. Duis
nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis
eget orci sit amet orci dignissim rutrum.

Nam dui ligula, fringilla a, euismod sodales,
sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus
libero, pretium at, lobortis vitae, ultricies et, tellus. Donec
aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna,
vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit
mollis. Suspendisse ut massa. Cras nec ante. Pellentesque a nulla.
Cum sociis natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. Aliquam tincidunt urna. Nulla ullamcorper
vestibulum turpis. Pellentesque cursus luctus mauris.

\end{document}

Result

Package indentfirst

If also the first paragraph right after the section title should be indented, then load package indentfirst:

\usepackage{indentfirst}

Result indentfirst

Package parskip

If you do not want the indentation of the first paragraph line, but vertical space between paragraphs instead, then load package parskip:

\usepackage{parskip}

Result <code>parskip</code>

Some document classes (e.g., KOMA-Script) configure this by options, thus that package parskip is not necessary and should not be used then.

Heiko Oberdiek
  • 271,626
6

Let us assume that you use article class. Then instead of numbering sections by hand, you should allow latex to do the job. Use \section commands. Then we can make titlesec package to indent the first paragraph after the section title.

\documentclass{article}
\usepackage{lipsum}   %% for demo only
\usepackage{titlesec}
%\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titlespacing{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\begin{document}
  \section{Introduction}
  \lipsum[1]
  \lipsum[2]
\end{document}

The magic here is \titlespacing command. This command does the indenting job while its starred companion \titlespacing* kills the indentation.

enter image description here