# LaTeX unable to parse the names of journals in my bib file due to backslash

I have downloaded various bibtex references from NASA ADS (the astrophysics article finding tool). They all refer to journal names with a backslash as if its a code. For example for an article from the Monthly Notices of the Royal Astronomical Society it says this:

``````journal = {\mnras},
``````

Unfortunately, LaTeX appears to be unable to handle this form of journal name. But since all the downloaded citations are the same, I'm assuming there must be a way for LaTeX to read this. If so, how can i do this?

PS. I am currently using the .bst file found in the following link to read in the references which I assume is where the issue lies: ftp://ftp.edpsciences.org/pub/aa/bibtex/aa.bst

• Please see tex.stackexchange.com/q/366618/35864 you might also be interested in the rest of tex.stackexchange.com/q/386053/35864 – moewe Dec 31 '18 at 17:42
• What happens if you add the instruction `\providecommand\mnras{Monthly Notices of the Royal Astronomical Society}` to the preamble and recompile the document? More generally, do the undefined-macro-name error messages vanish if you (a) download and save the file `aas_macros.sty` from adsabs.harvard.edu/abs_doc/aas_macros.sty and (b) provide the instruction `\usepackage{aas_macros}` in the preamble? – Mico Jan 1 at 1:42

Welcome to TeX.SE!

BibTeX basically works by reading the `.bib` and handled using the `.bst`-file. Bib(La)TeX then creates a LaTeX file (with a `.bbl` extention) based on the `.bst` files instructions, commonly consisting of a `thebibliography` environment with a lot of `\bibitem`s. The `.bst`-file for example tells BibTeX that the `journal` entry should be included in the `thebibliography` environment.

If then there is this undefined control sequence `\mnras` in the journal entry, then LaTeX is going to complain when the `.bbl` file is included.

As the NASA ADS FAQ says:

Please note that our BibTeX entries make use of the AASTeX macro definitions for the most popular astronomical journal. If you're not using the AASTeX package then you will need to include these macros in your LaTeX source.

In short all you have to do is download the contents this file, save it as `aas_macros.sty` and then write `\usepackage{aas_macros}` in your preamble.

In the "general" case of fixing this for empirical errors I suspect the easiest course of action would be, as @mico suggests in the comments, to just define the undefined control sequence to what you want it to show e.g. `\providecommand\mnras{Monthly Notices of the Royal Astronomical Society}`. (`\providecommand` is like a `\newcommand` but just doesn't do anything if the command already exists).

if you want the actual backslash to show, as the question title suggests, then you'd escape said backslashes using e.g. `\textbackslash`; for example replace `\mnras` with `\textbackslash mnras`. In this case it would show literally "\mnras" in your references text.

If you want to redefine how backslash behaves in bibtex, you're in for quite an adventure, and you'd might want to dedicate a day or two to do so.