2

I use the authoryear citestyle, but I don't want it to print the year when citing an online source (but I do want the date in the bibliography).

biber version is 2.7

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber, citestyle=authoryear]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{stackexchange,
    author = "{StackExchange}",
    title = {Tex StackExchange},
    url = {tex.stackexchange.com},
    urldate = {2017-12-10}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

StackExchange is a Website\autocite{stackexchange}.

\end{document}

Citation without year.

1 Answer 1

3
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber, citestyle=authoryear]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{stackexchange,
    author = "{StackExchange}",
    title = {Tex StackExchange},
    url = {tex.stackexchange.com},
    urldate = {2017-12-10}
}
\end{filecontents}

\addbibresource{\jobname.bib}


\newbibmacro*{cite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{cite:label}%
        \setunit{\printdelim{nonameyeardelim}}}
       {\printnames{labelname}%
        \setunit{\printdelim{nameyeardelim}}}%
        \ifentrytype{online}{}{%
             \usebibmacro{cite:labelyear+extrayear}%
     }}
    {\usebibmacro{cite:shorthand}}}


\begin{document}

StackExchange is a Website\autocite{stackexchange} a.

\printbibliography

\end{document}

You must log in to answer this question.

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