1

This is tex4ht only issue.

I have table where first column has links to internal sections (hyperlinks).

These links are all numbers. They point to subsections which are not shown in the example below to keep it short.

The problem is, since the table is too wide, the links wrap around, depending on screen size of the browser, so the number instead of showing as 12345, it might show as

1
2
3
4
5

or

12
34
45

This only happens to link column, even though it has no space in it.

If the column had a normal text as number 12345, then it does not wrap around, since there is no space between the digits.

I'd like the link to behave the same as normal text with no space. Otherwise, it is hard to read these numbers if they keep wrapping around, depending on screen size.

Here is a movie showing this effect.

enter image description here

The second column Z, does not wrap. But the first column, the number there wrap, since it is a link. Even though both columns are both given same width of 0.7in each. These links are meant to be problem numbers.

Here is the code which generated the above

\documentclass[12pt]{book}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array}
\usepackage{hyperref}

\begin{document}
   
\begin{longtable}[c]{|p{0.7in}|p{0.7in}|p{0.06in}|p{0.06in}|p{.06in}|p{2in}|p{1.2in}|p{.2in}|p{.2in}|p{0.3in}|}\hline       
\# & Z & A & B & C & D & E &F& G&H \\\hline
\hyperlink{10000000}{10000000}&1000000&1&2&2&second order type 5&some long text&some long text &{\Large ok}&0.016\\ \hline
\hyperlink{200000}{200000}&20000&1&2&2&second order type 5&some long text&some long text&{\Large ok}&0.016\\ \hline
\hyperlink{300000}{300000}&30000&1&2&2&second order type 5&some long text&some long text&{\Large ok}&0.016\\ \hline
\end{longtable}
                
\end{document}

The command used to compile the above is

 make4ht --shell-escape -ulm default foo3.tex 
         "mathjax,htm,notoc*,p-width,charset=utf-8" " -cunihtf -utf8"

Using TL 2020 with latest updates to tex4ht.

1 Answer 1

2

This is just how HTML works. You may try some CSS tricks to prevent the line breaking, even if I don't think it is a good idea. The following configuration will prevent line breaking for hyperlinks in tables:

\Preamble{xhtml}
\Css{td a{white-space: nowrap;overflow: hidden;}}
\begin{document}
\EndPreamble

Note that it will prevent line breaking also for hyperlinks that contain normal text, which may lead to quite bad results if you have longer chunks of hyperlinked text in tables.

Anyway this is how it looks:

enter image description here

You must log in to answer this question.

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