I'm trying to create a custom \cite command that takes in three arguments: the book/article name and the initial and final pages of the part that I'm citing. This is the code so far:


So if the input is


the output is

enter image description here

I'd like to modify is so that that output corresponds to the input

\cite{book_1, 64}

if the initial and final cited pages are the same, and

\cite{book_1, 64-65}

if they're different. Is there a way to do this?

  • Why do you want to do this, rather than just use the optional arguments to the \cite command? e.g. \cite[p.64]{book1}
    – Seamus
    Commented Feb 8, 2019 at 16:34

1 Answer 1


Personally, I don't think the usual input


is too complicated or far inferior to \cite{key}{64}{65}.

Here is a solution that only slightly modifies the macro \mknormrange to drop the second page number if it is equal to the first. We then need to change around the order of commands in the postnote formats to give expected output with respect to "p."/"pp.". Then you can use the standard biblatex postnote syntax


\usepackage[style=authoryear, backend=biber]{biblatex}







(Sigfridsson and Ryde 1998, p. 64)//(Sigfridsson and Ryde 1998, pp. 64–65)

You must log in to answer this question.

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