Search code examples
bloggermathjax

mathjax notation for a matrix in Blogger page


I am trying to produce below equation in my blogger page

enter image description here

using Mathjax notation :

$\begin{bmatrix} 230.1 & 37.8 & 69.8 \\ 44.5 & -39.3 & 45.1 \\ 17.2 & -45.9 & 69.3 \\ \vdots & \vdots & \vdots  \\ 8.6 & 2.1 & 1 \end{bmatrix}\begin{bmatrix} \beta_1 \\ \beta_2 \\ \beta_3 \end{bmatrix}$=$\beta_1$\begin{bmatrix} 230.1 \\ 44.5 \\ 17.2 \\ \vdots \\ 8.6 \end{bmatrix}+$\beta_2$\begin{bmatrix} 37.8 \\ -39.3 \\- 45.9 \\ \vdots \\ 2.1 \end{bmatrix}+$\beta_3$\begin{bmatrix} 69.8 \\ 45.1 \\ 69.3 \\ \vdots \\ 1  \end{bmatrix}

but above Mathjax renders as

enter image description here

Please suggest how to structure Mathjax so that it renders in one line.


Solution

  • Remove all the dollar signs except the one at the beginning and the end. You might want to use double dollars at the beginning and end, as this is better as a display equation than an in-line one.

    <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
    
    Your expression:
    
    $$\begin{bmatrix} 230.1 & 37.8 & 69.8 \\ 44.5 & -39.3 & 45.1 \\ 17.2 & -45.9 & 69.3 \\ \vdots & \vdots & \vdots  \\ 8.6 & 2.1 & 1 \end{bmatrix}\begin{bmatrix} \beta_1 \\ \beta_2 \\ \beta_3 \end{bmatrix}=\beta_1\begin{bmatrix} 230.1 \\ 44.5 \\ 17.2 \\ \vdots \\ 8.6 \end{bmatrix}+\beta_2\begin{bmatrix} 37.8 \\ -39.3 \\- 45.9 \\ \vdots \\ 2.1 \end{bmatrix}+\beta_3\begin{bmatrix} 69.8 \\ 45.1 \\ 69.3 \\ \vdots \\ 1  \end{bmatrix}$$

    I have used MathJax version 3, here, but you can use version 2.7 just as well. Note that I removed your dollar signs, and used $$ at the beginning and end of the expression, so that the entire equation is within (double) dollar signs.