0

I need a bit more extra vertical space between rows of a longtable. But \renewcommand\arraystretch{3} has no effect on the HTML output compare to PDF.

MWE

\documentclass[11pt]{article}%
\usepackage{longtable}
\renewcommand\arraystretch{3}
\begin{document}

\begin{longtable}{p{1in}|p{5in}}
1625 & Pietro Mengoli Alternative proof that harmonic series diverges\\
1638 & James Gregory. Born in Drumoak, United Kingdom. Scottish mathematician. Taylor series\\
\end{longtable}

\end{document}

Output of lualatex foo.tex is

Mathematica graphics

But output of make4ht foo.tex "htm,mathjax" is

Mathematica graphics

Since I want this vertical spacing for this table in this file only, without affecting other latex files, what is the correct way to do this and why is arraystretch is not having an effect?

2

I found this method after some trial and error. I am sure there is a better way, but it seems to work so far.

\documentclass[11pt]{article}%
\usepackage{longtable}

\ifdefined\HCode
\AtBeginDocument{%
\Css{td { 
    padding: 10px;
}}
}
\else
\renewcommand\arraystretch{3}
\fi

\begin{document}

\begin{longtable}{p{1in} p{5in}}
1625 & Pietro Mengoli Alternative proof that harmonic series diverges\\
1638 & James Gregory. Born in Drumoak, United Kingdom. Scottish mathematician. Taylor series\\
\end{longtable}

\end{document}

And now make4ht foo.tex "htm,mathjax" gives something similar to PDF. More vertical space between rows of table.

Mathematica graphics

|improve this answer|||||
  • this is the correct way. Only change that I would do, is that I would put it in a .cfg file – michal.h21 Jan 3 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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