### 13.1. The bib@list environment

This environment sets up the special bibliography list style.

nmtthesis2015.sty
%
% - - -   { b i b @ l i s t }
%
\newenvironment{bib@list}%
{% bib@list prologue


We use the generic list environment to format the bibliography entries. For a general discussion of the paragraph shapes for the two different citation styles, see Section 3.3, “Formatting bibliography entries”.

The \begin{list} takes two arguments. The first argument is the default label to be attached to list items that do not use the first, optional argument; this is empty in our case. The second argument contains commands that change the shape of the items.

nmtthesis2015.sty
  \begin{list}{}%
{% Changes to list environment


The enumiv counter is used to number entries when citations are by number.

nmtthesis2015.sty
    \usecounter{enumiv}%


Several dimensions are different depending on the citation style. If the \bib@sample command set by the {Reference}, {Bibliography}, or {chapterbibliography} environment is empty, we set up the author-year paragraph shape. If \bib@sample is not empty, it contains a template for the largest citation number; in that case we set up the numbered citation paragraph shape.

nmtthesis2015.sty
    \ifthenelse{\equal{\bib@sample}{}}%
{% No sample: use author-year citations
\setlength{\itemindent}{-\bib@margin}%
\setlength{\labelwidth}{0pt}%
\setlength{\leftmargin}{\bib@margin}%
}% No sample
{% Sample: use numeric citations
\setlength{\itemindent}{0pt}%
\settowidth{\labelwidth}{[\bib@sample]}%
\setlength{\leftmargin}{\labelwidth}%
}% Sample
}% Changes to list environment


The \sloppy command allows LaTeX to set the entries more loosely. The \frenchspacing command instructs LaTeX to use a normal-sized space after a period. Single-spacing is set up by Section 13.12, “\single@spacing: Set up single-spaced lines”. At the end of the list environment, we reassert double-spacing; see Section 13.6, “\double@spacing: Set up double-spaced lines”.

nmtthesis2015.sty
  \sloppy
\frenchspacing
\single@spacing
}% bib@list prologue
{% bib@list epilogue
\end{list}
\double@spacing
}% bib@list epilogue