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 have to use EasyBib to make my bibliography, and I've put it into my LaTeX document by copying/pasting. But I need to have a hanging indent for each item.

I've been able to get the effect I want by putting this before each item:

\hangindent=2.5em
\noindent

However, I have to write this out for every item. Is there a way to automate doing this?

share|improve this question
    
\everypar{...} or \parindent=0pt? –  Henri Menke Apr 26 at 21:33
    
@HenriMenke \noindent doesn't seem to work with that. (I'm using \everypar{\noindent\hangindent=2.5em} and I've tried with/without the \hangindent. It doesn't seem to have any effect. The hanging indent does work though. –  Joe the Person Apr 26 at 21:39
    
Then try \parindent=0pt. –  Henri Menke Apr 26 at 21:41
    
@HenriMenke That did work - I had to move the \parindent outside the \everypar If you put your comment as an Answer I'll accept it. –  Joe the Person Apr 26 at 21:44
    
I would recommend to use bibtex or biblatex to manage your bibliography. Alternatively you can warp the bibliography in \begin{thebibliogrpahy}{99} and \end{thebibliography} and \bibitem` before each entry. –  Guido Apr 26 at 22:05

2 Answers 2

up vote 5 down vote accepted

Instead of putting \noindent in front of every item, it is easier to set globally

\parindent=0pt

Furthermore I recommend, that you use either LaTeX's internal thebibliography environment or bibtex.

share|improve this answer

The indentation of the first line for all paragraphs in scope can be set by (see Menke's answer):

\setlength{\parindent}{0pt}

\hangindent has to be repeated for each paragraph. \everypar helps:

\everypar{\setlength{\hangindent}{2.5em}}

But caution is needed, because LaTeX uses \everypar quite often itself, e.g. in \section and friends.

An alternative is moving the paragraphs to the right by setting \leftskip and moving the first line to the left using a negative value for \parindent.

Example file:

\documentclass{article}
\usepackage{lipsum}

\begin{document}

\lipsum[65]

\bigskip

\setlength{\hangindent}{2.5em}
\noindent
\lipsum[65]

\bigskip

\begingroup
  \setlength{\parindent}{0pt}%
  \everypar{\setlength{\hangindent}{2.5em}}%
  \lipsum[65-66]
  \par
\endgroup

\bigskip

\begingroup
  \par
  \setlength{\parindent}{-2.5em}
  \addtolength{\leftskip}{-\parindent}
  \lipsum[65-66]
  \par
\endgroup

\end{document}

Result

share|improve this answer

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.