当使用 alpha 样式时,标签在多菜单项中如何工作?

当使用 alpha 样式时,标签在多菜单项中如何工作?

当使用多书目分隔书目时,标签有助于向读者展示实际书目条目的位置。遗憾的是,这似乎不适用于字母样式。以下最小示例显示了此问题:

\documentclass{article}

\title{}
\author{}
\date{}

\usepackage[labeled]{multibib}
\newcites{Math}{Math Readings}
\newcites{Phys}{Physics Readings}

\begin{document}
\maketitle

\citeMath{paper3}
\citePhys{paper4}

\bibliographystyleMath{alpha}
\bibliographyMath{refs-etc}

\bibliographystylePhys{alpha}
\bibliographyPhys{refs-etc}

\end{document}

标签缺失

如您所见,标签显示在参考书目中,但未显示在实际引用中。我是否遗漏了什么?

答案1

multibiblabeled选项不适用于 的可选参数\bibitem( 大量使用alpha.bst)。以下定义也考虑到\@bibitem应该labeled支持 的可选参数\bibitem

\documentclass{article}

\usepackage[labeled]{multibib}

\makeatletter
\def\newcites#1#2{%
  \def\@suffixlist{#1,}%
  \@for\@newrefname:=#2\do{%
    \mylop\@suffixlist\to\@suffix
    \expandafter\protected@edef\csname refname\@suffix\endcsname
      {\@newrefname}%
    \if@filesw
      \expandafter\newwrite\csname @auxout\@suffix\endcsname
      \expandafter\edef\csname @auxout\@suffix name\endcsname{\@suffix}%
      \begingroup
        \makeatletter
        \@input@{\csname @auxout\@suffix name\endcsname .aux}%
      \endgroup
      \immediate\openout\csname @auxout\@suffix\endcsname
                        \csname @auxout\@suffix name\endcsname .aux
    \fi
    \@for\@citename:=\@mb@citenamelist\do{%
      \expandafter\edef\csname \@citename\@suffix\endcsname{%
        \let\noexpand\@citex\noexpand\mb@@citex
        \let\noexpand\@newciteauxhandle\csname @auxout\@suffix\endcsname
        \noexpand\csname\@citename\endcsname}%
    }%
    \expandafter\edef\csname nocite\@suffix\endcsname##1{{%
      \let\noexpand\@auxout\csname @auxout\@suffix\endcsname
      \noexpand\nocite{##1}}}%
    \iflabeled % if option labeled
      \expandafter\edef\csname @bibitem\@suffix\endcsname##1{%
        \noexpand\item
        \noexpand\if@filesw \noexpand\immediate\noexpand\write\noexpand\@auxout
        {\noexpand\string\noexpand\bibcite{##1}%
           {\@suffix\noexpand\the\noexpand\value{\noexpand\@listctr}}}%
        \noexpand\fi
        \noexpand\ignorespaces}%
      \expandafter\edef\csname @lbibitem\@suffix\endcsname[##1]##2{%
        \noexpand\item[\noexpand\@biblabel{##1}\noexpand\hfill]
        \noexpand\if@filesw \noexpand\immediate\noexpand\write\noexpand\@auxout
        {\noexpand\string\noexpand\bibcite{##2}{\@suffix##1}}%
        \noexpand\fi
        \noexpand\ignorespaces}%
      \expandafter\edef\csname @biblabel\@suffix\endcsname##1{[\@suffix##1]}%
    \fi % end if option labeled
    \expandafter\edef\csname bibliography\@suffix\endcsname##1{{%
      \let\noexpand\temp@auxout\noexpand\@auxout
      \let\noexpand\addtocontents\noexpand\mb@addtocontents
      \let\noexpand\@auxout\csname @auxout\@suffix\endcsname
      \let\noexpand\jobname
         \expandafter\noexpand\csname @auxout\@suffix name\endcsname
      \let\noexpand\refname
          \expandafter\noexpand\csname refname\@suffix\endcsname
      \let\noexpand\bibname
          \expandafter\noexpand\csname refname\@suffix\endcsname
      \iflabeled
        \let\noexpand\@bibitem
            \expandafter\noexpand\csname @bibitem\@suffix\endcsname
        \let\noexpand\@lbibitem
            \expandafter\noexpand\csname @lbibitem\@suffix\endcsname
        \let\noexpand\@biblabel
            \expandafter\noexpand\csname @biblabel\@suffix\endcsname
      \fi
      \noexpand\bibliography{##1}%
      }}
    \expandafter\edef\csname bibliographystyle\@suffix\endcsname##1{%
      \noexpand\if@filesw
        \noexpand\immediate\noexpand\write\csname @auxout\@suffix\endcsname
          {\noexpand\string\noexpand\bibstyle{##1}}%
      \noexpand\fi}
   }%
}
\makeatother

\newcites{Math}{Math Readings}
\newcites{Phys}{Physics Readings}

\begin{document}
\citeMath{article-full}
\citePhys{incollection-full}

\bibliographystyleMath{alpha}
\bibliographyMath{xampl}

\bibliographystylePhys{alpha}
\bibliographyPhys{xampl}

\end{document}

[数学86] [物理77]

相关内容