2

I'm currently using Mendeley to gather my references and export them as a .bib file. I turned off the URL parameters on inclusion of Biblatex as I don't want URLs for published papers, books, etc:

\usepackage[backend=biber,
            style=numeric,
            sorting=none,
            url=false]{biblatex}

However, I want the URLs in my references for webpages. I realise that one solution is to just remove the URLs from Mendeley before exporting to .bib, but I also want to keep the URLs there for published works.

  • 1
    For your webpages, you should use @online, for which the url is always printed, even with url=false. I'm not a Mendeley user though, so I'm not sure about how to tell it to do that. Anyway, that's what biblatex would expect. – gusbrs Apr 28 '18 at 0:59
  • 2
    Welcome! That will work, provided you are using appropriate entry types, as @gusbrs notes and provided, of course, that Mendeley includes the data in the exported .bib. If Mendeley is using the wrong entry type for web pages, that's where you need to intervene in your workflow. – cfr Apr 28 '18 at 1:35
  • Chances are that Mendeley exports webpages as @misc or as a weird entrytype that biblatex does not know and therefore maps to @misc. As gusbrs and cfr already pointed out, if you have an @online you should get to see the URL even with url=false. – moewe Apr 28 '18 at 6:10
  • Thanks for the replies! I didn't realise but Mendeley is exporting webpage references as @misc instead of @online. I can't seem to find a way of changing this. Mendeley's auto .bib syncing is very useful, but it looks like I'm just going to have to manually change the @misc to @online before submission. – Oliver Crow Apr 28 '18 at 9:34
  • 1
    Maybe you should consider complaining to the Mendeley people. They really should export @online if they want to support biblatex. tex.stackexchange.com/q/422563/35864 has a work-around to reclassify @miscs with URL as @online. – moewe Apr 28 '18 at 11:06
4

The standard behaviour of biblatex is to always display URLs for @online regardless of the url option. So even with url=false you should see the URL of @online entries.

Mendeley exports websites as @misc entries. But @misc does not fall under the @online exception above and so the URLs of your sources are suppressed.

The solution is to tell the Mendeley people that they should export online sources to @online if they want to support biblatex properly. I have googled around a bit and it seems like people have been trying to get Mendeley to change their .bib export for quite a while, apparently with limited success.

You can use a method similar to Mendeley and Biblatex: how to interpret 'misc' as 'patent' or 'online' to try and salvage your .bib file. The map

\DeclareStyleSourcemap{
  \maps[datatype=bibtex, overwrite=true]{
    \map{
      \step[fieldsource=url, final]
      \step[typesource=misc, typetarget=online]
    }
  }
}

converts all @miscs with a URL field to @online.

The map

\DeclareStyleSourcemap{
  \maps[datatype=bibtex, overwrite=true]{
    \map{
      \step[typesource=misc, typetarget=online]
    }
  }
}

converts all @miscs to @online.

Both solutions assume that you have no legitimate @misc entries with a url field (which should not be converted to @online).

  • Perfect, this is exactly what I was looking for. Thank you. – Oliver Crow Apr 29 '18 at 12:26
  • @OliverCrow But don't rely on this workaround. Pressure the Mendeley people into implementing a proper .bib export. – moewe Apr 29 '18 at 12:59
  • 1
    I have sent them a message about this (through their contact methods). Their Feature Requests page just returns a 404... – Oliver Crow Apr 29 '18 at 13:26

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.