The MWE below is issued from here
It compiles with no errors when using: Latex —> Biber —> Latex. Moreover, it produces exactly the desired result.
However, when compiling using: htlatex —> Biber —> htlatex, it produces the following kind of warnings at the second htlatex compilation:
l.310 --- TeX4ht warning --- Problem with 'list' environment. Expected syntax:
\begin{list}{label}{spacing} \item.... \end{list} ---
! Missing number, treated as zero.
<to be read again>
\c:\end:itm
l.310 ...ography[title={Publication list by year}]
?
Moreover, it skips all newlines, corresponding to new bib entries, in the html file, which seems to be in direct connexion with the warning message.
Is it an incompatibility or a bug? Any help or workaround will be very much appreciated.
Here is the MWE: [EDITED: adding 2 @misc references to the right MWE]
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Article{c,
date = 2020,
author = {Author, BBB},
title = {Title},
journaltitle = {Journal},
volume = 10,
number = 4,
pages = {100-141}}
@Misc{hh,
date = 2003,
author = {Misc, Misc},
title = {Misc},
journaltitle = {Misc},
pages = {100-141}}
@Report{hh2,
date = 2020,
author = {Misc, Misc},
title = {Misc},
journaltitle = {Misc},
pages = {100-141}}
@Misc{hh3,
date = 2005,
author = {Misc, Misc},
title = {Misc},
journaltitle = {Misc},
pages = {100-141}}
@Article{d,
date = 2003,
author = {Author, Amy},
title = {Title},
journaltitle = {Journal},
volume = 10,
number = 4,
pages = {100-141}}
@Article{i,
date = 2016,
author = {Author, Amy},
title = {Title},
journaltitle = {Journal},
volume = 10,
number = 4,
pages = {100-141}}
@patent{l,
year = 2016,
author = {Author, Amy},
title = {Patent 1},
number = 4,
pages = {100-141}}
@inproceedings{j,
date = 2020,
author = {Author, Amy},
title = {Title 1},
journaltitle = {Journal},
volume = 10,
number = 4,
pages = {100-141}}
@patent{o,
year = 2016,
author = {Author, Amy},
title = {Patent 1},
number = 4,
pages = {100-141}}
@patent{m,
year = 2016,
author = {Author, Amy},
title = {Patent 2},
number = 4,
pages = {100-141}}
@Article{n,
date = 2016,
author = {Author, Amy},
title = {Title},
journaltitle = {Journal},
volume = 10,
number = 4,
pages = {100-141}}
@Article{b,
date = 2003,
author = {Author, Amy},
title = {Title},
journaltitle = {Journal},
volume = 10,
number = 4,
pages = {100-141}}
\end{filecontents*}
\usepackage[backend=biber,defernumbers=true,sorting=ydnt]{biblatex}
\addbibresource{\jobname.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\pertype{article}
\step[fieldset=presort,fieldvalue=article]
}
\map{
\pertype{inproceedings}
\step[fieldset=presort,fieldvalue=inproceedings]
}
\map{
\pertype{patent}
\step[fieldset=presort,fieldvalue=patent]
}
}
}
\DeclareSortingTemplate{rasha}{
\sort[direction=ascending]{
\field{year}}
\sort{\field{presort}}
}
\defbibenvironment{bibliography}
{\enumerate}
{\endenumerate}
{\item[]}
\newcounter{myyear}
\setcounter{myyear}{0}
\newcommand\printyear{\textbf{\hspace*{-\leftmargin}\printfield{year}}\par}
\newcommand\bibsection[1]{\hspace*{-\leftmargin}\textbf{#1}\par\noindent}
\newcommand\printenum{\stepcounter{enumi}\hspace*{-\leftmargin}\arabic{enumi}.\space}
\newcommand\mybibitem{\printenum}
\renewbibmacro{begentry}{%
\ifnumgreater{\thefield{year}}{\value{myyear}}
{\printyear%
\setcounter{myyear}{\thefield{year}}%
\setcounter{enumi}{0}%
\xdef\mylastentrytype{}%
}%
{}%
\iffieldequals{entrytype}{\mylastentrytype}
{}
{%
\setcounter{enumi}{0}%
\iffieldequalstr{entrytype}{article}%
{\bibsection{Journal Articles}}%
{ \iffieldequalstr{entrytype}{inproceedings}%
{\bibsection{Conference Papers}%
}%
{\iffieldequalstr{entrytype}{patent}%
{\bibsection{Patents}%
\setcounter{enumi}{0}%
}%
{}%
}%
}%
\xdef\mylastentrytype{\thefield{entrytype}}%
}%
\mybibitem%
}
\begin{document}
\nocite{*}
\begin{refcontext}[sorting=rasha]
\printbibliography[title={Publication list by year}]
\end{refcontext}
\end{document}
tex4ht
/htlatex
2018-07-03-10:36
. (In case the was any doubt, the output is as I expected. It looks pretty much like the PDF.) – moewe Feb 24 '20 at 16:44mwe
you posted on TeX4ht issue tracker and it fails to compile, so maybe you just posted wrong code here. – michal.h21 Feb 24 '20 at 16:53