[Tex/LaTex] Setting the indents in bibliography


I want to set the indent of the first (1) and the second (2) (third..) line. In addition, setting the space (3) between first and second cite. Is it possible? Thank you.


My MWE is here:


    author = "Albert Einstein",
    title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
    [{On} the electrodynamics of moving bodies]",
    journal = "Annalen der Physik",
    volume = "322",
    number = "10",
    pages = "891--921",
    year = "1905",
    DOI = "http://dx.doi.org/10.1002/andp.19053221004",
    keywords = "physics"

    title = {The Principles of Quantum Mechanics},
    author = {Paul Adrien Maurice Dirac},
    isbn = {9780198520115},
    series = {International series of monographs on physics},
    year = {1981},
    publisher = {Clarendon Press},
    keywords = {physics}

    author = "Donald Knuth",
    title = "Knuth: Computers and Typesetting",
    url  = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    addendum = "(accessed: 01.09.2016)",
    keywords = "latex,knuth"



% Customize headings
\newcommand*{\myonevspace}{13.850574pt}% <-- Define a macro \myonehalfvspace
\newcommand*{\myonehalfvspace}{20.775861pt}% <-- Define a macro \myonehalfvspace
\newcommand*{\mytwovspace}{27.701147pt}% <-- Define a macro \mytwovspace

% Chapter heading \titlespacing*{command}{left}{before-sep}{after-sep}[right-sep]
\titlespacing{\chapter}{1cm}{0cm plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}

\bibliographystyle{plainnat} % or some other suitable bib style


\usepackage[spaces,obeyspaces,hyphens]{xurl} % allow arbitrary line breaks in URL strings

\chapter{Chapter 1}

Chapter name and the first line of the paragraph is aligned here \cite{einstein}, \cite{dirac}, \cite{knuthwebsite}.



Best Answer

You've indicated that you use the natbib package as well as (somewhat implicitly) an author-year citation call-out style.

Excerpting from section 2.12, "Other formatting options" (pp. 15f.) of the user guide of natbib package:

\bibhang The list of references for author-year styles uses a hanging indentation format: the first line of each reference is flush left, the following lines are set with an indentation from the left margin. This indentation is 1em by default but may be changed by redefining (with \setlength) the length parameter \bibhang.

\bibsep The vertical spacing between references in the list, whether author-year or numerical, is controlled by the length \bibsep. If this is set to 0pt, there is no extra line spacing between references. The default spacing depends on the font size selected in \documentclass, and is almost a full blank line. Change this by redefining \bibsep with \setlength command.

Coming back to your questions:

  1. To modify the amount of indentation of the first line, natbib offers no special facilities as authoryear-style citation call-outs are being used. Since this citation style has no need for numbers, there's no need to modify the indentation of the first line of the formatted bibliographic item.

    If you really need to modify the amount of indentation of the first line, you'd have to modify some low-level LaTeX parameters that govern the amount of indentation of the first line of a paragraph. Please advise if this is actually a priority for you. (Speaking for myself, I'd find any amount of non-zero indentation to be rather odd-looking.)

  2. To modify the amount of hanging indentation in a paragraph, change the parameter \bibhang via a \setlength statement. E.g., \setlength\bibhang{0pt} directs LaTeX not to create a hanging indentation.

  3. The default value of \bibsep is -- since the 12pt document class option is in effect -- 10pt plus 5pt minus 2pt. Note that is a "rubber length" in TeX parlance. The mild stretchability and shrinkability is actually a nice feature, especially if \flushbottom is in effect. To change this parameter to a fixed (i.e., non-strechable and non-shrinkable) length, issue a statement such as \setlength{\bibsep}{1\baselineskip}. (For the 12pt document class option, 1\baselineskip amounts to 14.5pt.)