1

I've a little question. For papers in university we're supposed to use the apa citation style, however one of our professors wants some slight changes to the apa style (he calls this style apa+), when it comes to online sources:

He requires the following style:

EUR-Lex. (2017). Democratic Deficit - EU-LEX. Retrieved from https://eur-lex.europa.eu/summary/glossary/democratic_deficit.html on 16 March 2018.

However when I use the default apa style it the citation looks like that:

EUR-Lex. (2017). Democratic Deficit - EU-LEX. Retrieved 16 March 2018, from https://eur-lex.europa.eu/summary/glossary/democratic_deficit.html

I somehow need to change the order and the prefixes of 'url' and 'urldate', but I've been looking through a lot of questions and articles but I couldn't find anything that worked for that specific case.

Here is my latex code:

\documentclass{scrartcl}
\usepackage[british]{babel}
\usepackage[style=apa, backend=biber, dateabbrev=false, urldate=long] {biblatex}
\usepackage{csquotes}


% used to remove the 'th' in the british date format
\DefineBibliographyExtras{british}{
% d-m-y format for long dates
\protected\def\mkbibdatelong#1#2#3{%
\iffieldundef{#3}
  {}
  {\stripzeros{\thefield{#3}}%
   \iffieldundef{#2}{}{\nobreakspace}}%
\iffieldundef{#2}
  {}
  {\mkbibmonth{\thefield{#2}}%
   \iffieldundef{#1}{}{\space}}%
\iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\stripzeros{\thefield{#1}}}}%
}

\bibliography{new.bib}


\begin{document}

ping.\parencite{EUR-LexDemocraticDeficitEULEXs.d.}

\printbibliography

\end{document}

And here the bib file:

@online{EUR-LexDemocraticDeficitEULEXs.d.,
  title = {Democratic {{Deficit}} - {{EU}}-{{LEX}}},
  url = {https://eur-lex.europa.eu/summary/glossary/democratic_deficit.html},
  urldate = {2018-03-16},
  year = {2017},
  author = {{EUR-Lex}},
}

I would be extremely thankful for any ideas!

2

We 'just' need to redefine the bibmacro url+urldate a bit. Since the APA has some peculiar ideas about URLs, that macro is not that short already. Unfortunately, "APA+" does not really make it shorter or simpler. Then we need a bit of trickery to get the period back if the entry ends in a URL with urldate.

\documentclass{scrartcl}
\usepackage[british]{babel}
\usepackage[style=apa, backend=biber, dateabbrev=false, urldate=long] {biblatex}
\usepackage{csquotes}


\DefineBibliographyExtras{british}{%
\protected\def\mkbibdatelong#1#2#3{%
  \iffieldundef{#3}
    {}
    {\stripzeros{\thefield{#3}}%
     \iffieldundef{#2}{}{\nobreakspace}}%
  \iffieldundef{#2}
    {}
    {\mkbibmonth{\thefield{#2}}%
     \iffieldundef{#1}{}{\space}}%
  \iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\stripzeros{\thefield{#1}}}}}

\DefineBibliographyStrings{british}{urlseen = {on}}

\DeclareFieldFormat{urldate}{\bibstring{urlseen}~#1}
\renewbibmacro*{url+urldate}{%
  \ifthenelse{\(\iffieldundef{url}\AND\iffieldundef{abstracturl}\AND\iffieldundef{abstractloc}\)\OR\NOT\iffieldundef{doi}}
    {}
    {\ifthenelse{\iffieldundef{abstracturl}\AND\iffieldundef{abstractloc}}
       {}
       {\printtext{\bibcpstring{abstract}}\addspace}%
       \iffieldequalstr{entrysubtype}{{DVD}}
         {\printtext{\bibstring{available}}}
         {\printtext{\bibstring{retrieved}}}%
        \setunit{\addspace}%
        \printtext{\bibstring{from}}%
        \setunit*{\addspace}%
        \printfield{urldescription}%
        \setunit*{\addcolon\addspace}%
        \printfield{url}%
        \printfield{abstractloc}%
        \printfield{abstracturl}%
        \setunit{\addspace}%
        \iffieldundef{urlyear}
          {}
          {\printtext{\printurldate}}}}

\usepackage{xpatch}
\xpatchbibdriver{online}
  {\iffieldundef{url}{}{\renewcommand*{\finentrypunct}{\relax}}}
  {\ifboolexpr{not test {\iffieldundef{url}} and test {\iffieldundef{urlyear}}}{\renewcommand*{\finentrypunct}{\relax}}{}}
  {}{}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{EUR-LexDemocraticDeficitEULEXs.d.,
  title = {Democratic {{Deficit}} - {{EU}}-{{LEX}}},
  url = {https://eur-lex.europa.eu/summary/glossary/democratic_deficit.html},
  urldate = {2018-03-16},
  year = {2017},
  author = {{EUR-Lex}},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
ping.\parencite{EUR-LexDemocraticDeficitEULEXs.d.,worman,sigfridsson}

\printbibliography
\end{document}

enter image description here

  • 3
    It's really such a waste of anybody's time that some professors seem to think it important to have their students apply their cosmetic changes to an otherwise established style to come up with monsters such as APA+. – moewe Apr 9 '18 at 15:13
  • I had tried to deal with this one, but couldn't sort out whatever was happening to the final punctuation. What's the deal with the frequent \renewcommand*{\finentrypunct}{\relax} to be found in biblatex-apa? What's their purpose? – gusbrs Apr 9 '18 at 15:34
  • @gusbrs I think that is to suppress a final period in case the reference ends with a URL. Presumably to avoid confusion about whether the dot belongs to the URL or not. – moewe Apr 9 '18 at 15:42
  • That's what I supposed initially, but then I saw a number of them, including after abstractloc (whatever that is). But looking closer after your comment everything I recognize seems to fit in your case (eprint, doi etc). Thanks! – gusbrs Apr 9 '18 at 16:01
  • Thank you so much @moewe! Can you recommend me a good documentation for those citation style edits? I'd love to get some understanding of it. – lilo Apr 9 '18 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.