Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have to separate my citations on two lists: Preliminary Work (Own Papers) and the standard Bibliography list. The references to the standard Bibliography list should be numbered and cited with arabic numbers. The references to the Preliminary Work should be numbered and cited with roman numbers.

There are several packages, which do similar work. But it seems that none of them can be used in my case. For example, the package multibib introduces a nice tool for creating several citation lists and citing them with the user defined command like \citesec. However, this is not appropriate for my purposes (I can be wrong) since: (i) in the process of editing our document with co-authors we can move some items between different lists; (ii) we want to have a possibility to cite items from two lists as \cite{Ref2, Own2}, in order to get a result like [2, II]. It may also be important that these two lists should appear in different parts of the document.

In order to resolve this problem I define the new environment thepreliminarywork similar to the environment thebibliography. Here is my example:

\documentclass{report}

\makeatletter

\newenvironment{thepreliminarywork}[1]
     {\chapter*{Preliminary Work}%
      \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
      \list{\@biblabel{\@Roman\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@Roman\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thepreliminarywork' environment}}%
      \endlist}

\makeatother

\begin{document}

These are references to the standard bibliography list: \cite{Ref1}, \cite{Ref2}. This example works properly.

These are references to the list of preliminary papers: \cite{Own1}, \cite{Own2}. This example does not work properly since I want to get [I], [II].

I also want to write like this: \cite{Ref1, Own1}. This example also does not work properly since I want to get [1, I].   

\begin{thepreliminarywork}{9}
\bibitem{Own1} The preliminary paper no. 1.
\bibitem{Own2} The preliminary paper no. 2.
\end{thepreliminarywork}

\begin{thebibliography}{9}
\bibitem{Ref1} The paper no. 1.
\bibitem{Ref2} The paper no. 2.
\end{thebibliography}

\end{document}

This gives correct numbering in both lists of citations. However the result of citation with \cite is always given by arabic numbers. Is there a way to correct my code? Or maybe there are some completely alternative solutions?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

You must redefine the internal command \@bibitem which is responsible for writing \bibcite command in the .aux file; we need that it writes \theenumiv and not \the\value{enumiv}.

\makeatletter
\newenvironment{thepreliminarywork}[1]
  {\chapter*{Preliminary Work}%
   \@mkboth{\MakeUppercase{Preliminary work}}{\MakeUppercase{Preliminary work}}%
   %%% Redefine (locally) \@bibitem
   \def\@bibitem##1{\item\if@filesw \immediate\write\@auxout
     {\string\bibcite{##1}{\csname the\@listctr\endcsname}}\fi\ignorespaces}%
   %%%
   \list{\@biblabel{\@Roman\c@enumiv}}%
     {\settowidth\labelwidth{\@biblabel{#1}}%
      \leftmargin\labelwidth
      \advance\leftmargin\labelsep
      \@openbib@code
      \usecounter{enumiv}%
      \let\p@enumiv\@empty
      \renewcommand\theenumiv{\@Roman\c@enumiv}}%
   \sloppy
   \clubpenalty4000
   \@clubpenalty \clubpenalty
   \widowpenalty4000%
   \sfcode`\.\@m}
   {\def\@noitemerr
     {\@latex@warning{Empty `thepreliminarywork' environment}}%
    \endlist}
\makeatother

I've also changed the \@mkboth command to produce "Preliminary work" in the headers.

share|improve this answer
    
Thank you very much! –  Andrew Dec 1 '12 at 11:43
    
A (minor, nit-picky) suggestion: One might want to tell the user to call the thepreliminarywork environment with an argument such as 78 ("Roman": LXXVIII) rather than the "usual" value of 99 or 100 (which will get rendered much more compactly as IC and C...) to make LaTeX set aside enough space for (Roman-numbered) labels, or one could use the value of 78 as the default value for the calculation of the \labelwidth calculation. :-) –  Mico Dec 1 '12 at 11:51
    
@Mico Of course you're right; I'd suggest to wait until the list of "preliminary work" items is in final form and to look at the widest label. –  egreg Dec 1 '12 at 12:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.