3

I have been using biblatex, with the help of a number of answers here, in a book that has

  1. A list of abbreviations divided in 4 parts, 3 parts for the main authors discussed, and another for other primary texts

  2. A bibliography for the book divided into 5 sub-bibliographies, 3 for the main authors, 1 for other primary texts, and the last for secondary texts.

Everything works fine, except for the fact that some unwanted extra lines appear in the sub-bibs. Here's an example, generated from the MWE to follow, where there is an extra line between the entry for Benacerraf & Putnam and the entry for Berger:

enter image description here

The MWE is unfortunately a bit long:

\documentclass[a4,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage[english=american]{csquotes}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{Moore1903,
  author    = {Moore, G. E.},
  title     = {Principia Ethica},
  date      = {1903},
  publisher = {Cambridge University Press},
  location  = {Cambridge},
  shorthand = {PE},
}
@Book{Frege1893,
  author      = {Frege, Gottlob},
  title       = {Grundgesetze der Arithmetik},
  date        = {1893},
  volume      = {I},
  publisher   = {Hermann Pohle},
  location    = {Jena},
  related     = {Frege2013a},
  relatedtype = {englishtitle},
  shorthand   = {BLI},
  shorttitle  = {Grundgesetze I},
}
@Book{Frege2013a,
  author = {Frege, Gottlob},
  title  = {{B}asic {L}aws of {A}rithmetic, \emph{Vol. I}},
  date = {2013},
}
@Article{Candlish1989,
  author       = {Candlish, Stewart},
  title        = {The Truth about F. H. Bradley},
  journaltitle = {Mind},
  date         = {1989},
  volume       = {98},
  number       = {391},
  pages        = {331--48},
}
@Collection{Benacerraf1984,
  editor    = {Benacerraf, Paul and Putnam, Hilary},
  title     = {Philosophy of Mathematics: Selected Readings},
  date      = {1984},
  edition   = {revised and expanded},
  publisher = {Prentice-Hall},
  location  = {Englewood Cliffs, NJ},
}
@Book{Bell1979,
  author    = {Bell, David},
  title     = {Frege's Theory of Judgment},
  date      = {1979},
  publisher = {Clarendon Press},
  location  = {Oxford},
}
@Book{Wittgenstein1979,
  author     = {Wittgenstein, Ludwig},
  title      = {Notebooks, 1914--1916},
  date       = {1979},
  editor     = {Wright, G. H. von and Anscombe, G. E. M.},
  translator = {Anscombe, G. E. M.},
  edition    = {2},
  publisher  = {Basil Blackwell},
  location   = {Oxford},
  origyear   = {1913},
  shorthand  = {NB},
  shorttitle = {Notebooks},
}
@Book{Russell1903a,
  author     = {Russell, Bertrand},
  title      = {The Principles of Mathematics},
  date       = {1903},
  publisher  = {Cambridge University Press},
  location   = {Cambridge},
  shorthand  = {PoM},
  shorttitle = {Principles},
}
@Collection{Berger2011,
  editor    = {Berger, Alan},
  title     = {Saul Kripke},
  date      = {2011},
  publisher = {Cambridge University Press},
  location  = {Cambridge},
}
\end{filecontents}

\usepackage[style=oxyear,indexing=cite,issuestyle=parens,natbib=true]{biblatex}
\usepackage{citeall}
\addbibresource{\jobname.bib}

% Environment for Abbreviation lists with the shorthands italicized by \emph
\DeclareFieldFormat{shorthand}{\emph{#1}}
\defbibenvironment{abbrevs}
{\list
{\printfield[shorthandwidth]{shorthand}}
{\setlength{\labelwidth}{\shorthandwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\renewcommand*{\makelabel}[1]{\emph{##1}\hss}}}
{\endlist}
{\item}

% Titles for Parts of Bibliography
\defbibheading{subbibtitleonly}[\bibname]{%
\section*{#1}}

% Main primary sources categories
\newcommand*{\generateauthorcategory}[3]{%   
   \DeclareBibliographyCategory{by#1}%   
   \DeclareIndexNameFormat{cat#1}{%     
      \ifboolexpr{%
         test {\ifdefstring{\namepartfamily}{#2}}%         
      and% 
         test {\ifdefstring{\namepartgiven}{#3}}%
      }%
      {\addtocategory{by#1}{\thefield{entrykey}}}%       
      {}}%   
   \AtDataInput{\indexnames[cat#1][1-999]{author}}}

\generateauthorcategory{frege}{Frege}{Gottlob}
\generateauthorcategory{russell}{Russell}{Bertrand}
\generateauthorcategory{moore}{Moore}{G.\bibnamedelimi E.}

% Filter for other primary sources, but NOT main ones
\defbibfilter{notmainprimary}{%
not category=byfrege %
and not category=bymoore %
and not category=byrussell %
}

% Check for all primary sources and another for secondary sources
\defbibcheck{primarysource}{
  \iffieldint{origyear}
    {\ifnumless{\thefield{origyear}}{1936}
      {}
      {\skipentry}
    }
    {\iffieldint{year}
      {\ifnumless{\thefield{year}}{1936}
        {}
        {\skipentry}
      }
      {\skipentry}
    }
}
\defbibcheck{secondarysource}{
  \iffieldint{origyear}
    {\ifnumgreater{\thefield{origyear}}{1936}
      {}
      {\skipentry}
    }
    {\iffieldint{year}
      {\ifnumgreater{\thefield{year}}{1936}
        {}
        {\skipentry}
      }
      {\skipentry}
    }
}

% Filtering entries for abbreviations lists
\DeclareBiblistFilter{fregeabbrevs}{
    \filter[type=field,filter=shorthand]
}
\DeclareBiblistFilter{mainabbrevs}{
    \filter[type=field,filter=shorthand]
}
\DeclareBiblistFilter{moreabbrevs}{
    \filter[type=field,filter=shorthand]
}

% Sorting the abbreviations lists
\DeclareSortingTemplate{fregeabbrevs}{ \sort[final]{ \field{sortshorthand} } \sort{ \field{shorthand} } }
\DeclareSortingTemplate{mainabbrevs}{ \sort[final]{ \field{sortshorthand} } \sort{ \field{shorthand} } }
\DeclareSortingTemplate{moreabbrevs}{ \sort[final]{ \field{sortshorthand} } \sort{ \field{author} } }

% Adding English titles of Frege's works (from entries related to) to German entries in Bibliography
\newbibmacro*{related:englishtitle}[1]{%
  \entrydata{#1}{%
    \printtext{English title:}%
    \setunit{\addspace}%
    \usebibmacro{title}}}

% Drivers for printing abbreviations lists

\DeclareBibliographyDriver{fregeabbrevs}{%   
  \iffieldequalstr{relatedtype}{englishtitle}
    {\entrydata{\thefield{related}}{\usebibmacro{title}}}
    {{\usebibmacro{title}}}%   
  \setunit{\addcomma\space}\newblock   
\printlabeldate}

\DeclareBibliographyDriver{mainabbrevs}{%   
\usebibmacro{title}%   
\setunit{\addcomma\space}\newblock   
\printlabeldate}

\DeclareBibliographyDriver{moreabbrevs}{%
\renewbibmacro*{date+extradate}{}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\addcomma\space}\newblock
\usebibmacro{title}%
\setunit{\addcomma\space}\newblock
\printlabeldate}

\begin{document}

\chapter*{Abbreviations}
The following abbreviations are for frequently cited primary sources. Full details of these works are in the Bibliography.

\printbiblist[env=abbrevs,title={Writings of Frege}, heading=subbibtitleonly, category=byfrege]{fregeabbrevs}

\printbiblist[env=abbrevs,title={Writings of Moore}, heading=subbibtitleonly, category=bymoore]{mainabbrevs}

\printbiblist[env=abbrevs,title={Writings of Russell}, heading=subbibtitleonly, category=byrussell]{mainabbrevs}

\printbiblist[env=abbrevs,title={Other Primary Sources}, heading=subbibtitleonly, check=primarysource, notcategory=byfrege, notcategory=bymoore, notcategory=byrussell]{moreabbrevs}\newpage

\citeall

\chapter*{Bibliography}

\printbibliography[title={Writings of Frege}, heading=subbibtitleonly, category=byfrege]

\printbibliography[title={Writings of Moore}, heading=subbibtitleonly, category=bymoore]

\printbibliography[title={Writings of Russell}, heading=subbibtitleonly, category=byrussell]

\printbibliography[title={Other Primary Sources}, heading=subbibtitleonly, check=primarysource, notcategory=byfrege, notcategory=bymoore, notcategory=byrussell]

\printbibliography[title={Secondary Sources}, heading=subbibtitleonly, check=secondarysource, notcategory=byfrege, notcategory=bymoore, notcategory=byrussell]

\end{document}

It seem clear that the problem is not that solved in Unwanted extra lines appearing in bibliography

The reason is that if one used \printbibliography instead of \chapter*{Bibliography} and the 5 subsequent commands to print the sub-bibs, the resulting biblio with no sub-bibliographies doesn't have the extra line:

enter image description here

Any help greatly appreciated!

  • ss1789, btw, very nicely asked question. Clear problem statement, effort is also demonstrated, and all the elements needed to answer are present. Kudos! – gusbrs Dec 16 '18 at 0:14
  • @gusbrs, thanks, and thanks for your solution! – ss1789 Dec 16 '18 at 0:15
3

You were actually really close to debugging this on your own, when you notice that:

The reason is that if one used \printbibliography instead of \chapter*{Bibliography} and the 5 subsequent commands to print the sub-bibs, the resulting biblio with no sub-bibliographies doesn't have the extra line.

That puts us on the trail of the only thing that is different in the offending bibliography, the secondarysource check. I'm not sure why the check introduces spurious spaces there, but apparently it does, for if we take care of them with:

\defbibcheck{secondarysource}{%
  \iffieldint{origyear}
    {\ifnumgreater{\thefield{origyear}}{1936}
      {}
      {\skipentry}%
    }
    {\iffieldint{year}
      {\ifnumgreater{\thefield{year}}{1936}
        {}
        {\skipentry}%
      }
      {\skipentry}%
    }%
}

the extra line is gone.

In full:

\documentclass[a4,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage[english=american]{csquotes}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{Moore1903,
  author    = {Moore, G. E.},
  title     = {Principia Ethica},
  date      = {1903},
  publisher = {Cambridge University Press},
  location  = {Cambridge},
  shorthand = {PE},
}
@Book{Frege1893,
  author      = {Frege, Gottlob},
  title       = {Grundgesetze der Arithmetik},
  date        = {1893},
  volume      = {I},
  publisher   = {Hermann Pohle},
  location    = {Jena},
  related     = {Frege2013a},
  relatedtype = {englishtitle},
  shorthand   = {BLI},
  shorttitle  = {Grundgesetze I},
}
@Book{Frege2013a,
  author = {Frege, Gottlob},
  title  = {{B}asic {L}aws of {A}rithmetic, \emph{Vol. I}},
  date = {2013},
}
@Article{Candlish1989,
  author       = {Candlish, Stewart},
  title        = {The Truth about F. H. Bradley},
  journaltitle = {Mind},
  date         = {1989},
  volume       = {98},
  number       = {391},
  pages        = {331--48},
}
@Collection{Benacerraf1984,
  editor    = {Benacerraf, Paul and Putnam, Hilary},
  title     = {Philosophy of Mathematics: Selected Readings},
  date      = {1984},
  edition   = {revised and expanded},
  publisher = {Prentice-Hall},
  location  = {Englewood Cliffs, NJ},
}
@Book{Bell1979,
  author    = {Bell, David},
  title     = {Frege's Theory of Judgment},
  date      = {1979},
  publisher = {Clarendon Press},
  location  = {Oxford},
}
@Book{Wittgenstein1979,
  author     = {Wittgenstein, Ludwig},
  title      = {Notebooks, 1914--1916},
  date       = {1979},
  editor     = {Wright, G. H. von and Anscombe, G. E. M.},
  translator = {Anscombe, G. E. M.},
  edition    = {2},
  publisher  = {Basil Blackwell},
  location   = {Oxford},
  origyear   = {1913},
  shorthand  = {NB},
  shorttitle = {Notebooks},
}
@Book{Russell1903a,
  author     = {Russell, Bertrand},
  title      = {The Principles of Mathematics},
  date       = {1903},
  publisher  = {Cambridge University Press},
  location   = {Cambridge},
  shorthand  = {PoM},
  shorttitle = {Principles},
}
@Collection{Berger2011,
  editor    = {Berger, Alan},
  title     = {Saul Kripke},
  date      = {2011},
  publisher = {Cambridge University Press},
  location  = {Cambridge},
}
\end{filecontents}

\usepackage[style=oxyear,indexing=cite,issuestyle=parens,natbib=true]{biblatex}
\usepackage{citeall}
\addbibresource{\jobname.bib}

% Environment for Abbreviation lists with the shorthands italicized by \emph
\DeclareFieldFormat{shorthand}{\emph{#1}}
\defbibenvironment{abbrevs}
{\list
{\printfield[shorthandwidth]{shorthand}}
{\setlength{\labelwidth}{\shorthandwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}%
\renewcommand*{\makelabel}[1]{\emph{##1}\hss}}}
{\endlist}
{\item}

% Titles for Parts of Bibliography
\defbibheading{subbibtitleonly}[\bibname]{%
\section*{#1}}

% Main primary sources categories
\newcommand*{\generateauthorcategory}[3]{%
   \DeclareBibliographyCategory{by#1}%
   \DeclareIndexNameFormat{cat#1}{%
      \ifboolexpr{%
         test {\ifdefstring{\namepartfamily}{#2}}%
      and%
         test {\ifdefstring{\namepartgiven}{#3}}%
      }%
      {\addtocategory{by#1}{\thefield{entrykey}}}%
      {}}%
   \AtDataInput{\indexnames[cat#1][1-999]{author}}}

\generateauthorcategory{frege}{Frege}{Gottlob}
\generateauthorcategory{russell}{Russell}{Bertrand}
\generateauthorcategory{moore}{Moore}{G.\bibnamedelimi E.}

% Filter for other primary sources, but NOT main ones
\defbibfilter{notmainprimary}{%
not category=byfrege %
and not category=bymoore %
and not category=byrussell %
}

% Check for all primary sources and another for secondary sources
\defbibcheck{primarysource}{%
  \iffieldint{origyear}
    {\ifnumless{\thefield{origyear}}{1936}
      {}
      {\skipentry}%
    }
    {\iffieldint{year}
      {\ifnumless{\thefield{year}}{1936}
        {}
        {\skipentry}%
      }
      {\skipentry}%
    }%
}
\defbibcheck{secondarysource}{%
  \iffieldint{origyear}
    {\ifnumgreater{\thefield{origyear}}{1936}
      {}
      {\skipentry}%
    }
    {\iffieldint{year}
      {\ifnumgreater{\thefield{year}}{1936}
        {}
        {\skipentry}%
      }
      {\skipentry}%
    }%
}

% Filtering entries for abbreviations lists
\DeclareBiblistFilter{fregeabbrevs}{
    \filter[type=field,filter=shorthand]
}
\DeclareBiblistFilter{mainabbrevs}{
    \filter[type=field,filter=shorthand]
}
\DeclareBiblistFilter{moreabbrevs}{
    \filter[type=field,filter=shorthand]
}

% Sorting the abbreviations lists
\DeclareSortingTemplate{fregeabbrevs}{ \sort[final]{ \field{sortshorthand} } \sort{ \field{shorthand} } }
\DeclareSortingTemplate{mainabbrevs}{ \sort[final]{ \field{sortshorthand} } \sort{ \field{shorthand} } }
\DeclareSortingTemplate{moreabbrevs}{ \sort[final]{ \field{sortshorthand} } \sort{ \field{author} } }

% Adding English titles of Frege's works (from entries related to) to German entries in Bibliography
\newbibmacro*{related:englishtitle}[1]{%
  \entrydata{#1}{%
    \printtext{English title:}%
    \setunit{\addspace}%
    \usebibmacro{title}}}

% Drivers for printing abbreviations lists

\DeclareBibliographyDriver{fregeabbrevs}{%
  \iffieldequalstr{relatedtype}{englishtitle}
    {\entrydata{\thefield{related}}{\usebibmacro{title}}}
    {{\usebibmacro{title}}}%
  \setunit{\addcomma\space}\newblock
\printlabeldate}

\DeclareBibliographyDriver{mainabbrevs}{%
\usebibmacro{title}%
\setunit{\addcomma\space}\newblock
\printlabeldate}

\DeclareBibliographyDriver{moreabbrevs}{%
\renewbibmacro*{date+extradate}{}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\addcomma\space}\newblock
\usebibmacro{title}%
\setunit{\addcomma\space}\newblock
\printlabeldate}


\begin{document}

\chapter*{Abbreviations}
The following abbreviations are for frequently cited primary sources. Full details of these works are in the Bibliography.

\printbiblist[env=abbrevs,title={Writings of Frege}, heading=subbibtitleonly, category=byfrege]{fregeabbrevs}

\printbiblist[env=abbrevs,title={Writings of Moore}, heading=subbibtitleonly, category=bymoore]{mainabbrevs}

\printbiblist[env=abbrevs,title={Writings of Russell}, heading=subbibtitleonly, category=byrussell]{mainabbrevs}

\printbiblist[env=abbrevs,title={Other Primary Sources}, heading=subbibtitleonly, check=primarysource, notcategory=byfrege, notcategory=bymoore, notcategory=byrussell]{moreabbrevs}\newpage

\citeall

\chapter*{Bibliography}

\printbibliography[title={Writings of Frege}, heading=subbibtitleonly, category=byfrege]

\printbibliography[title={Writings of Moore}, heading=subbibtitleonly, category=bymoore]

\printbibliography[title={Writings of Russell}, heading=subbibtitleonly, category=byrussell]

\printbibliography[title={Other Primary Sources}, heading=subbibtitleonly, check=primarysource, notcategory=byfrege, notcategory=bymoore, notcategory=byrussell]

\printbibliography[title={Secondary Sources}, heading=subbibtitleonly, check=secondarysource, notcategory=byfrege, notcategory=bymoore, notcategory=byrussell]

\end{document}

enter image description here

  • 1
    If we were not in a list environment it is sort of clear why the test would introduce horizontal space. After all the check is just code that is executed at some point and if the code contains spurious spaces, that's what you get in the output. It is a bit counter-intuitive that this would lead to vertical space in a list environment at first and I can't claim to understand why that is, but given all the stuff that is happening in bibliographies with lists and \leavevmodes it does not surprise me. – moewe Dec 16 '18 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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