Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
3  
It would help the people who are trying to answer questions if you also provide a MWE showing the problem. –  JohnReed Jun 9 '12 at 20:50
1  
have you tried \hspace*{length}? note the * for it work at the beginning of a line. –  ArTourter Jun 9 '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 9 '12 at 21:49

2 Answers 2

up vote 14 down vote accepted

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}
share|improve this answer
    
Thanks! It's easier than I thought. –  balping Jun 9 '12 at 20:56

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.

share|improve this answer
    
works like a charm !! –  bkd.online Oct 16 at 21:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.