[Tex/LaTex] print cited page range in bibliography

biblatex

I have to print the actually cited page range of cited books in the bibliography. example
The suffix [10--20] should be compressed to 10 f. or 10 ff., but in the bibliography printed as p. 10--20
I've got no clue how to achieve it, I searched for commands but without result.
compress page range gives only an example how to compress page ranges from 10-19 to 10-9

One possible pathway to the solution could be via this MWE:

\documentclass{scrreprt}
\usepackage[latin1]{inputenc}
\usepackage[ 
bibstyle=test, citestyle=test 
]{biblatex}

\begin{filecontents*}{books.bib}
@BOOK{scrubs,
  author = {John Dorian},
  title = {How to endure girls names},
  year = {2009},
  edition = {8}
  publisher = {Cox publishing}
}

\end{filecontents*}

\bibliography{books.bib}

\begin{document}
\cite[10--20]{scrubs}

\printbibliography
\end{document}

and my bbx-file

\newbibmacro*{begentry}{}
\newbibmacro*{finentry}{\finentry}

\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location}%
  \newunit\newblock
  \usebibmacro{p.}
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \usebibmacro{date}%
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}}



\newbibmacro*{maintitle+title}{%
  \iffieldsequal{maintitle}{title}
    {\clearfield{maintitle}%
     \clearfield{mainsubtitle}%
     \clearfield{maintitleaddon}}
    {\iffieldundef{maintitle}
       {}
       {\usebibmacro{maintitle}%
    \newunit\newblock
    \iffieldundef{volume}
      {}
      {\printfield{volume}%
           \printfield{part}%
           \setunit{\addcolon\space}}}}%
  \usebibmacro{title}%
  \newunit}

\newbibmacro*{maintitle+booktitle}{%
  \iffieldundef{maintitle}
    {}
    {\usebibmacro{maintitle}%
     \newunit\newblock
     \iffieldundef{volume}
       {}
       {\printfield{volume}%
        \printfield{part}%
        \setunit{\addcolon\space}}}%
  \usebibmacro{booktitle}%
  \newunit}

\newbibmacro*{volume}{%
  \printfield{volume}%
  \setunit*{\adddot}%
  }


\newbibmacro*{series+number}{%
  \printfield{series}%
  \setunit*{\addspace}%
  \printfield{number}%
  \newunit}

\newbibmacro*{publisher+location}{%
    \iflistundef{publisher}
    {}
  \printlist{publisher}%
  \setunit*{\addcomma\space}
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \newunit}

\newbibmacro*{chapter+pages}{%
  \printfield{chapter}%
  \setunit{\bibpagespunct}%
  \printfield{pages}%
  \newunit}

\newbibmacro*{addendum+pubstate}{%
  \printfield{addendum}%
  \newunit\newblock
  \printfield{pubstate}}



\newbibmacro*{p.}{%
  \printtext{p. }}
\endinput

and my cbx-file

% $Id: test.cbx,v 1.7 2011/11/13 19:09:07 lehman stable $

\ProvidesFile{test.cbx}
[\abx@cbxid $Id: verbose-inote.cbx,v 1.7 2011/11/13 19:09:07 lehman stable $]

\providebool{bbx:subentry}

\DeclareFieldFormat{entrysetcount}{\mknumalph{#1}}
\newbibmacro*{cite}{%
  \printtext[bibhyperref]{%
    \printfield{prefixnumber}%
    \printfield{labelnumber}%
    \ifbool{bbx:subentry}
      {\printfield{entrysetcount}}
      {}}}

\DeclareCiteCommand{\cite}[\mkbibbrackets]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\AtEveryBibitem{\clearfield{month}}
\endinput

Best Answer

You need to distinguish between the pages you used from the book (to be printed in the bibliography) and the pages you are actually citing. For the former, use the pages field (described in the biblatex manual, section 2.2.2), for the latter use the optional argument to \cite.

The following code

\documentclass{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage{biblatex}

\begin{filecontents*}{books.bib}
@BOOK{scrubs,
  author = {John Dorian},
  title = {How to endure girls names},
  year = {2009},
  edition = {8},
  publisher = {Cox publishing},
  pages={10--20}
}

\end{filecontents*}

\bibliography{books.bib}

\begin{document}
\cite[10f.]{scrubs}

\printbibliography
\end{document}

results in

excerpt of compiled code