1

I am converting latex to html/ebook using the command tex4ebook filename.tex .

When using the booktabs package, the line generated by \toprule, \midrule, \bottomrule are interrupted (have extra space) between the columns. Here is a screenshot:

Screenshot of Booktabs table after converting to html

How can I get continuous lines?

MWE :

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{lll}
\toprule
Computer Science Term &  Explanation & some  \\
\midrule
bias  &  intercept in regression & thing \\
weight & coefficient in regression & else  \\
pattern recognition & classification & yes \\
\bottomrule
\end{tabular} 
\end{document}

1 Answer 1

1

Edit:

If you use TeX Live, you can update your distribution, and rules should then work correctly.

Original:

I am not sure that you have an up-to date version of TeX4ht, because I don't get such result, the lines are connected for your example. There is a problem though, because by default, TeX4ebook produces Epub 2 ebooks, and there is a missing CSS instruction that cause the lines to disappear completely:

enter image description here

You can add the CSS instruction using the following .cfg file:

\Preamble{xhtml}
\Css{ table.tabular{border-collapse: collapse; border-spacing: 0;}}
\begin{document}
\EndPreamble

The result is then correct:

enter image description here

2
  • Thank you, this worked! I updated my miktex distribution (Windows), but I still get the same graph I originally posted. Does not matter; it works with the .cfg file.
    – Matthias
    Nov 10, 2021 at 16:41
  • @Matthias Miktex can have older files than TeX Live. I am glad that .cfg file works
    – michal.h21
    Nov 10, 2021 at 17:09

You must log in to answer this question.

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