<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Sylwester, <br>
I think it's a bug that should be fixed in mwbk.4ht.<br>
(probably also reported as such at
<a class="moz-txt-link-freetext" href="https://puszcza.gnu.org.ua/projects/tex4ht/">https://puszcza.gnu.org.ua/projects/tex4ht/</a>)<br>
<br>
Tracing down the error, I see that \mw@normalheading macro gives
trouble.<br>
<br>
<tt>\newcommand*\mw@normalheading{%</tt><tt><br>
</tt><tt> \if\mw@HeadingBreakBefore \hrule\@height\z@\nobreak</tt><tt><br>
</tt><tt> \else \addpenalty\@secpenalty \fi</tt><tt><br>
</tt><tt> \addvspace{\csname \mw@HeadingType @preskip\endcsname}%</tt><tt><br>
</tt><tt>................</tt><tt><br>
</tt><br>
The condition is TRUE if section is numbered, and FALSE if section
is unnumbered. <br>
In latter case \addpenalty is excuted and gives error if section
is not in vertical mode.<br>
(and most probably hyperref's hooks introduce code that puts
section in horizontal mode). <br>
<br>
possible fix in <i>mwbk.4ht</i>:<br>
<tt>\let\:o:mw@normalheading\mw@normalheading</tt><tt><br>
</tt><tt>\pend:def\mw@normalheading{\def\mw@HeadingBreakBefore{00}}</tt><tt><br>
<br>
</tt>This fix sets the if statement to be always TRUE.<br>
Another possible fix would be redefine \mw@normalheading macro <br>
dropping first two lines (I assume that these two lines are
irrelevant to html output) <br>
<br>
MWE for testing: <br>
\documentclass{mwbk}<br>
\usepackage{hyperref}<br>
\begin{document}<br>
\section*{bug}<br>
\subsection*{foo}<br>
\subsubsection*{bar}<br>
\end{document}<br>
<br>
<br>
Regards,<br>
<pre class="moz-signature" cols="160">--
Deimantas
</pre>
On 6/17/2014 11:59 AM, Sylwester Arabas wrote:<br>
</div>
<blockquote cite="mid:53A00356.5050102@igf.fuw.edu.pl" type="cite">Hi
Deimantas,
<br>
<br>
Thanks a lot! It works!
<br>
For the record: I had to also add:
<br>
<br>
\def\subsection@flags{0100}
<br>
\def\subsubsection@flags{0100}
<br>
<br>
Is it (or should it be) documented anywhere?
<br>
<br>
Regards,
<br>
Sylwester
<br>
<br>
On 17/06/14 07:10, Deimantas Galcius wrote:
<br>
> Hi Sylwester,
<br>
>
<br>
> try this way:
<br>
>
<br>
> \documentclass{mwbk}
<br>
> \usepackage[tex4ht]{hyperref}
<br>
> \setcounter{secnumdepth}{0}
<br>
> *\makeatletter**
<br>
> ** \def\section@flags{0100}**
<br>
> ** \makeatother*
<br>
> \begin{document}
<br>
> \section{bug}
<br>
> \end{document}
<br>
>
<br>
> --
<br>
> Deimantas
<br>
>
<br>
> On 6/16/2014 2:39 PM, Sylwester Arabas wrote:
<br>
>> Dear All,
<br>
>>
<br>
>> Having a problem compiling a large "mwbk" document with
tex4ht using
<br>
>> hyperref, I've managed to track down the problem to the
following
<br>
>> short code:
<br>
>>
<br>
>> \documentclass{mwbk}
<br>
>> \usepackage[tex4ht]{hyperref}
<br>
>> \setcounter{secnumdepth}{0}
<br>
>> \begin{document}
<br>
>> \section{bug}
<br>
>> \end{document}
<br>
>>
<br>
>> When trying to compile using htlatex, it gives the
following error:
<br>
>>
<br>
>> ...
<br>
>> No file bug.aux.
<br>
>> ! LaTeX Error: Something's wrong--perhaps a missing
\item.
<br>
>> See the LaTeX manual or LaTeX Companion for
explanation.
<br>
>> Type H <return> for immediate help.
<br>
>> ...
<br>
>> l.5 \section{bug}
<br>
>>
<br>
>>
<br>
>> Changing mwbk into book helps. Removing hyperref
inclusion helps.
<br>
>> Removing setcounter helps as well. Compiling with
"pdflatex" instead
<br>
>> of htlatex helps.
<br>
>>
<br>
>> Any help very welcome!
<br>
>> Thanks,
<br>
>> Sylwester
<br>
<br>
</blockquote>
<br>
</body>
</html>