10

BibLaTeX - How to cite with only year inside parenthesis?

(but only in some occasions - without changing how parencite works for the remaining citations)

I found some questions/answers but they either used natbib or were for different situations.

I thought about just trying to change the format of /citeyear but it doesn't create a link to the bibliography. Is it its normal behavior?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=authoryear,dashed=false,backref=true,firstinits=true]{biblatex}
\renewcommand\nameyeardelim{\addcomma\addspace}
\DefineBibliographyStrings{portuguese}{%
  url={Disponível em},
}
\DeclareFieldFormat{url}{\bibstring{url}\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{#1}}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

\addbibresource{\jobname.bib}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}

@book{Nunes,
    author = {Mister X},
    title = {Book Z english ensligh},
    year = {2013},
    location = {Lisboa, Portugal},
    note = {Dissertação para obtenção do Grau de Mestre em Engenharia Informática e de Computadores. Instituto Superior Técnico, Universidade de Lisboa},
}
\end{filecontents}

\begin{document}

Tal como Nunes no seu livro Z portuguese portuguese \citeyear{Nunes}

\printbibliography

\end{document}

I'd like to get the following:

Tal como Nunes no seu livro Z portuguese portuguese (2013)

(with the normal link to the bibliography)

3
  • 2
    Why not simply (\citeyear)? Apr 4, 2016 at 18:55
  • 3
    Because \citeyear doesn't create a link to the bibliography like \parencite or \textcite
    – JCML
    Apr 4, 2016 at 19:00
  • As of time of writing, for me \citeyear does create a link to the bibioliography.
    – rmwenz
    Sep 26, 2022 at 0:36

2 Answers 2

11

You can use the starred version of \cite or \parencite. Those commands are defined for authoryear- and authortitle-like styles and simply omit the name.

\parencite*{sigfridsson} or \cite*{aksin}

If you are using the natbib compatibility mode, this function is overruled by natbib's behaviour to temporary override the maxnames function and print all authors in the starred versions. You will have to give the command a new name, the exact definition depends on the style, for authoryear it is

\DeclareCiteCommand*{\nparencite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{citeyear}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
0

It's now possible to simply use \citeyear which, along with other natbib citation commands, creates a bibliography link.

See the Overleaf natbib documentation for a full list of commands

You must log in to answer this question.

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