0

The journal I'm writing for doesn't allow in text page number references.

I'd like to type \cite[p. 123]{abc2001}

Right now this shows up as something like

[p. 123, 1]

I'd like to have it show up as a numerical square bracket reference like,

[1]

but with the page numbers included in the bibliography reference such as

Doe, J. The Journal of Examples, 'a study on abc 123', 2001, p. 123

Can this be done with natbib or another package?

  • 1
    Could you please put a MWE. โ€“ A Diyanat Jul 28 '19 at 02:30
  • 1
    Suppose you cite the same source twice with different page numbers (\cite[380]{sigfridsson} and later \cite[382]{sigfridsson}). What should happen in the bibliography? How would your readers tell which page reference belongs where? โ€“ moewe Jul 28 '19 at 07:12
  • 1
    Anyway, I'm not aware of any package that offers these function out of the box. It should theoretically be possible to implement a feature like this with both BibTeX-based bibliographies and biblatex, but if I'm allowed to choose which system I use I'd definitely go for biblatex. โ€“ moewe Jul 28 '19 at 08:09

1 Answers1

1

There are some conceptual issues with a style like this.

What if you cite the same source multiple times with several different postnotes? How would that be shown in the bibliography? How would a reader know which postnote belongs to which citation?

If you cite the same source multiple times it is much easier for a reader to have the page references directly in the citation. I only need to look up which work "[1]" is once and can then easily understand "[1, p. 234]" and "[1, p. 235]". But if all references are "[1]" and need to check the bibliography every time for a more specific pinpoint location, I'm just wasting my time.

Here is a proof of concept with biblatex based on ideas from Customize backref similar to Wikipedia to show that this works. I 'solved' the issues mentioned above using links to the specific occurrences. This sort of works for a PDF on screen, but of course badly breaks down in print.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{hyperref}

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

\renewbibmacro{postnote}{}

\makeatletter
\DeclareFieldFormat{bibhypertarget}{%
  \bibhypertarget{cbx:instcount:\the\value{instcount}}{#1}}

\def\abx@aux@pnbackref#1#2#3#4{%
  \listcsgadd{cbx@pnbackref@#1@#2}{#3}%
  \csgdef{cbx@pnbackref@postnote@#1@#2@#3}{#4}}

\def\blx@addpnbackref#1#2{%
  \if@filesw
    \protected@write\@mainaux{}{%
      \string\abx@aux@pnbackref
        {\the\c@refsection}{#1}{\the\value{instcount}}
        {\detokenize{#2}}}%
    \fi}

\def\blx@addpnbackref@helper#1{\blx@addpnbackref{\thefield{entrykey}}{#1}}

\def\blx@instcount@label{%
  \label{cbx@instcount@\the\value{instcount}}}

\AtEveryCitekey{%
  \iffieldundef{postnote}
    {}
    {\expandafter\blx@addpnbackref@helper\expandafter{\abx@field@postnote}}%
  \blx@instcount@label
}

\newcommand*{\pnbackref@prnt@pn}[2]{%
  \DeclareFieldFormat{bibhypertarget}{\bibhyperlink{cbx:instcount:#2}{##1}}%
  \printtext[bibhypertarget]{%
    $\uparrow$\printtext[postnote]{#1}}}

\newbibmacro*{pnbackref:item}[1]{%
  \ifcsvoid{cbx@pnbackref@postnote@\the\c@refsection @\thefield{entrykey}@#1}
    {}
    {\letcs\cbx@tempa{cbx@pnbackref@postnote@\the\c@refsection @\thefield{entrykey}@#1}%
     \expandafter\pnbackref@prnt@pn\expandafter{\cbx@tempa}{#1}%
     \setunit{\addcomma\space}}}

\newbibmacro*{pnbackref}{%
  \ifcsundef{cbx@pnbackref@\the\c@refsection @\thefield{entrykey}}
    {}
    {\forlistcsloop{\usebibmacro{pnbackref:item}}
       {cbx@pnbackref@\the\c@refsection @\thefield{entrykey}}}}

\renewbibmacro*{pageref}{\usebibmacro{pnbackref}}
\makeatother

\renewcommand*{\bibpagerefpunct}{\addperiod\space}

\renewbibmacro*{cite}{%
  \printtext[bibhypertarget]{%
    \printtext[bibhyperref]{%
      \printfield{labelprefix}%
      \printfield{labelnumber}%
      \ifbool{bbx:subentry}
        {\printfield{entrysetcount}}
        {}}}}

\addbibresource{biblatex-examples.bib}


\begin{document}
Lorem~\autocite[380]{sigfridsson}
ipsum~\autocite[12-14]{worman}
dolor~\autocite{nussbaum}
sit~\autocite[381]{sigfridsson}
amet~\autocite[382]{sigfridsson}.

\clearpage

Lorem~\autocite[27-30]{geer}
ipsum~\autocite[\textbf{รค}]{worman}
dolor~\autocite[34]{pines}
sit~\autocite[382]{sigfridsson}
amet~\autocite[383]{sigfridsson}.

Dolor~\autocite[380-381]{worman}

\printbibliography
\end{document}

Citations without postnotes, page references appear in the bibliography only.

moewe
  • 175,683