Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with natbib #37

Open
mjthoraval opened this issue Apr 27, 2023 · 0 comments
Open

Conflict with natbib #37

mjthoraval opened this issue Apr 27, 2023 · 0 comments

Comments

@mjthoraval
Copy link
Contributor

When I use jabbrv with natbib, it breaks the commands \citet and \citeauthor.

Here is a minimal example:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

%Import the natbib package and sets a bibliography  and citation styles
%\usepackage[numbers, sort&compress]{natbib}
\usepackage{natbib}
\usepackage{jabbrv} % Use a custom jabbrv-compatible style (.bst file) in \bibliographystyle
% Use a custom jabbrv-compatible style (.bst file) in \bibliographystyle when using the package jabbrv
\bibliographystyle{unsrtnat}
%\bibliographystyle{jabbrv_unsrtnat} % Does not seem to be compatible with jabbrv

% Write the bibtex file
% https://latexref.xyz/fr/filecontents.html
\begin{filecontents*}[overwrite]{References.bib}
@article{einstein,
  author =       "Albert Einstein",
  title =        "Test title",
  journal =      "Annalen der Physik",
  volume =       "322",
  number =       "10",
  pages =        "891--921",
  year =         "1905",
  DOI =          "10.1002/andp.19053221004"
}
\end{filecontents*}

\title{Test Natbib and Jabbrv}
\author{}
\date{}

\begin{document}
\maketitle

Test of the different Natbib commands:
\begin{enumerate}
    \item \verb|cite|: \cite{einstein}
    \item \verb|citet|: \citet{einstein}
    \item \verb|citep|: \citep{einstein}
    \item \citeauthor{einstein}
\end{enumerate}


\bibliography{References}

\end{document}

If I remove the jabbrv package, here is the expected result:
image

After adding the jabbrv package, here is the result:
image

I get the following error:
! Package natbib Error: Bibliography not compatible with author-year citations.
And warnings:
Package natbib Warning: Author undefined for citation`einstein'

Any idea of what is going wrong and how it could be fixed?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant