1

I'm trying to define a hangindent (I managed that) which is repeated for each new line or each new paragraph or something. Do I really have to repeat that before each entry or is there a way of setting that generally for each line / paragraph in this particular chapter? The idea is that if an entry is longer than a line the later lines should have a hanging indentation.

(And yes, I'm aware that writing the bibliography manually is totally silly but my department is very peculiar about how the bibliography has to look like and I wasted 2 days already trying to get a custom style to work (and failed obviously) so I figured doing it manually would in the end be quicker.. -.-)

thx a lot in advance :)

\chapter{Bibliography}
\addcontentsline{toc}{chapter}{Bibliography}
\label{Bibliography}

\hangindent=\parindent
\hangafter=1

Adams, Ansel. \emph{Die neue Ansel Adams Photobibliothek: Das Negativ}. Ed. Robert Baker. 9th ed. München: Christian Verlag GmbH, 1998.\\
Kiefer, Roland. \emph{Nikon Fotoschule}. Schaffhausen: Verlag Photographie, 1981.
  • it would be easier if you provided a real example that could be tested but indentation (hanging or not) just applies to the start of a paragraph, and you only have one paragraph in the supplied example, so what do you see (and what do you expect) as you have not provided an example that can be run, hard to be sure.... – David Carlisle Sep 8 '16 at 15:13
  • welcome to tex.sx. the style you want is essentially what is provided by the "numbered" style of \bibitem, which is built into the basic latex faciilties. it would probably be easier to call on that than to build your own. – barbara beeton Sep 8 '16 at 15:18
  • it is a real example. this is an external chapter to my MA paper. sry forgot to say that. So this is all there is in this file. Do you need the main file too? Also idm whether it applies for each new line or for each new paragraph. It would just be easier if I could trigger it that way since I'll need it for every entry – Cinna Sep 8 '16 at 15:20
  • it doesn't make sense to ask for paragraph indentation on every line of the paragraph! I would have thought that you wanted each entry to be a separate paragraph anyway in which case you need to replace \\ (new line) by a blank line (paragraph break) – David Carlisle Sep 8 '16 at 15:55
  • I tried \bibitem and managed to remove the labels. However that still has no hanging indentation then or is that removed by me removing the labels? – Cinna Sep 8 '16 at 16:03
2

Since you're not going to have lists or whatever in your bibliography, using \leftskip and a negative \parindent seems easier.

Adjust the amount of indentation to your liking.

\documentclass{book}

\makeatletter
\newenvironment{mybibliography}
 {\let\@afterindentfalse\@afterindenttrue % we want \parindent anywhere
  \chapter{\bibname}%
  \setlength{\leftskip}{2em}%
  \setlength{\parindent}{-\leftskip}}
 {}
\makeatother

\begin{document}

\frontmatter

\tableofcontents

\mainmatter

\chapter{Whatever}

text


\backmatter

\begin{mybibliography}

Adams, Ansel. \emph{Die neue Ansel Adams Photobibliothek: Das Negativ}. Ed. Robert Baker. 9th ed. München: Christian Verlag GmbH, 1998.\\
Kiefer, Roland. \emph{Nikon Fotoschule}. Schaffhausen: Verlag Photographie, 1981.

Adams, Ansel. \emph{Die neue Ansel Adams Photobibliothek: Das Negativ}. Ed. Robert Baker. 9th ed. München: Christian Verlag GmbH, 1998.\\
Kiefer, Roland. \emph{Nikon Fotoschule}. Schaffhausen: Verlag Photographie, 1981.

Adams, Ansel. \emph{Die neue Ansel Adams Photobibliothek: Das Negativ}. Ed. Robert Baker. 9th ed. München: Christian Verlag GmbH, 1998.\\
Kiefer, Roland. \emph{Nikon Fotoschule}. Schaffhausen: Verlag Photographie, 1981.

\end{mybibliography}

\end{document}

enter image description here

If you want the hanging indentation to be the same as the normal parindent, just do

\makeatletter
\newenvironment{mybibliography}
 {\let\@afterindentfalse\@afterindenttrue % we want \parindent anywhere
  \chapter{\bibname}%
  \setlength{\leftskip}{\parindent}%
  \setlength{\parindent}{-\leftskip}}
 {}
\makeatother

The normal setting to \parindent as well as the behavior of \if@afterindent will be restored as soon as \end{mybibliography} is executed.

You may want to add also a setting to \parskip, say

\setlength{\parskip}{\medskipamount}

so changing the code into

\makeatletter
\newenvironment{mybibliography}
 {\let\@afterindentfalse\@afterindenttrue % we want \parindent anywhere
  \chapter{\bibname}%
  \setlength{\leftskip}{\parindent}%
  \setlength{\parindent}{-\leftskip}%
\setlength{\parskip}{\medskipamount}}
 {}
\makeatother

These changes would produce

enter image description here

|improve this answer|||||
1

You can use a list for this. E.g.

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\begin{document}

\begin{itemize}[label=,leftmargin=\parindent,itemindent=-\parindent]
\item Adams, Ansel. \emph{Die neue Ansel Adams Photobibliothek: Das Negativ}. Ed. Robert Baker. 9th ed. München: Christian Verlag GmbH, 1998.\\
Kiefer, Roland. \emph{Nikon Fotoschule}. Schaffhausen: Verlag Photographie, 1981.

\item Adams, Ansel. \emph{Die neue Ansel Adams Photobibliothek: Das Negativ}. Ed. Robert Baker. 9th ed. München: Christian Verlag GmbH, 1998.\\
Kiefer, Roland. \emph{Nikon Fotoschule}. Schaffhausen: Verlag Photographie, 1981.

\end{itemize}
\end{document}
|improve this answer|||||
0

thanks a lot for all the answers :) I found a way to get thebibliography to do what I wanted (which has the additional benefit that I can use \cite more easily than with a simple list). I added the following to the preamble:

\makeatletter
\renewcommand\@biblabel[1]{}
\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

redefinition for thebibliography found here: http://latex-community.org/forum/viewtopic.php?t=9048&f=50

|improve this answer|||||

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.