0

How can I prevent natbib with aasjournal style to print the DOI and how can I make it print all references without a \newline for each one (in order to save space)?

I have been trying to modify a few lines in aasjournal.bst and I can manage to prevent DOI to show up but then also other (apparently unrelated) journal details are missing such as issues and pages.

I am using \documentclass[letterpaper,11pt]{article}

1 Answer 1

1

I don't know much about .bst files; however, a cludgey way to get rid of the doi (and other urls) in the aasjournal bibliography style is to change the following commands from:

  "\providecommand{\url}[1]{\href{#1}{#1}}"
  write$ newline$
  "\providecommand{\dodoi}[1]{doi:~\href{http://doi.org/#1}{\nolinkurl{#1}}}"
  write$ newline$
  "\providecommand{\doeprint}[1]{\href{http://ascl.net/#1}{\nolinkurl{http://ascl.net/#1}}}"
  write$ newline$
  "\providecommand{\doarXiv}[1]{\href{https://arxiv.org/abs/#1}{\nolinkurl{https://arxiv.org/abs/#1}}}"
  write$ newline$

to

  "\providecommand{\url}[1]{\href{#1}{#1}}"
  write$ newline$
  "\providecommand{\dodoi}[1]{}"
  write$ newline$
  "\providecommand{\doeprint}[1]{}"
  write$ newline$
  "\providecommand{\doarXiv}[1]{}"
  write$ newline$

In my copy of the file, this begins on line 1776. Removing the newline$ commands from the file won't change the line spacing.

To change the spacing in the bibliography, the natbib package has a useful command to change the separation between bibitems (see this Stack answer). If using aastex, I believe natbib is already loaded.

\usepackage{natbib}  % skip if already loaded
\setlength{\bibsep}{2pt}

To completely remove the new line and have the entries simply listed, there is a solution which works with aastex on {TeX|Stackexchange} here. Commenting out the two \printfield commands will remove the added line numbers. This will override the aasjournal.bst style.

2
  • Thanks! This seems to work. However, even with \setlength each bibitem starts on a new line, which is precisely what I don't want. I'd need all items to be continuous like text. Do you also know how to add "et al." for more than two authors?
    – Py-ser
    Dec 18, 2021 at 15:04
  • Oh, I misunderstood the "without a \newline" part. I will need to update the answer above, but (a) solution can be found in the tex.stackexchange answer here. It's pretty easily modifiable and it works with aastex. This will not work with .bst files, but you can lookup how to modify biblatex styles. A jumping off point with would be this useful post.
    – J.L
    Dec 20, 2021 at 0:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .