1

This question already has an answer here:

How can one create a single first line indent? The idea is to produce the same exact effect as the Microsoft Word "First line indent":

Word First line indent

That produces an output, such as: enter image description here

Side-note: the purpose is not to indent the paragraph, but rather make the extended line (big sentence - not new line) start before the normal (not indented) first line. That is to say, how can one outdent all lines except the first one (including a section, subsection, etc)?

Thanks in advance!

marked as duplicate by user13907, Mensch, barbara beeton, Maarten Dhondt, Thorsten Mar 30 '16 at 16:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Holene Mar 30 '16 at 15:15
  • Please provide an MWE illustrating the way you intend to use title, such that it is easier/possible to understand what kind of behaviour you're trying to achieve. – Holene Mar 30 '16 at 15:32
  • What you are asking for is not good-practice nor a very common thing to do. Because of this it is not something that is easily done and I think you should strongly reconsider whether you actually want to do it. Nevertheless I am confident the great people of this site will come up with a good way of doing it. – jonalv Mar 30 '16 at 15:44
  • Trying to elicit an answer by posting a link to a graphic showing a Microsoft Word settings dialogue is really not a good thing. First, Microsoft Word outputs are different depending upon the printer used, second you limit your answers to people that actually use Microsoft Word. – A Feldman Mar 30 '16 at 16:13
  • 1
    I voted to reopen, since this question is about outdenting all lines except the first one and not about indenting the first one. Clearly no duplicate ;-) However the question is phrased wring and @ChokuRei should rephrase it to state the actual problem … – Tobi Mar 30 '16 at 21:14
4

Indent for first line

This is actually the default behavior in TeX. The amount of indenting can be controlled by setting the length \parindent.

\documentclass{article}

\setlength{\parindent}{20mm}

\begin{document}
   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.

   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.
\end{document}

enter image description here

Note that the indent only applies for normal paragraphs and not section headings etc. if you want these also to be indented (which I don’t recommend!) you must redefine them e.g. with titlesec package or when using KOMA-Script with \RedeclareSectionCommand.

Outdent for all lines except the first one

If you want all line except the first one you can use \parshape together with \everypar (must be used after \begin{document} or with \AtBeginDocument).

\documentclass{article}

\usepackage{showframe}

\setlength{\parindent}{0pt}

\AtBeginDocument{
   \everypar{%
      \parshape 2
          0pt \textwidth
          -2em \dimexpr\textwidth+2em\relax
   }
}

\begin{document}
   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.
   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.
   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.

   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.
\end{document}

enter image description here

However it looks really strange and is unusual – don’t use it ;-)

Mor about \parshape: Opposite of \parindent


Edit: To preserve this setting at a \section you must re-apply it afterwards, because \everypar is re-setted. I use \ReneowDocumentCommand from the sparse package.

\documentclass{article}

\usepackage{showframe}

\setlength{\parindent}{0pt}

\newcommand{\activateoutdenting}{%
   \everypar{%
      \parshape 2
          0pt \textwidth
          -2em \dimexpr\textwidth+2em\relax
   }
}

\AtBeginDocument{\activateoutdenting}

\usepackage{xparse}

\let\origsection\section
\RenewDocumentCommand{\section}{ s o m }{%
   \IfBooleanTF{#1}{%
      \IfValueTF{#2}{%
         Impossible case!%
      }{%
         \origsection*{#3}%
      }
   }{%
      \IfValueTF{#2}{%
         \origsection[#2]{#3}%
      }{%
         \origsection{#3}%
      }
   }
   \activateoutdenting
}

\begin{document}
   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.
   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.
   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.

   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.

   \section{Test}
   A quite long sentence a quite long a sentence quite a long sentence a quite long sentence.
\end{document}

Note that this hast to be done for other section headings too and this is no robust implementation. I repeat myself but: Why would you do this? It looks awful …

  • It doesn't work Tobi! All it does it indenting the paragraph, note that on word the second line will start "within the margins". The first line is still aligned with the title, it is the second line who moves towards the margins, if you know what I mean! – ChokuRei Mar 30 '16 at 15:22
  • I believe this is a duplicate of tex.stackexchange.com/questions/31555/… – A Feldman Mar 30 '16 at 15:22
  • It is a different question! Nevertheless, none of the answers in there provide this effect. Thank you anyway :) – ChokuRei Mar 30 '16 at 15:25
  • 1
    Since you have a "Title 1" and you want indentation is seems that should be your question. Of course if your question is really "how do I make this exactly like Microsoft Word" then that is way too vague and broad to be answered here. Post your attempt at making what you want, that will certainly help. – A Feldman Mar 30 '16 at 15:29
  • @ChokuRei: Then why do you ask about “indent the first line”? You want to outdent als lines except the first line. This can be done as shown in my edit. – Tobi Mar 30 '16 at 15:35

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