[Tex/LaTex] Get Biblatex to show URL for Webpage references

biblatexurls

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.

Best Answer

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).