Is it possible to add some configuration somewhere in order to have LaTeX list, such as:

 \item[keyword1] Description.
 \item[keyword2] Another description.
 \item[keyword3] Yet another.

formated as an HTML table by tex4ht, something like:

<tr><td>keyword2</td><td>Another description.</td></tr>
<tr><td>keyword3</td><td>Yet another.</td></tr>


Before you tell me that if I want a table I should use tabular, I'll say that I'm trying to adapt an old LaTeX document by modifying the .sty files, introducing as few changes as possible in the .tex. The customlist environment is defined as a list, introducing some kind of header, so the LaTeX output already looks a bit like a table.

My main problem with tex4t is that the descriptions are not the argument to any command, so I don't know how to introduce the </td></tr>part at the end of each row. The rest would probably be something along the lines of:


But of course, that does not create a valid table (at least not in XHTML, which is what I'd prefer).

Something that formats the list as a tabular in LaTeX would be welcome too.

  • 1
    Note the </td></tr> are optional in HTML, it is valid, and parses the same way, without them. Commented Aug 14, 2013 at 18:38
  • @DavidCarlisle You are right, of course... I guess I meant XHMTML, I've edited the question :)
    – Jellby
    Commented Aug 14, 2013 at 18:51
  • 1
    what about something like (untested): \ConfigureList{customlist} {\Tg<table>\def\trtdend{}} {\Tg</table>} {\trtdend\HCode{<tr><td>}\def\trtdend{\HCode{</td></tr>}}} {\Tg</td><td>}
    – michal.h21
    Commented Aug 14, 2013 at 19:13
  • @michal.h21 Interesting... I'd need to add \trtdend before the </table> too, but it seems to do the work.
    – Jellby
    Commented Aug 14, 2013 at 19:22
  • ok, I will add it as answer
    – michal.h21
    Commented Aug 14, 2013 at 19:24

1 Answer 1


You can use some helper macro:


Macro \trtdend is inserted in at every item. It is set empty at begining of the environment and in first item it is set to \HCode{</td></tr>} so these tags are correctly closed at every next item or at the end of the environment

You must log in to answer this question.

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