1

How to properly link an url in Bibliography?

I've tried this:

@book{wiki4,
    label    = {Razor},
    author   = {Wikipedia's collaborators},
    date     = {2014-01-01},
    url      = {http://en.wikipedia.org/wiki/ASP.NET_Razor_view_engine},
    urldate  = {2014-04-12}
}

But, urldate doesn't work. Is there any other format allowing that, please?

Thanks a lot!

17
  • 1
    Could you please edit your post and add a fully compilable (minimum working) example? It would a great starting point for solvers.
    – Malipivo
    Commented Apr 12, 2014 at 15:43
  • Are you loading hyperref?
    – cfr
    Commented Apr 12, 2014 at 16:51
  • @Malipivo, I've updated my post.
    – Djouma
    Commented Apr 12, 2014 at 18:09
  • @cfr, yes, you'll find its code in the posted code.
    – Djouma
    Commented Apr 12, 2014 at 18:41
  • 1
    I get no errors (once I corrected a couple of typos in the code), and I get a printed and functional URL and date. Commented Apr 12, 2014 at 19:05

1 Answer 1

2

The code works fine. It has nothing to do with urldate. You just haven't specified anything to handle any language other than American English.

If you are compiling with LaTeX or pdfLaTeX, you should use babel. You also want to use the T1 encoding for French. I've added inputenc with utf8 so you can type accented characters such as ŵ directly. If you don't want that, just comment it out. Finally csquotes is recommended for use with biblatex etc.

\documentclass[12pt,french]{report}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[backend=biber, style=alphabetic]{biblatex}
\begin{filecontents}{wikis.bib}
@book{wiki4,
        label    = {Razor},
        author   = {Wikipedia's collaborators},
        date     = {2014-01-01},
        url      = {http://en.wikipedia.org/wiki/ASP.NET_Razor_view_engine},
        urldate  = {2014-04-12}
    }
\end{filecontents}
\usepackage[unicode=true,
bookmarks=true,bookmarksnumbered=true,bookmarksopen=false,
breaklinks=true,pdfborder={0 0 0},backref=false,colorlinks=false]
{hyperref}

\addbibresource{wikis.bib}
\begin{document}
\nocite{*}
\printbibliography
\addcontentsline{toc}{chapter}{Bibliography}
\end{document}

Bibliography in French

Full code

This is based on the full example you added to your question. As posted, that code would not compile so the following is not identical with what you posted. Rather, it is minimally modified to compile. The modified version works fine for me, including the hyperlink, date formatting etc.

\documentclass[12pt,english,french]{report}
\usepackage{mathptmx}
\usepackage{helvet}
\usepackage{courier}
\usepackage[T1]{fontenc}
\usepackage[cp1250]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in,headheight=12pt,headsep=25pt,footskip=30pt}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}
\usepackage[bottom,hang]{footmisc}
\usepackage{latexsym}
\usepackage{pifont}
\usepackage{color}
\usepackage{float}
\usepackage{textcomp}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{babel}
\usepackage{csquotes}% recommended in output (biblatex)
\usepackage[backend=biber, style=alphabetic]{biblatex}
\usepackage{titletoc}
\usepackage{url}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{array}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{abstract}
\usepackage{caption}
%\usepackage[toc]{glossaries}

\skip\footins 1cm

\DeclareLabelalphaTemplate{% adjust the template for the label based on the default one - requires biber
  \labelelement{%
    \field[final]{shorthand}% if shorthand specified, use it
    \field{label}% if label specified, use it author's name
  }
  \labelelement{%
    \literal{,\addhighpenspace}% add comma
  }
  \labelelement{%
  \field[strwidth=2,strside=right]{year}% take the rightmost 2 numbers from the year
  }
}
\usepackage{filecontents}
\begin{filecontents}{wikis.bib}
@book{wiki4,
        label    = {Razor},
        author   = {Wikipedia's collaborators},
        date     = {2014-01-01},
        url      = {http://en.wikipedia.org/wiki/ASP.NET_Razor_view_engine},
        urldate  = {2014-04-12}
    }
\end{filecontents}
\usepackage[unicode=true,bookmarks=true,bookmarksnumbered=true,bookmarksopen=false,breaklinks=true,pdfborder={0 0 0},backref=false,colorlinks=false]{hyperref}

\addbibresource{wikis.bib}

\begin{document}
\nocite{*}
\printbibliography
\addcontentsline{toc}{chapter}{Bibliography}
\end{document}

Notes

  • If you wish to use \MakeAutoQuote*{“}{”} then you need to specify the utf8 input encoding. I've therefore deleted the line setting active quotes in my example.
  • Only load hyperref once and load it after biblatex. I've deleted the first invocation (before biblatex), leaving only the second.
  • I also tidied up some erroneous line breaks but those could be artefacts of copy-paste rather than a function of the original code.
  • Always look at the output when you have trouble - not just the final document or lack of one. Often, this means switching to the command line to compile. In this case, compilation stopped at least 3 times with errors, several of which told you exactly what was wrong. (Though at least one was much less obvious.) The .log file is another useful resource in these cases.
  • Another strategy is to selectively comment out parts of your code until you find what is causing the trouble. Combining this with examination of the output and .log was especially useful in this case.

Bibliography

14
  • But, at the compiling biber time, I get this only warning.
    – Djouma
    Commented Apr 13, 2014 at 14:43
  • @Djouma Most of that is just info. The warning is probably important, though. It looks as if your version of the biblatex .bcf is not what biber expects. Sometimes this happens if you've just updated and a rerun of pdflatex solves the issue. However, it is finding a newer version than expected. Do you have more than one installation of TeX?
    – cfr
    Commented Apr 13, 2014 at 14:58
  • @Djouma Please try my examples as posted and report your results. This won't solve the problem you are actually facing but it is a crucial step towards diagnosing it. Adding greater and greater complexity to your example is just adding more and more unknown factors.
    – cfr
    Commented Apr 13, 2014 at 15:03
  • Have you seen my edited posted code? I've just added a few lines before \begin{document}, after doing that, pdfLaTeX/Biber are not building the bibliography section correctly.
    – Djouma
    Commented Apr 13, 2014 at 15:09
  • @Djouma Does it work without that? If so, comment out sections until you identify the culprit. (There are more than 'a few' lines added.)
    – cfr
    Commented Apr 13, 2014 at 15:13

You must log in to answer this question.

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