6

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.

5
  • 2
    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, 2018 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, 2018 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, 2018 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. Apr 28, 2018 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, 2018 at 11:06

1 Answer 1

10

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

\DeclareSourcemap{
  \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

\DeclareSourcemap{
  \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).

6
  • Perfect, this is exactly what I was looking for. Thank you. Apr 29, 2018 at 12:26
  • 1
    @OliverCrow But don't rely on this workaround. Pressure the Mendeley people into implementing a proper .bib export.
    – moewe
    Apr 29, 2018 at 12:59
  • 2
    I have sent them a message about this (through their contact methods). Their Feature Requests page just returns a 404... Apr 29, 2018 at 13:26
  • Great answer, second snippet worked for me perfectly
    – d-man
    May 10, 2022 at 14:13
  • 1
    @pms plain is a very old BibTeX style (not biblatex, as in this question). It was written before URLs were a big thing. That's why it doesn't support a url field. You need to choose a style that does. You could try plainurl instead of plain or one of the natbib styles.
    – moewe
    May 29 at 5:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .