[Tex/LaTex] How to add a primary literature bibliography

biblatexbiblatex-chicagobibliographies

In Indological literature there's the convention of having two separate bibliographies: One for secondary literature, which can be handled more or less straightforward by existing types and fields already present in biblatex(-chicago), and a primary literature one, for which in a previous publication project I had to resort to ugly hacks like abusing the title field for the name of the work and, optionally, its author, then hardcoding all the actual bibliographical information into the note field. How ugly was that, as in the following, which is roughly how I used to do it:

\documentclass{article}
\usepackage[authordate,backend=biber]{biblatex-chicago}
\usepackage{filecontents}

\begin{filecontents*}{pri.bib}

@misc{Kuṭṭanīmata,
title = {Kuṭṭanīmata \emph {of Dāmodaragupta}},
note = {\textit{Dāmodaraguptaviracitaṃ Kuṭṭanīmatam:  The Bawd’s Counsel, Being an Eighth-century Verse Novel in Sanskrit by Dāmodaragupta, Newly Edited and Translated into English}, edited and translated by Csaba Dezső and Dominic Goodall.  Groningen Oriental Studies 23.  Groningen: Egbert Forsten, 2012},
}

\end{filecontents*}

\begin{filecontents*}{sec.bib}

@book{DezsoGoodall2012,
title = {Dāmodaraguptaviracitaṃ Kuṭṭanīmatam},
subtitle = {The Bawd’s Counsel, Being an Eighth-century Verse Novel in Sanskrit by Dāmodaragupta, Newly Edited and Translated into English},
editor = {Csaba Dezső and Dominic Goodall},
translator = {Csaba Dezső and Dominic Goodall},
series =  {Groningen Oriental Studies},
number = {23},
location = {Groningen},
publisher = {Egbert Forsten},
year = {2012},
}

\end{filecontents*}


\begin{filecontents*}{biber.conf}
<?xml version="1.0" encoding="UTF-8"?>
<config>
  <sourcemap>
    <maps datatype="bibtex" bmap_overwrite="1">
      <map>
        <per_datasource>pri.bib</per_datasource>
        <map_step map_field_set="KEYWORDS" map_field_value="pri"/>
      </map>
      <map>
        <per_datasource>sec.bib</per_datasource>
        <map_step map_field_set="KEYWORDS" map_field_value="sec"/>
      </map>
    </maps>
  </sourcemap>
</config>

\end{filecontents*}


\addbibresource{pri.bib}
\addbibresource{sec.bib}

\begin{document}
\nocite{*}

\printbibliography[title=Primary Sources, keyword=pri,heading=subbibliography]
\printbibliography[title=Secondary Sources, keyword=sec,heading=subbibliography]
\end{document}

example

For a new project I am now thinking to do it properly, but am not quite sure how to go about it. Maybe I could create new types, say @pri-book, for which I guess I'd have to copy the definition of @book from chicago-authordate.bbx, and extend it by two extra fields, e.g. pri-title, containing the Sanskrit title of the work, and the optional pri-author, which of course would also need to be defined, and change the order of fields for the year to be output at the end of the entry?

Best Answer

Update

Here's a version that keeps the author and title separate. It copes with different languages OK. I've also kept your source map and used the source map to set the sortkey to title so that entries are sorted by title rather than author. The relatedoptions={dataonly,useditor=false,usetranslator=false} ensures that the related entry does not appear in the bibliography unless explicitly cited and the editor and translator appear after the title.

It's not super clever, but is a reasonably place to start.

