1

I want to add the labels of the right side and bottom (строка столбец), like shown in the following picture:

enter image description here

This is the code of my current matrix

\begin{equation} T_{i j}(\varphi)=\left[\begin{array}{ccccccc} 1 & \ldots & \ldots & \ldots & \ldots & \ldots & 0 \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ \ldots & \ldots & \cos \varphi & \ldots & -\sin \varphi & \ldots & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ \ldots & \ldots & \sin \varphi & \ldots & \cos \varphi & \ldots & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ 0 & \ldots & \ldots & \ldots & \ldots & \ldots & 1 \end{array}\right] 

which generates the following

enter image description here

Finally to give it a cleaner look, I would like to get rid of the unnecessary dots enter image description here

2 Answers 2

2
+50

Option 1: With nicematrix (and mathtools for \mathclap command)

enter image description here

\documentclass{article} \usepackage{nicematrix, mathtools} \newcommand{\up}[1]{\overset{\textstyle\uparrow}{\mathclap{\textstyle#1\strut}}} \begin{document} \[ T_{ij}(\varphi)=\begin{bNiceMatrix}[last-row, last-col] 1\\ & 1\\ & & \ddots\\ & & & \cos\varphi & & -\sin\varphi & & & & i^{\mathit{th}}\mathit{ row}\\ & & & & \ddots\\ & & & \sin\varphi & & \cos\varphi & & & & j^{\mathit{th}}\mathit{ row}\\ & & & & & & \ddots\\ & & & & & & & 1\\ & & & & & & & & 1\\ & & & \up{i^{\mathit{th}}\mathit{ column}} & & \up{j^{\mathit{th}}\mathit{ column}} \end{bNiceMatrix} \] \end{document} 

Option 2: Without nicematrix

enter image description here

\usepackage{mathtools} \newcommand{\up}[1]{\overset{\textstyle\uparrow}{\mathclap{\textstyle#1\strut}}} \begin{document} \[ T_{ij}(\varphi)=\underset{\up{i^{\mathit{th}}\mathit{ column}}\hspace{5.33em}\up{j^{\mathit{th}}\mathit{ column}}\hspace{.4em}}{\begin{bmatrix} 1\\ & 1\\ & & \ddots\\ & & & \cos\varphi & & -\sin\varphi\\ & & & & \ddots\\ & & & \sin\varphi & & \cos\varphi\\ & & & & & & \ddots\\ & & & & & & & 1\\ & & & & & & & & 1 \end{bmatrix}} \begin{matrix} \\ \\ \phantom{\ddots}\\ i^{\mathit{th}}\mathit{ row} \\ \phantom{\ddots}\\ j^{\mathit{th}}\mathit{ row} \\ \phantom{\ddots}\\ \\ {} \end{matrix} \] \end{document} 
4

Here is a suggestion.

\documentclass{article} \usepackage{nicematrix} \usepackage{tikz} \begin{document} \newcommand{\Clap}[1]{\multicolumn{1}{w{c}{0mm}}{#1}} \NiceMatrixOptions{code-for-first-row = \scriptstyle,code-for-first-col = \scriptstyle } \setcounter{MaxMatrixCols}{12} \newcommand{\blue}{\color{blue}} \[\begin{pNiceMatrix}[last-row,last-col,nullify-dots,xdots/line-style={dashed,blue}] 1& & & \Vdots & & & & \Vdots \\ & \Ddots[line-style=standard] \\ & & 1 \\ \Cdots[color=blue,line-style=dashed]& & & \Clap{\blue \cos\theta} & \Cdots & & & \Clap{\blue -\sin\theta} & & & \Cdots & \blue \leftarrow i \\ & & & & 1 \\ & & &\Vdots & & \Ddots[line-style=standard] & & \Vdots \\ & & & & & & 1 \\ \Cdots & & & \Clap{\blue \sin\theta} & \Cdots & & \Cdots & \Clap{\blue \cos\theta} & & & \Cdots & \blue \leftarrow j \\ & & & & & & & & 1 \\ & & & & & & & & & \Ddots[line-style=standard] \\ & & & \Vdots & & & & \Vdots & & & 1 \\ & & & \blue \overset{\uparrow}{i} & & & & \blue \overset{\uparrow}{j} \\ \end{pNiceMatrix}\] \end{document} 

You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

1
  • I appreciate your suggestion. That looks kinda complicated Commented Jun 2, 2023 at 19:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.