Document Classesnatbib | Set Option(s) after Package is loaded

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
beenakker
Posts: 2
Joined: Tue Sep 20, 2011 8:36 pm

natbib | Set Option(s) after Package is loaded

Post by beenakker »

The natbib release notes say:
"It is possible to change the merge, sort, and compress options even after the package loads, and even after \begin{document}."
How do I do this?

I need this possibility, because I'm using revtex, which loads natbib without giving the user the chance to load options.

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

natbib | Set Option(s) after Package is loaded

Post by localghost »

The natbib manual suggests to use the \setcitestyle command (see Section 5). You can also try to give desired options globally to the document class. It might pass them to the package. If this doesn't work, you will get corresponding warnings in the log file and you will have to use the suggested command.


Best regards and welcome to the board
Thorsten
beenakker
Posts: 2
Joined: Tue Sep 20, 2011 8:36 pm

Re: natbib | Set Option(s) after Package is loaded

Post by beenakker »

@Thorsten - thank you for the quick response; unfortunately, the options that can be set with \setcitestyle do not include "compress" (only formatting options work); and passing arguments globally when calling revtex has no effect; calling natbib explicitly gives an error message about calling a package already loaded by the documentclass.

so I'm stuck.
Post Reply