[Tex/LaTex] Printing bibliography with biblatex in Tufte-handout fullwidth environment

biblatexindentationtufte

I'm trying to print the bibliography (using biblatex) inside the fullwidth environment. But when I place the \printbibliography command inside the fullwidth environment, every line other than the very first gets indented.

As far I as can tell, biblatex prints bibliographies as follows:

  1. The first line of each item is flushed left.

  2. Any other line of each item is indented using \bibhang.

If I simply place \printbibliography at the end of my file, I get the expected behavior:

Default behavior<code>\printbibliography</code>

If instead I place it inside a fulldiwth environment, every line in the bibliography other than the first one gets indented the same amount.

Here's a minimal example

\documentclass[nobib]{tufte-handout} 
\usepackage[style=authoryear-comp]{biblatex} 
\begin{filecontents*}{mybib5.bib} 
@MISC{Volkmann, 
  author = {Volkmann, Albert}, 
  title = {My Title}, 
  year = {2005}, 
  addendum={Lorem ipsum dolor sit amet, consectetur adipisicing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.} 
} 

@MISC{Caesar, 
  author = {Caesar, Gaius J.}, 
  title = {My long title}, 
  year = {2005}, 
  addendum={Lorem ipsum dolor sit amet, consectetur adipisicing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.} 
} 

\end{filecontents*} 
\title{Test} 
\author{Me} 
\bibliography{mybib5} 
\begin{document} 
\maketitle 
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut  aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \cite{Volkmann,Caesar} 

\begin{fullwidth} 
\printbibliography 
\end{fullwidth} 
\end{document} 

The output looks like so: Odd behavior: biblatex and fullwidth environment

If I set \parindent to 0pt right before \printbibliography, I get the same result. If instead I set \bibhang to 0pt right before \printbibliography, so that

\begin{fullwidth}
\printbibliography
\end{bibliography}

is replaced by:

\begin{fullwidth}
\bibhang=0pt
\printbibliography
\end{bibliography}

no line in the bibliography is indented:

After setting <code>\bibhang</code> to 0pt

What I can't get is the default behavior (first line of each item flushed left, every additional line indented) within the fullwidth environment.

Any thoughts?

UPDATE: I'm using version 3.5.2 of tufte-common.def.

Best Answer

With the default tufte-latex layout, you can just extend the right margin inside the bibliography environment.

\documentclass[nobib]{tufte-handout}
\usepackage{hyphenat}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear-comp,autocite=footnote]{biblatex}

\defbibenvironment{bibliography}
  {\list{}{%
     \leftmargin\bibhang
     \itemindent-\leftmargin
     \advance\rightmargin-\marginparwidth
     \advance\rightmargin-\marginparsep
     \itemsep\bibitemsep
     \parsep\bibparsep}}
  {\endlist}
  {\item}

\addbibresource{biblatex-examples.bib}
\begin{document}
Filler text \autocite{companion,ctan,markey,aristotle:poetics,aristotle:rhetoric}.
\printbibliography
\end{document}

enter image description here

With the layout settings twoside,symmetric something like tufte-latex's fullwidth environment is needed, but it won't work if the bibliography breaks across pages. For a single bibliography contained in one page, the following should give you proper indentation inside the fullwidth environment.

\defbibenvironment{bibliography}
  {\list{}{%
     \leftmargin\bibhang
     \itemindent-\leftmargin
     \listparindent\itemindent
     \parsep\bibparsep}}
  {\endlist}
  {\item}

The more general case can be handled using the mdframed package and some spacing trickery with \AtEveryBibitem.

\documentclass[nobib,twoside,symmetric]{tufte-handout}
\usepackage{hyphenat}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear-comp]{biblatex}
\usepackage{mdframed}

\newmdenv[skipabove=3.5ex plus 1ex minus .2ex,% Equal to section title spacing
  innerleftmargin=0pt,innerrightmargin=0pt,%
  innerbottommargin=0pt,innertopmargin=0pt,linewidth=0pt,innermargin=0pt,%
  outermargin=\dimexpr-\marginparwidth-\marginparsep\relax]{mdfullwidth}

\defbibenvironment{bibliography}
  {\list{}{\parsep\bibparsep}}
  {\endlist}
  {\item}

\AtEveryBibitem{\hskip-\bibhang}

\addbibresource{biblatex-examples.bib}
\begin{document}
\null\vfill
One of the most prominent and distinctive features of this style is the
extensive use of sidenotes.\footcite{companion,ctan,markey,aristotle:rhetoric} There is a wide margin to provide ample room for sidenotes and small figures. Any footnotes will automatically be converted to sidenotes.
\begin{mdfullwidth}
\printbibliography[type=online]
\end{mdfullwidth}
\pagebreak
One of the most prominent and distinctive features of this style is the
extensive use of sidenotes.\footcite{companion,ctan,markey,aristotle:poetics} There is a wide margin to provide ample room for sidenotes and small figures. Any footnotes will automatically be converted to sidenotes.
\begin{mdfullwidth}
\printbibliography[nottype=online]
\end{mdfullwidth}
\end{document}

enter image description here enter image description here

Related Question