# Can one set up 2 kinds of shorthand lists in biblatex?

This is a follow-up to Customizing biblatex lists of abbreviations: separate lists for different authors. With moewe's

\DeclareBibliographyDriver{shorthand}{%
\usebibmacro{title}%
\newunit\newblock
\printdate}


there's only title and date in the list of shorthands. However, it turns out I need two types of shorthand lists, one with only title and date, and the other with author, title, and date. The reason is that I have abbreviations of two main authors, but also abbreviations from a number of other authors; for the latter it would be helpful for the reader to see the author. So, for example, I would like to have a slight change from what one gets from moewe's code:

The change is that I'd like to have

KS    Frege, Gottlob, Kleine Schriften, 1967

in the final, "Shorthands by other authors" part.

Edit following David Purton's answer.

The answer is very helpful but doesn't fully work. The problem now is that all entries by the authors in question show up in the lists of shorthands, even those for which there is no shorthand in the .bib file. Here's an MWE:

\documentclass{book}

\usepackage{fontspec}

\usepackage{microtype}

\usepackage{polyglossia}
\setmainlanguage{english}

\usepackage[style=authoryear,natbib=true,backend=biber]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@Book{Frege1967,
Title                    = {{K}leine {S}chriften},
Address                  = {Hildesheim},
Author                   = {Frege, Gottlob},
Publisher                = {Georg Olms},
Year                     = {1967},
Shorthand                = {\emph{KS}}
}
@Article{Russell1905b,
Title                    = {{O}n {D}enoting},
Author                   = {Russell, Bertrand},
Year                     = {1905},
Number                   = {56},
Pages                    = {479-493},
Volume                   = {14},
Journal                  = {Mind}
}
@Book{Bradley1893,
Title                    = {{A}ppearance and {R}eality: a {M}etaphysical {E}ssay},
Address                  = {London},
Author                   = {Bradley, Francis Herbert},
Publisher                = {Swan Sonnenshein},
Year                     = {1893},
Shorthand                = {\emph{AR}}
}
@Article{Korselt1903,
Title                    = {{Ü}ber die {G}rundlagen der {G}eometrie},
Author                   = {Korselt, Alwin},
Journaltitle             = {Jahresbericht der Deutschen Mathematiker Vereinigung},
Year                     = {1903},
Pages                    = {402–7}
}
@Inbook{Peirce1880a,
Title                    = {{A} {B}oolian {A}lgebra with {O}ne {C}onstant},
Author                   = {Peirce, Charles Sanders},
Booktitle                = {Collected Papers of Charles Sanders Peirce},
Year                     = {1880},
Editor                   = {Hartshorne, Charles and Weiss, Paul and Burks, Arthur},
Pages                    = {12-20},
Publisher                = {Harvard University Press},
Volume                   = {4}
}
@Article{Moore1899,
Title                    = {{T}he {N}ature of {J}udgment},
Author                   = {Moore, G. E.},
Year                     = {1899},
Number                   = {30},
Pages                    = {176-193},
Volume                   = {8},
Journal                  = {Mind},
Shorthand                = {\emph{NJ}},
}
@Mvbook{Whitehead1910-1913,
Title                    = {{P}rincipia {M}athematica},
Author                   = {Whitehead, Alfred North and Russell, Bertrand},
Year                     = {1910-1913},
Edition                  = {1},
Address                  = {Cambridge},
Publisher                = {Cambridge University Press},
Shorthand                = {\emph{PM}}
}
@Inbook{Frege1918,
Title                    = {{T}hought},
Author                   = {Frege, Gottlob},
Year                     = {1918},
Pages                    = {351-372},
Crossref                 = {Frege1984}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\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.}

\defbibfilter{moorerussell}{%
( category=bymoore or category=byrussell )
}

\defbibfilter{notmainprimary}{%
not category=byfrege
and not category=bymoore
and not category=byrussell
}

\defbibcheck{primarysource}{%
\iffieldint{year}
{\ifnumless{\thefield{year}}{1925}
{}
{\skipentry}}
{\skipentry}}

\defbibcheck{secondarysource}{%
\iffieldint{year}
{\ifnumgreater{\thefield{year}}{1925}
{}
{\skipentry}}
{\skipentry}}

\DeclareBiblistFilter{author}{
\filter[type=field,filter=shorthand]
}

\DeclareBiblistFilter{title}{
\filter[type=field,filter=shorthand]
}

\DeclareBibliographyDriver{author}{%
\usebibmacro{title}%
\newunit\newblock
\printdate}

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

\begin{document}

\chapter*{Abbreviations}

Full details of these works are in the Bibliography.

\printbiblist[env=shorthand,title={Works of Frege}, heading=subbibliography, category=byfrege]{author}

\printbiblist[env=shorthand,title={Works of Moore and Russell}, heading=subbibliography, filter=moorerussell]{author}

\printbiblist[env=shorthand,title={Other Primary Works}, heading=subbibliography, check=primarysource, notcategory=byfrege, notcategory=bymoore, notcategory=byrussell]{title}

\nocite{Frege1967,Russell1905b,Bradley1893,Korselt1903,Moore1899,Peirce1880a,Whitehead1910-1913,Frege1918}

\end{document}


When built in TeXStudio the result is:

"Thought," "On Denoting," and the Korselt and Peirce papers are in the list, but have no shorthands. So the question is how to exclude these from the list.

I've just now tried to implement moeve's suggestion in comment to David Purton's answer by adding \DeclareBiblistFilter's, but alas this has no effect. Most likely I've not written the right filters.

• I'll have another crack at it but might not get to it for a couple of days. @moewe might be able to post a better answer sooner. – David Purton Dec 24 '17 at 12:14
• Mhhh, I just compiled your very last MWE with the biblist filters (which look exactly fine) and it worked for me, i.e. I see only AR in the last list and not Korselt and Pierce. Did you delete the temporary files? What version of biblatex and Biber do you use? – moewe Dec 25 '17 at 6:46
• @moewe Wow, very strange. I just cut and paste from the question into texstudio, and it builds just fine. I'm using biblatex 3.9, updated MikTeX a couple of weeks ago. Anyway, it works, so, thanks! – ss1789 Dec 25 '17 at 20:25
• @moewe Just out of curosity, how does one go about redefining the sorting templates? I assume this is for sorting the list alphabetically by abbreviation? Not a must for what I need, but I'm interested in how it would be done. – ss1789 Dec 27 '17 at 22:04
• \DeclareSortingTemplate{shorthand}{ \sort[final]{ \field{sortshorthand} } \sort{ \field{shorthand} } } is the standard definition for shorthand sorting. In David's answer you'd need to have the same definitions for an author and title sorting template. – moewe Dec 27 '17 at 22:09

## 1 Answer

Updated to include required biblist filters

You can do this by defining new biblist drivers called title and author and using \printbiblist. Remove the old shorthand driver from moewe's answer to your previous question.

New drivers:

\DeclareBibliographyDriver{author}{%
\usebibmacro{title}%
\newunit\newblock
\printdate}

\DeclareBibliographyDriver{title}{%
\renewbibmacro*{date+extradate}{}% remove (date) after author.
\usebibmacro{author/editor+others/translator+others}%
\setunit{\addcomma\space}\newblock
\usebibmacro{title}%
\setunit{\addcomma\space}\newblock
\printdate}


New \printbiblist calls. Specifiy the environment using env=shorthand:

\printbiblist[env=shorthand,title={Shorthands by Kant}, heading=subbibliography, category=bykant]{author}
\printbiblist[env=shorthand,title={Shorthands by Elk}, heading=subbibliography, category=byelk]{author}
\printbiblist[env=shorthand,title={Shorthands by other authors}, heading=subbibliography, notcategory=byelk, notcategory=bykant]{title}


New filters:

\DeclareBiblistFilter{author}{
\filter[type=field,filter=shorthand]
}

\DeclareBiblistFilter{title}{
\filter[type=field,filter=shorthand]
}


Full MWE:

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@Article{russell:denoting,
Title   = {On Denoting},
Author  = {Russell, Bertrand},
Year    = {1905},
Number  = {56},
Pages   = {479-493},
Volume  = {14},
Journal = {Mind}
}
@book{elk:bronto,
author    = {Anne Elk},
title     = {Theory of Brontosauruses},
shorthand = {Bronto},
date      = {1972},
publisher = {Monthy and Co.},
location  = {London},
}
@book{elk:diplo,
author    = {Anne Elk},
title     = {Theory of Diplodocuses},
shorthand = {Diplo},
date      = {1974},
publisher = {Monthy and Co.},
location  = {London},
}
@book{frege,
author    = {Frege, Gottlob},
title     = {Kleine Schriften},
date      = {1967},
shorthand = {\emph{KS}},
location  = {Hildesheim},
publisher = {Georg Olms},
}
\end{filecontents}

\addbibresource{biblatex-examples.bib}
\addbibresource{\jobname.bib}

\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{elk}{Elk}{Anne}
\generateauthorcategory{kant}{Kant}{Immanuel}

\DeclareBibliographyDriver{author}{%
\usebibmacro{title}%
\newunit\newblock
\printdate}

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

\DeclareBiblistFilter{author}{
\filter[type=field,filter=shorthand]
}

\DeclareBiblistFilter{title}{
\filter[type=field,filter=shorthand]
}

\begin{document}
\nocite{kant:ku,kant:kpv,elk:diplo,elk:bronto,frege,russell:denoting}

\section*{Shorthands}
\thispagestyle{empty}
Introductory notes on shorthands. Full details can be found in the bibliography.
\printbiblist[env=shorthand,title={Shorthands by Kant}, heading=subbibliography, category=bykant]{author}
\printbiblist[env=shorthand,title={Shorthands by Elk}, heading=subbibliography, category=byelk]{author}
\printbiblist[env=shorthand,title={Shorthands by other authors}, heading=subbibliography, notcategory=byelk, notcategory=bykant]{title}
\printbibliography
\end{document}


• Since the mandatory argument to \printbiblist fixes the biblist filter and sorting, this approach might run into troubles. The 'best' solution I could think of was to introduce a new option for \printbiblist that can be used to override the driver and biblist filter. To fix your answer you'd need to \DeclareBiblistFilter the two filters author and title to do what shorthand does. To be really sure nothing goes wrong, you might also need to redefine the sorting templates. – moewe Dec 24 '17 at 11:27
• @moewe. Just tried adding \DeclareBiblistFilter{author}{\filter[type=field,filter=shorthand]} and \DeclareBiblistFilter{title}{\filter[type=field,filter=shorthand]} before \DeclareBibliographyDriver's in the MWE, but no effect on output. – ss1789 Dec 24 '17 at 23:42
• Most likely I've not written the biblist filters correctly. – ss1789 Dec 24 '17 at 23:50
• Your new MWE is correct I think. For the sake of completeness I have added filters for author and title lists to my answer. – David Purton Dec 25 '17 at 8:39
• @DavidPurton. Yes, as I wrote in reply to moewe, it now works for me. Thanks! – ss1789 Dec 25 '17 at 20:27