[Tex/LaTex] Upper triangular matrix with empty space in lower triangular matrices How to represent this upper triangular matrix? Best Answer I'm not sure which part of the matrix was giving you trouble, but here's a sample: \documentclass{amsart} \DeclareMathOperator{\Var}{Var} \DeclareMathOperator{\Cov}{Cov} \begin{document} \[ \Var(\epsilon) = \begin{bmatrix} \Var(\epsilon_1) & \cdots & \cdots & \cdots & \Cov(\epsilon_1,\epsilon_p) \\ & \Var(\epsilon_2) & \cdots & \cdots & \Cov(\epsilon_2,\epsilon_p) \\ & \ddots & \cdots & \cdots & \vdots \\ & & \ddots & \cdots & \vdots \\ & & & \ddots & \vdots \\ & & & & \Var(\epsilon_p) \end{bmatrix} = \Omega_{(np\times np)}. \] \end{document} Notice that I've made Var and Cov into operators, which affects how they're typeset. The output: Related Solutions[Tex/LaTex] Upper triangular matrix with big zero in lower triangular \documentclass[]{article} \usepackage{mathtools} \begin{document} \[ \left( \begin{array}{ccccc} 1 \\ & 1 & & \text{\huge0}\\ & & 1 \\ & \text{\huge0} & & 1 \\ & & & & 1 \end{array} \right) \] \end{document} or \makebox(0,0){\text{\huge0}} if you want to have the same line spacing. [Tex/LaTex] How to shade or highlight the upper or lower triangular part in a matrix A solution would be: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,fit} \begin{document} \pgfdeclarelayer{background} \pgfsetlayers{background,main} \begin{tikzpicture} \matrix[matrix of math nodes,left delimiter = (,right delimiter = ),row sep=10pt,column sep = 10pt] (m) { 1 &3 &-8\\ 2 &0 &1\\ -7 &9 &1\\ }; \begin{pgfonlayer}{background} \node[inner sep=3pt,fit=(m-1-1)] (1) {}; \node[inner sep=3pt,fit=(m-1-2) (m-2-3)] (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) -- (2.north east) |- (3.south west) |- (2.south west) |- (1.south west) -- cycle; \end{pgfonlayer} \end{tikzpicture} \end{document} Related Question[Tex/LaTex] Highlight the upper or lower triangular portion of a matrixMatrix to triangle
Best Answer
I'm not sure which part of the matrix was giving you trouble, but here's a sample:
Notice that I've made
Var
andCov
into operators, which affects how they're typeset. The output: