0

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}

Minions
  • 185
  • 1
  • 8
  • 3
    As the error says, you myplain style is not compatible with natbib (which expects the .bbl file to be formatted a very certain way). Try using plainnat instead of myplain. If you are forced to use the myplain style, then you cannot also use natbib, sorry – daleif Mar 31 '20 at 15:03
  • Thanks @daleif .. – Minions Mar 31 '20 at 15:09
  • Have you tried loading natbib with the option numbers and performing a full recompile cycle (latex-bibtex-latex-latex)? – Mico Mar 31 '20 at 15:36
  • 1
    You can still use myplain with natbib, but the style will not support \citet and can not be used with author-year citations, so only works with \usepackage[numbers]{natbib}. – moewe Mar 31 '20 at 15:36
  • yes @Mico, it doesn't work. – Minions Mar 31 '20 at 15:45
  • @moewe unfortunately no. I tried it. – Minions Mar 31 '20 at 15:46
  • 2
    That surprises me quite a bit since natbib essentially 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:08
  • Is the myplain.bst bibliography style file available online? And, do please clarify what "it doesn't work" entail. – Mico Mar 31 '20 at 16:11
  • 1
    https://tex.stackexchange.com/q/552533/35864 – moewe Jul 14 '20 at 16:40

0 Answers0