16

I'd like to add a citation which looks like this:

[_Text_ Citation_01, pages]

For example:

[See: 155, pp.89--99]

How can I do this using standard \cite{} command (without natbib or anything else)?

P.S. The text might be in Cyrillic!

2
  • Please, can you add some more information about what you're using for citations? Just the default LaTeX commands or natbib or whatever?
    – egreg
    Jan 3 '13 at 18:25
  • @egreg, just standard \cite{} command, nothing special Jan 3 '13 at 18:34
20

A recommendable choice would be to use natbib or better yet biblatex. Let's see with natbib:

\begin{filecontents*}{\jobname.bib}
@book{01,
 author={Caesar, Gaius Iulius},
 title={Commentarii de bello {Gallico}},
 year={703},
}
\end{filecontents*}
\documentclass{article}
\usepackage[numbers,square]{natbib}

\begin{document}

Here's a citation \cite[See:][p.~2]{01}

Another: \cite[p.~3]{01}.

Another: \cite{01}.

\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}

The \cite command has now two optional argument. When only one is present, it's the "post-citation"; if two are present, the first is the "pre-citation" and the second one the post-citation.

Without extra packages you can still emulate this behavior:

\begin{filecontents*}{\jobname.bib}
@book{01,
 author={Caesar, Gaius Iulius},
 title={Commentarii de bello {Gallico}},
 year={703},
}
\end{filecontents*}
\documentclass{article}

