1

Is there any way to redefine a variant of biblatex's \citeauthor[xx]{author} so that the postnote uses ", p./pp." instead of a colon ? "In Author (p. xx)..." (That way we do not have to repeat the year several times when it is self-understood.)

I tried with \DeclareDelimFormat and \DeclareFieldFormat inside a \DeclareCiteCommand{\citeauthorpage}, but I've no idea what i'm doing.

I think the best way would be to define another postnote macro: \newbibmacro{\authorpostnote}{...}

I also tried this but it does not work at all:

\DeclareDelimFormat[citeauthor]{postnotedelim}
{\mkpageprefix[pagination]{#1}}

MWE


\documentclass{article}

\usepackage[english]{babel}

\usepackage{xspace}

\usepackage[backend=biber,natbib=true,citestyle=ext-authoryear-comp,bibstyle=ext-authoryear,articlein=false,innamebeforetitle=true,dashed=false,useprefix=true,sortcites=false]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat{postnote}{\mknormrange{#1}} %remove p. in ref \DeclareFieldFormat{multipostnote}{\mknormrange{#1}} %remove pp. in ref \DeclareDelimFormat{postnotedelim}{\addcolon@\xspace\nobreak} %colon after year in ref

\begin{document} Lorem \textcite[380]{sigfridsson} ipsum \citeauthor[380]{sigfridsson}

\printbibliography \end{document}

enter image description here

  • 1
    In the standard styles there is no colon in \citeauthor and the default settings even give you "p."/"pp.". See https://gist.github.com/moewew/73bf18f4e39508acafd05b72f9d0b1a1. We can only offer solutions that work for your (non-standard) setup, if you show us a small example document with your relevant settings. – moewe May 08 '22 at 20:06
  • I just removed \mkpageprefix[pagination] from the definitions and modified the postnote delimiter. (I updated the original post.) – Vincent Krebs May 08 '22 at 20:13
  • 1
    Please turn your code into a fully compilable document. That way we all see the same thing and we don't have to guess the things that aren't there. Feel free to use my example from https://gist.github.com/moewew/73bf18f4e39508acafd05b72f9d0b1a1 as basis. – moewe May 08 '22 at 20:15
  • Done (many thanks for providing the template). – Vincent Krebs May 08 '22 at 20:25
  • 1
    So to be clear: You don't want "p."/"pp." in normal cites (where you also want a colon), but you want "p."/"pp." for \citeauthor? Isn't that terribly inconsistent? – moewe May 08 '22 at 20:26
  • When you cite the name of an author inside the text, then provide the year in parentheses, the colon is natural. However if only the name is here, not the year:
    • if you put the page number between parentheses, we could think it's a year;
    • if you put a colon directly after the opening parenthese, it's very strange.

    By the way in all the linguistics articles I read, the standard is year followed by colon, the "p./pp." style is quite uncommon.

    – Vincent Krebs May 08 '22 at 20:30
  • 1
    Mhhh, I guess I'd just never think to use \citeauthor to cite a work. \citeauthor is really just there to give the name of the author(s). There are styles like ext-authoryear-tcomp that can drop the year if it is not needed (because there is only one work by that author), but apart from that I think I would always keep the year: The labels don't get much longer that way. – moewe May 08 '22 at 20:33
  • In all the articles I read, the year is only mentioned once if the book/article is quoted several times within a few lines. I only want to be able to drop the name while still precising the page. It's a bit like "op. cit. : page" but simpler; linguists never use the latter. – Vincent Krebs May 08 '22 at 20:34
  • 1
    Interesting. I don't think I've ever seen this. But then different fields have vastly different conventions. And is it also normal to switch between colon/no "pp." and "pp." seamlessly? Anyway, it's late where I am, so an answer from me will have to wait until tomorrow, I'm afraid. – moewe May 08 '22 at 20:38
  • The colon is widely used in "author (year)" refs (much clearer in comp cites in my opinion); "p." is just an abreviation to precise the page wherever needed, including internal referencing. – Vincent Krebs May 08 '22 at 20:40
  • Please don't edit the solution into the question. That makes it harder to follow what is being asked and what the answer refers to. The question post should be just that: The question. It is perfectly fine to post an additional answer if you think it is different enough from the answer(s) you have received so far. If you want to draw attention to related issues, you can add a comment. The related post will then be linked in the "related" section in the right sidebar. – moewe Feb 14 '23 at 16:07

2 Answers2

1

It would be easily possible to change the delimiters just for citeauthor (that's what the context sensitive delimiter interface is for), but since you also need to change field formats (which are not naturally sensitive to the context), we end up redefining \citeauthor anyway and use a less sophisticated method.

\documentclass{article}

\usepackage[english]{babel}

\usepackage[ backend=biber, natbib=true, style=ext-authoryear-comp, articlein=false, innamebeforetitle=true, dashed=false, useprefix=true, sortcites=false, ]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat{postnote}{\mknormrange{#1}} \DeclareFieldFormat{multipostnote}{\mknormrange{#1}} \DeclareDelimFormat{postnotedelim}{\addcolon@\space\nobreak}

\DeclareFieldFormat{postnote:citeauthor}{% \mkbibparens{% \mkpageprefix[pagination][\mknormrange]{#1}}}

\newbibmacro*{postnote:citeauthor}{% \iffieldundef{postnote} {} {\setunit{\addspace}% \printfield[postnote:citeauthor]{postnote}}}

\DeclareCiteCommand{\citeauthor} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\ifciteindex {\indexnames{labelname}} {}% \printnames{labelname}} {\multicitedelim} {\usebibmacro{postnote:citeauthor}}

\begin{document} Lorem \textcite[380]{sigfridsson} ipsum \citeauthor[380]{sigfridsson}

\printbibliography \end{document}

Lorem Sigfridsson and Ryde (1998: 380) ipsum Sigfridsson and Ryde (p. 380)

You can find the original definitions of the macros involved in biblatex.def. \citeauthor is defined in ll. 2172-2181. postnote:citeauthor is modelled after postnote (ll. 2379-2383).

moewe
  • 175,683
  • 1
    @VincentKrebs The code shown at the end of the question "combines" definitions that would be appropriate for \DeclareDelimFormat and \DeclareFieldFormat into a single \newbibmacro. That cannot work. (For starters in \DeclareFieldFormat the #1 refers to the field content. In \newbibmacro there is no #1 unless you define a macro that takes an argument.) – moewe May 09 '22 at 14:48
0

Question Solved

  • I. Programming a Postnote dedicated to \citeauthor

\newbibmacro{authorpostnote}{\addcomma\space\nobreak\mkpageprefix[pagination][\mknormrange]

\DeclareCiteCommand{\citeauthorpage}[\mkbibparens] % Parencite with just author name! {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\ifciteindex {\indexnames{labelname}} {}% \printnames{labelname}} {\multicitedelim} {\usebibmacro{authorpostnote}}

  • II. Possessive Variant

I may, as a complement, draw attention to a wonderful piece of code which turns any cite command into a possessive, and which works perfectly in this case too.

Credits go to @Psychonaut and @Audrey, see this page:

https://tex.stackexchange.com/a/307461/262813.

\documentclass{article}

\usepackage[english]{babel}

\usepackage[ backend=biber, natbib=true, style=ext-authoryear-comp, articlein=false, innamebeforetitle=true, dashed=false, useprefix=true, sortcites=false, ]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat{postnote}{\mknormrange{#1}} \DeclareFieldFormat{multipostnote}{\mknormrange{#1}} \DeclareDelimFormat{postnotedelim}{\addcolon@\space\nobreak}

\DeclareNameWrapperFormat{labelname:poss}{#1's}

\DeclareFieldFormat{shorthand:poss}{% \ifnameundef{labelname}{#1's}{#1}}

\DeclareFieldFormat{citetitle:poss}{\mkbibemph{#1}'s}

\DeclareFieldFormat{label:poss}{#1's}

\newrobustcmd*{\posscitealias}{% \AtNextCite{% \DeclareNameWrapperAlias{labelname}{labelname:poss}% \DeclareFieldAlias{shorthand}{shorthand:poss}% \DeclareFieldAlias{citetitle}{citetitle:poss}% \DeclareFieldAlias{label}{label:poss}}}

\DeclareFieldFormat{postnote:citeauthor}{% \mkbibparens{% \mkpageprefix[pagination][\mknormrange]{#1}}}

\newbibmacro*{postnote:citeauthor}{% \iffieldundef{postnote} {} {\setunit{\addspace}% \printfield[postnote:citeauthor]{postnote}}}

\DeclareCiteCommand{\citeauthorpage} {\boolfalse{citetracker}% \boolfalse{pagetracker}% \usebibmacro{prenote}} {\ifciteindex {\indexnames{labelname}} {}% \printnames{labelname}} {\multicitedelim} {\usebibmacro{postnote:citeauthor}}

\newrobustcmd*{\citeauthorpagepos}{% \posscitealias% \citeauthorpage}

\begin{document}

Lorem \citeauthorpage[380]{sigfridsson} ipsum \citeauthorpagepos[380]{sigfridsson}

\printbibliography \end{document}

enter image description here