Skip to content

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

@WizardMeow

Description

@WizardMeow

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code ExampleContains an illustrative code example, solution, or work-aroundFeature Requestv4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions