Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

If I change the font size of the annotations in my bibliography the size changes but the baseline skip doesn’t. I know that TeX uses the last font in a paragraph to calculate the baseline skip, but I don’t know how I can fix this problem.

At this image it’s obvious that the annotations is set with a too big skip.

problem with baseline skip

\documentclass{article}

\usepackage[%
   backend=biber,
   style=authortitle-dw,
   annotation=true,
]{biblatex}
\addbibresource{biblatex-examples.bib}

% extreme values make the problem obvious
\renewcommand{\annotationfont}{\scriptsize}
\usepackage[textwidth=3cm]{geometry}

\begin{document}
\nocite{bertram}
\printbibliography
\end{document}

I tried to set the annotation with a \parbox with

\DeclareFieldFormat{annotation}{%
   \par\vspace{-0.7\baselineskip}
   \parbox{\textwidth}{\annotationfont #1\addperiod}.
}

but this leads to an extra period that I can’t delete. Furthermor it seems like a bad hack to me …
(I made \annotationfont red for the next image to make the extra period visible.)

extra period

share|improve this question
    
+1 for the MWE. –  domwass Feb 28 '12 at 13:13
add comment

1 Answer

up vote 6 down vote accepted

There is a superfluous \finentry command in biblatex-dw’s (re)definition of the bibmacro finentry. If you delete that and put a \par into the DeclareFieldFormat command, it works. I have altered your example accordingly:

\documentclass{article}

\usepackage[%
   backend=biber,
   style=authortitle-dw,
   annotation=true,
]{biblatex}
\addbibresource{biblatex-examples.bib}

% extreme values make the problem obvious
\renewcommand{\annotationfont}{\scriptsize}
\usepackage[textwidth=3cm]{geometry}

\DeclareFieldFormat{annotation}{%
   \annotationfont #1\addperiod\par}

\renewbibmacro*{finentry}{%
  \ifboolexpr{
    test {\iffieldundef{annotation}}
    and
    test {\iffieldundef{library}}
  }
    {\finentry}
    {\iffieldundef{library}
      {}
      {\ifbool{bbx:library}
        {\setunit{\addperiod\par}
         \printfield{library}}
        {}}%
     \iffieldundef{annotation}
      {}
      {\ifbool{bbx:annotation}
        {\iffieldundef{library}
           {\setunit{\addperiod\par}}
           {}
         \printfield{annotation}}
        {}}}}

\begin{document}
\cite{bertram,springer}
\printbibliography
\end{document}

I will take care to make this more robust in future releases of biblatex-dw, so that a simple redefinition of the \annotationfont macro will have the desired effect.

Edit: I improved the redefinition of the bibmacro finentry, so that it now also works if the fields library and annotation are both defined.

share|improve this answer
    
Thank you! It even works if I leave out the \printtext{\par} in \renewbibmacro*{finentry} since this one doubles the \par of \DeclareFieldFormat{annotation}, I guess. –  Tobi Feb 28 '12 at 13:24
    
@Tobi, thanks for pointing to this, I just forgot to delete it after trying some things out. –  domwass Feb 28 '12 at 13:31
    
Ah, OK. I just discovered that \printtext{\par} causes a blank line between the bib entries even if \bibitemsep is set to 0pt. –  Tobi Feb 28 '12 at 13:39
    
@Tobi, do you still have a blank line with my edited code? –  domwass Feb 28 '12 at 13:47
    
The new solution works as expected :-) –  Tobi Feb 28 '12 at 15:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.