1

I have something like the following citation in my bibtex file. I am using IEEEtranN bibliography style.

@electronic{UT,
    author = {{Test}},
    title = {{Test Code}},
    url = "http://test.com"
}

However, for some reason the author does not appear in my bibliography but all the other information does;

——. Test Code. [Online]. Available: http://test.com

Can anyone tell me why this is happening and what can be done to stop it?

Emm
  • 11
  • 3
  • Please tell us which bibliography style you employ. – Mico Apr 23 '20 at 13:24
  • @Mico sorry I should have included that. I have updated my question. – Emm Apr 23 '20 at 13:26
  • 1
    Do you have another author Test in your document? – Alan Munn Apr 23 '20 at 13:29
  • Ah yes @AlanMunn I do have one other one with the same author but it is pointing to a different URL. Is there any way around this? – Emm Apr 23 '20 at 13:31
  • The IEEEtranN bibliography style is programmed to replace the contents of the author field with ------- if there are entries with repeated authors. (E.g., two enries whose author field equals Test.) If you can't stand this feature, you should probably not be using the IEEEtranN bibliography style. – Mico Apr 23 '20 at 13:45

1 Answers1

5

As Mico commented, this is the expected behavior for IEEEtranN (and the other IEEEtran styles), i.e., if an author is cited two or more times, then the name is printed only the first time and any subsequent repeated entries are printed with a horizontal line instead of the author name.

To change this behavior you can use the \noop approach. This is a workaround that is normally used to change the sort order of bibliography entries, see for example Sorting bibliography according to the order in .bib file. However, it can also be used to make two authors appear differently to Bibtex while they are printed equally.

The idea is that you add a command in front of the author name that does nothing, i.e., a non-operation or 'no-op'. This command just takes an argument and discards it, so nothing is printed. However, since the command is part of the author name field, it is used for sorting and also for determining if two author fields have the same contents. If one entry has a noop command and the other does not, or if they both have the command but with different arguments, then the author is 'different' and the full name is printed for the second entry instead of a horizontal line.

The special command should be defined in the preamble of the .bib file using a @PREAMBLE entry.

MWE, .bib:

@PREAMBLE{"\def\authornoop#1{}"}

@electronic{testone,
    author = {{\authornoop{T}}Test},
    title = {Test Code 1},
    url = "http://test.com"
}

@electronic{testtwo,
    author = {Test},
    title = {Test Code 2},
    url = "http://test.com"
}

.tex:

\documentclass{IEEEtran}
\usepackage[numbers]{natbib}
\begin{document}
\citet{testone} \citet{testtwo}
\bibliographystyle{IEEEtranN}
\bibliography{mybibfile}
\end{document}

Result:

enter image description here

Note that this may change the sort order. You can modify the argument to \authornoop to correct this, and add another \authornoop to other entries if needed.

Alternatively, you can try a more robust approach by editing the .bst file, see for example Is it normal for BibTeX to replace similar author names with "------"?.

Note that if you plan to submit a paper to IEEE then they actually want to format repeated authors like this, so your modifications will likely be reversed on publication.

Marijn
  • 37,699
  • do you happen to know why IEEE does this? – jstm Sep 16 '23 at 16:54
  • 1
    @jstm I don't know why IEEE made this choice, but I do know that there are a number of other publishers and more general style guides that use this convention, and that it was done like this since long before LaTeX or the IEEE itself existed. I guess the idea is to easily visually group authors, in order for the reader to see that the references 'belong together' as they come from the same source. – Marijn Sep 17 '23 at 08:51