[tex4ht] [bug #344] tex4ht may generate HTML file with incorrect indent

Reinhard Kotucha reinhard.kotucha at web.de
Wed Dec 14 22:47:43 CET 2016


On 2016-12-13 at 17:48:36 -0800, William F Hammond wrote:

 > Karl Berry wrote:
 > 
 >     Indeed, \centering is the declaration, while \center is the
 >     environment.  LaTeX is somewhat forgiving about this, but I
 >     don't think tex4ht can be. Sorry.
 > 
 > AFAIK the use of \center to introduce the LaTeX "center"
 > environment is an undocumented feature that happens to work
 > sometimes with some TeX engines.  I believe that the only
 > documented way to introduce the environment is with "\begin{center}".

LaTeX environments work like this:

  \begin opens a new group and executes its argument.  Of course, a
  control sequence called \center must exist.

  \end executes \csname endcenter\endcsname (in this case) and closes
  the group.  Thus a control sequence \endcenter doesn't have to
  exist.

So you can use control sequences in environments which are not
explicitly designed for this purpose.  \small is a declaration and
there is no \endsmall.

  \begin{small}
    some text
  \end{small}
 
expands to something like

  \bgroup\small some text\csname endsmall\endcsname\egroup

And if \endsmall is \undefined it's equivalent to

  \bgroup\small some text\egroup

This (using declarative control sequences in environments) is an
undocumented feature indeed, but I'm convinced that many LaTeX users
found out that it works somehow and use it with pleasure.

However, LaTeX is more complex and sometimes the environment variant
produces extra vertical space at the bottom.  I don't know why.

Regards,
  Reinhard

-- 
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------



More information about the tex4ht mailing list