typst-tablex icon indicating copy to clipboard operation
typst-tablex copied to clipboard

Feature request: Nice Matrix support

Open fyuniv opened this issue 1 year ago • 3 comments

There is a LaTeX package NiceMatrix that is similar to tabular but support nice matrix output. For example, one may add row and/or indices, and add colors, draw vertical or horizontal line segments. I think typst-tablex is totally cable of producing nicer matrix. The following is an example.

#import "@preview/tablex:0.0.6": *
#tablex(
  columns: (auto, 3pt,)+(auto,)*3+(3pt,), 
  auto-lines: false, 
  align: center + horizon,
  map-cells: cell => {
    cell.content = {show math.equation: set text(0.8em); cell.content}
    if cell.x == 0 {cell.content = text(red, cell.content)}
    if cell.y == 0 {cell.content = text(blue, cell.content)}
    cell
    },
  [], [],  $C_1$,$ C_2$, $C_3$, [],
  $R_1$, rowspanx(2)[$lr("(", size: #300%)$], $a_11$, $a_12$, $a_13$, rowspanx(2)[$lr(")", size: #300%)$],
  $R_2$, $a_21$, $a_22$, $a_23 + a_(12)$,
)

Is it possible that typst-tablex provides an function that similar to the original mat() function, but can easily place the delimiter after the $k$-th column below the $j$-th row?

fyuniv avatar Dec 17 '23 03:12 fyuniv