How to replicate this matrix using Latex in R Markdown

I'm new to R and I'm currently writing a markdown for a project. However, I am facing a problem when reproducing the following matrices:

https://imageshack.com/i/f02dxhpHp https://imageshack.com/i/p1X5khBRp

Specifically, can you tell me how to reproduce curly braces?

The code I have written so far:

\begin{equation*}
\mathbf{A_{eq}} =
\left[ \begin{matrix}
1 & 1 & \ldots
& 1 & & 0 & & 0 & \ldots
& 0 \\
w_1 & w_2 & \ldots
& w_n & & 0 & & 0 & \ldots
& 0\\
\end{matrix} \right] 
\mathbf{a_{eq}} =
\left[ \begin{matrix}
1 \\
\bar{r} \\
\end{matrix} \right] 
\end{equation*}

      

+3


source to share


1 answer


These curly braces are executed using the command \overbrace{<you_code>}

. For more information, see page 250 of the guidebook (in Italian as you suggest nickname), you can find it here or the LaTeX section on Stackexchange.For non-Italian speakers, information and examples about \overbrace{}

can be found here .

I find it a very difficult task to translate this code into markdown. My advice is to use R markdown and embed the LaTeX code (which is the provided code) in it and knit it as PDF. Your code will render well because knitr PDF uses pdfLaTeX as a sub engine. Of course, if you try to bundle it as HTML, you're going to have a bad day and the output is useless with pure LaTeX code that won't interpret well.



Edit

As Roberto pointed out \overbrace{<you_code>}

, doesn't seem to work with the standard (and "ancient") matrix environment.

0


source







All Articles