89

So I'm making this summary of a course where I've only been getting information from one book. Sometimes I want to show what page from the book a statement is taken from but I can't figure out a clean way of doing it.

Basically I would like to have something (in function) similar to:

"Statement[Book p123]"

Do you have any suggestions?

  • if you use only one book you can start by a note that say [number] refers to page number from the book. – touhami Feb 13 '16 at 12:05

1 Answers1

126

This is quite easy with BibLaTeX, though for a single reference, it may seem a little like overkill (then again, it'll get you familiar).

Here's a minimal example:

TeX File:

\documentclass{article}

\usepackage{biblatex}
\addbibresource{references.bib}

\begin{document}
Reference to the book: \cite{kopka2003guide}, and something found on some page:
\cite[p.~150]{kopka2003guide}.

% The content of the [] brackets is arbitrary.

\printbibliography
\end{document}

Bib File:

@book{kopka2003guide,
  title        = {Guide to LaTeX (Adobe Reader)},
  author       = {Kopka, H. and Daly, P.W.},
  isbn         = 9780321617743,
  year         = 2003,
  publisher    = {Pearson Education}
}

Output

output

JP-Ellis
  • 8,929
  • 2
  • 33
  • 49
  • how to cite mulit pages with the same method? lets say from page 150 to 153. – Sadegh Jan 15 '17 at 12:15
  • 11
    The text is arbitrary in the brackets, so you can just write \cite[pp.~150--153]{kopka2003guide}. – JP-Ellis Jan 15 '17 at 12:18
  • 5
    Could you explain why you use a tilde (~) instead of a normal whitespace between p. and the page number? What are the advantages over using a whitespace? – Phonolog Jun 19 '17 at 07:12
  • 24
    The tilde ~ is a non-breaking space. Typically, LaTeX will prefer to break a line after a full stop (since this usually indicates the end of sentence), but in this case we want to avoid that hence the use of ~. – JP-Ellis Jun 19 '17 at 07:15
  • 18
    biblatex users don't need the p.~, a language-dependent page prefix will be added automatically (if the style wants a page prefix): \cite[150]{kopka2003guide} – moewe Sep 19 '18 at 12:17
  • @moewe Do you know how to apply the same with '\supercite' rather than '\cite'? – hesham Sep 30 '18 at 22:09
  • @hesham What exactly do you mean? biblatex suppresses pre- and postnotes in \supercite. – moewe Oct 01 '18 at 05:50
  • @moewe Thanks I just figured it out. That exactly what I meant "biblatex suppresses pre- and postnotes in \supercite," I wanted to cite page numbers with \supercite so I had to remove that 'suppression'.Redifining \supercite as follows did the job:
    `\DeclareCiteCommand{\supercite}[\mkbibsuperscript]
    {\usebibmacro{cite:init}%
    

    \let\multicitedelim=\supercitedelim {,}\bibopenbracket \usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite:comp}} {} {\usebibmacro{cite:dump}\usebibmacro{postnote}\bibclosebracket} %`

    – hesham Oct 01 '18 at 21:24
  • 3
    The optional argument should be used carefully; I haven't seen the [1, p 150] notation used in literature yet; When using [1, eq. (20)], I got the comment "clarify if you mean eq. (20) in [1], or ref. [1] and eq. (20) in THIS document" as feedback, i.e. unless the notation is common in a field, it may be considered bad style. – kdb Jan 21 '19 at 18:24
  • cite[pg.~42]{Author-etc} doesn't work with \usepackage[strings]{underscore}. I haven't looked at that package to try to understand why that happens. – Van Snyder Apr 13 '21 at 01:31