2

After I updated Tex Live 2021 last night, I am finding that tex4ht no longer shows horizontal lines in tables.

Why is that, and how to get them to show again?

Here is MWE

\documentclass[12pt]{book}
\begin{document}

\begin{tabular}{|c|c|}\hline
A & B \\\hline 
C & D \\\hline 
\end{tabular}

\end{document}

Compiled using

>make4ht -ulm default -a debug foo2.tex "htm"
[INFO]    mkparams: Output dir:
[INFO]    mkparams: Compiler: dvilualatex
[INFO]    mkparams: Latex options: -jobname=foo2
[INFO]    mkparams: tex4ht.sty: xhtml,htm,charset=utf-8
[INFO]    mkparams: tex4ht:  -cmozhtf -utf8
[INFO]    mkparams: build_file: foo2.mk4
[INFO]    mkparams: Output format: html5
[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: foo2.tex
[INFO]    mkutils: Load extension       common_domfilters
[INFO]    mkutils: Cannot open config file      foo2.mk4
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param ext
[INFO]    make4ht-lib: Adding:  ext     dvi
[INFO]    htlatex: LaTeX call: dvilualatex --interaction=errorstopmode -jobname=foo2   '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode xhtml,htm,charset=utf-8,html5.a.b.c.\input "\detokenize{foo2.tex}"'
This is LuaTeX, Version 1.13.2 (TeX Live 2021)
....
Execute script `foo2.lg'

[INFO]    make4ht-lib: executing: t4ht  "foo2.dvi"
----------------------------
t4ht.c (2018-07-04-14:25 kpathsea)
t4ht foo2.dvi
(/usr/local/texlive/2021/texmf-dist/tex4ht/base/unix/tex4ht.env)
Entering foo2.lg
Entering foo2.css
Entering foo2.tmp

[INFO]    mkutils: Parse LG
[INFO]    make4ht-lib: parse_lg process file: foo2.htm
[INFO]    make4ht-lib: parse_lg process file: foo2.htm
[INFO]    make4ht: outdir:
[INFO]    make4ht-lib: parse_lg process file: foo2.css
[INFO]    make4ht: outdir:
[INFO]    make4ht-lib: parse_lg process file: foo2.tmp
[INFO]    make4ht-lib: tmp file
[STATUS]  make4ht: Conversion finished
>

Gives this HTML

enter image description here

The raw HTML it generated is

<!DOCTYPE html> 
<html lang='en-US' xml:lang='en-US'> 
<head><title></title> 
<meta charset='utf-8' /> 
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' /> 
<meta content='width=device-width,initial-scale=1' name='viewport' /> 
<link href='foo2.css' rel='stylesheet' type='text/css' /> 
<meta content='foo2.tex' name='src' /> 
</head><body> 
<div class='tabular'> <table class='tabular' id='TBL-1'><colgroup id='TBL-1-1g'><col id='TBL-1-1' /></colgroup><colgroup id='TBL-1-2g'><col id='TBL-1-2' /></colgroup><tr class='hline'><td></td><td></td></tr><tr id='TBL-1-1-' style='vertical-align:baseline;'><td class='td11' id='TBL-1-1-1' style='white-space:nowrap; text-align:center;'>A</td><td class='td11' id='TBL-1-1-2' style='white-space:nowrap; text-align:center;'>B</td></tr><tr class='hline'><td></td><td></td></tr><tr id='TBL-1-2-' style='vertical-align:baseline;'><td class='td11' id='TBL-1-2-1' style='white-space:nowrap; text-align:center;'> C </td> <td class='td11' id='TBL-1-2-2' style='white-space:nowrap; text-align:center;'>D</td>
</tr><tr class='hline'><td></td><td></td></tr></table>
</div>   
 
</body> 
</html>

But lualatex foo2.tex gives this PDF

>lualatex foo2.tex
This is LuaHBTeX, Version 1.13.2 (TeX Live 2021)
 restricted system commands enabled.
(./foo2.tex
LaTeX2e <2021-06-01> patch level 1
 L3 programming layer <2021-08-27>
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/book.cls
Document Class: book 2021/02/12 v1.4n Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/bk12.clo))
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-luatex.def)
(./foo2.aux) (/usr/local/texlive/2021/texmf-dist/tex/latex/base/ts1cmr.fd)
[1{/usr/local/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./foo2.aux))
 406 words of node memory still in use:
   3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 48 glue_spec
, 4 attribute_list, 1 write nodes
   avail lists: 2:58,3:4,4:1,5:23,6:2,7:112,8:1,9:56
</usr/local/texlive/2021/texmf-dist/fonts/opentype/public/lm/lmroman12-regular.
otf>
Output written on foo2.pdf (1 page, 3083 bytes).
Transcript written on foo2.log.
>

enter image description here

To verify, I compiled the same tex file on a Linux which I did not update texlive on. Using the same command as above. It gives there the correct output

>make4ht -ulm default -a debug foo2.tex "htm"
[INFO]    mkparams: Output dir: 
[INFO]    mkparams: Compiler: dvilualatex
[INFO]    mkparams: Latex options: -jobname=foo2  
[INFO]    mkparams: tex4ht.sty: xhtml,htm,charset=utf-8
[INFO]    mkparams: tex4ht:  -cmozhtf -utf8
[INFO]    mkparams: build_file: foo2.mk4
[INFO]    mkparams: Output format: html5
[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: foo2.tex
[INFO]    mkutils: Load extension   common_domfilters
[INFO]    mkutils: Cannot open config file  foo2.mk4
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param correct_exit
[INFO]    make4ht-lib: setting param ext
[INFO]    make4ht-lib: Adding:  ext dvi
[INFO]    htlatex: LaTeX call: dvilualatex --interaction=errorstopmode -jobname=foo2   '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode xhtml,htm,charset=utf-8,html5.a.b.c.\input "\detokenize{foo2.tex}"'
This is LuaTeX, Version 1.10.0 (TeX Live 2019) 
 restricted system commands enabled.
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-02-25> (./foo2.tex
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/book.cls
Document Class: book 2019/12/20 v1.4l Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/bk12.clo))
(/usr/local/texlive/2019/texmf-dist/tex/generic/tex4ht/tex4ht.sty)
(/usr/local/texlive/2019/texmf-dist/tex/generic/tex4ht/tex4ht.4ht
....

Execute script `foo2.lg'

[INFO]    make4ht-lib: executing: t4ht  "foo2.dvi"
----------------------------
t4ht.c (2018-07-04-14:25 kpathsea)
t4ht foo2.dvi 
(/usr/local/texlive/2019/texmf-dist/tex4ht/base/unix/tex4ht.env)
Entering foo2.lg
Entering foo2.css
Entering foo2.tmp

[INFO]    mkutils: Parse LG
[INFO]    make4ht-lib: parse_lg process file: foo2.htm
[INFO]    make4ht: outdir: 
[INFO]    make4ht-lib: parse_lg process file: foo2.css
[INFO]    make4ht: outdir: 
[INFO]    make4ht-lib: parse_lg process file: foo2.tmp
[INFO]    make4ht-lib: tmp file
[STATUS]  make4ht: Conversion finished

enter image description here

The raw HTML on this system seems little different (did not yet check where the difference is)

<!DOCTYPE html> 
<html lang="en-US" xml:lang="en-US" > 
<head><title></title> 
<meta  charset="utf-8" /> 
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)" /> 
<meta name="viewport" content="width=device-width,initial-scale=1" /> 
<link rel="stylesheet" type="text/css" href="foo2.css" /> 
<meta name="src" content="foo2.tex" /> 
</head><body 
> 
<div class="tabular"> <table id="TBL-1" class="tabular" 
 
