Is there a way to add LaTeX packages to jupyter lab? I need "math tools" package for making a matrix look compact since "asmmath" package (which jupyter seems to have) is not adequate for my purposes.
I am trying to write a compact looking inline 4x4 matrix as enormous matrices looks ugly in inline usage.
Writing $\begin{bmatrix} -c^2 & 0 & 0 & 0\\ 0 & \frac{a^2(t)}{1-kr^2} & 0 & 0\\ 0 & 0 & a^2(t)r^2 & 0\\ 0 & 0 & 0 & a^2(t)r^2sin^2\theta \end{bmatrix}$
for 4x4 matrices results in something not appropriate for inline uses due to its size. Normally "asmmath" package has a solution for this as following: $\big[\begin{bmatrix} -c^2 & 0 & 0 & 0\\ 0 & \frac{a^2(t)}{1-kr^2} & 0 & 0\\ 0 & 0 & a^2(t)r^2 & 0\\ 0 & 0 & 0 & a^2(t)r^2sin^2\theta \end{bmatrix}\big)$
But this definition fails for 4x4 matrices. It makes the "[]" smaller but its content overflows to outside.
"mathtools" package offers the exact same definition in a more compact way... and for some reason it works correctly even for 4x4 matrices. The definition from "mathtools" package is given below:
$\begin{bsmallmatrix} -c^2 & 0 & 0 & 0\\ 0 & \frac{a^2(t)}{1-kr^2} & 0 & 0\\ 0 & 0 & a^2(t)r^2 & 0\\ 0 & 0 & 0 & a^2(t)r^2sin^2\theta \end{bsmallmatrix}$
So that's why I need to find out a way to add "mathtools" LaTeX package to Jupyter Lab.