# Bibiography problems with natbib package

Good morning,

I'm writing a journal article using the "LaTeX macro package" in the link below :

I'm new in Latex, so I have some difficulties in using it. I have to respect the journal template. They are using for BibTeX users one of the following bibliography styles:

\bibliographystyle{spbasic}
\bibliographystyle{spmpsci}
\bibliographystyle{spphys}


with the \bibliography{bibliographyFile} command.

I'm using the natbib package as follows : \usepackage[numbers,sort&compress]{natbib} in the preamble.

Actually, I have two main problems in my document:

1. The online references are cited as a mark question in my text.

I tried to cite the with @misc and @online but I'm always getting the same issue:

@Misc{Aaa,
author = {DEPARTMENT OF HEALTH AND HUMAN SERVICES},
title  = {for Privacy of Individually Identifiable Health Information; FinalRule},
year   = {2002},
}
@online{RefA,
author = {DEPARTMENT OF HEALTH AND HUMAN SERVICES},
title = {{MS Windows NT} Standards for Privacy of Individually Identifiable Health Information; FinalRule},
year = {2002},
urldate = {2002-08-14}
}

1. The references are sorted and cited in a different order oftheir appearance in the bib file.

Could someone help me to solve those problems please?

• Welcome to TeX.SE. – Mico Jan 7 at 12:32

• "The online references are cited as [question marks] in my text."

It very much sounds like you haven't run BibTeX since adding the most recent batch of \cite instructions. Whenever one adds or deletes \cite instructions, one has to perform a full recompile cycle -- LaTeX, BibTeX, and LaTeX twice more -- to (a) update the entries in the formatted bibliography and (b) get valid citation call-outs.

• "The references are sorted and cited in a different order of their appearance in the bib file."

The ordering of the entries in the bib file is utterly irrelevant. (Well, there is one minor exception: Entries that are cross-referenced by other entries should come last in the bib file. That said, the entries you've shown in your posting don't contain crossref fields; hence, this "minor exception" doesn't apply.)

The bibliography style that's in use determines, among many other things, whether the formatted bibliographic entries aree (a) displayed in the order they are cited in the body of the document or (b) sorted alphabetically by authors' and/or editors' surnames. For instance, the spbasic bibliography style sorts all entries alphabetically.

Incidentally, which one of the three possible bibliography styles -- spbasic, spphys, or spmpsci -- do you mean to employ? Having three \bibliographystyle instructions in one document makes no sense. After deleting two of the three \bibliographystyle instructions, you again must perform a full recompile cycle: -- LaTeX, BibTeX, and LaTeX twice more.

• You should replace all instances of

author = {DEPARTMENT OF HEALTH AND HUMAN SERVICES},


with

author = {{Department of Health and Human Services}},


If you fail to provide the second pair of curly braces around the contents of the author field, BibTeX will have no way of knowing that the entry's author is a "corporate author". Instead, BibTeX will determine that the entry has two separate authors: The first author will be taken to have given name "Health", von-component "of", and surname "Health", and the second author will be taken to have given name "Human" and surname "Services". Moreover, the entry will be sorted under "o" for "of Health" rather than under "D" for "Department. Why? Because the word "and" is a keyword in the author field: its function is to separate distinct authors. Clearly, that's not what should happen; hence the need to encase the entire author field in a second pair of curly braces.

• If you wish to use the note field rather than the url field to store a URL string, you should encase that string in a \url directive. E.g., be sure to change

Note  = {https://www.hhs.gov/sites/default/files/ocr/privacy/hipaa/administrative/privacyrule/privrulepd.pdf},


to

Note  = {\url{https://www.hhs.gov/sites/default/files/ocr/privacy/hipaa/administrative/privacyrule/privrulepd.pdf}},


Better still, just change it to

url  = {https://www.hhs.gov/sites/default/files/ocr/privacy/hipaa/administrative/privacyrule/privrulepd.pdf},

• Be sure to load the url or, better still, the xurl package, so that long URL strings can be suitably line-broken.

• A final comment: The title of your posting -- "Bib[l]iography problems with natbib package -- verges on being misleading. For sure, none of the problems you report in your posting are associated with the natbib citation management package.

A full MWE (minimum working example):

\documentclass{svjour3}
\begin{filecontents}[overwrite]{mybib.bib}
@Misc{Aaa,
author = {{Department of Health and Human Services}},
title  = {Final Rule for Privacy of Individually Identifiable Health Information},
year   = {2002},
}
@online{RefA,
author = {{Department of Health and Human Services}},
title  = {Final Rule, {MS Windows NT} Standards for Privacy of Individually Identifiable Health Information},
year   = {2002},