7

I am using the IEEE LaTeX bibliography style, and I want to make a small change to the format of authors' names. This is not actually for submission to the IEEE so changing the format won't be a problem.

Right now, their format produces a space between each initial of an authors first and middle name(s), in addition to the abbreviating period. That is, "John Frederik Camelot Smith" (I made that up if you can believe it) gets formatted as "J. F. C. Smith". I would like it if the only space in that string were the one between the last initial and the last name, i.e. "J.F.C. Smith".

Now, IEEE provides a special bibliography entry, @IEEEtranBSTCTL that allows you to modify some aspects of their formatting, and one of the member fields is CTLname_format_string, which dictates the formatting of the author name field. By default it is:

CTLname_format_string = "{f.~}{vv~}{ll}{, jj}",

I've tried playing around with this, changing the non-breaking spaces to small spaces (\,) or negative spaces (\!), but everything I've tried seems to apply to all the spaces.

Can someone explain:

  1. What the formatting of CTLname_format_string means, i.e. what are the f, vv, etc fields?
  2. How to get the format that I'm looking for, so that the only author initial with a space after its period would be the last one before the last name, as follows:

    "John Frederik Camelot Smith" -> "J.F.C. Smith"

    "Jason Bourne" -> "J. Bourne"

--- Additional Info ---

If anyone wants to experiment with this and is unfamiliar with the IEEE .bib files, here's the quick run-down:

  • They're included with MikTex distributions (at least they were with mine)

  • Invoke them with:

    \bibliographystyle{IEEEtran}
    \bibliography{IEEEabrv,your_bib_file_name}{}
    

To modify the formatting as I've been talking about you need to do three things:

  1. Add the following entry to your bibliography (.bib file):

    @IEEEtranBSTCTL{IEEEexample:BSTcontrol,
        CTLuse_article_number = "yes",
        CTLuse_paper = "yes",
        CTLuse_forced_etal = "no",
        CTLmax_names_forced_etal = "10",
        CTLnames_show_etal = "1",
        CTLuse_alt_spacing = "yes",
        CTLalt_stretch_factor = "4",
        CTLdash_repeated_names = "yes",
        CTLname_format_string = "{f.~}{vv~}{ll}{, jj}",
        CTLname_latex_cmd = "",
        CTLname_url_prefix = "[Online]. Available:"
    }
    
  2. If you're not also using the IEEEtran style, add the following to your preamble:

    \makeatletter
    \def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
    \def\@bstctlcite[#1]#2{\@bsphack
      \@for\@citeb:=#2\do{%
        \edef\@citeb{\expandafter\@firstofone\@citeb}%
        \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
      \@esphack}
    \makeatother
    
  3. Add the following citation just after your \begin{document}:

    \bstctlcite{IEEEexample:BSTcontrol}
    

--- Update After Comment from Lockstep ---

The following provides a minimal working example:

Main Latex file contents:

\documentclass[12pt, oneside, ]{report} 

% Define the IEEE citation control command (not necessary if using IEEEtran class)
\makeatletter
\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
\def\@bstctlcite[#1]#2{\@bsphack
  \@for\@citeb:=#2\do{%
    \edef\@citeb{\expandafter\@firstofone\@citeb}%
    \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
  \@esphack}
\makeatother


% Begin Logical Document
\begin{document}
\bstctlcite{IEEEexample:BSTcontrol}

Here is an example citation \cite{smith2009pain}. 

\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,keylatex}{}

% End Logical Document
\end{document}

Bib file contents (named keylatex.bib in this example):

@ARTICLE{smith2009pain,
  author = {John Frederik Camelot Smith and Jason Bourne},
  title = {{The Pain of Having a Foolish Name}},
  journal = {Journal of Modern Fiction},
  year = {2009},
  volume = {52},
  pages = {114},
  number = {1},
  issn = {0010-4620},
  publisher = {Grendel Publishing}
}

@IEEEtranBSTCTL{IEEEexample:BSTcontrol,
    CTLuse_article_number = "yes",
    CTLuse_paper = "yes",
    CTLuse_forced_etal = "no",
    CTLmax_names_forced_etal = "10",
    CTLnames_show_etal = "1",
    CTLuse_alt_spacing = "yes",
    CTLalt_stretch_factor = "4",
    CTLdash_repeated_names = "yes",
    CTLname_format_string = "{f.~}{vv~}{ll}{, jj}",
    CTLname_latex_cmd = "",
    CTLname_url_prefix = "[Online]. Available:"
}

When I compile the above with MikTex 2.8 using pdflatex and bibtex, I get "J. F. C. Smith and J. Bourne" for names when I want "J.F.C. Smith and J. Bourne" (notice the lack of spaces in "J.F.C.").

  • Wecome to tex.sx! You should provide a minimal working example -- this shouldn't be too hard, as you have already listed large code blocks. – lockstep Apr 24 '11 at 15:55
  • @lockstep: Thanks for the comment. I've added an example to my question. – SSilk Apr 24 '11 at 18:31
6

After reading section 5.4 ("Name formatting") of Designing BibTeX Styles, I tried CTLname_format_string = "{f{.}.~}{vv~}{ll}{, jj}" and succeeded. :-)

\documentclass[12pt, oneside, ]{article} 

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@ARTICLE{smith2009pain,
  author = {John Frederik Camelot Smith and Jason Bourne},
  title = {{The Pain of Having a Foolish Name}},
  journal = {Journal of Modern Fiction},
  year = {2009},
  volume = {52},
  pages = {114},
  number = {1},
  issn = {0010-4620},
  publisher = {Grendel Publishing}
}

@IEEEtranBSTCTL{IEEEexample:BSTcontrol,
    CTLuse_article_number = "yes",
    CTLuse_paper = "yes",
    CTLuse_forced_etal = "no",
    CTLmax_names_forced_etal = "10",
    CTLnames_show_etal = "1",
    CTLuse_alt_spacing = "yes",
    CTLalt_stretch_factor = "4",
    CTLdash_repeated_names = "yes",
    CTLname_format_string = "{f{.}.~}{vv~}{ll}{, jj}",
    CTLname_latex_cmd = "",
    CTLname_url_prefix = "[Online]. Available:"
}
\end{filecontents}

% Define the IEEE citation control command (not necessary if using IEEEtran class)
\makeatletter
\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
\def\@bstctlcite[#1]#2{\@bsphack
  \@for\@citeb:=#2\do{%
    \edef\@citeb{\expandafter\@firstofone\@citeb}%
    \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
  \@esphack}
\makeatother


% Begin Logical Document
\begin{document}
\bstctlcite{IEEEexample:BSTcontrol}

Here is an example citation \cite{smith2009pain}. 

\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,\jobname}{}

% End Logical Document
\end{document}
  • Just tried your solution, it worked perfectly. Thank you. – SSilk Apr 24 '11 at 19:14
  • Did not work for me in the first try. I put the settings in a seperate file IEEEsettings.bib, as normally Mandeley generates the bib file. But you need to put the settings file last. I.e. \bibliography{IEEEabrv,references,IEEEsettings}. – JHBonarius Feb 27 '18 at 14:11

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.