2

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.

indent

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}
  • @user191173 - I don't think the queries are meaningfully related. The link you provided points to a query that uses the biblatex package, whereas the present query uses the natbib package. – Mico Jun 20 at 14:13
1

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.)

  • Thank you @Mico Second and third problems are solved thanks to you. First problem is exactly: bibliography text must start at the chapter name's alignment. i.stack.imgur.com/aSzzt.jpg It starts in MWE but in the overleaf project it is not. – volkan Jun 20 at 13:53
  • @volkan - There must be something in your document's code that creates a negative indent for the first line of the bib entries. Not knowing what this code might be, I'm afraid I have no idea how to go about fixing the issue. I can only suggest that you create a new query in which you focus on just this one issue and provide all necessary information. – Mico Jun 20 at 14:11
  • In fact, the negative indent is created consciously to obeying thesis rules. Without making any changes for chapter names, I have to set the indent of the cite’s first line. Under the circumstances, have you any advice? – volkan Jun 20 at 15:44
  • @volkan - Without knowledge of how the “thesis rules” are translated into LaTeX code, I can’t offer any further advice. – Mico Jun 21 at 1:52
  • The chapter (section, subsection...) title must have 1 cm indent. And cite's first line must start at the chapter name's alignment. I updated MWE in my question. There are the codes that run the chapter name's indent. In terms of giving an idea, I'd appreciate it if you could browse. – volkan Jun 21 at 6:13

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.