0

I'm using biblatex-apa. my problem is with the way biblatex displays web page references. Biblatex displays the urldate before the url. I would like it to be the opposite.

here's how it looks now (it's French but I believe this is not so important)

Duben, R. (2022). Conférences & ateliers. Consulté le 14/09/2022, en ligne sur le site https://remydubern.com/conferences/

and here's how I would like it to be something like :

Duben, R. (2022). Conférences & ateliers. En ligne sur le site https://remydubern.com/conferences/ Consulté le 14/09/2022

I tried to modify the apa.bbx which in my computer is located in /opt/texlive/2022/texmf-dist/tex/latex/biblatex-apa/.

I managed to change the order of the url and date, but not the "consulté le" and "En ligne sur le site" parts (this would be something like "retrieved" and "from" in Englishn ; these are translated via french-apa.lbx)

I believe my solution lies somewhere here. I had some success messing with DeclareFieldFormat{urldate} and \renewbibmacro*{url+urldate} but I just don't know how this thing works.

\DeclareFieldFormat{url}{\url{#1}\nopunct}

\DeclareFieldFormat{urldate}{%
  \bibstring{retrieved}\space#1%
  \urldatecomma\bibstring{from}}

\newbibmacro*{doi+url}{%
  \ifboolexpr{          test {\iffieldundef{doi}}
                 or not togl {bbx:doi}}
    {\ifboolexpr{       test {\iffieldundef{url}}
                 or not togl {bbx:url}}
       {\newunit}
       {\usebibmacro{url+urldate}%
        \setunit{\addspace}}}
    {\printfield{doi}%
     \setunit{\addspace}}}

\renewbibmacro*{url+urldate}{%
  \ifthenelse{\iffieldundef{url}\OR\NOT\iffieldundef{doi}}
    {}
    {\iffieldundef{urlyear}
      {}
      {\printurldate
       \setunit{\addspace}}%
     \printfield{url}}}

Here's my .tex file

\documentclass[12pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{polyglossia}
\usepackage{csquotes}
\usepackage[style=apa,dateera=astronomical,seconds=true,urldate=short]{biblatex}
\bibliography{biblio.bib}
\setmainlanguage{french}

\begin{document}

\title{APA test}
\author{}
\date{}

\maketitle


\printbibliography
\nocite{*}

\end{document}

And here's an extract of my .bib

@online{duben_conferences_nodate,
    title = {Conférences \& ateliers},
    date = {2022},
    url = {https://remydubern.com/conferences/},
    author = {Duben, Remy},
    urldate = {2022-09-14},
    langid = {french},
}

I'm interested in any kind of solution.

1 Answer 1

0

Never modify files from your TeX distribution like /opt/texlive/2022/texmf-dist/tex/latex/biblatex-apa/ directly. Only work with renamed copies. If you modified the file already, it is not guaranteed that the following will work. If push comes to shove reinstall the relevant package biblatex-apa on your machine.


You want to reorder the calls to \printfield and \usebibmacro in the definition of the bibmacro url+urldate.

\documentclass[12pt,a4paper]{article}
\usepackage{polyglossia}
\usepackage{csquotes}
\usepackage[style=apa,dateera=astronomical,seconds=true,urldate=short]{biblatex}
\setmainlanguage{french}

\DefineBibliographyStrings{french}{
  urlfrom = {en ligne sur le site},
  urlseen = {consulté le},
}

\DeclareFieldFormat{url}{%
  \bibstring{urlfrom}\space\url{#1}}
\DeclareFieldFormat{urldate}{%
  \bibstring{urlseen}\space#1}

\renewbibmacro*{url+urldate}{%
  \ifthenelse{\iffieldundef{url}\OR\NOT\iffieldundef{doi}}
    {}
    {\printfield{url}%
     \setunit{\addspace\bibsentence}%
     \printurldate}}

\begin{filecontents}{\jobname.bib}
@online{duben_conferences_nodate,
  title   = {Conférences \& ateliers},
  date    = {2022},
  url     = {https://remydubern.com/conferences/},
  author  = {Duben, Remy},
  urldate = {2022-09-14},
  langid  = {french},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\printbibliography
\nocite{*}
\end{document}

Duben, R. (2022). Conférences & ateliers. En ligne sur le site https://remydubern.com/conferences/ Consulté le 14/09/2022.

You must log in to answer this question.

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