Natbib produce errors when being included












1















Problem:



Following the recommendations to use the Natbib according to http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management, I continue to receive errors when I try to follow the guidelines.



The error:



natbib.sty (line 351)
LaTex error: Unknown option 'options' for package 'natbib'. (newcommand)


Code for thesis.tex:



%Default style using S5 paper
%documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU_A4}
%Use this instead if you need A4 paper.
documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU}

%: Macro file for Latex
% Macros help you summarize frequently repeated Latex commands.
% Here, they are placed in an external file /Latex/Macros/MacroFile1.tex
% An macro that you may use frequently is the figuremacro
include{Latex/Macros/MacroFile1}

usepackage[options]{natbib}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{pdfpages}
usepackage{afterpage}
usepackage{emptypage}

% Change how references are included (see the natbib package).
setcitestyle{square,numbers}


...



%: ----------------------- ´Bibliography ------------------------

% The section below defines how references are listed and formatted.

%begin{multicols}{2} % begin{multicols}{ # columns}[ header text][ space] %uncomment to have 2 columns
begin{scriptsize} % tiny(5) < scriptsize(7) < footnotesize(8) < small (9)

%Default style file. Change according to you preferences.
bibliographystyle{plainnat}

% Changes the header from Bibliography to References
renewcommand{bibname}{References}

% File containing all references in BibTex format
bibliography{thesis}

end{scriptsize}


Code for thesis.cls:



%-------------------------- identification ---------------------
%NeedsTeXFormat{LaTeX2e}
ProvidesClass{Latex/Classes/PhDthesisSU}[2011/09/23 PhD thesis class]

%:-------------------------- book style -----------------------

DeclareOption*{PassOptionsToClass{CurrentOption}{book}}
ProcessOptionsrelax
LoadClass[pdftex, a4paper]{book}

%:-------------------------- packages for fancy things -----------------------
usepackage{mathptmx} % Default font for dissertations is Times.
%usepackage{fourier} % If mathematics don't display well using Times, then use Fourier.
usepackage{enumitem}
usepackage{tabularx,ragged2e,booktabs,caption,tabulary}
usepackage[flushleft]{threeparttable}
%usepackage{setspace}
usepackage{geometry}
usepackage{amssymb}
usepackage{textcomp}
usepackage{atbegshi}
usepackage{amsmath}
usepackage{amsbsy}
usepackage[pdftex]{graphicx} % for improved inclusion of graphics
usepackage{epstopdf} % converts eps figures to pdf
usepackage[margin=10pt,font=small,labelfont=bf]{caption} % for improved layout of figure captions with extra margin, smaller font than text
usepackage{fancyhdr} % for better header layout
usepackage{eucal}
usepackage[polutonikogreek,english,swedish]{babel}
usepackage[usenames, dvipsnames]{color}
usepackage[perpage]{footmisc}
usepackage{enumerate} % enumerated list for List of Papers
%usepackage[sort,compress]{natbib}
usepackage{ifthen}
usepackage{multicol} % for pages with multiple text columns, e.g. References
setlength{columnsep}{20pt} % space between columns; default 10pt quite narrow
usepackage[nottoc]{tocbibind} % correct page numbers for bib in TOC, nottoc suppresses an entry for TOC itself
%usepackage{nextpage}
usepackage[T1]{fontenc}
usepackage{calligra}

newcolumntype{C}[1]{>{Centering}m{#1}}
renewcommandtabularxcolumn[1]{C{#1}}

renewcommandboldsymbol[1]{pmb{#1}}

DeclareFixedFont{timesEightteen}{encodingdefault}{sfdefault}{seriesdefault}{shapedefault}{17p@}

% Removing the "Chapter n" text an replacing it by a single number.
def@makechapterhead#1{%
vspace{0p@}%
{parindent z@ raggedright normalfont
ifnum c@secnumdepth >m@ne
% Skipping the "Chapter n" text
if@mainmatter
baselineskip=20ptrightskip 2cm plus 3cmLARGEthechapter.hspace{0.5em}%Chapterpoint added.
fi
fi
LARGE #1parnobreak
vskip 74p@
}}
def@makeschapterhead#1{%
vspace*{0p@}%
{parindent z@ raggedright
normalfont
interlinepenalty@M
huge #1parnobreak
vskip 74p@
}}


%:-------------------------- Glossary/Abbrev./Symbols -----------------------

usepackage{nomencl} % load nomencl extension; include in TOC
%nomrefpage % to include page numbers after abbrevations
renewcommand{nomlabel}[1]{textbf{#1}} % make abbreviations bold
makenomenclature % used to be makeglossary
newcommand{g}{footnote{For all abbreviations see the glossary on page pageref{nom}.}} % type "g" to refer to glossary

% used to be for sorting into categories:
%renewcommandnomgroup[1]{%
% ifthenelse{equal{#1}{A}}{%
% item[textbf{Roman Symbols}] }{% A - Roman
% ifthenelse{equal{#1}{G}}{%
% item[textbf{Greek Symbols}]}{% G - Greek
% ifthenelse{equal{#1}{R}}{%
% item[textbf{Superscripts}]}{% R - Superscripts
% ifthenelse{equal{#1}{S}}{%
% item[textbf{Subscripts}]}{{% S - Subscripts
% ifthenelse{equal{#1}{X}}{%
% item[textbf{Other Symbols}]}{{% X - Other Symbols
% ifthenelse{equal{#1}{Z}}{%
% item[textbf{Acronyms}]}% Z - Acronyms
% {{}}}}}}}}}}


%:-------------------------- PDF/PS setup -----------------------

%if you use a macTeX 2008 or later, use the ifpdf package
usepackage{ifpdf}


%-->
%--> Google.com search "hyperref options"
%-->
%--> http://www.ai.mit.edu/lab/sysadmin/latex/documentation/latex/hyperref/manual.pdf
%--> http://www.chemie.unibas.ch/~vogtp/LaTeX2PDFLaTeX.pdf
%--> http://www.uni-giessen.de/partosch/eurotex99/ oberdiek/print/sli4a4col.pdf
%--> http://me.in-berlin.de/~miwie/tex-refs/html/latex-packages.html
%-->
usepackage[ pdftex, plainpages = false, pdfpagelabels,
pdfpagelayout = useoutlines,
bookmarks,
bookmarksopen = true,
bookmarksnumbered = true,
breaklinks = true,
linktocpage,
pagebackref,
colorlinks = false, % was true
linkcolor = blue,
urlcolor = blue,
citecolor = red,
anchorcolor = green,
hyperindex = true,
hyperfigures
]{hyperref}

DeclareGraphicsExtensions{.png, .jpg, .jpeg, .pdf} %GIF doesn't work
usepackage[pdftex]{graphicx}
pdfcompresslevel=9
graphicspath{{0_frontmatter/figures/}}



%:-------------------------- page layout -----------------------

%S5 settings (default)

geometry{paperheight=242mm,paperwidth=165mm}
geometry{left=22.5mm,right=22.5mm}
geometry{top=22.5mm,bottom=22.5mm}


%Make al headlines non-fat
defsection{@startsection {section}{1}{z@}{-3.5ex plus -1ex minus
-.2ex}{2.3ex plus .2ex}{Large}}
defsubsection{@startsection{subsection}{2}{z@}{-3.25ex plus -1ex minus
-.2ex}{1.5ex plus .2ex}{large}}
defsubsubsection{@startsection{subsubsection}{3}{z@}{-3.25ex plus
-1ex minus -.2ex}{1.5ex plus .2ex}{normalsize}}



%:-------------------------- page layout -----------------------

% FRONTMATTER
% No page numbering until chapter 1

newcommand{frontmatterSU}{
frontmatter
pagestyle{empty}
fancypagestyle{plain}{
fancyhead{}
fancyfoot{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}
}


% MAINMATTER
newcommand{mainmatterSU}{

begingroup
cleardoublepage
edefx{endgroup
noexpandmainmatter
noexpandsetcounter{page}{thevalue{page}}%
}%
x

cleardoublepage

fancypagestyle{plain}
{
fancyhead{}
fancyfoot[LE,RO]{{fontfamily{verdana}selectfontthepage}}
} % re-define plain page

pagestyle{fancy}
fancyhf{}
fancyfoot[LE,RO]{{fontfamily{verdana}selectfontthepage}}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}


% BACKMATTER
newcommand{backmatterSU}{

backmatter
renewcommand{thepage}{roman{page}}
%
pagestyle{empty}
fancypagestyle{plain}{
fancyhead{}
fancyfoot{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}
}

% DECLARATIONS
% These macros are used to declare arguments needed for the
% construction of the title page and other preamble.

% Subtitle
defsubtitle#1{gdef@subtitle{#1}}
% Defining the crest
defcrest#1{gdef@crest{#1}}

% These macros define an environment for front matter that is always
% single column even in a double-column document.

newenvironment{alwayssingle}{%
@restonecolfalseif@twocolumn@restonecoltrueonecolumn
elsenewpagefi}
{if@restonecoltwocolumnelsenewpagefi}

%Halftitlepage
%newcommand{halftitlepage}%
%{
%thispagestyle{empty}
% noindent
% {large @title~-- @subtitle\}\
% noindent
% {Large@author}
%cleardoublepage
%}

crest{includegraphics[width=25mm]{SU-Logga}}

%define title page layout
renewcommand{maketitle}{
renewcommand{footnotesize}{small}
renewcommand{footnoterule}{relax}
thispagestyle{empty}
{large vspace*{0mm} hspace*{90mm} {{@crest} par} } %Move the logo
{ huge vspace*{30mm}{noindent}{@title} par vspace*{4mm}}
{LARGE {noindent}{@subtitle} par vspace*{8mm}}
{{Large {noindent}@author} par}
nullvfill
}

%:-------------------------- front matter layout -----------------------


Code for thesis.bib:



@article{baumeister:need,
author = {Baumeister, R. F. and Leary, M. R.},
title = {The need to belong: Desire for interpersonal attachments as a fundamental human motivation.},
journal = {Psychological Bulletin},
volume = {117},
number = {3},
pages = {497-529},
year = {1995},
type = {Journal Article}
}


Code for including citations in text:



cite{baumeister:need}









share|improve this question




















  • 2





    [options] is not intended to be used as a literal string, it means to use whatever options you want at that point, for example the line you have commented out usepackage[sort,compress]{natbib} which would use the sort and compress options

    – David Carlisle
    Feb 7 '15 at 12:00






  • 2





    include{Latex/Macros/MacroFile1} should be input (or better give the file a .sty extension and use usepackage{MacroFile1} you should not use include in the preamble.

    – David Carlisle
    Feb 7 '15 at 12:02






  • 1





    not strictly an error but the class file loads graphicx twice and the preamble loads it a third time (latex checks for this and only loads it once but..)

    – David Carlisle
    Feb 7 '15 at 12:05






  • 3





    To elaborate on what David said, put usepackage[square,numbers]{natbib} and remove the line setcitestyle{square,numbers}.

    – user11232
    Feb 7 '15 at 12:05











  • Have you a solution or can we close this question?

    – Kurt
    Sep 15 '15 at 21:15
















1















Problem:



Following the recommendations to use the Natbib according to http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management, I continue to receive errors when I try to follow the guidelines.



The error:



natbib.sty (line 351)
LaTex error: Unknown option 'options' for package 'natbib'. (newcommand)


Code for thesis.tex:



%Default style using S5 paper
%documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU_A4}
%Use this instead if you need A4 paper.
documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU}

%: Macro file for Latex
% Macros help you summarize frequently repeated Latex commands.
% Here, they are placed in an external file /Latex/Macros/MacroFile1.tex
% An macro that you may use frequently is the figuremacro
include{Latex/Macros/MacroFile1}

usepackage[options]{natbib}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{pdfpages}
usepackage{afterpage}
usepackage{emptypage}

% Change how references are included (see the natbib package).
setcitestyle{square,numbers}


...



%: ----------------------- ´Bibliography ------------------------

% The section below defines how references are listed and formatted.

%begin{multicols}{2} % begin{multicols}{ # columns}[ header text][ space] %uncomment to have 2 columns
begin{scriptsize} % tiny(5) < scriptsize(7) < footnotesize(8) < small (9)

%Default style file. Change according to you preferences.
bibliographystyle{plainnat}

% Changes the header from Bibliography to References
renewcommand{bibname}{References}

% File containing all references in BibTex format
bibliography{thesis}

end{scriptsize}


Code for thesis.cls:



%-------------------------- identification ---------------------
%NeedsTeXFormat{LaTeX2e}
ProvidesClass{Latex/Classes/PhDthesisSU}[2011/09/23 PhD thesis class]

%:-------------------------- book style -----------------------

DeclareOption*{PassOptionsToClass{CurrentOption}{book}}
ProcessOptionsrelax
LoadClass[pdftex, a4paper]{book}

%:-------------------------- packages for fancy things -----------------------
usepackage{mathptmx} % Default font for dissertations is Times.
%usepackage{fourier} % If mathematics don't display well using Times, then use Fourier.
usepackage{enumitem}
usepackage{tabularx,ragged2e,booktabs,caption,tabulary}
usepackage[flushleft]{threeparttable}
%usepackage{setspace}
usepackage{geometry}
usepackage{amssymb}
usepackage{textcomp}
usepackage{atbegshi}
usepackage{amsmath}
usepackage{amsbsy}
usepackage[pdftex]{graphicx} % for improved inclusion of graphics
usepackage{epstopdf} % converts eps figures to pdf
usepackage[margin=10pt,font=small,labelfont=bf]{caption} % for improved layout of figure captions with extra margin, smaller font than text
usepackage{fancyhdr} % for better header layout
usepackage{eucal}
usepackage[polutonikogreek,english,swedish]{babel}
usepackage[usenames, dvipsnames]{color}
usepackage[perpage]{footmisc}
usepackage{enumerate} % enumerated list for List of Papers
%usepackage[sort,compress]{natbib}
usepackage{ifthen}
usepackage{multicol} % for pages with multiple text columns, e.g. References
setlength{columnsep}{20pt} % space between columns; default 10pt quite narrow
usepackage[nottoc]{tocbibind} % correct page numbers for bib in TOC, nottoc suppresses an entry for TOC itself
%usepackage{nextpage}
usepackage[T1]{fontenc}
usepackage{calligra}

newcolumntype{C}[1]{>{Centering}m{#1}}
renewcommandtabularxcolumn[1]{C{#1}}

renewcommandboldsymbol[1]{pmb{#1}}

DeclareFixedFont{timesEightteen}{encodingdefault}{sfdefault}{seriesdefault}{shapedefault}{17p@}

% Removing the "Chapter n" text an replacing it by a single number.
def@makechapterhead#1{%
vspace{0p@}%
{parindent z@ raggedright normalfont
ifnum c@secnumdepth >m@ne
% Skipping the "Chapter n" text
if@mainmatter
baselineskip=20ptrightskip 2cm plus 3cmLARGEthechapter.hspace{0.5em}%Chapterpoint added.
fi
fi
LARGE #1parnobreak
vskip 74p@
}}
def@makeschapterhead#1{%
vspace*{0p@}%
{parindent z@ raggedright
normalfont
interlinepenalty@M
huge #1parnobreak
vskip 74p@
}}


%:-------------------------- Glossary/Abbrev./Symbols -----------------------

usepackage{nomencl} % load nomencl extension; include in TOC
%nomrefpage % to include page numbers after abbrevations
renewcommand{nomlabel}[1]{textbf{#1}} % make abbreviations bold
makenomenclature % used to be makeglossary
newcommand{g}{footnote{For all abbreviations see the glossary on page pageref{nom}.}} % type "g" to refer to glossary

% used to be for sorting into categories:
%renewcommandnomgroup[1]{%
% ifthenelse{equal{#1}{A}}{%
% item[textbf{Roman Symbols}] }{% A - Roman
% ifthenelse{equal{#1}{G}}{%
% item[textbf{Greek Symbols}]}{% G - Greek
% ifthenelse{equal{#1}{R}}{%
% item[textbf{Superscripts}]}{% R - Superscripts
% ifthenelse{equal{#1}{S}}{%
% item[textbf{Subscripts}]}{{% S - Subscripts
% ifthenelse{equal{#1}{X}}{%
% item[textbf{Other Symbols}]}{{% X - Other Symbols
% ifthenelse{equal{#1}{Z}}{%
% item[textbf{Acronyms}]}% Z - Acronyms
% {{}}}}}}}}}}


%:-------------------------- PDF/PS setup -----------------------

%if you use a macTeX 2008 or later, use the ifpdf package
usepackage{ifpdf}


%-->
%--> Google.com search "hyperref options"
%-->
%--> http://www.ai.mit.edu/lab/sysadmin/latex/documentation/latex/hyperref/manual.pdf
%--> http://www.chemie.unibas.ch/~vogtp/LaTeX2PDFLaTeX.pdf
%--> http://www.uni-giessen.de/partosch/eurotex99/ oberdiek/print/sli4a4col.pdf
%--> http://me.in-berlin.de/~miwie/tex-refs/html/latex-packages.html
%-->
usepackage[ pdftex, plainpages = false, pdfpagelabels,
pdfpagelayout = useoutlines,
bookmarks,
bookmarksopen = true,
bookmarksnumbered = true,
breaklinks = true,
linktocpage,
pagebackref,
colorlinks = false, % was true
linkcolor = blue,
urlcolor = blue,
citecolor = red,
anchorcolor = green,
hyperindex = true,
hyperfigures
]{hyperref}

DeclareGraphicsExtensions{.png, .jpg, .jpeg, .pdf} %GIF doesn't work
usepackage[pdftex]{graphicx}
pdfcompresslevel=9
graphicspath{{0_frontmatter/figures/}}



%:-------------------------- page layout -----------------------

%S5 settings (default)

geometry{paperheight=242mm,paperwidth=165mm}
geometry{left=22.5mm,right=22.5mm}
geometry{top=22.5mm,bottom=22.5mm}


%Make al headlines non-fat
defsection{@startsection {section}{1}{z@}{-3.5ex plus -1ex minus
-.2ex}{2.3ex plus .2ex}{Large}}
defsubsection{@startsection{subsection}{2}{z@}{-3.25ex plus -1ex minus
-.2ex}{1.5ex plus .2ex}{large}}
defsubsubsection{@startsection{subsubsection}{3}{z@}{-3.25ex plus
-1ex minus -.2ex}{1.5ex plus .2ex}{normalsize}}



%:-------------------------- page layout -----------------------

% FRONTMATTER
% No page numbering until chapter 1

newcommand{frontmatterSU}{
frontmatter
pagestyle{empty}
fancypagestyle{plain}{
fancyhead{}
fancyfoot{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}
}


% MAINMATTER
newcommand{mainmatterSU}{

begingroup
cleardoublepage
edefx{endgroup
noexpandmainmatter
noexpandsetcounter{page}{thevalue{page}}%
}%
x

cleardoublepage

fancypagestyle{plain}
{
fancyhead{}
fancyfoot[LE,RO]{{fontfamily{verdana}selectfontthepage}}
} % re-define plain page

pagestyle{fancy}
fancyhf{}
fancyfoot[LE,RO]{{fontfamily{verdana}selectfontthepage}}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}


% BACKMATTER
newcommand{backmatterSU}{

backmatter
renewcommand{thepage}{roman{page}}
%
pagestyle{empty}
fancypagestyle{plain}{
fancyhead{}
fancyfoot{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}
}

% DECLARATIONS
% These macros are used to declare arguments needed for the
% construction of the title page and other preamble.

% Subtitle
defsubtitle#1{gdef@subtitle{#1}}
% Defining the crest
defcrest#1{gdef@crest{#1}}

% These macros define an environment for front matter that is always
% single column even in a double-column document.

newenvironment{alwayssingle}{%
@restonecolfalseif@twocolumn@restonecoltrueonecolumn
elsenewpagefi}
{if@restonecoltwocolumnelsenewpagefi}

%Halftitlepage
%newcommand{halftitlepage}%
%{
%thispagestyle{empty}
% noindent
% {large @title~-- @subtitle\}\
% noindent
% {Large@author}
%cleardoublepage
%}

crest{includegraphics[width=25mm]{SU-Logga}}

%define title page layout
renewcommand{maketitle}{
renewcommand{footnotesize}{small}
renewcommand{footnoterule}{relax}
thispagestyle{empty}
{large vspace*{0mm} hspace*{90mm} {{@crest} par} } %Move the logo
{ huge vspace*{30mm}{noindent}{@title} par vspace*{4mm}}
{LARGE {noindent}{@subtitle} par vspace*{8mm}}
{{Large {noindent}@author} par}
nullvfill
}

%:-------------------------- front matter layout -----------------------


Code for thesis.bib:



@article{baumeister:need,
author = {Baumeister, R. F. and Leary, M. R.},
title = {The need to belong: Desire for interpersonal attachments as a fundamental human motivation.},
journal = {Psychological Bulletin},
volume = {117},
number = {3},
pages = {497-529},
year = {1995},
type = {Journal Article}
}


Code for including citations in text:



cite{baumeister:need}









share|improve this question




















  • 2





    [options] is not intended to be used as a literal string, it means to use whatever options you want at that point, for example the line you have commented out usepackage[sort,compress]{natbib} which would use the sort and compress options

    – David Carlisle
    Feb 7 '15 at 12:00






  • 2





    include{Latex/Macros/MacroFile1} should be input (or better give the file a .sty extension and use usepackage{MacroFile1} you should not use include in the preamble.

    – David Carlisle
    Feb 7 '15 at 12:02






  • 1





    not strictly an error but the class file loads graphicx twice and the preamble loads it a third time (latex checks for this and only loads it once but..)

    – David Carlisle
    Feb 7 '15 at 12:05






  • 3





    To elaborate on what David said, put usepackage[square,numbers]{natbib} and remove the line setcitestyle{square,numbers}.

    – user11232
    Feb 7 '15 at 12:05











  • Have you a solution or can we close this question?

    – Kurt
    Sep 15 '15 at 21:15














1












1








1








Problem:



Following the recommendations to use the Natbib according to http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management, I continue to receive errors when I try to follow the guidelines.



The error:



natbib.sty (line 351)
LaTex error: Unknown option 'options' for package 'natbib'. (newcommand)


Code for thesis.tex:



%Default style using S5 paper
%documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU_A4}
%Use this instead if you need A4 paper.
documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU}

%: Macro file for Latex
% Macros help you summarize frequently repeated Latex commands.
% Here, they are placed in an external file /Latex/Macros/MacroFile1.tex
% An macro that you may use frequently is the figuremacro
include{Latex/Macros/MacroFile1}

usepackage[options]{natbib}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{pdfpages}
usepackage{afterpage}
usepackage{emptypage}

% Change how references are included (see the natbib package).
setcitestyle{square,numbers}


...



%: ----------------------- ´Bibliography ------------------------

% The section below defines how references are listed and formatted.

%begin{multicols}{2} % begin{multicols}{ # columns}[ header text][ space] %uncomment to have 2 columns
begin{scriptsize} % tiny(5) < scriptsize(7) < footnotesize(8) < small (9)

%Default style file. Change according to you preferences.
bibliographystyle{plainnat}

% Changes the header from Bibliography to References
renewcommand{bibname}{References}

% File containing all references in BibTex format
bibliography{thesis}

end{scriptsize}


Code for thesis.cls:



%-------------------------- identification ---------------------
%NeedsTeXFormat{LaTeX2e}
ProvidesClass{Latex/Classes/PhDthesisSU}[2011/09/23 PhD thesis class]

%:-------------------------- book style -----------------------

DeclareOption*{PassOptionsToClass{CurrentOption}{book}}
ProcessOptionsrelax
LoadClass[pdftex, a4paper]{book}

%:-------------------------- packages for fancy things -----------------------
usepackage{mathptmx} % Default font for dissertations is Times.
%usepackage{fourier} % If mathematics don't display well using Times, then use Fourier.
usepackage{enumitem}
usepackage{tabularx,ragged2e,booktabs,caption,tabulary}
usepackage[flushleft]{threeparttable}
%usepackage{setspace}
usepackage{geometry}
usepackage{amssymb}
usepackage{textcomp}
usepackage{atbegshi}
usepackage{amsmath}
usepackage{amsbsy}
usepackage[pdftex]{graphicx} % for improved inclusion of graphics
usepackage{epstopdf} % converts eps figures to pdf
usepackage[margin=10pt,font=small,labelfont=bf]{caption} % for improved layout of figure captions with extra margin, smaller font than text
usepackage{fancyhdr} % for better header layout
usepackage{eucal}
usepackage[polutonikogreek,english,swedish]{babel}
usepackage[usenames, dvipsnames]{color}
usepackage[perpage]{footmisc}
usepackage{enumerate} % enumerated list for List of Papers
%usepackage[sort,compress]{natbib}
usepackage{ifthen}
usepackage{multicol} % for pages with multiple text columns, e.g. References
setlength{columnsep}{20pt} % space between columns; default 10pt quite narrow
usepackage[nottoc]{tocbibind} % correct page numbers for bib in TOC, nottoc suppresses an entry for TOC itself
%usepackage{nextpage}
usepackage[T1]{fontenc}
usepackage{calligra}

newcolumntype{C}[1]{>{Centering}m{#1}}
renewcommandtabularxcolumn[1]{C{#1}}

renewcommandboldsymbol[1]{pmb{#1}}

DeclareFixedFont{timesEightteen}{encodingdefault}{sfdefault}{seriesdefault}{shapedefault}{17p@}

% Removing the "Chapter n" text an replacing it by a single number.
def@makechapterhead#1{%
vspace{0p@}%
{parindent z@ raggedright normalfont
ifnum c@secnumdepth >m@ne
% Skipping the "Chapter n" text
if@mainmatter
baselineskip=20ptrightskip 2cm plus 3cmLARGEthechapter.hspace{0.5em}%Chapterpoint added.
fi
fi
LARGE #1parnobreak
vskip 74p@
}}
def@makeschapterhead#1{%
vspace*{0p@}%
{parindent z@ raggedright
normalfont
interlinepenalty@M
huge #1parnobreak
vskip 74p@
}}


%:-------------------------- Glossary/Abbrev./Symbols -----------------------

usepackage{nomencl} % load nomencl extension; include in TOC
%nomrefpage % to include page numbers after abbrevations
renewcommand{nomlabel}[1]{textbf{#1}} % make abbreviations bold
makenomenclature % used to be makeglossary
newcommand{g}{footnote{For all abbreviations see the glossary on page pageref{nom}.}} % type "g" to refer to glossary

% used to be for sorting into categories:
%renewcommandnomgroup[1]{%
% ifthenelse{equal{#1}{A}}{%
% item[textbf{Roman Symbols}] }{% A - Roman
% ifthenelse{equal{#1}{G}}{%
% item[textbf{Greek Symbols}]}{% G - Greek
% ifthenelse{equal{#1}{R}}{%
% item[textbf{Superscripts}]}{% R - Superscripts
% ifthenelse{equal{#1}{S}}{%
% item[textbf{Subscripts}]}{{% S - Subscripts
% ifthenelse{equal{#1}{X}}{%
% item[textbf{Other Symbols}]}{{% X - Other Symbols
% ifthenelse{equal{#1}{Z}}{%
% item[textbf{Acronyms}]}% Z - Acronyms
% {{}}}}}}}}}}


%:-------------------------- PDF/PS setup -----------------------

%if you use a macTeX 2008 or later, use the ifpdf package
usepackage{ifpdf}


%-->
%--> Google.com search "hyperref options"
%-->
%--> http://www.ai.mit.edu/lab/sysadmin/latex/documentation/latex/hyperref/manual.pdf
%--> http://www.chemie.unibas.ch/~vogtp/LaTeX2PDFLaTeX.pdf
%--> http://www.uni-giessen.de/partosch/eurotex99/ oberdiek/print/sli4a4col.pdf
%--> http://me.in-berlin.de/~miwie/tex-refs/html/latex-packages.html
%-->
usepackage[ pdftex, plainpages = false, pdfpagelabels,
pdfpagelayout = useoutlines,
bookmarks,
bookmarksopen = true,
bookmarksnumbered = true,
breaklinks = true,
linktocpage,
pagebackref,
colorlinks = false, % was true
linkcolor = blue,
urlcolor = blue,
citecolor = red,
anchorcolor = green,
hyperindex = true,
hyperfigures
]{hyperref}

DeclareGraphicsExtensions{.png, .jpg, .jpeg, .pdf} %GIF doesn't work
usepackage[pdftex]{graphicx}
pdfcompresslevel=9
graphicspath{{0_frontmatter/figures/}}



%:-------------------------- page layout -----------------------

%S5 settings (default)

geometry{paperheight=242mm,paperwidth=165mm}
geometry{left=22.5mm,right=22.5mm}
geometry{top=22.5mm,bottom=22.5mm}


%Make al headlines non-fat
defsection{@startsection {section}{1}{z@}{-3.5ex plus -1ex minus
-.2ex}{2.3ex plus .2ex}{Large}}
defsubsection{@startsection{subsection}{2}{z@}{-3.25ex plus -1ex minus
-.2ex}{1.5ex plus .2ex}{large}}
defsubsubsection{@startsection{subsubsection}{3}{z@}{-3.25ex plus
-1ex minus -.2ex}{1.5ex plus .2ex}{normalsize}}



%:-------------------------- page layout -----------------------

% FRONTMATTER
% No page numbering until chapter 1

newcommand{frontmatterSU}{
frontmatter
pagestyle{empty}
fancypagestyle{plain}{
fancyhead{}
fancyfoot{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}
}


% MAINMATTER
newcommand{mainmatterSU}{

begingroup
cleardoublepage
edefx{endgroup
noexpandmainmatter
noexpandsetcounter{page}{thevalue{page}}%
}%
x

cleardoublepage

fancypagestyle{plain}
{
fancyhead{}
fancyfoot[LE,RO]{{fontfamily{verdana}selectfontthepage}}
} % re-define plain page

pagestyle{fancy}
fancyhf{}
fancyfoot[LE,RO]{{fontfamily{verdana}selectfontthepage}}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}


% BACKMATTER
newcommand{backmatterSU}{

backmatter
renewcommand{thepage}{roman{page}}
%
pagestyle{empty}
fancypagestyle{plain}{
fancyhead{}
fancyfoot{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}
}

% DECLARATIONS
% These macros are used to declare arguments needed for the
% construction of the title page and other preamble.

% Subtitle
defsubtitle#1{gdef@subtitle{#1}}
% Defining the crest
defcrest#1{gdef@crest{#1}}

% These macros define an environment for front matter that is always
% single column even in a double-column document.

newenvironment{alwayssingle}{%
@restonecolfalseif@twocolumn@restonecoltrueonecolumn
elsenewpagefi}
{if@restonecoltwocolumnelsenewpagefi}

%Halftitlepage
%newcommand{halftitlepage}%
%{
%thispagestyle{empty}
% noindent
% {large @title~-- @subtitle\}\
% noindent
% {Large@author}
%cleardoublepage
%}

crest{includegraphics[width=25mm]{SU-Logga}}

%define title page layout
renewcommand{maketitle}{
renewcommand{footnotesize}{small}
renewcommand{footnoterule}{relax}
thispagestyle{empty}
{large vspace*{0mm} hspace*{90mm} {{@crest} par} } %Move the logo
{ huge vspace*{30mm}{noindent}{@title} par vspace*{4mm}}
{LARGE {noindent}{@subtitle} par vspace*{8mm}}
{{Large {noindent}@author} par}
nullvfill
}

%:-------------------------- front matter layout -----------------------


Code for thesis.bib:



@article{baumeister:need,
author = {Baumeister, R. F. and Leary, M. R.},
title = {The need to belong: Desire for interpersonal attachments as a fundamental human motivation.},
journal = {Psychological Bulletin},
volume = {117},
number = {3},
pages = {497-529},
year = {1995},
type = {Journal Article}
}


Code for including citations in text:



cite{baumeister:need}









share|improve this question
















Problem:



Following the recommendations to use the Natbib according to http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management, I continue to receive errors when I try to follow the guidelines.



The error:



natbib.sty (line 351)
LaTex error: Unknown option 'options' for package 'natbib'. (newcommand)


Code for thesis.tex:



%Default style using S5 paper
%documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU_A4}
%Use this instead if you need A4 paper.
documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU}

%: Macro file for Latex
% Macros help you summarize frequently repeated Latex commands.
% Here, they are placed in an external file /Latex/Macros/MacroFile1.tex
% An macro that you may use frequently is the figuremacro
include{Latex/Macros/MacroFile1}

usepackage[options]{natbib}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{pdfpages}
usepackage{afterpage}
usepackage{emptypage}

% Change how references are included (see the natbib package).
setcitestyle{square,numbers}


...



%: ----------------------- ´Bibliography ------------------------

% The section below defines how references are listed and formatted.

%begin{multicols}{2} % begin{multicols}{ # columns}[ header text][ space] %uncomment to have 2 columns
begin{scriptsize} % tiny(5) < scriptsize(7) < footnotesize(8) < small (9)

%Default style file. Change according to you preferences.
bibliographystyle{plainnat}

% Changes the header from Bibliography to References
renewcommand{bibname}{References}

% File containing all references in BibTex format
bibliography{thesis}

end{scriptsize}


Code for thesis.cls:



%-------------------------- identification ---------------------
%NeedsTeXFormat{LaTeX2e}
ProvidesClass{Latex/Classes/PhDthesisSU}[2011/09/23 PhD thesis class]

%:-------------------------- book style -----------------------

DeclareOption*{PassOptionsToClass{CurrentOption}{book}}
ProcessOptionsrelax
LoadClass[pdftex, a4paper]{book}

%:-------------------------- packages for fancy things -----------------------
usepackage{mathptmx} % Default font for dissertations is Times.
%usepackage{fourier} % If mathematics don't display well using Times, then use Fourier.
usepackage{enumitem}
usepackage{tabularx,ragged2e,booktabs,caption,tabulary}
usepackage[flushleft]{threeparttable}
%usepackage{setspace}
usepackage{geometry}
usepackage{amssymb}
usepackage{textcomp}
usepackage{atbegshi}
usepackage{amsmath}
usepackage{amsbsy}
usepackage[pdftex]{graphicx} % for improved inclusion of graphics
usepackage{epstopdf} % converts eps figures to pdf
usepackage[margin=10pt,font=small,labelfont=bf]{caption} % for improved layout of figure captions with extra margin, smaller font than text
usepackage{fancyhdr} % for better header layout
usepackage{eucal}
usepackage[polutonikogreek,english,swedish]{babel}
usepackage[usenames, dvipsnames]{color}
usepackage[perpage]{footmisc}
usepackage{enumerate} % enumerated list for List of Papers
%usepackage[sort,compress]{natbib}
usepackage{ifthen}
usepackage{multicol} % for pages with multiple text columns, e.g. References
setlength{columnsep}{20pt} % space between columns; default 10pt quite narrow
usepackage[nottoc]{tocbibind} % correct page numbers for bib in TOC, nottoc suppresses an entry for TOC itself
%usepackage{nextpage}
usepackage[T1]{fontenc}
usepackage{calligra}

newcolumntype{C}[1]{>{Centering}m{#1}}
renewcommandtabularxcolumn[1]{C{#1}}

renewcommandboldsymbol[1]{pmb{#1}}

DeclareFixedFont{timesEightteen}{encodingdefault}{sfdefault}{seriesdefault}{shapedefault}{17p@}

% Removing the "Chapter n" text an replacing it by a single number.
def@makechapterhead#1{%
vspace{0p@}%
{parindent z@ raggedright normalfont
ifnum c@secnumdepth >m@ne
% Skipping the "Chapter n" text
if@mainmatter
baselineskip=20ptrightskip 2cm plus 3cmLARGEthechapter.hspace{0.5em}%Chapterpoint added.
fi
fi
LARGE #1parnobreak
vskip 74p@
}}
def@makeschapterhead#1{%
vspace*{0p@}%
{parindent z@ raggedright
normalfont
interlinepenalty@M
huge #1parnobreak
vskip 74p@
}}


%:-------------------------- Glossary/Abbrev./Symbols -----------------------

usepackage{nomencl} % load nomencl extension; include in TOC
%nomrefpage % to include page numbers after abbrevations
renewcommand{nomlabel}[1]{textbf{#1}} % make abbreviations bold
makenomenclature % used to be makeglossary
newcommand{g}{footnote{For all abbreviations see the glossary on page pageref{nom}.}} % type "g" to refer to glossary

% used to be for sorting into categories:
%renewcommandnomgroup[1]{%
% ifthenelse{equal{#1}{A}}{%
% item[textbf{Roman Symbols}] }{% A - Roman
% ifthenelse{equal{#1}{G}}{%
% item[textbf{Greek Symbols}]}{% G - Greek
% ifthenelse{equal{#1}{R}}{%
% item[textbf{Superscripts}]}{% R - Superscripts
% ifthenelse{equal{#1}{S}}{%
% item[textbf{Subscripts}]}{{% S - Subscripts
% ifthenelse{equal{#1}{X}}{%
% item[textbf{Other Symbols}]}{{% X - Other Symbols
% ifthenelse{equal{#1}{Z}}{%
% item[textbf{Acronyms}]}% Z - Acronyms
% {{}}}}}}}}}}


%:-------------------------- PDF/PS setup -----------------------

%if you use a macTeX 2008 or later, use the ifpdf package
usepackage{ifpdf}


%-->
%--> Google.com search "hyperref options"
%-->
%--> http://www.ai.mit.edu/lab/sysadmin/latex/documentation/latex/hyperref/manual.pdf
%--> http://www.chemie.unibas.ch/~vogtp/LaTeX2PDFLaTeX.pdf
%--> http://www.uni-giessen.de/partosch/eurotex99/ oberdiek/print/sli4a4col.pdf
%--> http://me.in-berlin.de/~miwie/tex-refs/html/latex-packages.html
%-->
usepackage[ pdftex, plainpages = false, pdfpagelabels,
pdfpagelayout = useoutlines,
bookmarks,
bookmarksopen = true,
bookmarksnumbered = true,
breaklinks = true,
linktocpage,
pagebackref,
colorlinks = false, % was true
linkcolor = blue,
urlcolor = blue,
citecolor = red,
anchorcolor = green,
hyperindex = true,
hyperfigures
]{hyperref}

DeclareGraphicsExtensions{.png, .jpg, .jpeg, .pdf} %GIF doesn't work
usepackage[pdftex]{graphicx}
pdfcompresslevel=9
graphicspath{{0_frontmatter/figures/}}



%:-------------------------- page layout -----------------------

%S5 settings (default)

geometry{paperheight=242mm,paperwidth=165mm}
geometry{left=22.5mm,right=22.5mm}
geometry{top=22.5mm,bottom=22.5mm}


%Make al headlines non-fat
defsection{@startsection {section}{1}{z@}{-3.5ex plus -1ex minus
-.2ex}{2.3ex plus .2ex}{Large}}
defsubsection{@startsection{subsection}{2}{z@}{-3.25ex plus -1ex minus
-.2ex}{1.5ex plus .2ex}{large}}
defsubsubsection{@startsection{subsubsection}{3}{z@}{-3.25ex plus
-1ex minus -.2ex}{1.5ex plus .2ex}{normalsize}}



%:-------------------------- page layout -----------------------

% FRONTMATTER
% No page numbering until chapter 1

newcommand{frontmatterSU}{
frontmatter
pagestyle{empty}
fancypagestyle{plain}{
fancyhead{}
fancyfoot{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}
}


% MAINMATTER
newcommand{mainmatterSU}{

begingroup
cleardoublepage
edefx{endgroup
noexpandmainmatter
noexpandsetcounter{page}{thevalue{page}}%
}%
x

cleardoublepage

fancypagestyle{plain}
{
fancyhead{}
fancyfoot[LE,RO]{{fontfamily{verdana}selectfontthepage}}
} % re-define plain page

pagestyle{fancy}
fancyhf{}
fancyfoot[LE,RO]{{fontfamily{verdana}selectfontthepage}}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}


% BACKMATTER
newcommand{backmatterSU}{

backmatter
renewcommand{thepage}{roman{page}}
%
pagestyle{empty}
fancypagestyle{plain}{
fancyhead{}
fancyfoot{}
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
}
}

% DECLARATIONS
% These macros are used to declare arguments needed for the
% construction of the title page and other preamble.

% Subtitle
defsubtitle#1{gdef@subtitle{#1}}
% Defining the crest
defcrest#1{gdef@crest{#1}}

% These macros define an environment for front matter that is always
% single column even in a double-column document.

newenvironment{alwayssingle}{%
@restonecolfalseif@twocolumn@restonecoltrueonecolumn
elsenewpagefi}
{if@restonecoltwocolumnelsenewpagefi}

%Halftitlepage
%newcommand{halftitlepage}%
%{
%thispagestyle{empty}
% noindent
% {large @title~-- @subtitle\}\
% noindent
% {Large@author}
%cleardoublepage
%}

crest{includegraphics[width=25mm]{SU-Logga}}

%define title page layout
renewcommand{maketitle}{
renewcommand{footnotesize}{small}
renewcommand{footnoterule}{relax}
thispagestyle{empty}
{large vspace*{0mm} hspace*{90mm} {{@crest} par} } %Move the logo
{ huge vspace*{30mm}{noindent}{@title} par vspace*{4mm}}
{LARGE {noindent}{@subtitle} par vspace*{8mm}}
{{Large {noindent}@author} par}
nullvfill
}

%:-------------------------- front matter layout -----------------------


Code for thesis.bib:



@article{baumeister:need,
author = {Baumeister, R. F. and Leary, M. R.},
title = {The need to belong: Desire for interpersonal attachments as a fundamental human motivation.},
journal = {Psychological Bulletin},
volume = {117},
number = {3},
pages = {497-529},
year = {1995},
type = {Journal Article}
}


Code for including citations in text:



cite{baumeister:need}






natbib






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 7 '15 at 12:51









lockstep

192k53593723




192k53593723










asked Feb 7 '15 at 11:32









kexxcreamkexxcream

75921228




75921228








  • 2





    [options] is not intended to be used as a literal string, it means to use whatever options you want at that point, for example the line you have commented out usepackage[sort,compress]{natbib} which would use the sort and compress options

    – David Carlisle
    Feb 7 '15 at 12:00






  • 2





    include{Latex/Macros/MacroFile1} should be input (or better give the file a .sty extension and use usepackage{MacroFile1} you should not use include in the preamble.

    – David Carlisle
    Feb 7 '15 at 12:02






  • 1





    not strictly an error but the class file loads graphicx twice and the preamble loads it a third time (latex checks for this and only loads it once but..)

    – David Carlisle
    Feb 7 '15 at 12:05






  • 3





    To elaborate on what David said, put usepackage[square,numbers]{natbib} and remove the line setcitestyle{square,numbers}.

    – user11232
    Feb 7 '15 at 12:05











  • Have you a solution or can we close this question?

    – Kurt
    Sep 15 '15 at 21:15














  • 2





    [options] is not intended to be used as a literal string, it means to use whatever options you want at that point, for example the line you have commented out usepackage[sort,compress]{natbib} which would use the sort and compress options

    – David Carlisle
    Feb 7 '15 at 12:00






  • 2





    include{Latex/Macros/MacroFile1} should be input (or better give the file a .sty extension and use usepackage{MacroFile1} you should not use include in the preamble.

    – David Carlisle
    Feb 7 '15 at 12:02






  • 1





    not strictly an error but the class file loads graphicx twice and the preamble loads it a third time (latex checks for this and only loads it once but..)

    – David Carlisle
    Feb 7 '15 at 12:05






  • 3





    To elaborate on what David said, put usepackage[square,numbers]{natbib} and remove the line setcitestyle{square,numbers}.

    – user11232
    Feb 7 '15 at 12:05











  • Have you a solution or can we close this question?

    – Kurt
    Sep 15 '15 at 21:15








2




2





[options] is not intended to be used as a literal string, it means to use whatever options you want at that point, for example the line you have commented out usepackage[sort,compress]{natbib} which would use the sort and compress options

– David Carlisle
Feb 7 '15 at 12:00





[options] is not intended to be used as a literal string, it means to use whatever options you want at that point, for example the line you have commented out usepackage[sort,compress]{natbib} which would use the sort and compress options

– David Carlisle
Feb 7 '15 at 12:00




2




2





include{Latex/Macros/MacroFile1} should be input (or better give the file a .sty extension and use usepackage{MacroFile1} you should not use include in the preamble.

– David Carlisle
Feb 7 '15 at 12:02





include{Latex/Macros/MacroFile1} should be input (or better give the file a .sty extension and use usepackage{MacroFile1} you should not use include in the preamble.

– David Carlisle
Feb 7 '15 at 12:02




1




1





not strictly an error but the class file loads graphicx twice and the preamble loads it a third time (latex checks for this and only loads it once but..)

– David Carlisle
Feb 7 '15 at 12:05





not strictly an error but the class file loads graphicx twice and the preamble loads it a third time (latex checks for this and only loads it once but..)

– David Carlisle
Feb 7 '15 at 12:05




3




3





To elaborate on what David said, put usepackage[square,numbers]{natbib} and remove the line setcitestyle{square,numbers}.

– user11232
Feb 7 '15 at 12:05





To elaborate on what David said, put usepackage[square,numbers]{natbib} and remove the line setcitestyle{square,numbers}.

– user11232
Feb 7 '15 at 12:05













Have you a solution or can we close this question?

– Kurt
Sep 15 '15 at 21:15





Have you a solution or can we close this question?

– Kurt
Sep 15 '15 at 21:15










1 Answer
1






active

oldest

votes


















3














The line



usepackage[options]{natbib}


says that options is the literal name of an option for natbib package. As this is not defined to be an option in natbib, an error is thrown. In fact the string options means the possible options like square, numbers etc.



Hence if you want to pass options to the natbib package while loading itself, use



usepackage[square,numbers]{natbib}


then you won't need to use



% Change how references are included (see the natbib package).
setcitestyle{square,numbers}


On the other hand, you may also use



usepackage{natbib}     %% note the absence of options
% Change how references are included (see the natbib package).
setcitestyle{square,numbers}





share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f227006%2fnatbib-produce-errors-when-being-included%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    The line



    usepackage[options]{natbib}


    says that options is the literal name of an option for natbib package. As this is not defined to be an option in natbib, an error is thrown. In fact the string options means the possible options like square, numbers etc.



    Hence if you want to pass options to the natbib package while loading itself, use



    usepackage[square,numbers]{natbib}


    then you won't need to use



    % Change how references are included (see the natbib package).
    setcitestyle{square,numbers}


    On the other hand, you may also use



    usepackage{natbib}     %% note the absence of options
    % Change how references are included (see the natbib package).
    setcitestyle{square,numbers}





    share|improve this answer




























      3














      The line



      usepackage[options]{natbib}


      says that options is the literal name of an option for natbib package. As this is not defined to be an option in natbib, an error is thrown. In fact the string options means the possible options like square, numbers etc.



      Hence if you want to pass options to the natbib package while loading itself, use



      usepackage[square,numbers]{natbib}


      then you won't need to use



      % Change how references are included (see the natbib package).
      setcitestyle{square,numbers}


      On the other hand, you may also use



      usepackage{natbib}     %% note the absence of options
      % Change how references are included (see the natbib package).
      setcitestyle{square,numbers}





      share|improve this answer


























        3












        3








        3







        The line



        usepackage[options]{natbib}


        says that options is the literal name of an option for natbib package. As this is not defined to be an option in natbib, an error is thrown. In fact the string options means the possible options like square, numbers etc.



        Hence if you want to pass options to the natbib package while loading itself, use



        usepackage[square,numbers]{natbib}


        then you won't need to use



        % Change how references are included (see the natbib package).
        setcitestyle{square,numbers}


        On the other hand, you may also use



        usepackage{natbib}     %% note the absence of options
        % Change how references are included (see the natbib package).
        setcitestyle{square,numbers}





        share|improve this answer













        The line



        usepackage[options]{natbib}


        says that options is the literal name of an option for natbib package. As this is not defined to be an option in natbib, an error is thrown. In fact the string options means the possible options like square, numbers etc.



        Hence if you want to pass options to the natbib package while loading itself, use



        usepackage[square,numbers]{natbib}


        then you won't need to use



        % Change how references are included (see the natbib package).
        setcitestyle{square,numbers}


        On the other hand, you may also use



        usepackage{natbib}     %% note the absence of options
        % Change how references are included (see the natbib package).
        setcitestyle{square,numbers}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 26 '15 at 5:18







        user11232





































            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f227006%2fnatbib-produce-errors-when-being-included%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks