44

I know there are some similar questions here, but I haven't found the perfect answer for my problem.

I don't like that TeX indents he first line of each paragraph and I'm too lazy to write \noindent to the beginning of the paragraphs, so I use this: \setlength{\parindent}{0cm} (I also tried the parskip package)

The only problem is that when I try to indent a line inside a paragraph with \indent, nothing happens. I also tried unbreakable spaces (~~~~~~~) but they didn't work.

Any idea how to solve this problem?

balping
  • 1,246
  • 3
    It would help the people who are trying to answer questions if you also provide a MWE showing the problem. – JohnReed Jun 09 '12 at 20:50
  • 1
    have you tried \hspace*{length}? note the * for it work at the beginning of a line. – ArTourter Jun 09 '12 at 20:53
  • It's quite difficult to understand why you want to suppress the indent, while using it sometimes. Either always use it or never; the former alternative is better, in my opinion. – egreg Jun 09 '12 at 21:49

2 Answers2

43

For even lazier people. ;)

You can use the parskip package, just add \usepackage{parskip} to your preamble. 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.

Count Zero
  • 17,424
38

Before setting \parindent to zero, we can store its value in another length variable and redefine the \indent command to use this other length variable instead of \parindent (which has been set to zero).

\documentclass[12pt]{article}

\newlength\tindent
\setlength{\tindent}{\parindent}
\setlength{\parindent}{0pt}
\renewcommand{\indent}{\hspace*{\tindent}}

\begin{document}

This is some text that will not be indented.

\indent This is some text that will be indented.

\end{document}
JohnReed
  • 2,627