0

Edit: I tried making a MWE, I hope it is correct this way. If not, please let me know!

.tex document:

\documentclass[a4paper,12pt]{scrreprt}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{url}
\usepackage{csquotes}

\usepackage[
    backend=biber,
    style=authoryear,
    bibstyle=authortitle,
    sortlocale=de_DE,
    natbib=true,
    url=true, 
    doi=true,
    eprint=false
]{biblatex}

\DefineBibliographyStrings{german}{% 
urlseen = {Stand:}, 
}

\renewbibmacro*{cite}{% 
  \iffieldundef{shorthand} 
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} 
       {\usebibmacro{cite:label}% 
        \setunit{\addspace}} 
       {\printnames{labelname}% 
        \setunit{\addspace}% 
        \ifnamesequal{labelname}{editor} 
          {\printtext[parens]{\usebibmacro{editorstrg}}} 
          {}% 
        \setunit{\nameyeardelim}}% 
     \ifentrytype{online} 
     {\setunit{\addcomma\space}% 
        \usebibmacro{urldate}
     \ifnameundef{labelname}
       {\setunit{\addcomma\space}% 
        \usebibmacro{url}
        } 
       {}} }
    {\usebibmacro{cite:shorthand}}}   

\addbibresource{MWE.bib} 

\begin{document}

This is cited from a book \footcite[Vgl.][32\psq]{fritzsch}

This is cited from a website \footcite[Vlg.][]{paulip}

\printbibliography 

\end{document}

.bib document:

@Online{paulip,
  title   = {Pauli-Prinzip},
  url     = {http://www.chemie.de/lexikon/Pauli-Prinzip.html},
  urldate = {2018-08-12},
}

@Book{fritzsch,
  author    = {Harald Fritzsch},
  title     = {Elementarteilchen - Bausteine der Materie},
  year      = {2004},
  publisher = {Verlag C.H. Beck},
  location  = {München},
}

I'm using biblatex and have some issues with citing the way I am required to.

There are three things I need to change, but I am totally lost on how I can do it.

  1. The "renewbibmacro" snippet of code (which I found online when I wanted to display the url and the date when the url was seen in footcites too when the author is unknown) also changed that the year suddenly isn't shown on book entries anymore, which was not intended. A book footcite should look like this:

enter image description here

  1. I would like the "Stand: urldate" to be displayed after the url and if possible in square brackets [], not round ones ()

  2. What do I need to do so that the last and first name are not separated by a comma in the bibliography and there is a comma instead of a period after the name? Meaning instead of

    "Fritzsch, Harald. Elementarteilchen - Bausteine der Materie. München: Verlag C.H. Beck, 2004."

    it is

    "Fritzsch Harald, Elementarteilchen - Bausteine der Materie. München: Verlag C.H. Beck, 2004."

  • 1
    Welcome to TeX SX! Please post a complete (yet minimal) code reproducing the problem. – Bernard Feb 16 at 19:53
  • It is much easier to answer questions like this if the code is not posted in several snippets, but as one fully compilable document (a so-called MWE: tex.meta.stackexchange.com/q/228/35864 or MWEB tex.meta.stackexchange.com/q/4407/35864). It is also generally strongly preferred to ask only one question per question and not several (related, no doubt) questions in one. See tex.meta.stackexchange.com/q/7425/35864 – moewe Feb 16 at 19:58
  • Thank you for your comments! I tried making a (hopefully correct) MWE and will remember to post separate questions for every single problem next time. – Loviare Feb 16 at 20:56
  • Did you find the snippet for the URL in golatex.de/… or somewhere else? Do you also want to retain the feature of that code to write "editor"/"Herausgeber" after the name also in citations? – moewe Feb 16 at 21:11
  • I believe it was that website, but to be honest I'm not 100% sure. And I don't want "editor"/"Herausgeber" written after the name, I didn't even realise the code had that feature. – Loviare Feb 16 at 21:19
1

You may want to try the following.

The comma between family and given name is controlled with \revsdnamepunct, the comma between label/sort name and title with nametitledelim.

I have modernised the cite bibmacro redefinition based on the current definition in authoryear.cbx. The only difference to the original is the added block

     \ifboolexpr{test {\ifnameundef{labelname}} and test {\ifentrytype{online}}}
       {\setunit{\addcomma\space}%
        \usebibmacro{url+urldate}}
       {}

that prints URL and access date for @online entries without (author/label) name.

The \DeclareFieldFormat{urldate} bit takes care of the square brackets. Compare the new definition to the original in biblatex.def.

The \DeclareLabeldates make sure that the urldate is not used to populate the label date used for citations and suppresses the 'n.d.'/nodate string for @online entries.

\documentclass[a4paper,12pt]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{url}
\usepackage{csquotes}

\usepackage[
    backend=biber,
    citestyle=authoryear,
    bibstyle=authortitle,
    sorting=nyt,
    eprint=false
]{biblatex}

\renewcommand*{\revsdnamepunct}{}
\renewcommand*{\mkbibnamefamily}{\textsc}
\DeclareDelimFormat[bib]{nametitledelim}{\addcomma\space}

\DeclareDelimFormat{nameyeardelim}{\addcomma\space}

\renewbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{cite:label}%
        \setunit{\printdelim{nonameyeardelim}}}
       {\printnames{labelname}%
        \setunit{\printdelim{nameyeardelim}}}%
     \usebibmacro{cite:labeldate+extradate}%
     \ifboolexpr{test {\ifnameundef{labelname}} and test {\ifentrytype{online}}}
       {\setunit{\addcomma\space}%
        \usebibmacro{url+urldate}}
       {}}
    {\usebibmacro{cite:shorthand}}}

\DefineBibliographyStrings{german}{%
  urlseen = {Stand},
}

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

\DeclareLabeldate{%
  \field{date}
  \field{year}
  \field{eventdate}
  \field{origdate}
  \literal{nodate}
}

\DeclareLabeldate[online]{%
  \field{date}
  \field{year}
  \field{eventdate}
  \field{origdate}
}

%\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{paulip,
  title   = {Pauli-Prinzip},
  url     = {http://www.chemie.de/lexikon/Pauli-Prinzip.html},
  urldate = {2018-08-12},
}
@book{fritzsch,
  author    = {Harald Fritzsch},
  title     = {Elementarteilchen},
  subtitle  = {Bausteine der Materie},
  year      = {2004},
  publisher = {Verlag C.H. Beck},
  location  = {München},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
This is cited from a book \footcite[Vgl.][32\psq]{fritzsch}

This is cited from a website \footcite[Vlg.][]{paulip}

\printbibliography
\end{document}

Vgl. Fritzsch, 2004, S. 32 f.//Vlg. Pauli-Prinzip, url: http : / / www . chemie . de / lexikon / Pauli - Prinzip . html [Stand: 12.08.2018].

  • This is exactly how it is supposed to look; thank you so much for helping a LaTeX beginner out, I honestly appreciate it. ^^ – Loviare Feb 16 at 21:42

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.