Border Matrix in Pluto

Hi,

I was wondering if it is possible to use a bordermatrix in Pluto? I tried the following without success:

md"
$M = \bordermatrix{~ & x & y \cr
              A & 1 & 0 \cr
              B & 0 & 1 \cr}$
"

this seems to work:



# ╔═╡ 0efec04f-c052-4f59-b41e-8dcc8f48a117
using Latexify

# ╔═╡ 64568856-c30a-40bd-93d6-258a4f3f77fd
L"\begin{align}
  f(x) &= ax^2 + bx + c \\
  &= \begin{array}{c c}
    & \begin{array} {@{} c c c @{}}
      u_1 & \cdots & u_q
    \end{array} \\
    \begin{array}{c}
      e_1 \\ \vdots \\ e_n
    \end{array}\hspace{-1em} &
    \left(
      \begin{array}{@{} c c c @{}}
        u_{11} & \cdots & u_{1q} \\
        \vdots &        & \vdots \\
        u_{n1} & \cdots & u_{nq}
      \end{array}
    \right) \\
    \mbox{} % Blank line to match column names so as to align the = vertically
  \end{array} \\[-12pt] % Correction for blank line
  &= ax^2 + bx + c
\end{align}"

you should be able to create a function to scaffold a julia type with the latex w/ latexify

another option is to try katex instead of mathjax:

the advantage of katex is that because it can be limited to one context (like a cell), it is more customizable.

Thank you for your answer. Is it possible to do this inside the notebook cell rather than the .jl file? The following did not work:

md"
L"\begin{align}
  f(x) &= ax^2 + bx + c \\
  &= \begin{array}{c c}
    & \begin{array} {@{} c c c @{}}
      u_1 & \cdots & u_q
    \end{array} \\
    \begin{array}{c}
      e_1 \\ \vdots \\ e_n
    \end{array}\hspace{-1em} &
    \left(
      \begin{array}{@{} c c c @{}}
        u_{11} & \cdots & u_{1q} \\
        \vdots &        & \vdots \\
        u_{n1} & \cdots & u_{nq}
      \end{array}
    \right) \\
    \mbox{} % Blank line to match column names so as to align the = vertically
  \end{array} \\[-12pt] % Correction for blank line
  &= ax^2 + bx + c
\end{align}"
"

CommonMark seems to work for me instead of the built in Markdown. It works in many situations where Markdown doesn’t work: CommonMark Math in Pluto

I had to remove the comments in the latex since they seemed to break the parser but worked fine after that.

# ╔═╡ d1657bc0-61e4-4129-9dd5-7bd7e89a3629
using CommonMark

# ╔═╡ f23b0978-7f30-47b1-b6bd-dbb72c25b82f
cm"""
``
\begin{align}
  f(x) &= ax^2 + bx + c \\
  &= \begin{array}{c c}
    & \begin{array} {@{} c c c @{}}
      u_1 & \cdots & u_q
    \end{array} \\
    \begin{array}{c}
      e_1 \\ \vdots \\ e_n
    \end{array}\hspace{-1em} &
    \left(
      \begin{array}{@{} c c c @{}}
        u_{11} & \cdots & u_{1q} \\
        \vdots &        & \vdots \\
        u_{n1} & \cdots & u_{nq}
      \end{array}
    \right) \\
    \mbox{} 
  \end{array}
  &= ax^2 + bx + c
\end{align}
``
"""

Thank you for your help!