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:
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{einstein,
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"
}
@book{dirac,
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}
}
@online{knuthwebsite,
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"
}
\end{filecontents}
\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[main=turkish,english,shorthands=:!]{babel}
\usepackage{titlesec}
\usepackage[normalem]{ulem}
\usepackage{etoolbox}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{titlesec}
% Customize headings
\usepackage{titlesec}
\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]
\titleformat{\chapter}
{\normalfont\normalsize\bfseries}{\thechapter.}{.5em}{}
\titlespacing{\chapter}{1cm}{0cm plus 4pt minus 2pt}{\myonehalfvspace plus 2pt minus 2pt}
\usepackage[round]{natbib}
\bibliographystyle{plainnat} % or some other suitable bib style
\usepackage[none]{hyphenat}
\usepackage[spaces,obeyspaces,hyphens]{xurl} % allow arbitrary line breaks in URL strings
\urlstyle{same}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\begin{document}
\chapter{Chapter 1}
\setlength{\parindent}{1cm}
Chapter name and the first line of the paragraph is aligned here \cite{einstein}, \cite{dirac}, \cite{knuthwebsite}.
\setlength\bibhang{50pt}
\bibliography{\jobname}
\end{document}
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:Coming back to your questions:
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.)
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.The default value of
\bibsep
is -- since the12pt
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 the12pt
document class option,1\baselineskip
amounts to14.5pt
.)