1

How can I add a point after the URL with biblatex?

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
        @Electronic{musk,
        author      = {Elon Musk},
        title       = {Tesla Model X},
        url         = {https://www.tesla.com/modelx?redirect=no},
        date        = {2017-07-04},
        institution = {Tesla},
        urldate     = {2018-10-16}}
}
\end{filecontents}

\documentclass{article}
\usepackage[style=authortitle,]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
Let's cite! \footcite{musk}
\printbibliography
\end{document}
derd
  • 107
  • 1
    and also a dot at the end (after urldate)?? Looks a bit curious ... However, try after biblatex package \renewbibmacro*{url}{\printfield{url}\adddot} –  Dec 11 '18 at 19:54
  • Thank you! It indeed looks strange but this is is a requirement. – derd Dec 11 '18 at 20:14

1 Answers1

2

If you also remove the parentheses around the urldate as in Biblatex change last visited it does not look that bad.

We only need to redefine the bibmacro url+urldate and change \setunit*{\addspace}% to \setunit*{\newunitpunct}%.

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{musk,
  author      = {Elon Musk},
  title       = {Tesla Model X},
  url         = {https://www.tesla.com/modelx?redirect=no},
  date        = {2017-07-04},
  institution = {Tesla},
  urldate     = {2018-10-16},
}
\end{filecontents}

\documentclass{article}
\usepackage[style=authortitle,]{biblatex}


\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}

\renewbibmacro*{url+urldate}{%
  \usebibmacro{url}%
  \iffieldundef{urlyear}
    {}
    {\setunit*{\newunitpunct}%
     \usebibmacro{urldate}}}

\addbibresource{\jobname.bib}
\begin{document}
Let's cite! \footcite{musk}
\printbibliography
\end{document}

Musk, Elon. Tesla Model X. July 4, 2017. url: https://www.tesla.com/modelx?redirect=no. Visited on 10/16/2018.

moewe
  • 175,683