Text Formattingequivalent onlinecite for non-revtex document-class

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
titus
Posts: 3
Joined: Sun May 23, 2010 10:51 am

equivalent onlinecite for non-revtex document-class

Post by titus »

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?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: equivalent onlinecite for non-revtex document-class

Post by josephwright »

achemso uses natbib. Please read the natbib manual, or indeed look at the demo file achemso-demo.
Joseph Wright
titus
Posts: 3
Joined: Sun May 23, 2010 10:51 am

Re: equivalent onlinecite for non-revtex document-class

Post by titus »

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
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: equivalent onlinecite for non-revtex document-class

Post by josephwright »

I don't understand. What is wrong with \citenum?
Joseph Wright
titus
Posts: 3
Joined: Sun May 23, 2010 10:51 am

Re: equivalent onlinecite for non-revtex document-class

Post by titus »

\citenum{refx} gives an error in the case that refx has not been cited (by "\cite{refx}") before the citenum-command
Post Reply