BibTeX, biblatex and biberHow to make it Single Spacing for Each Entry,?

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
ychao
Posts: 13
Joined: Sun Apr 04, 2010 12:24 am

How to make it Single Spacing for Each Entry,?

Post by ychao »

Dear all,

I have a quick question:

How to make it single spacing for each bibliography entry, rather than between entries?

I know using "\setlength{\bibsep}{0pt}" can do the job of setting line spacing between entries, but how to set line spaces WITHIN each entry?

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: How to make it Single Spacing for Each Entry,?

Post by gmedina »

Hi,

the standard behaviour is normally the one that you describe; are you using a non standard document class? or doing some modifications to the interline spacing?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
ychao
Posts: 13
Joined: Sun Apr 04, 2010 12:24 am

How to make it Single Spacing for Each Entry,?

Post by ychao »

gmedina wrote:Hi,

the standard behaviour is normally the one that you describe; are you using a non standard document class? or doing some modifications to the interline spacing?

Thank you for your quick reply, but you may misunderstand my question. My objective here is to set the line spacing WITHIN each entry to be Single-Spacing.

To be more specific, I want Single-Spacing within each entry, but Double-Spacing between entries.

"\setlength{\bibsep}{0pt}" works for line spacing between entries, but NOT for WITHIN each entry.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to make it Single Spacing for Each Entry,?

Post by gmedina »

in the standard classes the environment thebibliography is defined internally by using a list, so you could simply modify the \itemsep length for that particular list. The following example shows this procedure in the case of the article document class (the line added was marked with the comment "%adjust as required"):

Code: Select all

\begin{filecontents}{biblio.bib}
@book{goossens93,
	author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
	title = "The Latex Companion",
	year = "1993",
	publisher = "Addison-Wesley",
	address = "Reading, Massachusetts"

}

@article{greenwade93, 
	author = "George D. Greenwade",
	title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
	year = "1993",
	journal = "TUGBoat",
	volume = "14",
	number = "3",
	pages = "342--351"
}

@book{knuth79,
	author = "Donald E. Knuth",
	title = "Tex and Metafont, New Directions in Typesetting",
	year = "1979",
	publisher = "American Mathematical Society and Digital Press",
	address = "Stanford"
}
\end{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}

\makeatletter
\renewenvironment{thebibliography}[1]
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \setlength\itemsep{1\baselineskip plus2pt minus1pt}%adjust as required
            \@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}
\makeatother

\begin{document}

\nocite{*}

\bibliographystyle{plain}
\bibliography{biblio}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
ychao
Posts: 13
Joined: Sun Apr 04, 2010 12:24 am

How to make it Single Spacing for Each Entry,?

Post by ychao »

gmedina wrote:in the standard classes the environment thebibliography is defined internally by using a list, so you could simply modify the \itemsep length for that particular list. The following example shows this procedure in the case of the article document class (the line added was marked with the comment "%adjust as required"):

Code: Select all

\begin{filecontents}{biblio.bib}
@book{goossens93,
	author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
	title = "The Latex Companion",
	year = "1993",
	publisher = "Addison-Wesley",
	address = "Reading, Massachusetts"

}

@article{greenwade93, 
	author = "George D. Greenwade",
	title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
	year = "1993",
	journal = "TUGBoat",
	volume = "14",
	number = "3",
	pages = "342--351"
}

@book{knuth79,
	author = "Donald E. Knuth",
	title = "Tex and Metafont, New Directions in Typesetting",
	year = "1979",
	publisher = "American Mathematical Society and Digital Press",
	address = "Stanford"
}
\end{filecontents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}

\makeatletter
\renewenvironment{thebibliography}[1]
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \setlength\itemsep{1\baselineskip plus2pt minus1pt}%adjust as required
            \@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}
\makeatother

\begin{document}

\nocite{*}

\bibliographystyle{plain}
\bibliography{biblio}

\end{document}



Sorry, I am using Scientific Word with "natbib" package. Do you happen to know how to edit "natbib" using your code, or is there any other way I can deal with the issue for Scientific Word?
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: How to make it Single Spacing for Each Entry,?

Post by gmedina »

No; I am sorry, but I've never used Scientific Word.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply