TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

htlatex adds horizontal lines around figures floats. For instance, the HTML output for the following tex:


is as follows:

<hr class="figure">
<div class="figure">
<p class="noindent">
<img src="photo.png" alt="PIC" class="graphics" width="250pt" height="250pt">
</div><hr class="endfigure">

I want to prevent automatic insertion of <hr>s around my figure. Is there any way to do so?

share|improve this question
You can use CSS to select hr.figure and hr.endfigure then to fix property display to none: hr.figure, hr.endfigure {display:none;} – Paul Gaborit Jul 17 '12 at 14:26
up vote 4 down vote accepted

The way htlatex translates LaTeX environments and commands into HTML entities is configured by the file html4.4ht.

On my Windows 7 computer using MikTeX, this file resides in the %HOMEPATH%\AppData\Roaming\MiKTeX\2.9\tex\generic\tex4ht directory.

You can provide your own configuration file when invoking htlatex. The rules defined there overrule the standard configuration.

> htlatex myfile.tex "myfile.cfg,html"

The configuration file is a LaTeX file as described here, for example.

Based on html4.4ht, I used the following configuration file myfile.cfg


% Removing div element surrounding tables and figures.
% Always ignore \hline commands. Tables will rather be styled using CSS.
% This one removes the rulers. Taking a look at html4.4ht should make 
% clear what has been changed.
   {\ifOption{refcaption}{}{\csname par\endcsname\ShowPar \leavevmode}}
{\ifvmode \IgnorePar \fi\EndP \HCode{}\csname par\endcsname\ShowPar}

Note that in order to remove HTML code that would otherwise being added, you have to use the \HCode{} command to generate an empty HTML output rather than just leaving the brackets empty.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.