Hi,
I am writing an article in the ACS latex format, documentclass=achemso. Citations are in superscript, but sometimes it is handy to have in-text citations such as "It was shown in Ref. [..]..".
Revtex has the command \onlinecite{..} for this. Anybody knows how to do this in another documentclass such as achemso?
Text Formatting ⇒ equivalent onlinecite for non-revtex document-class
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: equivalent onlinecite for non-revtex document-class
achemso uses natbib. Please read the natbib manual, or indeed look at the demo file achemso-demo.
Joseph Wright
Re: equivalent onlinecite for non-revtex document-class
Despite the achemso package using natbib, citetext, citealp etc do not work. I found a way around defining
a new command
\newcommand{\onlinecite}[1]{\hspace{-1 ex} \nocite{#1}\citenum{#1}}
This gives pretty the same result as \onlinecite in revtex. Only multiple citation like "...in Refs. [1-4]"
I need to adapt manually to get the appropriate result
"..in Refs. [\onlinecite{ref1}- \nocite{ref2,ref3} \onlinecite{ref4}]"
but this is ok for small documents
a new command
\newcommand{\onlinecite}[1]{\hspace{-1 ex} \nocite{#1}\citenum{#1}}
This gives pretty the same result as \onlinecite in revtex. Only multiple citation like "...in Refs. [1-4]"
I need to adapt manually to get the appropriate result
"..in Refs. [\onlinecite{ref1}- \nocite{ref2,ref3} \onlinecite{ref4}]"
but this is ok for small documents
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: equivalent onlinecite for non-revtex document-class
I don't understand. What is wrong with \citenum?
Joseph Wright
Re: equivalent onlinecite for non-revtex document-class
\citenum{refx} gives an error in the case that refx has not been cited (by "\cite{refx}") before the citenum-command