question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Links in last row of aligned, array, matrix, frac, ... are not active

See original GitHub issue

Describe the bug: Links produced by \url{...} are not active in the last row of an array or matrix, nor in the denominator of a fraction.

The following examples show this on the KaTeX demo page (when the trust option is turned on):

\begin{array}{c}
\url{https://katex.org/} \text{ is active} \\
\url{https://katex.org/} \text{ is active} \\
\url{https://katex.org/} \text{ is inactive}
\end{array}
\frac
{\url{https://katex.org/} \text{ is active}}
{\url{https://katex.org/} \text{ is inactive}}

To Reproduce: Steps to reproduce the behavior:

  1. Go to https://katex.org
  2. Open the KaTeX Options pane and turn on the trust option (output html or htmlAndMathml)
  3. Enter either of the above examples
  4. The link in the bottom line does not react to hovering or clicking

Expected behavior: Links should be active wherever they are displayed

Screenshots: The links in the bottom lines look normal, but hovering or clicking on them has no effect; the links in the upper lines are active and react normally.

Screenshot 1 Screenshot 2

Environment (please complete the following information):

  • KaTeX Version: 0.12.0
  • Device: Desktop
  • OS: macOS
  • Browser: Safari
  • Version: 14.0.2

Additional context: Variations of the array example:

  • 1 row: link is active
  • 2 rows: link in last row is inactive
  • 3 rows: link in last row is inactive
  • 4 rows: links in last 2 rows are inactive (!)
  • 5 rows: links in last 2 rows are inactive

matrix has the same error. Presumably the implementations of \frac, {array} and {matrix} are closely related.

In the html generated by the \frac example, the following node appears to be covering the bottom line:

<span class="vlist" style="height: 0.90822em;"><span class=""></span></span>

When that node is deleted (manually in the browser) the link in the bottom line can be clicked.

I ran into this bug when using \href to link symbols in fractions to their definitions. For{array}, the following workaround makes both links active:

\begin{array}{c}
\url{https://katex.org/} \text{ is active} \\
\url{https://katex.org/} \text{ is active} \\{}
\end{array}

I don’t see a workaround for \frac (other than using an array with an \hline).

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pdmossescommented, Mar 27, 2021

I’d like to try using @kevinbarabash’s suggestion of setting pointer-events: none on the empty vlist that is covering up the bottom row. Is it possible to do that with a CSS selector?

The following CSS makes all the links clickable in my examples:

.katex .vlist-t2 > .vlist-r:nth-child(2) > .vlist {
  pointer-events: none;
}

Does that work in general, or are different selectors needed for other patterns of math display?

0reactions
parchedcommented, Aug 11, 2022

This still doesn’t work in 0.16.0. I’m using the workaround given above, but I’m unsure if it will cause any other issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Left alignment not working on array environment - TeX
You misunderstood the use the option l in array: each row of the array will be left-aligned w.r.t. the array , but rhe...
Read more >
Matrix (mathematics) - Wikipedia
In mathematics, a matrix (plural matrices) is a rectangular array or table of numbers, symbols, or expressions, arranged in rows and ... Not...
Read more >
LaTeX:Commands - Art of Problem Solving
We can build an array or matrix with the \begin{array}…\end{array} commands, and use \left and \right to properly size the delimiters around the...
Read more >
Matrices and Alignment - Matrix - PGF/TikZ Manual
The rules for how the pictures on any given column are aligned are very similar to the row alignment: Consider all cell pictures...
Read more >
nicematrix.pdf - CTAN
\end{NiceArray}$. \end{enumerate}. 1. an item. 2. n. 0 1 2 3 4. 5 un. 1 2 4 8 16 32. It's also possible...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found