amsproc 类,格式化 \cite 命令

amsproc 类,格式化 \cite 命令

使用\documentclass{amsproc}\bibliographystyle{amsplain}

使用\cite{A,B}可以得到类似 的结果[1, 2]。我想减少1,和之间的空间(例如缩小空间) 2。如果您能提出任何建议,以简单地实现这一点,我将不胜感激,例如,通过(重新)定义宏,而不是使用附加包。但如果包是不可避免的,可以,但选择哪一个呢?

一个最小的工作示例:

\documentclass{amsproc}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{testa,
  title= "Title A",
  author= "Author A",
  journal= "Journal A",
  pages= "1-2",
  year = "2012"
}
@article{testb,
  title= "Title B",
  author= "Author B",
  journal= "Journal B",
  pages= "2-3",
  year = "2012"
}
\end{filecontents}

\begin{document}

\cite{testa,testb}
\bibliographystyle{amsplain}
\bibliography{\jobname}
\end{document}

在此处输入图片描述

答案1

不使用额外的软件包,将以下几行添加到文档的前言中:

\makeatletter
\def\@cite#1#2{{%
 \m@th\upshape\mdseries[{\bfseries #1}{\if@tempswa, #2\fi}]}}
\def\@citex[#1]#2{\leavevmode
\let\@citea\@empty
\@cite{\@for\@citeb:=#2\do
{\@citea\def\@citea{,\penalty\@m\,}%
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
\if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
\@ifundefined{b@\@citeb}{\hbox{\reset@font\bfseries ?}%
\G@refundefinedtrue
\@latex@warning
{Citation `\@citeb' on page \thepage \space undefined}}%
{\@cite@ofmt{\csname b@\@citeb\endcsname}}}}{#1}}
\makeatother

完整示例:

\documentclass{amsproc}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{testa,
  title= "Title A",
  author= "Author A",
  journal= "Journal A",
  pages= "1-2",
  year = "2012"
}
@article{testb,
  title= "Title B",
  author= "Author B",
  journal= "Journal B",
  pages= "2-3",
  year = "2012"
}
\end{filecontents}

\makeatletter
\def\@cite#1#2{{%
 \m@th\upshape\mdseries[{\bfseries #1}{\if@tempswa, #2\fi}]}}
\def\@citex[#1]#2{\leavevmode
\let\@citea\@empty
\@cite{\@for\@citeb:=#2\do
{\@citea\def\@citea{,\penalty\@m\,}%
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
\if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
\@ifundefined{b@\@citeb}{\hbox{\reset@font\bfseries ?}%
\G@refundefinedtrue
\@latex@warning
{Citation `\@citeb' on page \thepage \space undefined}}%
{\@cite@ofmt{\csname b@\@citeb\endcsname}}}}{#1}}
\makeatother

\begin{document}

\cite{testa,testb}
\bibliographystyle{amsplain}
\bibliography{\jobname}
\end{document}

输出放大到 200%:

在此处输入图片描述

使用包,您可以简单地加载cite包裹:

\usepackage{cite}

相关内容