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!
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityA 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.
natbib
solution; however I've added also the "package free" version.
What do you think about a new command \Cite
\newcommand{\Cite}[2]{[See~\cite{#1},~#2]}
\cite
.
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}
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{[}
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!
natbib
or whatever?