Hi,
In an application I need a list environment to sometimes number
from where it last left off and at other times start at 1.
This is how I can do it in LaTeX (complete example):
\documentclass[11pt]{article}
\usepackage{html}
\newcommand{\head}[1]{\leftline{\sc #1}}
\newcommand{\sect}[1]{\section*{\sc #1}}
\newcommand{\ssec}[1]{\subsection*{\sc #1}}
\newcommand{\sssec}[1]{\subsubsection*{\sc #1}}
\newcounter{last}
\newcommand{\save}{\setcounter{last}{\theenumi}}
\newcommand{\restore}{\setcounter{enumi}{\thelast}}
\newenvironment{papers}{\begin{list}{\textbf{\arabic{enumi}}}
{\usecounter{enumi}
\setlength{\labelsep}{8pt}
\setlength{\parsep}{2pt}
\setlength{\itemsep}{0pt}}}
{\save\end{list}}
\begin{document}
\head{PUBLICATIONS OF JOE BLOW}
\sect{Theses}
\begin{papers}
\item Thesis 1
\item Thesis 2
\item Thesis 3
\end{papers}
\sect{Books}
\begin{papers}
\item Book 1
\item Book 2
\end{papers}
\sect{Research papers}
\ssec{1970}
\begin{papers}
\item Paper 1
\end{papers}
\ssec{1973}
\begin{papers}\restore
\item Paper 2
\item Paper 3
\item Paper 4
\end{papers}
\ssec{1974}
\begin{papers}\restore
\item Paper 5
\end{papers}
\end{document}
This works fine in LaTeX ... but for LaTeX2HTML 98.1p4 the effect is as if
the role of \save and \restore were reversed.
BTW I had no joy at all with earlier versions of LaTeX2HTML 98.1p4.
After trying a number of other variations I finished up with
%begin{latexonly}
\newenvironment{papers}[1]{\begin{list}{\textbf{\arabic{enumi}}}
{\usecounter{enumi}
\setcounter{enumi}{#1}
\addtocounter{enumi}{-1}
\setlength{\labelsep}{8pt}
\setlength{\parsep}{2pt}
\setlength{\itemsep}{0pt}}}
{\end{list}}
%end{latexonly}
\begin{htmlonly}
\def\papers#1{\begin{rawhtml}<\end{rawhtml}OL START = #1 \rawhtml>\endrawhtml}
\def\endpapers{\begin{rawhtml} </OL> \end{rawhtml}}
\renewcommand{\item}{\begin{rawhtml} <LI> \end{rawhtml}}
\end{htmlonly}
in place of my original papers environment definition. This
environment takes an argument to initiate the counter with ...
and I had to use AmSTeX style delimiters for the environments,
e.g.
\ssec{1973}
\begin{papers}\restore
\item Paper 2
\item Paper 3
\item Paper 4
\end{papers}
became
\ssec{1973}
\papers{2}
\item Paper 2
\item Paper 3
\item Paper 4
\endpapers
Under LaTeX2HTML 98.1p1 this translates fine (but I had to forsake
boldfacing the numbers). However under LaTeX2HTML 98.1p4 it breaks
... the argument of papers is printed literally and then the list items
always start from 1.
Regards,
Greg Gamble
___________________________________________________________________
Greg Gamble __________________ mailto:[EMAIL PROTECTED]
Department of Mathematics ___ Tel: +61-8 9380 3383
The University of Western Australia Fax: +61-8 9380 1028
NEDLANDS WA 6907 AUSTRALIA http://maths.uwa.edu.au/~gregg/
___________________________________________________________________