4

I'm trying to create a precise spacing in a document, but am having issues. Despite the fact that I've requested an indent of 1.2cm, the two lines do not line up properly, as expected. What am I doing wrong?

\documentclass{book}

\begin{document}
\hangindent1.2cm{Taylor, Herman. \emph{A Tale of One City in the Dark}. New York: Little and Sons, 1998.}\\

\hspace{1.2cm}1. Herman Taylor, \emph{A Tale of One City in the Dark} (New York: Little and Sons, 1998), 77.

\end{document}
3
  • 1
    You're forgetting the \parindent and also are abusing \\. Can you tell what's the expected output?
    – egreg
    Nov 6, 2014 at 11:44
  • Ah yes, \parindent. Ok, I've got it to work with \noindent. But why is this \\ "abuse"?
    – Linter
    Nov 6, 2014 at 11:46
  • Paragraphs are ended by an empty line, not with \\.
    – egreg
    Nov 6, 2014 at 11:47

1 Answer 1

4

The primitive command \hangindent specifies that the first \hangafter lines are not indented (the default value of \hangafter is 1) and subsequent lines are indented from the left margin as requested by the argument to \hangindent.

This applies if both \hangindent and \hangafter are positive, different effects can be obtained when one or both are negative.

The normal indentation is applied anyway, so if you want that the text starts at the left margin you need \noindent:

\noindent\hangindent=1.2cm
Taylor, Herman. \emph{A Tale of One City in the Dark}. New York: Little and Sons, 1998.

Note that there's no argument. Moreover \\ should never be used to end a paragraph.

Here's an example:

\documentclass{book}
\usepackage{showframe}

\begin{document}

\noindent
\hangindent1.2cm
Taylor, Herman. \emph{A Tale of One City in the Dark}. New York: Little and Sons, 1998.

\noindent
\hspace{1.2cm}1. Herman Taylor, \emph{A Tale of One City in the Dark} (New York: Little and Sons, 1998), 77.

\end{document}

I use showframe just to show the margins. Note that setting \hangindent is incompatible with LaTeX list environments.

enter image description here

You must log in to answer this question.

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