最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

latex - Reorder Biblatex URL and urldate in bibliography - Stack Overflow

programmeradmin9浏览0评论

I use a biblatex bibliography where i have customized the urlseen message. However, I want to display the message after the URL, not in front. What im most confused about is that all examples i see from other questions have it in the order i want, as it would be default.

\documentclass[12pt]{article}
\usepackage[ngerman]{babel}

\usepackage[backend=biber,
style=apa,
sorting=nyvt,
giveninits=true,
maxbibnames=99,
maxcitenames=2]{biblatex}

\DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\space#1}}
\DefineBibliographyStrings{ngerman}{ %alles für Abrufdatum am
  urlseen = {Abrufdatum:}
}

\begin{filecontents}{references.bib}
@online{bdew_allgemeine_2022,
    title = {Allgemeine Festlegungen zu den {EDIFACT}- und {XML}-Nachrichten},
    url = {/},
    author = {{BDEW}},
    urldate = {2024-04-22},
    date = {2022-08-01}
    }

\end{filecontents}
\addbibresource{references.bib}
\begin{document}
\nocite{bdew_allgemeine_2022}
\newpage
\raggedright
\printbibliography[heading=bibintoc,title={Bibliography}]
\end{document}  

I use a biblatex bibliography where i have customized the urlseen message. However, I want to display the message after the URL, not in front. What im most confused about is that all examples i see from other questions have it in the order i want, as it would be default.

\documentclass[12pt]{article}
\usepackage[ngerman]{babel}

\usepackage[backend=biber,
style=apa,
sorting=nyvt,
giveninits=true,
maxbibnames=99,
maxcitenames=2]{biblatex}

\DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\space#1}}
\DefineBibliographyStrings{ngerman}{ %alles für Abrufdatum am
  urlseen = {Abrufdatum:}
}

\begin{filecontents}{references.bib}
@online{bdew_allgemeine_2022,
    title = {Allgemeine Festlegungen zu den {EDIFACT}- und {XML}-Nachrichten},
    url = {https://www.bundesnetzagentur.de/DE/},
    author = {{BDEW}},
    urldate = {2024-04-22},
    date = {2022-08-01}
    }

\end{filecontents}
\addbibresource{references.bib}
\begin{document}
\nocite{bdew_allgemeine_2022}
\newpage
\raggedright
\printbibliography[heading=bibintoc,title={Bibliography}]
\end{document}  
Share Improve this question edited Mar 23 at 18:34 samcarter_is_at_topanswers.xyz 39.3k5 gold badges58 silver badges77 bronze badges asked Mar 23 at 18:08 Lennart HerrmannLennart Herrmann 111 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

You could re-order the elements in the url+urldate macro:

\documentclass[12pt]{article}
\usepackage[ngerman]{babel}

\usepackage[backend=biber,
style=apa,
sorting=nyvt,
giveninits=true,
maxbibnames=99,
maxcitenames=2]{biblatex}

\DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\space#1}}
\DefineBibliographyStrings{ngerman}{ %alles für Abrufdatum am
  urlseen = {Abrufdatum:}
}

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

\begin{filecontents*}[overwrite]{references.bib}
@online{bdew_allgemeine_2022,
    title = {Allgemeine Festlegungen zu den {EDIFACT}- und {XML}-Nachrichten},
    url = {https://www.bundesnetzagentur.de/DE/},
    author = {{BDEW}},
    urldate = {2024-04-22},
    date = {2022-08-01}
    }
\end{filecontents*}

\addbibresource{references.bib}
\begin{document}
\nocite{bdew_allgemeine_2022}
\newpage
\raggedright
\printbibliography[heading=bibintoc,title={Bibliography}]
\end{document}  

发布评论

评论列表(0)

  1. 暂无评论