><colgroup id="TBL-1-1g"><col 
id="TBL-1-1" /></colgroup><colgroup id="TBL-1-2g"><col 
id="TBL-1-2" /></colgroup><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-1-1-"><td  style="white-space:nowrap; text-align:center;" id="TBL-1-1-1"  
class="td11">A</td><td  style="white-space:nowrap; text-align:center;" id="TBL-1-1-2"  
class="td11">B</td></tr><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-1-2-"><td  style="white-space:nowrap; text-align:center;" id="TBL-1-2-1"  
class="td11"> C </td> <td  style="white-space:nowrap; text-align:center;" id="TBL-1-2-2"  
class="td11">D</td>
</tr><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-1-3-"><td  style="white-space:nowrap; text-align:center;" id="TBL-1-3-1"  
class="td11">  </td> 
</tr></table>
</div>   
 
</body> 
</html>

so something changed in tex4ht recently to cause this.

reference https://puszcza.gnu.org.ua/bugs/index.php?528

1 Answer 1

3

This is actually caused by make4ht. It automatically fixes some issues in the HTML code, one of which is that it removes horizontal lines from tables, assuming that they will be rendered using CSS. They aren't which is probably caused by my mistake. I will fix that in TeX4ht sources. In the meantime, you can use the following CSS in your configuration file:

\Preamble{xhtml}
\Css{tr.hline{border-top:1px solid black;}}
\begin{document}
\EndPreamble

The table then looks correctly:

enter image description here

You must log in to answer this question.

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