# Natbib error when using options

I have a TeX file like this

\documentclass[twocolumn]{webofc}

\usepackage{natbib}
\usepackage[varg]{txfonts}   % Web of Conferences font
\usepackage{booktabs}
\usepackage{array} %% needed for advanced table manipulation
\usepackage{amsmath}
\usepackage{bm}
\usepackage{float}
\usepackage[caption = false]{subfig}
\usepackage{graphicx}

\usepackage[font={footnotesize}]{caption}
\usepackage{epstopdf}
\usepackage{afterpage}
\usepackage{color}
\usepackage{multirow}
\usepackage{url}
\urlstyle{same}
\def\UrlBreaks{\do\/\do-}

\begin{document}

....

\bibliographystyle{plainnat}
\bibliography{ACOc}
\end{document}


If I use \citet{} shows, e.g. (Author?)[3]. When using natbib options, like [square] or [numbers] it does not compile because it tells that the option is not recognized. I have also tested plain bib style instead of plainnat with the same result. I do not know if the problem is some incompatibility with another package or with the doc style. I would like to use \citet{ref} so it shows Smith et al.[3] format.

Thank you very much for the help

Regards

• You can't generate author-number formatted citation call-outs with the plainnat bibliography style. Are you committed to using the plainnat style, or are you free to use another bibliography style? – Mico Aug 25 '17 at 17:33
• References section should be as IEEEtran or similar with numbers, e.g., [3] Smith ......Thank you. – user1993416 Aug 25 '17 at 17:50
• I'm afraid I know of no bibliography style that generates citation call-outs of the form "[3] Smith". – Mico Aug 25 '17 at 18:38
• I do not know if I explained well. In the References Section of the paper (at the end) with the number [3], but the \citet{} command the name of the author and the number Smith et al. [3]. Thanks. – user1993416 Aug 25 '17 at 19:25
• Have you tried the elsarticle-num-names bibliography style? It'll create the desired type of citation call-out. However, I don't know if the formatting of the bibliographic entries will meet your needs. (Coming to think of it, you haven't told us anything yet about how the bib entries should be formatted...) – Mico Aug 25 '17 at 19:31

The error message you get is Option class for package natbib. (Next time please include it to your question.)

That means that your used package webofc already called package natbib with options, not including square.

To be able to pass your wished option to package natbib use the command

\PassOptionsToPackage{square}{natbib} % option package


With the following MWE

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Goossens,
author    = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title     = {The LaTeX Companion},
edition   = {1},
year      = {1994},
}
title     = {The Restaurant at the End of the Universe},
series    = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year      = {1980},
}
@article{Wurm2004,
author = {Wurm, Florian M.},
doi = {10.1038/nbt1026},
file = {:C$\backslash$:/Users/sille/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/Unknown - Unknown - R E V I E W.pdf:pdf},
journal = {Nature Biotechnology},
number = {11},
pages = {393--398},
title = {{Production of recombinant protein therapeutics in cultivated mammalian cells}},
url = {https://doi.org/10.1038/nbt1026},
volume = {22},
year = {2004}
}
@misc{obs,
title  = "Titre",
author = {Joe Doe},
year   = {2017},
url    = {https://www.reallylongurl.fr/aaaa/bbbbbbbbbbbbbbbbb/ccccccc-ccccc_ddddddddd?eeeeeeeeee=125784.pdf}
}
author    = {Arthur D. Smith},
title     = {A simple model of LaTeX References.},
journal   = {Journal of LaTeX},
year      = {2001},
volume    = {100},
pages     = {1--10},
number    = {3},
keywords  = {LaTeX models; biology},
doi       = {10.1115/1.1372322},
publisher = {Cambridge},
}
@article{stacey1999,
TITLE   = "Learning the Algebraic Method of Solving Problems",
JOURNAL = "The Journal of Mathematical Behavior",
VOLUME  = "18",
NUMBER  = "2",
PAGES   = "149--167",
YEAR    = "1999",
ISSN    = "0732-3123",
DOI     = {10.1016/S0732-3123(99)00026-7},
AUTHOR  = "Kaye Stacey and Mollie MacGregor",
}
\end{filecontents*}

\documentclass[twocolumn]{webofc} % webofc

\PassOptionsToPackage{square}{natbib} % option package <================
%\usepackage[square]{natbib}

\usepackage{amsmath}

\usepackage[varg]{txfonts}   % Web of Conferences font
\usepackage{booktabs}
\usepackage{array} %% needed for advanced table manipulation

\usepackage{bm}
\usepackage{float}
\usepackage[caption = false]{subfig}
\usepackage{graphicx}

\usepackage[font={footnotesize}]{caption}
\usepackage{epstopdf}
\usepackage{afterpage}
\usepackage{color}
\usepackage{multirow}

\usepackage{url}
\urlstyle{same}
\def\UrlBreaks{\do\/\do-\do.\do+\do\n\do\l\do\o}

\begin{document}

\nocite{*}

\bibliography{\jobname}
\end{document}


you get the resulting pdf:

• Thank you. I can pass square to natbib. However, the use of \citet{}does not provide the name of an author and the ref number together. – user1993416 Aug 26 '17 at 15:51
• I wanted to achieve the correct rendering of \citet or \citep`. Do you know a way to do it? I am not sure if it because of the .cls or not. Thank you for your help. – user1993416 Aug 26 '17 at 17:05