Text Formattingto change spacing in bibliography

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
bitacovir
Posts: 12
Joined: Sat Oct 12, 2013 7:51 am

to change spacing in bibliography

Post by bitacovir »

Hi. I have another problem with the latex template that I am using. The document is set up with double space between lines, but in the Bibliography this does not look good. I want 1.5 space between lines in the bibliografy and maybe double space between each reference.. I do not how to do it. The template use a *.sty file with the parameters.

In the sty file there is a section for bibliography parameters. I tried writing \setlength{\bibsep}{0.0pt} but only changes the vertical space between reference and I want to reduce the double space between the lines in each reference.
I wrote \setlength{\itemsep}{0pt plus 0.3ex} but does not change at all.
Some idea how to change the spacing between lines?

The *.sty file:

Code: Select all

%% A template for doctoral thesis based on memoir class
%% 
%%
%% Author: Nitin Yadav
%%
%%
%%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{rmit}[2013/05/01 v0.1 RMIT thesis template]
%% Only works with the memoir class!
\@ifclassloaded{memoir}{\let\endrmit\relax}{\let\endrmit\endinput
  \PackageError{rmit}{The rmit package only works with the memoir class}{\@ehd}}
\endrmit


%% Import packages that are commonly used
\usepackage{url}
\usepackage{graphicx}
\usepackage{stmaryrd}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{latexsym} 
\usepackage{pgf, tikz}
\usetikzlibrary{arrows,decorations,backgrounds,automata,shapes,patterns}
\usepackage{algorithm}
\usepackage{algorithmic}  
\usepackage{xspace}
\usepackage{soul}\setuldepth{x} 
%\usepackage{gitinfo}
\usepackage{bibentry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{float}
\usepackage{verbatim}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{natbib}
\usepackage[colorlinks=true]{hyperref}
\urlstyle{same}
\hypersetup{
    citecolor=BrickRed,
    filecolor=Brown,
    linkcolor=NavyBlue,
    urlcolor=RoyalBlue
}
\def\Tiny{\fontsize{6pt}{6pt} \selectfont}
%\setverbatimfont{\normalfont\rmfamily}% make verbatims use the body font
%\renewcommand*{\foottextfont}{\normalfont\normalsize} %footnote font

%% We generally use the 'fancyplain' format
%%  Header (left, center, right) for odd and even pages (note different brackets)
%% The \fancyplain command itself takes two arguments: one for pages that
%% LaTeX would normally format in 'plain' (1st page in Chapters etc.) and one for others.
% \lhead[\fancyplain{}{}]{\fancyplain{}{{\small \leftmark}}}
% \chead[\fancyplain{}{}]{\fancyplain{}{}}
% \rhead[\fancyplain{}{}]{\fancyplain{}{}}
% %% Footer (left, center, right) for odd and even pages (note different brackets)
% \lfoot[\fancyplain{}{}]{\fancyplain{\sffamily{\footnotesize{Revision\gitVtags: \gitAbbrevHash{} (\gitAuthorDate)}}}{\sffamily{\footnotesize{Revision\gitVtags: \gitAbbrevHash{} (\gitAuthorDate)}}}}
% \cfoot[\fancyplain{}{\thepage}]{\fancyplain{\thepage}{\thepage}}
% \rfoot[\fancyplain{}{}]{\fancyplain{{\sffamily {\footnotesize (\today)}}}{{\sffamily {\footnotesize (\today)}}}}
% %% You can underline/overline header and footer,
% %% We don't use this, so we set it to 0pt
% \renewcommand{\headrulewidth}{0pt}
% % \renewcommand{\footrulewidth}{0.5pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 \setmarginnotes{17pt}{51pt}{\onelineskip}
\checkandfixthelayout
\usepackage{epigraph}
\setlength{\epigraphwidth}{.65\textwidth}
\setlength\epigraphrule{0pt}

%For use with the natbib package
\renewcommand{\cite}[1]{\citep{#1}}
\newcommand{\citeasnoun}[1]{\citet{#1}}
%\bibpunct{[}{]}{;}{n}{,}{;}
\bibpunct{[}{]}{,}{a}{}{;}
\raggedbottom
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% To enable spacing to be changed if neccesary by the user
\newcommand*{\setrmitspacing}[1]{%
\let\RmitSpacing#1
\RmitSpacing}
\setrmitspacing{\DoubleSpacing}
%% for main body, bottom of text at 1in, footer below
%% top of header at 1in, first text line double spaced
%% below base of header
\newlength{\linespace}
\setlength{\linespace}{\baselineskip} % current equivalent of \onelineskip
\setlength{\headheight}{\onelineskip}
\setlength{\headsep}{2\linespace}
\addtolength{\headsep}{-\topskip}
\setlength{\uppermargin}{1in}
\addtolength{\uppermargin}{\headheight}
\addtolength{\uppermargin}{\headsep}
%% and for the bottom
\setlength{\lowermargin}{1in}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-\uppermargin}
\addtolength{\textheight}{-\lowermargin}

%% footnote settings
\setlength{\footskip}{2\onelineskip}
\setlength{\footnotesep}{0.5\onelineskip}
\setlrmarginsandblock{3.5cm}{2.5cm}{*}%\setlrmarginsandblock{3.5cm}{2.5cm}{*}
% %% the fiddle lengths (..ta.. for title/approval page, others for prelims)
\newlength{\toptafiddle} \setlength{\toptafiddle}{2\linespace}
\newlength{\bottafiddle} \setlength{\bottafiddle}{0pt}
\newlength{\topfiddle} \setlength{\topfiddle}{\toptafiddle}
\newlength{\botfiddle} \setlength{\botfiddle}{\onelineskip}
\setlength{\parindent}{2em}
\checkandfixthelayout[nearest]
\newcommand*{\addtotextheight}[1]{%
\twocolumn
\addtolength{\textheight}{#1}%
\onecolumn}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\setsecindent{-8ex}
%%%% pagestyles
\makepagestyle{rmit}
%\makeevenhead{rmit}{\small \MakeUppercase{ Chapter \thechapter: \ \leftmark}}{}{}
\makeevenhead{rmit}{\footnotesize \MakeUppercase{ Chapter \thechapter:  \ \leftmark}}{}{}
\makeoddhead{rmit}{}{}{\footnotesize  \MakeUppercase{ Section \thesection: \ \rightmark}}
\makeoddfoot{rmit}{}{\thepage}{\sffamily {\footnotesize (\today)}}
\makeevenfoot{rmit}{}{\thepage}{\sffamily {\footnotesize (\today)}}

%% for continuation pages of the ToC, LoF, LoT
\makepagestyle{toc}
\makeevenfoot{toc}{}{\thepage}{}
\makeoddfoot{toc}{}{\thepage}{}
\makeevenhead{toc}{Chapter}{}{Page}
\makeoddhead{toc}{Chapter}{}{Page}
\makepagestyle{lof}
\makeevenfoot{lof}{}{\thepage}{}
\makeoddfoot{lof}{}{\thepage}{}
\makeevenhead{lof}{Figure}{}{Page}
\makeoddhead{lof}{Figure}{}{Page}
\makepagestyle{lot}
\makeevenfoot{lot}{}{\thepage}{}
\makeoddfoot{lot}{}{\thepage}{}
\makeevenhead{lot}{Table}{}{Page}
\makeoddhead{lot}{Table}{}{Page}

%% title page
\newcommand{\thetitlepage}{{%
\thispagestyle{empty}
\begin{center}

\textsc{\LARGE \thesistitle}\\[1.5cm]

A thesis submitted for the degree of 
\\Doctor of Philosophy
\vspace{1cm}
\\ \phdauthor~~\qualifications,
\\School of Computer Science and Information Technology,
\\College of Science, Engineering, and Health,
\\RMIT University,
\\Melbourne, Victoria, Australia.
\\

\vspace{3cm}
\begin{figure}[ht!]
\centering
\includegraphics[width=35mm]{RMIT_Coat_of_Arms.jpg}
\end{figure}

\vspace{1.5cm}
\emph{Supervisors:} \\
\supervisors \\ 

\vfill

\thesisdate
\end{center}
\cleardoublepage }}
\makeatother % RETURN @ to being a non-letter


\nouppercaseheads
\makepagestyle{rmitheadings}
\makeevenhead{rmitheadings}{}{}{}
\makeoddhead{rmitheadings}{}{}{}
\makeevenfoot{rmitheadings}{}{\thepage}{}
\makeoddfoot{rmitheadings}{}{\thepage}{}
\makeatother % RETURN @ to being a non-letter

\makechapterstyle{veeloc}{%
   \setlength{\afterchapskip}{40pt}
  \renewcommand*{\chapterheadstart}{\vspace*{40pt}}
  \renewcommand*{\afterchapternum}{\par\nobreak\vskip 25pt}
   \renewcommand*{\chapnamefont}{\normalfont\LARGE\flushright}
   \renewcommand*{\chapnumfont}{\normalfont\HUGE}
   \renewcommand*{\chaptitlefont}{\normalfont\huge\bfseries\flushright}
   \renewcommand*{\printchaptername}{%
     \chapnamefont\MakeUppercase{Chapter}}
   \renewcommand*{\chapternamenum}{}
  \setlength{\beforechapskip}{18mm}%  \numberheight
  \setlength{\midchapskip}{\paperwidth}% \barlength
  \addtolength{\midchapskip}{-\textwidth}
  \addtolength{\midchapskip}{-\spinemargin}
   \renewcommand*{\printchapternum}{%
     \makebox[0pt][l]{%
       \hspace{.8em}%
       \resizebox{!}{\beforechapskip}{\chapnumfont \thechapter}%
       \hspace{.8em}%
       \rule{\midchapskip}{\beforechapskip}%
     }%
   }%
   \makeoddfoot{plain}{}{\thepage}{}}
\chapterstyle{veeloc} % Veelo style is good for chapters as one can identify the start/end of chapters in the printed version
%%%%%%%%%%%%%%% end of *.sty file
\endinput

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

to change spacing in bibliography

Post by Johannes_B »

You did not provide some compilable code, so a shot in the blue right now:

Code: Select all

\begingroup\onehalfspacing\bibliography{<theName>}\endgroup
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
bitacovir
Posts: 12
Joined: Sat Oct 12, 2013 7:51 am

Re: to change spacing in bibliography

Post by bitacovir »

Sorry. I am new in latex, so my comprehension is limited. I am using a template for a thesis that you can find here:
https://sites.google.com/site/ssardina/ ... ects=0&d=1

So, I tried editing the file rmit.sty showed above.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

to change spacing in bibliography

Post by Johannes_B »

Please, do not change package files. As a matter of fact, i cannot trust any package file without a copright notice. Even files on my own computer, that i set up for my own personal use and never plan to give away or publish, have a copyright note.


You can enclose your bibliography with

Code: Select all

\begingroup\OnehalfSpacing
\bibliography{<bibname>}
\endgroup
Please note, that the spacingcommand differs a bit from the one above. I had to look up how it is called with memoir.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
bitacovir
Posts: 12
Joined: Sat Oct 12, 2013 7:51 am

Re: to change spacing in bibliography

Post by bitacovir »

It works.
Thanks a lot for your help and for your advice.
(I will try to be more responsable with latex files :))
Post Reply