BibTeX, biblatex and biberHanging Indentation for Bibliography Items

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
apa
Posts: 2
Joined: Thu Jun 03, 2010 10:25 pm

Hanging Indentation for Bibliography Items

Post by apa »

Dear members of the forum,

I have the following problem. A journal ask me to do the following with the references:

Use hanging indents for citations (i.e., the first line of the citation should be flush with the left margin and all other lines should be indented from the left margin by a set amount). Citations should be single-spaced with extra space between citations.

To do so, I am using the thebibliography environment. I fix the problem of the brackets (given that I do not want to appear in the references), but I do not know how I can manipulate \bibitem to create the indents for the second line of each citation of the references.

Any suggestion would be really welcome!!

This is the structure of the file.

Code: Select all

\documentclass[12pt]{article}

% No brackets for the references
\makeatletter
\renewcommand\@biblabel[1]{#1} 
\makeatother


\begin{document}
  \begin{thebibliography}{99}
    \bibitem{} Item
  \end{thebibliography}
\end{document}
Thanks a lot!
A.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Hanging Indentation for Bibliography Items

Post by gmedina »

Here's a modification to the thebibliography environment showing how to achieve the desired result (the code contains some explanatory comments).

Code: Select all

\documentclass[12pt]{article}
\usepackage{blindtext}  %only for dummy text, not for use in documents

\makeatletter
\renewcommand\@biblabel[1]{#1} % No brackets for the references
\renewenvironment{thebibliography}[1]
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin20pt% change 20 pt according to your needs
            \advance\leftmargin\labelsep
            \setlength\itemindent{-20pt}% change using the inverse of the length used before
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\renewcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\makeatother

\begin{document}

  \begin{thebibliography}{9}
    \bibitem{bibone} \blindtext
    \bibitem{bibtwo} \blindtext
  \end{thebibliography}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
apa
Posts: 2
Joined: Thu Jun 03, 2010 10:25 pm

Re: Hanging Indentation for Bibliography Items

Post by apa »

Thanks a lot! It works.
frustrateduser
Posts: 4
Joined: Sun Jul 28, 2013 6:15 pm

Hanging Indentation for Bibliography Items

Post by frustrateduser »

I am trying this with document class report, and I get an error.

Code: Select all

! Undefined control sequence.
<to be read again>  \refname 
                             \par 
l.1 \begin{thebibliography}{99}
What am I doing wrong?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Hanging Indentation for Bibliography Items

Post by localghost »

There are two modifications you need to do in the approach of gmedina.
  1. Replace \section* by \chapter*.
  2. Replace \refname by \bibname at all three places.

Thorsten
frustrateduser
Posts: 4
Joined: Sun Jul 28, 2013 6:15 pm

Hanging Indentation for Bibliography Items

Post by frustrateduser »

localghost wrote:There are two modifications you need to do in the approach of gmedina.
  1. Replace \section* by \chapter*.
  2. Replace \refname by \bibname at all three places.

Thorsten
This fixed it for me thanks! One last thing, can you tell me how to remove the numbers in front of each bibliography item? I want an unnumbered list.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Hanging Indentation for Bibliography Items

Post by localghost »

frustrateduser wrote:This fixed it for me thanks! One last thing, can you tell me how to remove the numbers in front of each bibliography item? I want an unnumbered list.
That makes only sense if you don't have any citations (references to the bibliography items) in your text. If so, another approach would be preferable. Can you clarify this point first?
frustrateduser
Posts: 4
Joined: Sun Jul 28, 2013 6:15 pm

Hanging Indentation for Bibliography Items

Post by frustrateduser »

localghost wrote:That makes only sense if you don't have any citations (references to the bibliography items) in your text. If so, another approach would be preferable. Can you clarify this point first?
Yes, that is correct. I went and put in references in the text the old fashioned way by typing in "(Author, year)". So I really don't want to go through and change all those to \cite references and use bibtex. I'm looking to keep my cites hard-coded and use my \bibitem style bibliography, but with indents and without numbers. My problem is I only have a little time to finish this, and I have a long bibliography.
frustrateduser
Posts: 4
Joined: Sun Jul 28, 2013 6:15 pm

Re: Hanging Indentation for Bibliography Items

Post by frustrateduser »

Actually I just found a good solution here: http://tex.stackexchange.com/questions/ ... bliography

So I won't need this code after all. Thanks for the help thought!
Post Reply