0

I had already asked a nearly identical question here

I am using biblatex with biber from TL2018 for my PhD thesis. Due to various reasons, I am forced to use Mendeley for citation managements and cannot switch to another tool now. Mendeley is capable of generating a bib file - but it is compatible with only the classic natbib/bibtex combo (although it correctly escapes special characters).

I understand that with biblatex/biber combo, the month field is not a string, but rather must be an integer. So, as expected and discussed here, I get the warning

WARN - month field 'jan' in entry 'Guo2012' is not an integer - this will probably not sort properly.

(this time for jan wherein unlike my original question, the month does not begin with captial J).

For tackling the original question, I used the regex given in that question in my preamble (given below)

\DeclareSourcemap{
    \maps[datatype=bibtex]{
        \map[overwrite]{
            \step[fieldsource=month, match=\regexp{\Ajan\Z}, replace=1]
            \step[fieldsource=month, match=\regexp{\Afeb\Z}, replace=2]
            \step[fieldsource=month, match=\regexp{\Amar\Z}, replace=3]
            \step[fieldsource=month, match=\regexp{\Aapr\Z}, replace=4]
            \step[fieldsource=month, match=\regexp{\Amay\Z}, replace=5]
            \step[fieldsource=month, match=\regexp{\Ajun\Z}, replace=6]
            \step[fieldsource=month, match=\regexp{\Ajul\Z}, replace=7]
            \step[fieldsource=month, match=\regexp{\Aaug\Z}, replace=8]
            \step[fieldsource=month, match=\regexp{\Asep\Z}, replace=9]
            \step[fieldsource=month, match=\regexp{\Aoct\Z}, replace=10]
            \step[fieldsource=month, match=\regexp{\Anov\Z}, replace=11]
            \step[fieldsource=month, match=\regexp{\Adec\Z}, replace=12]
        }
    }
}

How can this be modified suitably to handle this lowercase situation?

marked as duplicate by Alan Munn, Stefan Pinnow, Phelype Oleinik, Troy, Milo Sep 9 '18 at 17:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Can you please provide a complete MWE so that we can test our solutions and don't have to make up things that you already have? As I said under the original answer I just tested the code a few minutes ago and it worked for me. I need to see a full MWE and the complete .blg file. I don't see how this could be a case issue. The warning message mentions jan in lowercase and the code replaces lowercase jan. – moewe Sep 9 '18 at 15:18
  • Also let me please point out again that even with BibTeX (as backend for biblatex or with usual .bst files), month = {jan}, with braces is still unfortunate bordering on completely wrong. – moewe Sep 9 '18 at 15:19
  • @moewe It is Mendeley, not me! – Krishna Sep 9 '18 at 15:21
  • Sorry I don't understand what you mean to say with your last comment. Anyway, I have edited my original answer to match both jan and Jan. I for the life of me can not figure out why the code you posted in this question would not work for the warning you have shown, since everything is lowercase, but since you have not provided a minimal working example, but just code snippets I will not investigate that further until I get to see an MWE. – moewe Sep 9 '18 at 15:29
  • In the orginal answer @moewe used \A(j|J) in the regex to handle the lower/uppercase. In your snippet above this is missing. Is this intended? – Ulrike Fischer Sep 9 '18 at 15:43