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.

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}

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.