2

In our departement, we use JabRef for managing our literature based on custom entry types. The fields are mainly standard fields.

I now want to make it possible to cite literature in LaTeX-documents based on our database. I thereby face different problems.

I figured out that I can use the custom entry types based on

\declarBibliographyDriver{customEntryType}{% 
\usebibmacro{begentry}%
...
\usebibmacro{finentry}%
}

Now I do have two problems:

  1. required formatting in standard fields:

    The printing of standard fields, e.g. via \printnames{author} or \printdate works if everything is formatted as required by biblatex. Unfortunately, that is not the case for the date field which is used in the german manner dd.mm.yyyy. According to the biblatex doc (2.3.8 Date Specifications), the date has to be formatted in the yyyy-mm-dd style and thus, I get the error Invalid format '25.07.2016' of date field 'date' - ignoring.

    Is it possible to get a userdefined date specification? Maybe in combination with a definition of a custom entry type as pointed out in this question?

  2. custom fields:

    Some of the fields that we use are custom. Is ist possible to add them in order to use them in a \DeclareBibliographyDriver definition or do I have to create a custom entry type as described in here? The main problem that I have is with a field key, that we use to autolink pdf-files in JabRef. I would like to add it to the bibliography to make it easier to find an article in JabRef. Unfortunately, the key is not written into the .bbl-file and I can't use it in \DeclareBibliographyDriver.

Thank you very much in advance for every help!

  • You should always give the date fields in YYYY-MM-DD format in the .bib file, the output format can the be customised at will. Of course you can use Regex matching to transfer DD.MM.YYYY fields to YYYY-MM-DD, but it is better to configure the software that exports the .bib file to export the date in the correct format. – moewe Aug 10 '16 at 14:40
  • In fact the field key is known to biblatex and automatically remapped to sortkey, and the sortkey field "is consumed by the backend processing and does not appear in the .bbl". In general you need to declare a new field unknown to biblatex, see Biblatex: 2 custom fields, only one is working, Add field “tome” to biblatex entries, How can I add a field to an existing biblatex type? – moewe Aug 10 '16 at 14:42
1

Regarding the date you can use regular expression to correct the format:

\documentclass[11pt,a4paper]{article}
\usepackage{biblatex}

\DeclareSourcemap{
    \maps[datatype=bibtex]{
        \map[overwrite]{
            \step[fieldsource=date,
                  fieldset=date,
                  match=\regexp{([0-9]+)\.([0-9]+)\.([0-9]+)},
                  fieldvalue={$3-$2-$1}
            ]
        }
    }
}

\addbibresource{test.bib}
\begin{document}
\cite{testdate1,testdate2}
\printbibliography

\end{document}

with

@misc{testdate1,
author = {testauthor},
title = {blblb},
date = {03.04.2016},
}

@misc{testdate2,
author = {testauthor},
title = {blblb},
date = {2016-03-04},
}

enter image description here

Regarding your custom fields, you can either map them to existing fields (like e.g. usera, customa etc), or extend the datamodel. But your information is to vage to decide which would be more sensible.

  • thank you so much Ulrike Fischer for the perfect solution regarding the first question! I added a specific problem considering my 2nd problem. – Wolfson Aug 10 '16 at 11:17
  • Map the key field to the file field. – Ulrike Fischer Aug 10 '16 at 11:22

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.