\makeatletter
\let\cite\relax
\DeclareRobustCommand{\cite}{%
  \let\new@cite@pre\@gobble
  \@ifnextchar[\new@cite{\@citex[]}}
\def\new@cite[#1]{\@ifnextchar[{\new@citea{#1}}{\@citex[#1]}}
\def\new@citea#1{\def\new@cite@pre{#1}\@citex}
\def\@cite#1#2{[{\new@cite@pre\space#1\if\relax\detokenize{#2}\relax\else, #2\fi}]}
\makeatother

\begin{document}

Here's a citation \cite[See:][p.~2]{01}

Another: \cite[p.~3]{01}.

Another: \cite{01}.

Again: \cite[See:][]{01}

\bibliographystyle{plain}
\bibliography{\jobname}

\end{document}

In case you want only the "pre-citation", use

\cite[See:][]{01}

with an empty second optional argument.

enter image description here

5
  • @egreg, +1. Professional solution.
    – Sigur
    Jan 3 '13 at 19:22
  • Just one more thing... How to modify this code (the part which doesn't use extra packages) in order to make a citation [See: 1], that is, WITHOUT page number(s)? Jan 3 '13 at 19:39
  • @Physicsworks I'd prefer the natbib solution; however I've added also the "package free" version.
    – egreg
    Jan 3 '13 at 20:23
  • @egreg, I've already tried this, unfortunately, it adds a comma after citation number, so it looks like this: [See: 1,]. P.S. Sorry, I need this to be done without extra packages... Jan 3 '13 at 20:44
  • @Physicsworks I changed the code. With the present version no extra comma is added.
    – egreg
    Jan 3 '13 at 20:46
2

What do you think about a new command \Cite

\newcommand{\Cite}[2]{[See~\cite{#1},~#2]}
5
  • This adds the text AFTER Citation_01, not before, as I'd like to have Jan 3 '13 at 18:24
  • I believe that "155" in the OP's question refers to the number automatically generated by \cite.
    – egreg
    Jan 3 '13 at 18:24
  • @egreg, you're right Jan 3 '13 at 18:25
  • Oh, I see. My fault. Edited.
    – Sigur
    Jan 3 '13 at 18:25
  • @Sigur, Thanks, it works, although it adds extra [] Jan 3 '13 at 19:12
2

I'm sometimes required to use amsrefs and have been looking for something analogous to natbib's built-in \cite[pre][post]{label} for a while. Since I haven't seen it online or in the package documentation (as of 2018), I'm posting the solution here.

It turns out you can just write pre-citation and/or post-citation text inside a \citelist command, i.e., \citelist{cf. \cite{morgan-tian}} prints out: [cf. MT].

\documentclass{article}
\usepackage[shortalphabetic]{amsrefs}

\begin{document}
Theorem 1 follows from 
Lemma 2 \cite{morgan-tian}*{1.1} and 
Proposition 3 \citelist{cf. \cite{morgan-tian}*{1.2}}.

\begin{bibdiv}
\begin{biblist}
\bib{morgan-tian}{book}{
  author={Morgan, John},
  author={Tian, Gang},
  title={Ricci flow and the Poincar\'e conjecture},
  series={Clay Mathematics Monographs},
  volume={3},
  publisher={American Mathematical Society},
  place={Providence, RI},
  date={2007},
}
\end{biblist}
\end{bibdiv}

\end{document}

1

As noted by others, natbib or biblatex are the way to go. But if you have restrictions like me, you could try this option, which I think is a little easier to understand than the other answers here.

I couldn't get the usual precitation \cite[See: ][]{Citation_01} to work for my case, which is an IEEE computer society (compsoc) conference paper - although it has worked for me in the past with other formats. The prescribed preamble includes: \usepackage[nocompress]{cite}.

I ended up going with this hack:

\renewcommand\citeleft{[See:~}
...as proven in~\cite{Citation_01}. 
\renewcommand\citeleft{[}
1

Although it has been a while I would like to suggest a solution which I used for my \cite problem. In our documentation we should cite our reference documents as [RD-n] and for applicable documents [AD-n]. So here is my solution for that:

\DeclareFieldFormat{labelnumber}{\ifkeyword{RD}{RD-#1}{AD-#1}}

My example .bib file for RDs:

@article{einstein,
    author =       "Albert Einstein",
    title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
    [{On} the electrodynamics of moving bodies]",
    journal =      "Annalen der Physik",
    volume =       "322",
    number =       "10",
    pages =        "891--921",
    year =         "1905",
    DOI =          "http://dx.doi.org/10.1002/andp.19053221004",
    keywords =     "RD"
}

@book{dirac,
    title={The Principles of Quantum Mechanics},
    author={Paul Adrien Maurice Dirac},
    isbn={9780198520115},
    series={International series of monographs on physics},
    year={1981},
    publisher={Clarendon Press},
    keywords = {RD}
}

@online{knuthwebsite,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    keywords  = "RD"
}

@inbook{knuth-fa,
    author = "Donald E. Knuth",
    title = "Fundamental Algorithms",
    publisher = "Addison-Wesley",
    year = "1973",
    chapter = "1.2",
    keywords  = "RD"
}

Above solution provides me to identify if the keyword in .bib declared as "RD" then \cite{dirac} or \cite{<your_cite>} command prints out [RD-1] or [RD-n].

It is processing for ADs same as RDs.

Example .bib for ADs:

@book{onur,
    title={The Principles of Quantum Mechanics},
    author={Paul Adrien Maurice Dirac},
    isbn={9780198520115},
    series={International series of monographs on physics},
    year={1981},
    publisher={Clarendon Press},
    keywords = {AD}
}

@book{sergio,
    title={The Principles of Quantum Mechanics},
    author={Paul Adrien Maurice Dirac},
    isbn={9780198520115},
    series={International series of monographs on physics},
    year={1981},
    publisher={Clarendon Press},
    keywords = {AD}
}

@book{ivan,
    title={The Principles of Quantum Mechanics},
    author={Paul Adrien Maurice Dirac},
    isbn={9780198520115},
    series={International series of monographs on physics},
    year={1981},
    publisher={Clarendon Press},
    keywords = {AD}
}

Same as RDs we should only type \cite{<your_cite>}. Since our (company) applicable documents are not cite-able we are using \nocite*{<AD document keyword>} at the preamble of the document. Such as just after the \begin{document} command.

I hope this helps for anyone!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.