hendricius / the-sourdough-framework

Open source book dedicated to helping you to make the best possible sourdough bread at home.
https://breadco.de/book
Creative Commons Attribution Share Alike 4.0 International
2.62k stars 136 forks source link

Prevent tex4ht to load enumitem #312

Closed cedounet closed 9 months ago

cedounet commented 9 months ago

Apparently it breaks on kobo e-reader, see https://github.com/hendricius/the-sourdough-framework/issues/306

michal-h21 commented 9 months ago

I was able to create a MWE that causes compilation errors with the enumitem package and the options used in the document:

\documentclass{article}
\usepackage{enumitem}
\setlist[description]{style=nextline, leftmargin=0cm}
\begin{document}
Hello

\begin{description}
  \item[hello] world
  \item[second] item
\end{description}
\end{document}

This version of enumitem.4ht fixes the errors:

% enumitem.4ht (2022-05-01-08:25), generated from tex4ht-4ht.tex
% Copyright 2009-2009 Eitan M. Gurari
% Copyright 2009-2022 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
\immediate\write-1{version 2022-05-01-08:25}

\AddToHook{env/enumerate/end}{\ifx\enit@after\@empty\else%
  \let\enit:after\enit@after
  \let\enit@after\@empty
  \let\enumerate:executed\@empty
  \append:def\end:DL{\enit:after}
\fi}

\def\enit@postlabel{}
\Hinput{enumitem}
\endinput

I hope it fixes the error in the Sourdough Framework too.

cedounet commented 9 months ago

Thanks @michal-h21.

We "fixed" as per the commit by just not loading it. Thing is that the document compiled and opened fine on calibre/... but was not opening on the kobo reader.

Do you have a kobo reader to test?

michal-h21 commented 9 months ago

@cedounet I thought that the issue for Kobo was caused by this crash with Enumitem, because it produced invalid HTML. Are there also other issues? Unfortunately, I don't have access to Kobo, so I cannot test it myself.

cedounet commented 9 months ago

I don’t know what crashed the kobo, but I know that only loading the Enumitem package crashed it. No need to use any of its feature to break the build.

same as you I do not have the device so can’t really tell you more.