2014-10-05 52 views
0

我正在使用multibib在每节之后包含参考列表。为了使参考标签看起来像[a.1],[a.2],...,其中a是部分编号,我添加了一些代码。 看起来参考标签是左对齐的,这使得参考文本有超过9个条目时向右移动。 我希望将标签右对齐,以便标签后面的文本总是始于相同的位置。我忽略了multibib中的选项吗?带多边形的右对齐参考标签

这很可能,这不完全是一个好兆头。 感谢您的帮助

我texfile.tex是:

\documentclass[10pt,letterpaper]{article} 
\usepackage[numbers,square,comma]{natbib} 
\usepackage[resetlabels]{multibib} 
\usepackage{totcount} 
\newcites{sec}{Refs: Section 1} 
\newcommand\newcite[3]{\citetext{\ref{#1}:\citealp#2{#3}}} 
\renewcommand\bibsection{\subsection{\refname}} 
\makeatletter 
\newtotcounter{citenum} 
\def\@[email protected]{cite,citep,citet,citealp,citealt,citepalias,citetalias} 
\makeatother 
\pagestyle{plain} 
\begin{document} 
\section{Section 1}\label{sec:sec1} 
\makeatletter 
\renewcommand{\@biblabel}[1]{[\ref{sec:sec1}:\stepcounter{citenum}#1]} 
\makeatother 
\renewcommand{\newcite}[1]{\citetext{\ref{sec:sec1}:\citealpsec{#1}}} 
\subsection{Subsection 1} 
\noindent\newcite{knuth1986texbook1} 
\noindent\newcite{knuth1986texbook2} 
\noindent\newcite{knuth1986texbook3} 
\noindent\newcite{knuth1986texbook4} 
\noindent\newcite{knuth1986texbook5} 
\noindent\newcite{knuth1986texbook6} 
\noindent\newcite{knuth1986texbook7} 
\noindent\newcite{knuth1986texbook8} 
\noindent\newcite{knuth1986texbook9} 
\noindent\newcite{knuth1986texbook10} 
\bgroup 
\let\section\subsection 
\bibliographystylesec{unsrt} 
\bibliographysec{bibfile} 
\egroup 
\end{document} 

我bibfile.bib是:

@book{knuth1986texbook1, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook2, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook3, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook4, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook5, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook6, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook7, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook8, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook9, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
@book{knuth1986texbook10, 
    title={The texbook}, 
    author={Knuth, Donald Ervin and Bibby, Duane}, 
    volume={1993}, 
    year={1986}, 
    publisher={Addison-Wesley Reading, MA, USA} 
} 
+0

请参阅tex部分中的“multibib&indentation” – dufresne 2014-10-05 19:04:07

回答

0

演进的解决这个问题是由egreg于2013年2月13日建议Link to the stackexchange site

\usepackage{etoolbox} 
\makeatletter 
\patchcmd{\thebibliography}{% 
    \section*{\refname}\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}% 
}{}{}{} 
\begingroup\catcode`#=12 
\AtBeginDocument{ 
    \patchcmd\thebibliography 
    {\advance\@tempcnta#1} 
    {\advance\@tempcnta#1\else\@tempcnta#1} 
    {}{} 
} 
\endgroup 
\makeatother 
+0

你好!对不起,不是重新发布其他人的工作,而是将整个问题标记为迁移到该网站所在的位置。如果** egreg **提供了一个解决方案,如果这被认为是适当的,那么它可以被标记为问题的重复。 – 2014-10-06 14:28:03