I'm trying to use \citet command but I am getting this error:
Package natbib Error: Bibliography not compatible with author-year citations.
(natbib) Press <return> to continue in numerical citation style.
See the natbib package documentation for explanation.
Type H <return> for immediate help.
...
l.385 ...and\NAT@force@numbers{}\NAT@force@numbers
Check the bibliography entries for non-compliant syntax,
or select author-year BibTeX style, e.g. plainnat
I found online some solutions that suggest to change the style of the document or the document type. Unfortunately, I can't apply this kind of solutions because I'm following a specific template.
This is my code:
\documentclass[11pt,a4paper,twoside,openright,notitlepage]{report}
\usepackage{subfiles}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{soul}
\usepackage{xcolor} %May be necessary if you want to color links
\usepackage{hyperref}
\hypersetup{
colorlinks=true, %set true if you want colored links
linktoc=all, %set to all if you want both sections and subsections linked
linkcolor=blue, %choose some color if you want links to stand out
citecolor=blue,
filecolor=blue,
linkcolor=blue,
urlcolor=blue,
}
\usepackage{booktabs}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{natbib} %citep
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{textgreek}
\pagestyle{plain}
%ruotare le scritte nelle tabelle es. \rot{60}{\textit{Stylistic}}
\def\rot{\rotatebox}
\hypersetup{linktocpage}
\renewcommand{\thesection}{\thechapter.\number\numexpr\value{section}\relax}
\renewcommand{\thesubsection}{\thesection.\number\numexpr\value{subsection}\relax}
\renewcommand{\thesubsubsection}{\thesubsection.\number\numexpr\value{subsubsection}\relax}
\setcounter{secnumdepth}{3}
\setcounter{chapter}{0}% Not using chapters, but they're used in the counters
\begin{document}
\setcode{utf8}
\pagenumbering{gobble}
\titleUPV
\input{chapters/abstract}
\pagenumbering{roman}
\listoffigures
\listoftables
\pagebreak
\tableofcontents
\thispagestyle{empty}
\pagebreak
\pagenumbering{arabic}
\chapter{Introduction}
\input{chapters/chapter1}
\part{chapter2 title}
\chapter{chapter2}
% \input{chapters/chapter2}
%\clearpage
\newpage
\pagenumbering{roman}
\bibliographystyle{myplain}
\bibliography{main}
\end{document}
myplainstyle is not compatible withnatbib(which expects the.bblfile to be formatted a very certain way). Try usingplainnatinstead ofmyplain. If you are forced to use themyplainstyle, then you cannot also usenatbib, sorry – daleif Mar 31 '20 at 15:03natbibwith the optionnumbersand performing a full recompile cycle (latex-bibtex-latex-latex)? – Mico Mar 31 '20 at 15:36myplainwithnatbib, but the style will not support\citetand can not be used with author-year citations, so only works with\usepackage[numbers]{natbib}. – moewe Mar 31 '20 at 15:36natbibessentially suppresses the bit of code that produces the error in your example if you load it with\usepackage[numbers]{natbib}. – moewe Mar 31 '20 at 16:08myplain.bstbibliography style file available online? And, do please clarify what "it doesn't work" entail. – Mico Mar 31 '20 at 16:11