I am using htlatex to generate the HTML version of book and I am having problems with vertical spacing. I have configured an environment like this:
\ScriptEnv{tawny}
{\begin{samepage}\IgnorePar\EndP\HCode{<pre><code class="tawny">}\EndNoFonts}
{\NoFonts \HCode{</code></pre>}\end{samepage}}
I am then using Javascript to syntax highlight this.
The problem is that, although I am using \ScriptEnv, htlatex still inserts large vertical spaces at times. So, for instance, in this HTML,
http://homepages.cs.ncl.ac.uk/phillip.lord/take-wing/take_wing.html
This code:
\begin{tawny}
(as-subclasses
PizzaComponent
:disjoint :cover
(defclass PizzaBase)
(defclass PizzaTopping))
\end{tawny}
is coming out like this:
<pre><code class="tawny">(as-subclasses
PizzaComponent
:disjoint :cover
(defclass PizzaBase)
(defclass PizzaTopping))
</code></pre>
Obviously, as I am in a pre environment, this gap turns up in the final presentation on screen.
I do not get this gap in all environments, and it is inconsistent. It does not occur with small code snippets. I believe that the source of the error is coming from the pagination that tex is applying. Looking at the DVI file that is produced by htlatex, these gaps always occur at page breaks in the DVI, even though the page break is meaningless in the HTML.
I have tried adding samepage (you can see this in my configuration above) which does seem to reduce the problem, but not remove it entirely.
Is there any way I can stop this?
\paperheight– michal.h21 Oct 07 '14 at 11:09