In a htlatex compiled document a standard enumerated list environment shows up as a <li class="itemize"> tag.

For the pdf version I have loaded the enumitem package to aid with list customizations, but I am pretty sure that this won't help much (I think this might be relevant because the following customizations don't have any effect).

  • \setlist[itemize,]{label=$-$}
  • \setlist[itemize]{itemsep=0mm}
  • \renewcommand{\labelitemi}{$-$}

Since I just want a ~ space and a symbol like a hyphen because this is to be a plain text document, not an html document

I would like to either

  1. Remove the introduced itemize tag and print out my manually produced formatting

  2. Customize how the html file process the itemized output

So, I am not sure if either of these are possible but the respective possibilities might be to either:

  1. Rebuild the itemize environment so the tex compiler can deal with the desired text, or
  2. Reprogram the formatting display using css instructions in the custom config file that htlatex receives as a command line argument.

If I could get some direction as to which of these two approaches htlatex is designed to work with I will devise and post a MWE with the relevant attempt at redefining or customizing the list environment.


CFG file to try and accommodate list formatting modifications on the tex4ht compile side:

\Configure{@HEAD}{\HCode{<script type="text/javascript" src="underlinesec.js"></script>\Hnewline}}
\ConfigureList{itemize}{\HCode{\Hnewline}}{\HCode{\Hnewline}}{\setbox0=\hbox\bgroup}{\egroup\HCode{\Hnewline}  - }
\def\sechead#1#2{.#1Head #2,.like#1Head #2}
\def\sections#1{\sechead{section}{#1}, \sechead{section}{#1}, \sechead{subsection}{#1}, \sechead{subsubsection}{#1}}
\Css{\sections{.titlemark:after}{content:" ";}}
\Css{\sechead{section}{}{font-weight:normal;font-size: 100\%;text-align:left;text-transform: uppercase;}}
\Css{body{font-family: 'Lucida Console', sans-serif;}}

This config file puts me half way home, I get my plain tex list items, but I don't get my new lines as would be expected by the \HCode{\Hnewline} nor are these lines an accessible part of the file. Copying the text out and pasting it into notepad doesn't preserve these new lines.

Ideally as well there will be no line breaks between a paragraph and the start of a list (a new line yes, but not blank lines). I thought I could accomplish this by leaving arguments #2 and #3 blank, but I get a tag free collection of line breaks in the html source

class="newline" />last line of text before the list</p>

  • Did you intend that one aspect of your question seems to concern the turning of an ordered list into an unordered one? Or does li class="itemize" not have that implication?
    – cfr
    Commented Jan 3, 2016 at 3:07
  • @cfr If I had to hazard a guess, I believe the html tag that gives you the itemize formatting isn't order dependent because it's just a tag/prefix that is present before each item not just the beginning of the environment - that one looks like <ul class="itemize1"> (I didn't mention this one because I didn't think I would need to adapt it. I would either ignore it because the prefix and symbol were customized in the css file, or I wouldn't have this because I only simulate the appearance of an automatically formatted list in a new environment handled by the compiler.)
    – EngBIRD
    Commented Jan 3, 2016 at 4:18
  • So it isn't the environment which shows up that way but the individual items?
    – cfr
    Commented Jan 3, 2016 at 15:01
  • @cfr yes and no I think. The environment may handle wrapping and indents while the items may handle the symbols and subsequent spaces.
    – EngBIRD
    Commented Jan 3, 2016 at 15:31

1 Answer 1


Lists are configured using \ConfigureList{listname}{start tag}{end tag}{item label start}{item label end}. Sample configuration might look like this:

\ConfigureList{itemize}{\HCode{<br />\Hnewline}}{\HCode{<br />\Hnewline}}{\DeleteMark}{\HCode{<br />\Hnewline} -}

\HCode{<br />\Hnewline} inserts line break, the interesting part is {\DeleteMark}{\HCode{\Hnewline} -} - it discards the bullet item, breaks line and print -.

Fot complete config file, we may use my example configuration for Wiki markup:


\ConfigureList{itemize}{\HCode{<br />\Hnewline}}{\HCode{<br />\Hnewline}}{\DeleteMark}{\HCode{<br />\Hnewline} -} 

% remove html structure





% remove section id

% remove <p> elements

% \DeclareFieldFormat[article]{entrytype}{Cite journal}
% \DeclareFieldFormat*{titlecite}{{title=#1}}%
% \DeclareFieldFormat*{yearcite}{{year={#1}}}%
% \DeclareNameFormat*{labelname}{\ifthenelse{\value{listcount}=1}{#1}{}}
% \DeclareCiteCommand{\cite}%
%   {\printnames{labelname}\HCode{<ref>}\{\{}%
%   {%
%   \printfield{entrytype}
%   \setunit{|}%
%   \printtext{author=}%
%   \printnames{author}%
%   \setunit{|}%
%   \printfield[titlecite]{title}%
%   \setunit{|}%
%   \printfield[yearcite]{year}%
%   }%
%   {}%
%   {\}\}\HCode{</ref>}}%



A sample file:




  \item first item

  \item second \textit{item}

  \item some longer snippet of text. We hope that it may break the line
    somewhere. So it should be longer than it is currently. How about this? It might be enough.



is converted to:


 -first item

 -second ''item''

  -some  longer  snippet  of  text.  We  hope  that  it  may  break  the  line
     somewhere. So it should be longer than it is currently. How about this? It
     might be enough.

there is lot of white space but I guess it shouldn't be problem. You can remove some \Hnewlines if you want.

  • Thanks, but I'm a very puzzled. I have been trying to get this work for the last couple days, because when I run your cfg and tex files as above I get a single line of text in the html document. In debugging further I noticed that I loose my line breaks when I include \Configure{HtmlPar}{}{}{\HCode{\Hnewline}}{\HCode{\Hnewline}}. I get my initial line break when the only addition to my config file is \ConfigureList{itemize}{\HCode{\Hnewline}}{\HCode{\Hnewline}}{\setbox0=\hbox\bgroup}{\egroup\HCode{\Hnewline} -} but no breaks inbetween items of the same list. I will update my question.
    – EngBIRD
    Commented Jan 6, 2016 at 1:48
  • @EngBIRD you can remove the \Configure{HtmlPar} and try to add \Css{body{white-space:pre-line;}} instead
    – michal.h21
    Commented Jan 6, 2016 at 8:14
  • Thanks, I tried that but now there's blank lines everywhere, I can't seem to figure out what the pattern is behind their insertions, it doesn't seem to correspond to new line requests or blank spaces in the tex file... More perplexing, is the observation that these line breaks aren't preserved when I copy the file into notepad.
    – EngBIRD
    Commented Jan 7, 2016 at 23:16
  • @EngBIRD new lines are generally inserted with \Hnewline macros in configurations. )
    – michal.h21
    Commented Jan 7, 2016 at 23:20
  • I think I have figured out the crux of my problem: Using information you posted michal-h21.github.io/src4ht/tex4ht-infose2.html#x7-40002.2, my latest cfg customization uses this line \ConfigureList{itemize}{}{}{\HCode{\Hnewline}~~-~\DeleteMark}{} but argument #4 doesn't insert a line break. Is there a box or unbreakable paragraph that I have stumbled upon? Would this supersede a functional HTML or JS line break command?
    – EngBIRD
    Commented Jan 10, 2016 at 5:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .