0

Hi I am trying to put the Sigma in the center to define a matrix. But I have not been able to do so. Any suggestions?

\begin{equation}
  \mathbf{\Sigma} = \begin{tikzpicture}[baseline=($\mathbf{\Sigma}$.center)]
  \begin{tikzpicture}
      \matrix[matrix of math nodes,left delimiter = {[},right delimiter ={]},row sep=10pt,column sep = 10pt] (m)
  {
    \Sigma_{1,1}&\Sigma_{1,2} &\Sigma_{1,1}\\
    \Sigma_{2,1}&\Sigma_{2,2} &\Sigma_{2,1}\\
    \Sigma_{1,1}&\Sigma_{1,2} &\Sigma_{1,1}\\
  };
  \begin{pgfonlayer}{background}
    \node[inner sep=3pt,fit=(m-1-1)]          (1)   {};
    \node[inner sep=3pt,fit=(m-2-1) (m-3-2)]  (2)   {};
    \node[inner sep=3pt,fit=(m-3-3)]          (3)   {};
    \draw[rounded corners,dotted,fill=green!50!white,inner sep=3pt,fill opacity=0.1]
    (1.north west) |- (3.south east) |- (2.east) |- (2.north) |- (1.north) -- cycle;
  \end{pgfonlayer}
\end{tikzpicture}
\end{equation}
0

As stated in my comment, you could try using baseline={([yshift=-1ex]current bounding box.center)} (see this answer), like:

\documentclass[11pt]{article}

\usepackage{tikz}
\usetikzlibrary{matrix,backgrounds,calc,fit}

\begin{document}

\begin{equation}
  \mathbf{\Sigma} = \begin{tikzpicture}[baseline={([yshift=-1ex]current bounding box.center)}]
    \matrix[matrix of math nodes,left delimiter={[},right delimiter={]},row sep=10pt,column sep=10pt] (m) {
      \Sigma_{1,1} & \Sigma_{1,2} & \Sigma_{1,1} \\
      \Sigma_{2,1} & \Sigma_{2,2} & \Sigma_{2,1} \\
      \Sigma_{1,1} & \Sigma_{1,2} & \Sigma_{1,1} \\
    };
    \begin{pgfonlayer}{background}
      \node[inner sep=3pt,fit=(m-1-1)]          (1) {};
      \node[inner sep=3pt,fit=(m-2-1) (m-3-2)]  (2) {};
      \node[inner sep=3pt,fit=(m-3-3)]          (3) {};
      \draw[rounded corners,dotted,fill=green!50!white,inner sep=3pt,fill opacity=0.1]
        (1.north west) |- (3.south east) |- (2.east) |- (2.north) |- (1.north) -- cycle;
    \end{pgfonlayer}
  \end{tikzpicture}
\end{equation}

\end{document}

Result:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.