1

I want to indent a paragraph so that each new line of it starts from the same position as shown below:

 line 1
 line 2
 line 3

The LaTeX code below generates paragraph indented as follows:

  line 1
line 2
line 3

How can it be corrected?

LaTeX:

\section*{\hspace{150pt} Motivation}
\hspace{10pt}\begin{normalsize}
tagging conventions to define the general structure of a document (such as    
article, book, and letter), to stylise text throughout a document (such as 
bold and italic), and to add citations and cross-referencing. A TeX 
distribution such as TeXlive or MikTeX is used to produce an output file 
(such as PDF or DVI) suitable for printing or digital distribution.
8
  • 1
    Welcome to TeX.SX. Your 'document' contains some 'errors'. \begin{normalsize} is wrong in the sense that \normalsize is a font size switch, but no environment. Normally, a paragraph directly after a section heading isn't indented. Use \section*{\centering Motivation}\leavevmode and an empty line, remove \hspace{...} and then continue with tagging
    – user31729
    Commented Dec 29, 2015 at 7:52
  • @ChristianHupfer would u please tell me how to fix that error
    – Elpharaoh
    Commented Dec 29, 2015 at 7:55
  • 2
    Actually, your question is a duplicate of tex.stackexchange.com/questions/118165/…, which is a duplicate of -tex.stackexchange.com/questions/31555/… -- you will find the answer there
    – user31729
    Commented Dec 29, 2015 at 7:58
  • Reading your question again: Do you want to remove the indentation -- your 'examples' are contradicting, actually
    – user31729
    Commented Dec 29, 2015 at 8:11
  • 1
    Remove \hspace{10pt} if you don't want the paragraph to be indented by 10pt. And, get rid of the redundant and ill-formed instruction \begin{normalsize}.
    – Mico
    Commented Dec 29, 2015 at 8:18

1 Answer 1

2

I give it a try:

Standard Behaviour

The standard paragraph shows an indentation in the first line and no space between paragraphs (\parskip is zero).

\documentclass{article}

\usepackage{blindtext}

\begin{document}

\blindtext

\blindtext

\end{document}

enter image description here

Standard Document Class Solution

You can use the parskip package (CTAN link) to solve your problem.

From the documentation:

Package to be used with any document class at any size. It produces the following Paragraph Layout:

Zero Parindent and non-zero Parskip. The stretchable glue in \parskip helps LaTeX in finding the best place for page breaks.

In addition, the package adjusts the skips between list items.

This package is no more than quick fix; the ‘proper’ way to achieve effects as far-reaching as this is to create a new class. An example class is to be found in the ntgclass set: artikel3.cls

The koma-script bundle classes and the memoir class all provide similar functionality, and their respective documentation files discuss the pros (such as they are) and cons of this approach.

\documentclass{article}

% new package
\usepackage{parskip}

\usepackage{blindtext}

\begin{document}

\blindtext

\blindtext

\blindlist{itemize}

\end{document}

enter image description here

Bad Solution: Manually Change the Lengths

Important for you is that the package parskip takes care of other things too. Sometimes you see people manually changing the parameters like \setlength{\parindent}{0em} and \setlength{\parskip}{1em} but this is considered bad because it also could change the distance between items in lists and so on. But I am not an expert here.

Alternative Solution: KOMA Approach

There are the so called KOMA-Script (CTAN link) document classes (in contrast to the standard document classes like article and book).

They offer a document class option called parskip which also "takes care of everything".

\documentclass[parskip]{scrartcl}

\usepackage{blindtext}

\begin{document}

\blindtext

\blindtext

\blindlist{itemize}

\end{document}

enter image description here


PS: I don't get the

\section*{\hspace{150pt} Motivation}
\hspace{10pt}\begin{normalsize}

part of your code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .