3

I'd like to not print the year (nor a possible author), but only for Online types of citations.

Here's an illustration of what I would like to remove (in red):

enter image description here

Here's my MWE:

% arara: xelatex
% arara: biber
% arara: xelatex

\documentclass{scrartcl}
\usepackage[backend=biber,style=authoryear,sorting=nty]{biblatex}
\addbibresource{mwe.bib}

\begin{document}
Example\cite{tab:test}

\printbibliography
\end{document}

mwe.bib:

@Online{tab:test,
  Url                      = {http://www.example.com/images/image.jpg},
  Urldate                  = {2014-02-25},
  Timestamp                = {2014.06.13},
  Note                     = {Table \ref{tab:test}}
}

This question is motivated with difficulties in resolving Custom biblatex style for citing images and tables, and represents a narrower requirement

1 Answer 1

2

This will remove the date. But note that this code will print only the 'Note', 'URL' and 'URLdate' fields in the bibliography for bib items of type 'online', even if there are other fields

\documentclass{scrartcl}
\usepackage[colorlinks, urlcolor=black]{hyperref} %if you want the link to be clickable

\usepackage{filecontents} 
\begin{filecontents} {mwe.bib}
@online{tab:test,
  author                   = {Doe, John},
  Url                      = {http://www.example.com/images/image.jpg},
  Urldate                  = {2014-02-25},
  Timestamp                = {2014.06.13},
  Note                     = {Table \ref{tab:test}}, %not sure I understand why you are cross-referencing here
  year                     = {2014}, %this is necessary for the in-text citation to work
}
\end{filecontents}

\usepackage[backend=biber, backref=true, style=authoryear, sorting=nty]{biblatex}
\addbibresource{mwe.bib}

\DeclareBibliographyDriver{online}{%this defines what will be printed in the bibliography for entries of type 'online'
  \usebibmacro{note+pages}
  \setunit{\addperiod\addspace}%Period+space after 'Note' field
  \usebibmacro{url+urldate}
  \usebibmacro{finentry}}

\begin{document}
Example \citeyear{tab:test} %This lets you cite only the year even if there is an author listed in your bib file, as opposed to \cite

\printbibliography
\end{document}

result

1
  • This is more than enough for my use case. I now just have to figure out how to resolve the reference.
    – ipavlic
    Commented Jun 14, 2014 at 23:21

You must log in to answer this question.

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