6

Doing as it has been suggested on this site, and also having looked in the manual for biblatex.pdf, I cannot figure out the difference between DeclareDatamodeFields and DeclareDatamodeEntryfields. I only get the address field as the result (Paris in this case). pdflatex, biber.

MWE

\documentclass{article}
\usepackage[datamodel=manuscript,bibstyle=verbose,citestyle=verbose]{biblatex}
\begin{filecontents}{manuscript.dbx}
\DeclareDatamodelEntrytypes{manuscript}
\DeclareDatamodelFields[type=field, datatype=literal]{datation,title,library}
\DeclareDatamodelEntryfields[manuscript]{
title,
library,
datation}
\end{filecontents}
\begin{filecontents}{maniscript.bib}
@manuscript{P1470,
    library={BNF},
    address={Paris},
    datation={\textsc{viii}\textsuperscript{e} s.}
\end{filecontents}

\bibliography{manuscript.bib}
\begin{document}
\nocite{*}

\printbibliography
\end{document}
6

You are actually pretty close. If you look at moewe's canonical answer on the topic you can get a better grasp on the possibilities and requirements of creating a new entrytype.

Still, to get your new fields typeset in the bibliography, you are critically missing a driver for you manuscript entrytype. I'm not sure the format you are looking for, but this serves as an example:

\DeclareBibliographyDriver{manuscript}{%
  \usebibmacro{begentry}%
  \printfield{library}%
  \setunit{\addcomma\space}%
  \printlist{location}%
  \newunit\newblock
  \printfield{title}%
  \setunit{\addcomma\space}%
  \printfield{datation}%
  \usebibmacro{finentry}%
}

I've also removed title and library from your .dbx file, as they are already defined by default. You should still add them to your \DeclareDatamodelEntryfields[manuscript]{... as you do. Also, note that setting both citestyle and bibstyle to verbose is equivalent to the more direct style=verbose.

In full:

\documentclass{article}

\usepackage[datamodel=manuscript,style=verbose]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{manuscript.dbx}
  \DeclareDatamodelEntrytypes{manuscript}
  \DeclareDatamodelFields[type=field, datatype=literal]{datation}
  \DeclareDatamodelEntryfields[manuscript]{
    title,
    library,
    location,
    datation}
\end{filecontents}

\begin{filecontents}{manuscript.bib}
@manuscript{P1470,
  library = {BNF},
  title = {A title},
  location = {Paris},
  datation = {\textsc{viii}\textsuperscript{e} s.},
}
\end{filecontents}

\DeclareBibliographyDriver{manuscript}{%
  \usebibmacro{begentry}%
  \printfield{library}%
  \setunit{\addcomma\space}%
  \printlist{location}%
  \newunit\newblock
  \printfield{title}%
  \setunit{\addcomma\space}%
  \printfield{datation}%
  \usebibmacro{finentry}%
}

\DeclareFieldFormat[manuscript]{title}{\mkbibquote{#1\isdot}}

\addbibresource{manuscript.bib}

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

enter image description here

You can, and should, examine closer moewe's linked answer, particularly the formatting directives. Also, you can redefine your bibdriver to the order of fields and punctuation of your liking.

  • Thank you very much! You explained by a very clear and hands-on code what I have long tried to master. – Dmitry Starostin Dec 16 '18 at 21:23
  • Thank you for laying all out in such a complete reply. The need for such consultation emerges for people like me because I have only been trained in programming languages like Fortran77, Algol, and a bit of Pascal, and every step (1. Data model 2.driver 3. field format requires a conceptual "retooling". :) Making a driver can still be grasped, but "DeclareFieldFormat", frankly, was beyond my conceptual reach even though I read the manual. :) – Dmitry Starostin Dec 17 '18 at 10:36
  • @DmitryStarostin Indeed, biblatex's jargon needs some getting used to, but once you grasp it you'll see it has a logic. I hope it has been enough to get you started. moewe's answer, specially, is very thorough. But old time languages should be no impediment. I started myself with Basic on a TK85 (a ZX81 clone) with K7 tape memory and all! :) – gusbrs Dec 17 '18 at 11:12
  • 1
    Thank you! It does have logic indeed, one just has to get accustomed to the relatively "slow" flow of definitions, which are nevertheless all conceptually justified. I have been using Latex for about ten years now, and it has been teaching me a very high-level philosophy of programming. It is not only Turing-complete, it does have a very precise conceptual definition of every step that has taught me since to at least understand such languages as Python and Java. – Dmitry Starostin Dec 18 '18 at 15:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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