2

I am trying to write my dissertation for PhD in physics using overleaf website. I am using the template given by our school in this discipline that is called ua-thesis.

I also have a .bib file including all my citations. Besides the .tex file in the project, I also managed to find a bibliography style called aip.bst that seems to be common in my field. However, it seems that while compiling the project, I am receiving lots of error messages related to the in-text citations of the .tex file.

Am I missing some other file in the project required for the compilation (e.g. a .cls file that I am not aware of)?

Here is a MWE producing the same exact error messages:

\documentclass[draft]{ua-thesis}


\usepackage[figuresright]{rotating}
\usepackage{amsmath}
\usepackage{afterpage}
\usepackage{subfloat}
\usepackage{comment}
\usepackage{xspace}
\usepackage{graphicx}


\director{Advisor's Name}
\author{Author's Name}
\title{Title}
\date{2019}

\begin{document}

\maketitle

\tableofcontents
\listoffigures
\listoftables

\begin{abstract}
\end{abstract}

\chapter{Introduction}
Some statement \citep{2016MNRAS.460.1399V}. Another statement \citep{2016MNRAS.463.1666C}. This is known as something. \citep{1993MNRAS.264..201K,1999ApJ...522...82K,1999ApJ...524L..19M}. Still another statement \citep{2017arXiv171106267K}. Final statement \citep{Tolman511,1934rtc..book.....T,1935ApJ....82..302H,1996ApJ...456L..79P}.

\bibliographystyle{aip}
\bibliography{References}

\end{document}

This produces the error

Package natbib Error: Bibliography not compatible with author-year citations.

(natbib) Press to continue in numerical citation style. See the natbib package documentation for explanation. Type H for immediate help. ... l.31 ...mand\NAT@force@numbers{}\NAT@force@numbers Check the bibliography entries for non-compliant syntax, or select author-year BibTeX style, e.g. plainnat

My .bib file contains

@Article{2016MNRAS.460.1399V,
  author        = {{Vogelsberger}, M. and {Zavala}, J. and {Cyr-Racine}, F.-Y. and {Pfrommer}, C. and {Bringmann}, T. and {Sigurdson}, K.},
  title         = {{ETHOS - an effective theory of structure formation: dark matter physics as a possible explanation of the small-scale CDM problems}},
  journal       = {\mnras},
  year          = {2016},
  volume        = {460},
  pages         = {1399-1416},
  month         = aug,
  adsnote       = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl        = {http://adsabs.harvard.edu/abs/2016MNRAS.460.1399V},
  archiveprefix = {arXiv},
  doi           = {10.1093/mnras/stw1076},
  eprint        = {1512.05349},
  keywords      = {methods: numerical, galaxies: haloes, dark matter},
}

@Article{2016MNRAS.463.1666C,
  author        = {{Castro}, T. and {Marra}, V. and {Quartin}, M.},
  title         = {{Constraining the halo mass function with observations}},
  journal       = {\mnras},
  year          = {2016},
  volume        = {463},
  pages         = {1666-1677},
  month         = dec,
  adsnote       = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl        = {http://adsabs.harvard.edu/abs/2016MNRAS.463.1666C},
  archiveprefix = {arXiv},
  doi           = {10.1093/mnras/stw2072},
  eprint        = {1605.07548},
  keywords      = {large-scale structure of Universe, cosmology: observations, cosmological parameters, gravitational lensing: weak, stars: supernovae: general, supernovae: general},
}

@Article{1993MNRAS.264..201K,
  author  = {{Kauffmann}, G. and {White}, S.~D.~M. and {Guiderdoni}, B.},
  title   = {{The Formation and Evolution of Galaxies Within Merging Dark Matter Haloes}},
  journal = {\mnras},
  year    = {1993},
  volume  = {264},
  pages   = {201},
  month   = sep,
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl  = {http://adsabs.harvard.edu/abs/1993MNRAS.264..201K},
  doi     = {10.1093/mnras/264.1.201},
}

@Article{1999ApJ...522...82K,
  author   = {{Klypin}, A. and {Kravtsov}, A.~V. and {Valenzuela}, O. and {Prada}, F.},
  title    = {{Where Are the Missing Galactic Satellites?}},
  journal  = {\apj},
  year     = {1999},
  volume   = {522},
  pages    = {82-92},
  month    = sep,
  adsnote  = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl   = {http://adsabs.harvard.edu/abs/1999ApJ...522...82K},
  doi      = {10.1086/307643},
  eprint   = {astro-ph/9901240},
  keywords = {COSMOLOGY: THEORY, GALAXIES: CLUSTERS: GENERAL, GALAXIES: INTERACTIONS, GALAXY: FORMATION, GALAXIES: LOCAL GROUP, METHODS: NUMERICAL, Cosmology: Theory, Galaxies: Clusters: General, Galaxies: Interactions, Galaxy: Formation, Galaxies: Local Group, Methods: Numerical},
}

@Article{1999ApJ...524L..19M,
  author   = {{Moore}, B. and {Ghigna}, S. and {Governato}, F. and {Lake}, G. and {Quinn}, T. and {Stadel}, J. and {Tozzi}, P.},
  title    = {{Dark Matter Substructure within Galactic Halos}},
  journal  = {\apjl},
  year     = {1999},
  volume   = {524},
  pages    = {L19-L22},
  month    = oct,
  adsnote  = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl   = {http://adsabs.harvard.edu/abs/1999ApJ...524L..19M},
  doi      = {10.1086/312287},
  eprint   = {astro-ph/9907411},
  keywords = {COSMOLOGY: OBSERVATIONS, COSMOLOGY: THEORY, COSMOLOGY: DARK MATTER, GALAXIES: CLUSTERS: GENERAL, GALAXIES: FORMATION, Cosmology: Observations, Cosmology: Theory, Cosmology: Dark Matter, Galaxies: Clusters: General, Galaxies: Formation},
}

@Article{2017arXiv171106267K,
  author        = {{Kim}, S.~Y. and {Peter}, A.~H.~G. and {Hargis}, J.~R.},
  title         = {{There is No Missing Satellites Problem}},
  journal       = {ArXiv e-prints},
  year          = {2017},
  month         = nov,
  adsnote       = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl        = {http://adsabs.harvard.edu/abs/2017arXiv171106267K},
  archiveprefix = {arXiv},
  eprint        = {1711.06267},
  keywords      = {Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Astrophysics of Galaxies, High Energy Physics - Phenomenology},
}


@Article{Tolman511,
  author    = {Tolman, Richard C.},
  title     = {ON THE ESTIMATION OF DISTANCES IN A CURVED UNIVERSE WITH A NON-STATIC LINE ELEMENT},
  journal   = {Proceedings of the National Academy of Sciences},
  year      = {1930},
  volume    = {16},
  number    = {7},
  pages     = {511--520},
  issn      = {0027-8424},
  doi       = {10.1073/pnas.16.7.511},
  eprint    = {http://www.pnas.org/content/16/7/511.full.pdf},
  publisher = {National Academy of Sciences},
  url       = {http://www.pnas.org/content/16/7/511},
}
  • 6
    Can you make a minimal working example with bibliography (MWEB) that reproduces the errors you get? – user36296 Jan 28 at 20:50
  • 2
    Note that the message you quote is not the original error message that LaTeX would issue on an undefined command. It is an explanatory text added by your compiler (Overleaf?). In particular the real TeX error would tell you which command is undefined. That could give you a hint for a first online search. – moewe Jan 28 at 21:54
  • 5
    A classic issue with ADS-exported .bib entries is that they use macros for journal names. Unless you load a file that defines those names or define the names you need manually you will get an error. See tex.stackexchange.com/q/366618/35864 and linked questions. More generally see tex.stackexchange.com/q/386053/35864 (the ADS .bib export has quite some unfortunate idiosyncrasies). – moewe Jan 28 at 21:56
  • 3
    @moewe Can you please tell me where you bought your crystal ball? It seems to be of very high quality! – user36296 Jan 28 at 21:58
  • 3
    But you also need to load natbib differently. The code does not show how you load natbib (so strictly speaking it is not an MWE that reproduces the issue: tex.meta.stackexchange.com/q/228/35864). Since aip.bst does not do author-year citations, you need to load natbib with the option numbers, for example as \usepackage[numbers]{natbib}. – moewe Jan 28 at 22:17
3

With the documentclass ua-thesis you are using an older version ua-thesis.cls Document Class: ua-thesis 1997/03/08 UA Thesis Class. Using this class I get the error message that commands like \mras are undefined.

In the new version of this class (file uathesis-master.zip, you gave the link in your next question) you can find file aastex_hack.sys, containing the missing definitions. Copy this file into the same directory/project you have your tex code and vbib file.

In the following I'm using one file mwe.tex containing both parts (TeX code and bib file concatenated with package filecontents to one compilable MWE. In real you still have two files, your for example thesis-tex and references.bib or simular).

In your given code are two calls of packages missing:

\usepackage[numbers]{natbib} % <========================================
\usepackage{aastex_hack} % <============================================

Package natbib is needed to allow the usage of command \citep, package aastex_hack adds the commands for \mnras etc.

With this zip file you get bibliography style uabibnat (file uabibnat.bst) you can use. You did not mentions where your used file aip.bst comes from, I found one in the internet (see comment in the following MWE). With both styles you can compile the following code without errors. Depending on the used style there are some warnings I let to you to get rid of them ...

So please copy the following complete MWE to your computer and compile it, following the ususal chain:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Article{2016MNRAS.460.1399V,
  author        = {{Vogelsberger}, M. and {Zavala}, J. and {Cyr-Racine}, F.-Y. and {Pfrommer}, C. and {Bringmann}, T. and {Sigurdson}, K.},
  title         = {{ETHOS - an effective theory of structure formation: dark matter physics as a possible explanation of the small-scale CDM problems}},
  journal       = {\mnras},
  year          = {2016},
  volume        = {460},
  pages         = {1399-1416},
  month         = aug,
  adsnote       = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl        = {http://adsabs.harvard.edu/abs/2016MNRAS.460.1399V},
  archiveprefix = {arXiv},
  doi           = {10.1093/mnras/stw1076},
  eprint        = {1512.05349},
  keywords      = {methods: numerical, galaxies: haloes, dark matter},
}

@Article{2016MNRAS.463.1666C,
  author        = {{Castro}, T. and {Marra}, V. and {Quartin}, M.},
  title         = {{Constraining the halo mass function with observations}},
  journal       = {\mnras},
  year          = {2016},
  volume        = {463},
  pages         = {1666-1677},
  month         = dec,
  adsnote       = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl        = {http://adsabs.harvard.edu/abs/2016MNRAS.463.1666C},
  archiveprefix = {arXiv},
  doi           = {10.1093/mnras/stw2072},
  eprint        = {1605.07548},
  keywords      = {large-scale structure of Universe, cosmology: observations, cosmological parameters, gravitational lensing: weak, stars: supernovae: general, supernovae: general},
}

@Article{1993MNRAS.264..201K,
  author  = {{Kauffmann}, G. and {White}, S.~D.~M. and {Guiderdoni}, B.},
  title   = {{The Formation and Evolution of Galaxies Within Merging Dark Matter Haloes}},
  journal = {\mnras},
  year    = {1993},
  volume  = {264},
  pages   = {201},
  month   = sep,
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl  = {http://adsabs.harvard.edu/abs/1993MNRAS.264..201K},
  doi     = {10.1093/mnras/264.1.201},
}

@Article{1999ApJ...522...82K,
  author   = {{Klypin}, A. and {Kravtsov}, A.~V. and {Valenzuela}, O. and {Prada}, F.},
  title    = {{Where Are the Missing Galactic Satellites?}},
  journal  = {\apj},
  year     = {1999},
  volume   = {522},
  pages    = {82-92},
  month    = sep,
  adsnote  = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl   = {http://adsabs.harvard.edu/abs/1999ApJ...522...82K},
  doi      = {10.1086/307643},
  eprint   = {astro-ph/9901240},
  keywords = {COSMOLOGY: THEORY, GALAXIES: CLUSTERS: GENERAL, GALAXIES: INTERACTIONS, GALAXY: FORMATION, GALAXIES: LOCAL GROUP, METHODS: NUMERICAL, Cosmology: Theory, Galaxies: Clusters: General, Galaxies: Interactions, Galaxy: Formation, Galaxies: Local Group, Methods: Numerical},
}

@Article{1999ApJ...524L..19M,
  author   = {{Moore}, B. and {Ghigna}, S. and {Governato}, F. and {Lake}, G. and {Quinn}, T. and {Stadel}, J. and {Tozzi}, P.},
  title    = {{Dark Matter Substructure within Galactic Halos}},
  journal  = {\apjl},
  year     = {1999},
  volume   = {524},
  pages    = {L19-L22},
  month    = oct,
  adsnote  = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl   = {http://adsabs.harvard.edu/abs/1999ApJ...524L..19M},
  doi      = {10.1086/312287},
  eprint   = {astro-ph/9907411},
  keywords = {COSMOLOGY: OBSERVATIONS, COSMOLOGY: THEORY, COSMOLOGY: DARK MATTER, GALAXIES: CLUSTERS: GENERAL, GALAXIES: FORMATION, Cosmology: Observations, Cosmology: Theory, Cosmology: Dark Matter, Galaxies: Clusters: General, Galaxies: Formation},
}

@Article{2017arXiv171106267K,
  author        = {{Kim}, S.~Y. and {Peter}, A.~H.~G. and {Hargis}, J.~R.},
  title         = {{There is No Missing Satellites Problem}},
  journal       = {ArXiv e-prints},
  year          = {2017},
  month         = nov,
  adsnote       = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl        = {http://adsabs.harvard.edu/abs/2017arXiv171106267K},
  archiveprefix = {arXiv},
  eprint        = {1711.06267},
  keywords      = {Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Astrophysics of Galaxies, High Energy Physics - Phenomenology},
}


@Article{Tolman511,
  author    = {Tolman, Richard C.},
  title     = {ON THE ESTIMATION OF DISTANCES IN A CURVED UNIVERSE WITH A NON-STATIC LINE ELEMENT},
  journal   = {Proceedings of the National Academy of Sciences},
  year      = {1930},
  volume    = {16},
  number    = {7},
  pages     = {511--520},
  issn      = {0027-8424},
  doi       = {10.1073/pnas.16.7.511},
  eprint    = {http://www.pnas.org/content/16/7/511.full.pdf},
  publisher = {National Academy of Sciences},
  url       = {http://www.pnas.org/content/16/7/511},
}
\end{filecontents*}


\documentclass[draft]{ua-thesis}

\usepackage[figuresright]{rotating}
\usepackage{amsmath}
\usepackage{afterpage}
\usepackage{subfloat}
\usepackage{comment}
\usepackage{xspace}
\usepackage{graphicx}
\usepackage[numbers]{natbib} % <========================================
\usepackage{aastex_hack} % <============================================


\director{Advisor's Name}
\author{Author's Name}
\title{Title}
\date{2019}


\begin{document}

\maketitle

\tableofcontents
\listoffigures
\listoftables

\begin{abstract}
\end{abstract}

\chapter{Introduction}
Some statement \citep{2016MNRAS.460.1399V}. 
Another statement \citep{2016MNRAS.463.1666C}. 
This is known as something. \citep{1993MNRAS.264..201K,1999ApJ...522...82K,1999ApJ...524L..19M}. 
Still another statement \citep{2017arXiv171106267K}. 
Final statement \citep{Tolman511,1934rtc..book.....T,1935ApJ....82..302H,1996ApJ...456L..79P}.

% https://apps.carleton.edu/curricular/physics/assets/aip.bst
\bibliographystyle{uabibnat} % aip uabibnat
\bibliography{\jobname}

\end{document}

Then you will get the following bibliography, based on style uabibnat:

enter image description here

  • Yes, I followed all these and I still have an issue with the code as pointed in the other post: tex.stackexchange.com/questions/472678/… – Allan Jan 31 at 18:09
  • I have lots of issues with the old class. I wish there was a solution for the new class. – Allan Jan 31 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.