\documentclass{article}
\usepackage[french,american]{babel}
\usepackage{csquotes}
\usepackage{xpatch}
\usepackage[authordate,backend=biber,language=auto,autolang=other]{biblatex-chicago}
\usepackage{filecontents}
\begin{filecontents}{pri.bib}
@misc{Kuṭṭanīmata,
  entrysubtype = {classical},
  author = {Dāmodaragupta},
  title = {Kuṭṭanīmata},
  related = {DezsoGoodall2012},
  relatedoptions = {dataonly,useeditor=false,usetranslator=false}
}
@misc{Title:fr,
  entrysubtype = {classical},
  author = {Author},
  title = {Title},
  langid = {french},
}
\end{filecontents}
\begin{filecontents}{sec.bib}
@book{DezsoGoodall2012,
  title = {Dāmodaraguptaviracitaṃ Kuṭṭanīmatam},
  subtitle = {The Bawd’s Counsel, Being an Eighth-century Verse Novel in Sanskrit by Dāmodaragupta, Newly Edited and Translated into English},
  editor = {Csaba Dezső and Dominic Goodall},
  translator = {Csaba Dezső and Dominic Goodall},
  series =  {Groningen Oriental Studies},
  number = {23},
  location = {Groningen},
  publisher = {Egbert Forsten},
  year = {2012}
}
\end{filecontents}
\addbibresource{pri.bib}
\addbibresource{sec.bib}
\DeclareSourcemap{
  \maps{
    \map{
      \perdatasource{pri.bib}
      \step[fieldset=keywords, fieldvalue=pri]
      \step[fieldsource=title, final]
      \step[fieldset=sortkey, origfieldval]
    }
  }
}
\DeclareFieldFormat[misc]{title}{\mkbibemph{#1}\isdot}
\newbibmacro*{pri:titleofauthor}{%
  \ifentrytype{misc}
    {\iffieldequalstr{entrysubtype}{classical}
       {\ifbibliography
         {\printfield{title}%
          \ifnameundef{author}
            {}
            {\setunit*{\addspace}%
             \bibstring{of}%
             \setunit*{\addspace}%
             \printnames{author}%
             \clearname{author}}%
          \clearfield{title}}
         {\printtext[bibhyperref]{\printfield[citetitle]{title}}%
          \ifnameundef{labelname}
            {}
            {\setunit*{\addspace}%
             \bibstring{of}%
             \setunit*{\addspace}%
             \printnames{labelname}}%
          \clearfield{labeltitle}%
          \clearname{labelname}}}
       {}}
    {}}
\xpretobibmacro{cite}
  {\usebibmacro{pri:titleofauthor}}
  {}
  {}
\xpatchbibdriver{misc}
  {\usebibmacro{bibindex}}
  {\usebibmacro{bibindex}\usebibmacro{pri:titleofauthor}}
  {}
  {}
\begin{document}
Filler text \autocite{Kuṭṭanīmata}.

Filler text \autocite{Title:fr}.

Filler text \autocite{DezsoGoodall2012}.

\printbibliography[title=Primary Sources, keyword=pri,heading=subbibliography]
\printbibliography[title=Secondary Sources, notkeyword=pri,heading=subbibliography]
\end{document}

enter image description here


Original answer

This looks like a good candidate for the related feature of biblatex. You can set the entrysubtype field to classical for your primary source to get the output you want without really doing anything clever.

Ideally you'd want to separate author and title of your Kuṭṭanīmata entry, but if you don't want to modify the drivers, you could leave everything in the title field as you have now.

How's this?

\documentclass{article}
\usepackage[authordate,backend=biber]{biblatex-chicago}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{Kuṭṭanīmata,
  entrysubtype = {classical},
  title = {\mkbibemph{Kuṭṭanīmata} of Dāmodaragupta},
  related = {DezsoGoodall2012},
  relatedoptions = {dataonly,useeditor=false,usetranslator=false},
  keywords = {pri}
}
@book{DezsoGoodall2012,
  title = {Dāmodaraguptaviracitaṃ Kuṭṭanīmatam},
  subtitle = {The Bawd’s Counsel, Being an Eighth-century Verse Novel in Sanskrit by Dāmodaragupta, Newly Edited and Translated into English},
  editor = {Csaba Dezső and Dominic Goodall},
  translator = {Csaba Dezső and Dominic Goodall},
  series =  {Groningen Oriental Studies},
  number = {23},
  location = {Groningen},
  publisher = {Egbert Forsten},
  year = {2012},
  keywords = {sec}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Filler text \autocite{Kuṭṭanīmata}.

Filler text \autocite{DezsoGoodall2012}.

\printbibliography[title=Primary Sources, keyword=pri,heading=subbibliography]
\printbibliography[title=Secondary Sources, keyword=sec,heading=subbibliography]
\end{document}

enter image description here

Related Question