[Tex/LaTex] \bibliography{} starting from any number

bibliographiesbibtexnumbering

I'm aware of a previous question about changing bibliography starting number, but my problem is that I'm not using \begin{thebibliography} to build the bibliography, but directly reading it from a bibtex file. Is there any method of changing the default numbering, e.g. starting from 10 instead of 1 when compiling? The end of my file is as follows:

% REFERENCES AND NOTES
\bibliography{bibtextfile}
\bibliographystyle{style}

\end{document}

Best Answer

\setcounter{enumiv}{9} would work if the the \thebibliography wouldn't apply \usecounter{enumiv} which in turn resets the enumiv counter.

From article.cls

\newenvironment{thebibliography}[1]
     {\section*{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%   This is the 'culprit'!!!!!
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}

and from latex.ltx

\def\usecounter#1{\@nmbrlisttrue\def\@listctr{#1}\setcounter{#1}\z@}

i.e. \setcounter{#1}{0} effectively.

The following code uses a dummy counter mybibstartvalue and sets the enumiv counter after \usecounter{enumiv} using a patch.

However, this code is only meant for article.cls.

\documentclass{article}

\usepackage{xpatch}

\newcounter{mybibstartvalue}
\setcounter{mybibstartvalue}{9}

\xpatchcmd{\thebibliography}{%
  \usecounter{enumiv}%
}{%
  \usecounter{enumiv}%
  \setcounter{enumiv}{\value{mybibstartvalue}}%
}{}{}



\begin{document}


\cite{Lam94}

\cite{GSM97}

\bibliography{biblio}
\bibliographystyle{unsrt}

\end{document}

enter image description here

Related Question