# Refer to citation directly when using Biblatex numeric-comp style

My preferred citation style using biblatex is the numeric-comp style with theautocite=superscript option. However occasionally I need to refer to a specific reference in text and thus would like to switch to something like authoryear in this instance.

Using \textcite just negates the superscript option. Is it possible to write a new function that allows me to mix the two citation styles?

MWE:

\documentclass{report}

\begin{filecontents}{example.bib}
@article {Example_article,
AUTHOR = {Author, A. B.},
TITLE = {A example paper},
JOURNAL = {Example journal},
VOLUME = {1},
YEAR = {2018},
NUMBER = {1},
PAGES = {1-100}}
\end{filecontents}

\usepackage[style=numeric-comp,
autocite=superscript,
backend=biber
]{biblatex}

\begin{document}

I normally cite like this \autocite{Example_article} which is great but sometimes I want to do this \textcite{Example_article} but it doesn't seem to to work.

\end{document}


This produces:

I normally cite like this1 which is great but sometimes I want to do this Author [1] but it doesn’t seem to to work.

when what I would like is:

I normally cite like this1 which is great but sometimes I want to do this Author (2018) but it doesn’t seem to to work.

preferably only one author et al. (year) is listed when there are multiple authors.

• It doesn't make sense to use Author (2018) unless there's a bibliography entry labelled something like Author, First names (2018). What would the label refer to? Author-year is just like a numerical style: it uses labels in the text and those labels match sources in the bibliography. If nothing is labelled that way, it makes no sense to use the label in the text. Also, the bibliography is organised to make the labels easy to find: 1, 2 ... for numeric; A, B ... fro author-year. – cfr Feb 16 '18 at 3:29
• I see your point in that they are conflicting series of labeling. However to refer to something in text as "reference [1]" as in "as discussed by reference [1]" seems jarring as the number 1 is only assigned to it in the context of my document while Author (2018) specifies attributes that are specific to the document. I guess I'm not necessarily looking for a "citation" as much as a method to link text to a specific bibliography entry which after all has the author and year specified following the 1. – G_T Feb 16 '18 at 3:44
• The way \textcite does it is right. If I want to follow up the reference, I expect you to tell me the label which is assigned to that reference in your bibliography. I don't expect to have to trawl through half a dozen pages of sources searching for the relevant one. And it isn't about saying by reference. \textcite will give you by Author. It will just also give you the label rather than some fragment of the content of an entry with a label you don't bother to share. The point of these systems is to make it easy to find stuff. If the year's important, include it, but also the label. – cfr Feb 16 '18 at 4:26


\documentclass{report}

\usepackage[style=numeric-comp,
minbibnames=3,
maxbibnames=5,
maxcitenames=2,
mincitenames=1,
autocite=superscript,
backend=biber,
labeldateparts,
]{biblatex}

\usepackage{hyperref}

\newbibmacro{aycite}{%
\printtext[bibhyperref]{%
\printnames{labelname}%
\printtext[parens]{%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\printlabeldate
\printfield{labelprefix}%
\printfield{labelnumber}%
\ifnumequal{\value{citecount}}{\value{citetotal}}
{\usebibmacro{postnote}}
{}}}}

\DeclareCiteCommand{\aycite}
{}
{\usebibmacro{citeindex}%
\usebibmacro{aycite}}
{\multicitedelim}
{}

\begin{document}

\printbibliography
\end{document}


I have come up with an answer which I think is satisfactory. In the process these two questions were helpful: Question 1 and Question 2

I should also say I agree with the comments from @cfr about reference labels but this was not at the top of my mind as I usually use the hyperref package so citations and references are linked. I usually just click on citations as opposed to using them as keys in a reference table. I have thus incorporated the labels into my solution.

This is what I've got:

\documentclass{report}

\begin{filecontents}{example.bib}
@article {Example_article,
AUTHOR = {Author, A. B.},
TITLE = {A example paper},
JOURNAL = {Example journal},
VOLUME = {1},
YEAR = {2018},
NUMBER = {1},
PAGES = {1-100}}
\end{filecontents}

\usepackage[style=numeric-comp,
minbibnames=3,
maxbibnames=5,
maxcitenames=2,
mincitenames=1,
autocite=superscript,
backend=biber
]{biblatex}

\usepackage{hyperref}

\DeclareCiteCommand{\tabcite}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}%
\usebibmacro{postnote}}

\begin{document}

\printbibliography

\end{document}


which produces:

• It makes little sense to define \citelink to take two arguments, when it only uses one. Now you always need to carry around an empty argument. Defining a new command that expands to \citeauthor{#1} (\citeyear{#1}; ref. \tabcite{#1}) is really bad practice. Check out what happens if you cite two entries with \citelink{sigfridsson,worman}{}. You'll also find that this approach does not support pre and postnotes at all. – moewe Feb 16 '18 at 6:53