I am probably missing something simple, but typing a lot of LaTeX
in markdown strings seems to be harder than it needs to be when Latexify
exists.
Therefore, is there a simpler way to output
using Markdown
md"""
``
\boldsymbol{Σ}^{-1} = \begin{bmatrix}\frac{\min(σ_1, σ_2)}{σ_1} & 0 \\ 0 & \frac{\min(σ_1, σ_2)}{σ_2}\end{bmatrix}
``
"""
which prints
using Latexify
? I came up with the following, but I wasn’t able to include \boldsymbol
using Latexify
@latexify Σ^(-1) = [min(σ_1, σ_2)/σ_1 0; 0 min(σ_1, σ_2)/σ_2]
and therefore this prints
So how to use \boldsymbol
in Latexify
?
@korsbo May I kindly ask if you have any insights as the package author? If it’s just not possible, that would also be a valuable information.
fgerick
September 18, 2024, 9:41am
3
you can use \bfSigma<tab>
to get this
@latexify 𝚺^(-1) = [min(σ_1, σ_2)/σ_1 0; 0 min(σ_1, σ_2)/σ_2]
which gives
L"$\mathbf{\Sigma}^{-1} = \left[
\begin{array}{cc}
\frac{\mathrm{min}\left( \sigma_{1}, \sigma_{2} \right)}{\sigma_{1}} & 0 \\
0 & \frac{\mathrm{min}\left( \sigma_{1}, \sigma_{2} \right)}{\sigma_{2}} \\
\end{array}
\right]$"
It’s not \boldsymbol{\Sigma}
, but I think for this example it’s the same?
It doesn’t work for example for \bfnabla
:
julia> @latexify 𝛁∇
L"$\mathbf{\nabla}\nabla$"
since \mathbf{\nabla}
is the same as \nabla
2 Likes
fgerick:
\bfSigma<tab>
Wow, I didn’t know that this is possible. In my case it’s \biSigma<tab>
(bold and italic due to being variable).
Thank you very much, this is a more elegant solution than I had hoped for!
1 Like