mathjax / mathjax/MathJax

Support for \hline and \cline in Arrays (\begin{array})

Open
#3,471 1 comment 0 reactions 1 assignee View on GitHub

@dpvc is already working on this.

Since Dec 28, 2025.

Code Example Feature Request v4
Dominant language
JavaScript
Stars
10.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
I am looking to implement support for array/matrix commands like \cline{i-j} and &&\hline within MathJax, as they are currently unsupported, which hinders the rendering of structures like long division and matrices requiring partial horizontal separation.

\[
	\begin{array}{l}
		  &       &   & 6 & 8 \\
		  &       &    \hline
		8 & \big) & 5 & 4 & 4 \\
		  &       & 4 & 8 &   \\
		  &        \hline
		  &       &   & 6 & 4 \\
		  &       &   & 6 & 4 \\
		  &       &   &    \hline
		  &       &   &   & 0
	\end{array}
\]

Describe the solution you'd like
I intend to add support for these commands. I believe that since MathJax already uses SVG output for \mtable , it should be technically feasible to draw the necessary horizontal lines (with appropriate starting positions, lengths, and heights) directly onto the existing SVG structure based on the parsed commands.

I would greatly appreciate any suggestions from the core developers on how to implement this.

Describe alternatives you've considered

Additional context
Alternatively, if full implementation is not immediately feasible, what is the best way to handle these commands so they gracefully degrade to a full-row \hline ? This would ensure the array structure is not corrupted, even if the line rendering is technically incorrect.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.