2

I have the following code and maybe someone can tell me which line of code is delivering the indentation of the first line on every paragraph?

\documentclass{IEEEtran}

\makeatletter
\newcommand*\titleheader[1]{\gdef\@titleheader{#1}}
\pagenumbering{gobble} %no page number
\AtBeginDocument{%
  \let\st@red@title\@title
  \def\@title{%
    \bgroup\normalfont\large\centering\@titleheader\par\egroup
    \vskip1.5em\st@red@title}
}
\makeatother

\title{My Paper Title}
\titleheader{2016 IEEE 24th International Requirements Engineering Conference}

\author{\IEEEauthorblockN{M.Sc. John Doe}
\IEEEauthorblockA{Department of Economic Computer Science\\Economic Computer Science\\
University of California\\
California, USA 04103-04358\\
Email: John.Dow@university-xx.com}}
%#################DOCUMENTS STARTS HERE #########################
\begin{document}
\maketitle
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas porta ut orci in scelerisque. Sed cursus, quam ut facilisis dapibus, mi dui auctor lorem, id cursus turpis leo a ante. Nullam pharetra sem ipsum, sit amet porttitor nulla dapibus vitae. Donec venenatis dapibus leo. Nunc ultrices lacinia interdum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin bibendum mauris non arcu congue sollicitudin. Proin et velit ac ipsum porta dignissim.

Integer hendrerit at libero eget sagittis. Nullam eu rhoncus diam, eu pellentesque eros. Cras urna mi, scelerisque a nibh quis, consectetur rutrum massa. Ut at consectetur nisi. Aliquam erat lorem, dictum et tellus non, dapibus accumsan est. Duis porttitor scelerisque mauris sed ullamcorper. Cras venenatis maximus nibh, ut malesuada ipsum gravida ac. Fusce eu ligula eget eros porta vestibulum id eu sem. Aenean ullamcorper sollicitudin posuere. Donec gravida non tellus vitae suscipit. Mauris eget erat eu nisl aliquet dictum. Sed vestibulum tortor laoreet justo interdum, in fermentum eros malesuada. Nulla vitae lorem faucibus, lobortis dolor sed, consequat lectus. Mauris posuere feugiat mi eu egestas.

Duis pellentesque ornare eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed convallis ut sem id commodo. Aenean ac tellus at ipsum efficitur iaculis. Curabitur pharetra at dui quis aliquam. Pellentesque vitae ante purus. Ut eleifend augue eu arcu pretium, eu gravida sem pretium. Sed fringilla quam blandit tincidunt bibendum. In pellentesque tincidunt eros, a eleifend leo faucibus nec. Suspendisse sit amet nunc urna. Proin varius dolor facilisis ex mollis ornare. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed hendrerit id eros at malesuada. Praesent nisl dolor, consequat et aliquet vel, volutpat eu neque. Nunc venenatis at arcu quis ultricies. Vestibulum sollicitudin erat est, eu egestas lorem ultricies non.

Nam mauris eros, porta eget tincidunt in, facilisis id lacus. Nunc at mauris orci. Duis risus neque, feugiat vitae tincidunt a, placerat ut neque. Etiam eget tincidunt eros, eu posuere arcu. Mauris luctus, leo dapibus condimentum efficitur, orci quam tincidunt nisi, id malesuada risus elit vitae nisl. Vivamus fringilla erat sed maximus blandit. Nulla ultrices turpis quis erat dapibus gravida. Cras vestibulum, quam eget malesuada porttitor, est nunc faucibus nisi, ac molestie lectus ex id ante. Ut feugiat leo et neque malesuada, sed posuere nisl tincidunt. Curabitur congue id risus in eleifend. Cras cursus, augue vitae mattis posuere, lacus sapien efficitur tellus, et lobortis nibh dolor sed lectus.
\end{document}
  • 1
    It's normal typographic practice. – egreg Jan 5 '17 at 23:51
  • Sorry for the wrong code formatting. I found out my problem. When I have a line of block code e.t. 4 lines, then I have to make a return and then the next first line of the paragraph makes an indentation. I didn't do this return and that was my problem. – maxmin Jan 6 '17 at 0:05
  • Don't forget that \par produces a new paragraph. – Sigur Jan 6 '17 at 0:17
  • This is standard in LaTeX. See also this question for a quick solution to remove all indentation. – Karlo Jan 6 '17 at 0:17
  • 1
    ...and nearly every class sticks to that. (adding to @egreg's comment) btw: In standard LaTeX the format defines it: \parindent=20pt (c.f. latex.ltx). – Ruben Jan 6 '17 at 0:17
4

None of the lines of code in your document are at fault here, since this is an implicit feature of paragraph text in TeX, unless specifically set by a package or class - each paragraph has an accompanying indent, called a paragraph indent, the length of which is set within \parindent.

Paragraph indentation is meant to indicate the start of a (new) paragraph and separate it stylistically from the previous paragraph. Another way of separating paragraphs stylistically would be to set a paragraph skip (the length of which is stored in \parskip). There's rarely a need for both, so either one or the other is used.

You'll note that the first paragraph after a sectional title is typically not indented, since the style of the two units of text adequately distinguishes them from one another.

Since this may be stylistic in nature, some people don't like it. You could get rid of it by setting \parindent to 0pt in your preamble:

\setlength{\parindent}{0pt}

or a little better:

\usepackage{parskip}% Zero \parindent and non-zero \parskip.
                    % The stretchable glue in \parskip helps LaTeX in 
                    % finding the best place for page breaks.

As an example, consider the following:

enter image description here

\documentclass{article}

\begin{document}

\section{A section}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus iaculis diam arcu, 
id dictum urna malesuada quis. Vestibulum sed posuere sem. Duis eget velit molestie, 
faucibus risus nec, mattis nulla. Vestibulum ultricies sem non enim interdum pretium. 
In accumsan enim ut nisi mollis, eu semper nunc pulvinar.

Sed molestie mauris libero, eu vestibulum felis suscipit id. Sed dolor mauris, rhoncus 
non nulla vestibulum, ullamcorper condimentum dolor. Aliquam in luctus dolor. Vivamus 
maximus quam dignissim, elementum metus id, faucibus nulla. Pellentesque erat purus, 
interdum vel elementum ac, malesuada eu nunc.

Nulla scelerisque condimentum elit, a cursus quam lobortis non. Vestibulum eu augue 
augue. In a est at mi efficitur egestas. Sed ut fermentum nisl. Phasellus et ante diam. 
Phasellus orci velit, venenatis vel ex et, suscipit rutrum sapien. Cras tellus sem, 
interdum ut ipsum id, cursus varius justo. Nulla vel nibh metus.

Donec felis purus, molestie non elementum dapibus, porta a tortor. Class aptent taciti 
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Interdum et 
malesuada fames ac ante ipsum primis in faucibus. Donec bibendum dictum metus, sed 
sollicitudin tortor posuere eget. Ut malesuada mauris mattis tellus sodales, nec tristique 
dolor scelerisque. Integer enim nunc, viverra non lorem non, interdum convallis nibh. 
Donec accumsan ligula vitae.

Diam volutpat, sit amet lobortis metus egestas. Nunc nibh velit, imperdiet ut erat at, 
tempor egestas tellus. Maecenas sollicitudin neque neque, quis consequat enim convallis 
vitae. Aenean orci est, accumsan in convallis non, mollis sit amet enim. Suspendisse 
molestie mi at neque blandit, nec consequat ante suscipit.

Vestibulum lacinia tellus ut leo porttitor, in convallis leo pulvinar. Donec molestie 
tincidunt lectus, ut maximus ligula gravida a.

\end{document}
  • Under article, the default \parindent is 15pt. This may be different for other document classes.

  • No indent of the first paragraph is needed, since the distinction between typographical units are obvious, in addition to the space between them.

  • Without a paragraph indent, the break between paragraphs four and five might not be as visible, since the line ends very full:

    enter image description here

  • article does have a non-zero \parskip in the sense that it provides some glue to stretch content by at most 1pt if the need arises, based on other vertical content within the page.

Relevant references:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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