书目 作者 首字母间距

书目 作者 首字母间距

我使用的是 IEEE LaTeX 书目样式,我想对作者姓名的格式做一点小改动。这实际上不是为了提交给 IEEE,所以更改格式不会有问题。

目前,他们的格式在作者名字和中间名的每个首字母之间会产生一个空格,除了缩写句号之外。也就是说,“John Frederik Camelot Smith”(如果您相信的话,这是我编的)被格式化为“JFC Smith”。我希望该字符串中唯一的空格是最后一个首字母和姓氏之间的空格,即“JFC Smith”。

现在,IEEE 提供了一个特殊的书目条目,@IEEEtranBSTCTL允许您修改其格式的某些方面,其中一个成员字段是CTLname_format_string,它规定了作者姓名字段的格式。默认情况下,它是:

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

我尝试过这种方法,将不间断空格改为小空格(\,)或负空格(\!),但我尝试过的所有方法似乎都适用于所有空格。

有人可以解释一下吗:

  1. 的格式是什么 意思,即、等字段CTLname_format_string是什么?fvv
  2. 如何获取我想要的格式,以便唯一一个在句点后带有空格的作者首字母是姓氏之前的最后一个,如下所示:

    “约翰·弗雷德里克·卡米洛特·史密斯” -> “JFC·史密斯”

    “谍影重重” -> “谍影重重”

- - 附加信息 - -

如果有人想尝试这个但又不熟悉 IEEE.bib文件,下面是简要介绍:

  • 它们包含在 MikTex 发行版中(至少在我的发行版中是这样的)

  • 使用以下命令调用它们:

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

要修改我所说的格式,您需要做三件事:

  1. 将以下条目添加到您的参考书目(.bib文件):

    @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. 如果您不使用 IEEEtran 样式,请将以下内容添加到您的序言中:

    \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. 在您的后面添加以下引用\begin{document}

    \bstctlcite{IEEEexample:BSTcontrol}
    

--- Lockstep 评论后的更新 ---

下面提供了一个最小的工作示例:

Latex 主要文件内容:

\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文件内容(keylatex.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:"
}

当我使用 pdflatex 和 bibtex 通过 MikTex 2.8 编译上述内容时,当我想要“JFC Smith and J. Bourne”时,我得到的名字却是“JFC Smith and J. Bourne”(请注意“JFC”中没有空格)。

答案1

阅读第 5.4 节(“名称格式”)后设计 BibTeX 样式,我尝试过CTLname_format_string = "{f{.}.~}{vv~}{ll}{, jj}"并且成功了。:-)

\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}

相关内容