Final Result:


有一种可能是用户在安装时没有选择「full-scheme」

如果选择了medium而不是full安装方案,有可能会影响一些字体方面的,很讨厌
我自己非常建议新人就 scheme-full——by OsbertWang
如果遇到了上述问题,且texlive要是已经安装完了
用户可以尝试使用下面的命令「full-scheme」重新安装并刷新字体缓存:
tlmgr --reinstall install scheme-full请提供一个完整的,可让人直接编译后能复现你问题的最短代码。
你提供的代码内容 惜码如金 ,连]都没闭合...

为了追求更高质量的位置、长度自定义,如「方正」、「规整」等,同时受我自己的这个回答启发,我也用tikz的matrix子库自己实现了...
下面保留了matrix of math nodes的边界:
\documentclass{article}
\usepackage[OT1]{fontenc}
\usepackage{eulervm}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy,matrix}
% https://tex.stackexchange.com/a/112212/322482
\makeatletter
\DeclareRobustCommand{\rvdots}{%
\vbox{
\baselineskip4\p@\lineskiplimit\z@
\kern-\p@
\hbox{.}\hbox{.}\hbox{.}
}}
\makeatother
\newcommand*\myHbrace[3][0pt]{%
\draw[mybrace] (foo-#2.north west) -- node[above=3pt] {#3} (foo-#2.north east);
}%
\newcommand*\myVbrace[3][8pt]{%
\draw[mybrace=#1] (foo-#2.north east) -- node[right=8pt] {#3} (foo-#2.south east);
}%
\begin{document}
\begin{tikzpicture}[
every left delimiter/.style={xshift=.5em},
every right delimiter/.style={xshift=-.5em},
% https://tex.stackexchange.com/a/525165/322482
mybrace/.default=3pt,
mybrace/.style = {
thick,pen colour=black,
decorate,
decoration={
calligraphic brace, amplitude=2pt,
pre =moveto, pre length=1pt,
post=moveto, post length=1pt,
raise=#1},
},
]
\matrix (foo) [
matrix of math nodes,
% default linewidth = .4pt
column sep=-.4pt,row sep=-.4pt,
anchor=center,
nodes = {
draw=magenta,dashed,
inner sep=1pt,outer sep=0pt,
minimum size=.75cm,anchor=center,
},
left delimiter=(,right delimiter=),
]
{
A_{11} & A_{12} & \cdots & A_{1s} \\
A_{21} & A_{22} & \cdots & A_{2s} \\
\rvdots & \rvdots & & \rvdots \\
A_{r1} & A_{r2} & \cdots & A_{rs} \\
};
\myHbrace{1-1}{$n_1$}
\myHbrace{1-2}{$n_2$}
\node[above=3pt] at (foo-1-3.north) {$\cdots$};
\myHbrace{1-4}{$n_s$}
\myVbrace{1-4}{$m_1$}
\myVbrace{2-4}{$m_2$}
\node[right=12pt] at (foo-3-4.east) {$\rvdots$};
\myVbrace{4-4}{$m_r$}
\end{tikzpicture}
\end{document}
感觉这上面的图像某个数学益智小游戏...
tabularray方案(耐心即可)tabularray 能不能做到精确控制单元格边框?可以,耐下心看看对应部分的文档即可,真的不长,而且你目标明确...
\documentclass{article}
\usepackage{libertinus}
\usepackage{tabularray}
\setlength\lTblrDefaultHruleWidthDim{2pt}%
\setlength\lTblrDefaultVruleWidthDim{2pt}%
\begin{document}
\begin{tblr}{
colspec = *{4}{Q[c,.75cm]},
stretch=0,
rows = {ht=1cm,font=\bfseries\Large},
hline{1} = {1-2}{},
hline{2} = {1-2,4}{},
hline{3-4},
vline{1} = {1,3}{},
vline{2-3},
vline{4-5} = {2-3}{},
}
A & B & & \\
& C & & D \\
E & F & G & H \\
\end{tblr}
\end{document}不过我觉得控制严格「正方形」可能不总是太轻松....

这样是不是也勉强可行呢...语法更加简单一些...
\documentclass{article}
\usepackage{libertinus}
\usepackage{tabularray}
\usepackage{xcolor}
\begin{document}
\begin{tblr}{
colspec = *{4}{Q[c,.75cm]},
stretch=0,
rows = {ht=1cm,font=\bfseries\Large},
cell{1}{1-2} = {bg=gray!20},
cell{2}{2,4} = {bg=gray!20},
row{3} = {bg=gray!20},
}
A & B & & \\
& C & & D \\
E & F & G & H \\
\end{tblr}
\end{document}
TBC.
tikz方案,也许可以定义坐标系,如果内容「A,B,...,H」 的大小不变的话,封装一个「在给定坐标绘制对应node」的命令也许可行(?)不擅长tikz...我不打算用了
另外,总是应该先看看文档,最好不要过于依赖ds。
感谢 @u73286 Eureka老师提供的思路:
-?(?:\d+\.\d*|\.\d+|\d+)tblr里面有一个cmd键, 可以把这个判断写在cmd里面
PS1.该问题不需要多个嵌套表格,所以mwe代码理论上不应该用三合一的表格
PS2.在tabularray中上面例子的\usepackage{siunitx}是无法生效的,请看文档第五章
PS3.在article文档类选项中的UTF8是不用显式写出的,已经是默认值
\documentclass{article}
\usepackage{libertinus} % for better looking of number
\usepackage{xcolor}
\usepackage{tabularray}
\ExplSyntaxOn
\newcommand*{\mycolorednum}[2][red]{%
\regex_if_match:nnTF{\A -?(?:\d+\.\d*|\.\d+|\d+) \Z} { #2 }
{
\textcolor{ #1 }{ #2 }
}
{
#2
}
}
\ExplSyntaxOff
\begin{document}
\begin{tblr}{
colspec = *{4}{c},
hlines,vlines,
cells = {cmd = \mycolorednum[magenta]},
}
1 & test & 2 & -1.33\\
3 & 2test & text & 21.2 \\
test-3 & test & 4 & 2.33\\
test1 & 5 & 2test & 8 \\
-6 & test & 100 & test2 \\
-1test & -80 & 66.6 & 4test \\
0.09 & -888 & -0.08 & 231 \\
test1 & -5 & 2test & -8 \\
6 & test & 100 & test2 \\
-.1tt & 80 & 666 & 4test \\
0.09 & -.567 & .08 & 2test \\
\end{tblr}
\end{document}
(maybe) related references:
In the x-post, the best practice of this requirement is documented in the manual.
dash expand off is all what I need.
Makes theoffpart of a dash pattern expandable such that it can stretch. This only works when there is a singleonand a singleofffield and requires thedecorationslibrary. Right now this option has to be specified on the path where it is supposed to take effect after the dash pattern option because thedash patternhas to be known at the point where it is applied.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{ext.shapes.superellipse}
\begin{document}
\begin{tikzpicture} [
densely dashed,
% dash expand off,
every node/.append style={
draw=blue,
fill=yellow,
thick,
inner sep=2pt,
font=\LARGE,
},
]
\node [circle] {1};
\node [ellipse] at (1,0) {2};
\node [ext_superellipse,font=\tiny] at (2.25,0) {233333};
\end{tikzpicture}
\begin{tikzpicture} [
densely dashed,
dash expand off,
every node/.append style={
draw=violet,
fill=magenta,
thick,
inner sep=2pt,
font=\LARGE,
},
]
\node [circle] {1};
\node [ellipse] at (1,0) {2};
\node [ext_superellipse,font=\tiny] at (2.25,0) {233333};
\end{tikzpicture}
\end{document}
This can handle all the case by stretch the "off" part at the end, regardless of the node's content or the shape. IMHO, it's the best practice of this case.
\documentclass[tikz,border=5pt]{standalone}
\usepackage{pgfplots} % 核心绘图库
\pgfplotsset{compat=1.18} % 版本兼容性设置
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines = middle,
xmin = 0, xmax = 8,
ymin = 0, ymax = 6,
]
\addplot[
domain = 1:7.2831,
samples = 300,
smooth,
line width = 0.5pt,
black
] {sin(deg(x-1))+2.5};
\coordinate (A) at (axis cs:1,2.5);
\coordinate (B) at (axis cs:7.2831,2.5);
\coordinate (C) at (axis cs:2.5708,3.5);
\coordinate (D) at (axis cs:5.7123,1.5);
\pgfplotsinvokeforeach {A,B,C}{%
\node[above] at (#1) {$#1$};
}
\node[below] at (D) {$D$};
\end{axis}
\end{tikzpicture}
\end{document}

改用finish而不是overlay app即可。
\documentclass{article}
\usepackage[UTF8]{ctex}
\usepackage[most]{tcolorbox}
\usetikzlibrary{patterns}
\usepackage{zhlipsum}
\begin{document}
\tcbset{
frogbox/.style={
enhanced,
colback=green!10,
colframe=green!65!black,
enlarge top by=5.5mm,
overlay={
\foreach \x in {2cm, 3.5cm} {
\begin{scope}[shift={([xshift=\x]frame.north west)}]
\path[draw=green!65!black, fill=green!10, line width=1mm] (0,0) arc (0:180:5mm);
\path[fill=black] (-0.2,0) arc (0:180:1mm);
\end{scope}
}
}
},
ribbon/.style={
finish={
\path[
fill=blue!75!white,
draw=blue,
double=white!85!blue,
preaction={fill=blue!75!white},
line width=0.1mm,
double distance=0.2mm,
pattern=fivepointed stars,
pattern color=white!75!blue
]
([xshift=-0.2mm, yshift=-2.02cm]frame.north east)
-- ++(-2,2)
-- ++(-0.5,0)
-- ++(2.5,-2.5)
-- cycle;
}
}
}
\begin{tcolorbox}[frogbox, ribbon, title=My title]
\zhlipsum[1]
\end{tcolorbox}
\end{document}
Learning From this link
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[
foo /.tip = {Straight Barb[]Bar[width=10pt,sep=+0pt +-.5]},
]
\draw[foo-foo] (-.5,0) -- (-.5,2) node[midway,left] {$2$};
\draw[foo-foo] (-.5,2) -- (-.5,2+1) node[midway,left] {$1$};
\draw[foo-foo] (0,0) -- (0,2) node[midway,left] {$2$};
\draw[foo-foo] (.5,2) -- (.5,2+1) node[midway,left] {$1$};
\fill[red] (0,2) circle (0.3pt);
\fill[red] (.5,2) circle (0.3pt);
\end{tikzpicture}
\end{document}
在上面的链接中提到,Qrrbrbirlbel已经将符合这一特征的箭头加入TikZ-Extensions包中,查阅手册我们知道:
这种箭头特征被称为「untipped」

换言之,下面的代码可以更优雅地实现相同的效果:
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{ext.arrows}
\begin{document}
\begin{tikzpicture}[
foo /.tip = {Straight Barb[]ext_Untipped Bar[width=10pt]},
]
\draw[foo-foo] (-.5,0) -- (-.5,2) node[midway,left] {$2$};
\draw[foo-foo] (-.5,2) -- (-.5,2+1) node[midway,left] {$1$};
\draw[foo-foo] (0,0) -- (0,2) node[midway,left] {$2$};
\draw[foo-foo] (.5,2) -- (.5,2+1) node[midway,left] {$1$};
\fill[red] (0,2) circle (0.3pt);
\fill[red] (.5,2) circle (0.3pt);
\end{tikzpicture}
\end{document}
明明下面的十几行就可以完全反映你的问题,为什么要上传七八十行的代码(?) Tell Me Why?! Why?!
这给别人增加了很大的负担
\documentclass[tikz,border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines = middle,
xmin = -0.05, xmax = 1.1,
ymin = -0.05, ymax = 1.4,
axis line style = {-{Triangle[length=8pt, width=3pt]}},
ytick distance = 0.2,
]
\addplot[domain=0:1.4, thick, blue, samples=100] {x^2};
\end{axis}
\end{tikzpicture}
\end{document}坐标轴刻度线与箭头距离太近,增大xmax或ymax时坐标轴并没有延长相应的单位长度
指定ymax=1.35不可以吗? 不是很清楚你的具体需求?
\documentclass[tikz,border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines = middle,
xmin = -0.05, xmax = 1.1,
ymin = -0.05, ymax = 1.35,
axis line style = {-{Triangle[length=8pt, width=3pt]}},
ytick distance = 0.2,
]
\addplot[domain=0:1.4, thick, blue, samples=100] {x^2};
\end{axis}
\end{tikzpicture}
\end{document}
tikz的arrow提供的shorten >=功能调整「箭头末端」的长度:读文档!

\documentclass[tikz,border=5pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines = middle,
xmin = -0.05, xmax = 1.1,
ymin = -0.05, ymax = 1.4,
axis line style = {-{Triangle[length=8pt, width=3pt]},shorten >=-.8cm},
ytick distance = 0.2,
]
\addplot[domain=0:1.4, thick, blue, samples=100] {x^2};
\end{axis}
\end{tikzpicture}
\end{document}这将在保持使用ymax=1.4的同时得到:

有空的话逐个补充吧(虽然我也不是很懂)。
感觉每一个都可以算是「典中典」的「日经问题」,而且应该都能在「TeX.SE」上找到高赞回答。
数学模式里,为什么要$...$而不要\(...\)?
TL;DR: 更推荐$ $,一方面可以在plainTeX内使用,另一方面\(\)不容易因为过多的(和)影响代码的可读性。


Ref: https://tex.stackexchange.com/a/513/322482
数学模式里,为什么要\[...\]而不要$$...$$?
TL;DR: 其实是很典的,$$...$$前后的间距处理不正确,而\[...\]可以正确处理公式前后的行间距。
如果加上 equation* 环境最佳选择又是什么?在amsmath文档里的表述是:\[...\]与equation*完全等价。
但考虑到代码可读性和这个评论,似乎equation*在语义上会略好于\[\]
Ref1: 详见「孟晨」的这个回答
(P.S.)上述的评论区还有刘海洋对问题一的comment😀
Ref2: https://tex.stackexchange.com/questions/503/why-is-preferable-to
问题一与问题二的表述性质不太相同。
对于问题一:是「推荐」$...$而不是\(...\)
对于问题二:是「几乎不要(never)」(或者说严重点「禁止」)使用$$...$$,请使用\[...\]或equation*.
数学模式里,为什么要 align 环境而不要 eqnarray 环境?
TL;DR: 两个主要缺陷:
eqnarray在等号=周围设置的水平间距与其他数学环境(如\[...\]>或$$...$$)不一致(其间距更宽)。eqnarray(以及eqnarray*!)的公式编号定义不明确,导致引用时出现编号错误——尤其在使用\nonumber命令时。经典回答在:https://tex.stackexchange.com/a/197/322482
详见Ref: https://tug.org/pracjourn/2006-4/madsen/madsen.pdf
eqnarray的又一罪状\documentclass[12pt]{article}
\usepackage{showframe}
\usepackage{amsmath,amssymb}
\setlength{\parindent}{0cm}
\numberwithin{equation}{section}
\begin{document}
\section{aaa}
\section{bbb}
\section{ccc}
Why?
\begin{subequations}
\begin{eqnarray}
\tan^{-1}\left(\frac{1}{F_{2n-2}}\right) &=& \tan^{-1}\left(\frac{1}{F_{2n}}\right)+\tan^{-1}\left(\frac{1}{L_{2n-2}}\right)+\tan^{-1}\left(\frac{1}{L_{2n}}\right)\,,\\
\tan^{-1}\left(\frac{2}{L_{2n-1}}\right) &=& \tan^{-1}\left(\frac{1}{F_{2n}}\right)+\tan^{-1}\left(\frac{1}{L_{2n}}\right)\,,
\end{eqnarray}
\end{subequations}
Why not?
\begin{subequations}
\begin{align}
\tan^{-1}\left(\frac{1}{F_{2n-2}}\right) &=& \tan^{-1}\left(\frac{1}{F_{2n}}\right)+\tan^{-1}\left(\frac{1}{L_{2n-2}}\right)+\tan^{-1}\left(\frac{1}{L_{2n}}\right)\,,\\
\tan^{-1}\left(\frac{2}{L_{2n-1}}\right) &=& \tan^{-1}\left(\frac{1}{F_{2n}}\right)+\tan^{-1}\left(\frac{1}{L_{2n}}\right)\,,
\end{align}
\end{subequations}
\end{document}
同样的在上述论文的2.2节,出现「编号与内容重叠」的问题...

数学模式里,为什么要matrix,bmatrix,pmatrix,vmatrix,Vmatrix等环境而不要array环境去实现矩阵?
也许是这个链接(?)
array是LaTeX所有文档类通用的默认环境,而matrix需通过amsmath宏包或AMS类(如amsbook, amsart)引入。matrix环境主要为实现命名统一性而存在,因amsmath还提供带定界符的矩阵变体(如pmatrix, bmatrix, Bmatrix, vmatrix, Vmatrix)。matrix无需像array那样指定列对齐参数(如{ccc}),默认支持最多10列居中对齐(如需其他对齐方式仍需使用array)。若需超过10列,需修改MaxMatrixCols计数器。matrix的水平间距更紧凑(即array的宽度大于matrix)。(Translation Powered By Gemini...)
数学模式里,箭头是使用\to,\gets还是\rightarrow,\leftarrow
latexdef看定义的区别:latexdef \gets
\gets:
\mathchar"3220
\the\gets:
12832
latexdef \leftarrow
\leftarrow:
\mathchar"3220
\the\leftarrow:
12832latexdef \to
\to:
\mathchar"3221
\the\to:
12833
latexdef \rightarrow
\rightarrow:
\mathchar"3221
\the\rightarrow:
12833一方面,从定义上看:\to和\rightarrow内部「使用的字符是同一个」
但另一方面....IMHO, 优秀的code要保持代码语义上的可读性,换言之:
\to语义上的「趋向于」的意思,例如\lim_{n\to\infty}时,用\rightarrow是不合适的\rightarrow语义上的「从A到B的指向」的含义,而非「to」的意思时,用\to也是不合适的\bf,\bfseries,\mathbf,\boldmath,\unboldmath,\bm,\boldsymbol等这几个命令的区别和用法?
来自@u73286 老师的回答:
\bf: TeX 自带的命令,和现在的 NFSS 字体机制不太兼容,不推荐使用;\bfseries: NFSS 下切换粗体的命令, 和\textbf一样;\mathbf: 这个字体在默认配置下对应:OT1 cmr bx n, 其实就是\textbf对应的字体;\boldsymbol: 由AMSTeX宏集中的amsbsy宏包提供, 部分情况下可能出现一些间距问题;\bm: 会自动处理加粗对应的数学字体,还附带一些间距和斜体纠正, 推荐使用;
还有两个:\boldmath: 和\unboldmath对应,是由于LaTeX2e的历史原因才保留下来的;\mathversion{bold}和\mathversion{normal},它们和\boldmath,\unboldmath差不多,都会改变整个公式的样式, 但是推荐使用前者, 而不是\boldmath,\unboldmath。
借楼:
在QQ群中恰有一位朋友的类似需求如下:

这里总结一些我的尝试和搜罗到的解答,也希望@u78 老师能做点补充:
尝试基于tikz的matrix库,利用网格化的node定位确保平行...但缺陷也是有的,不好方便地控制「斜线倾斜的角度」
\documentclass[tikz,border=3pt]{standalone}
\usepackage{amsmath}
\usepackage{newpxmath}
\usetikzlibrary{matrix}
\usetikzlibrary{ext.positioning-plus}
\newcommand\blind{\phantom{a_{11}}}
\begin{document}
\begin{tikzpicture}[line cap=round]
\matrix (det) [matrix of math nodes,nodes={circle}]
{
\blind & \blind & a_{11} & a_{12} & a_{13} & \blind & \blind \\
\blind & \blind & a_{21} & a_{22} & a_{23} & \blind & \blind \\
\blind & \blind & a_{31} & a_{32} & a_{33} & \blind & \blind \\
\blind & \blind & \blind & \blind & \blind & \blind & \blind \\
};
\draw[blue,dashed,thick] (det-1-3.center) -- (det-3-1.center) -- (det-4-3.ext_corner south west) -- (det-2-5.center);
\draw[blue,dashed,thick] (det-1-4.center) -- (det-3-2.center) -- (det-4-4.ext_corner south west) -- (det-3-5.center);
\draw[blue,dashed,thick] (det-1-5.center) -- (det-3-3.center);
\draw[red,thick] (det-1-4.center) -- (det-3-6.center) -- (det-4-5.ext_corner south west) -- (det-3-3.center);
\draw[red,thick] (det-1-5.center) -- (det-3-7.center) -- (det-4-6.ext_corner south west) -- (det-3-4.center);
\draw[red,thick] (det-1-3.center) -- (det-3-5.center);
\draw[thick]
(det-1-3.ext_corner north west) -- (det-3-3.ext_corner south west)
(det-1-5.ext_corner north east) -- (det-3-5.ext_corner south east)
;
\end{tikzpicture}
\end{document}
基于nicematrix的\CodeAfter.
感谢@u98900 提出的思路:为了避免使用「绝对坐标」调整,使用calc计算「差向量」来辅助定位以保证绝对的平行.
\documentclass{article}
\usepackage{newpxmath}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\setlength{\extrarowheight}{1mm}
\[
D = \begin{vNiceMatrix}
a_{11} & a_{12} & a_{13}\\
a_{21} & a_{22} & a_{23}\\
a_{31} & a_{32} & a_{33}\\
\CodeAfter
\begin{tikzpicture}[line cap=round]
\coordinate (vec1) at ($(3-3.center)-(1-1.center)$);
\coordinate (vec2) at ($(3-1.center)-(1-3.center)$);
\draw[blue,dashed,thick] (1-3.center) -- (3-1.center);
\draw[blue,dashed,thick] (1-1.center) -- ++(vec2) -- ++($.75*(vec1)$) -- (2-3.center);
\draw[blue,dashed,thick] (1-2.center) -- ++(vec2) -- ++($.75*(vec1)$) -- (3-3.center);
\draw[red,thick] (1-1.center) -- (3-3.center);
\draw[red,thick] (1-2.center) -- ++(vec1) -- ++($.75*(vec2)$) -- (3-1.center);
\draw[red,thick] (1-3.center) -- ++(vec1) -- ++($.75*(vec2)$) -- (2-1.center);
\end{tikzpicture}
\end{vNiceMatrix}
\]
\end{document}
耿楠老师曾经说过:
一锤子买卖的话,没必要用代码,咋画都行。
如果后期需要维护,需要微调,需要大量复制,我建议还是上代码。
如果追求的是自由和乐趣,那就用代码思考人生。
基于nicematrix做了一点小小的自动化,如下:
% https://ask.latexstudio.net/ask/question/17826.html
\documentclass{article}
\usepackage{newpxmath}
\usepackage{nicematrix}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\pagestyle{empty}
\setlength{\extrarowheight}{1.5mm}
\ExplSyntaxOn
\def\N{8}
\def\ratio{\fpeval{\N/(2*(\N-1))}}
\[
\begin{vNiceMatrix}
% \c_math_subscript_token
\int_step_inline:nn {\N} {%
a\c_math_subscript_token{#11}%
\int_step_inline:nnn {2}{\N} {%
& a\c_math_subscript_token{#1{##1}}%
}%
\int_compare:nNnTF {#1} < {\N} {\\} {}%
}%
\CodeAfter%
\begin{tikzpicture}[line~cap=round]
% 定义主/副对角线的向量
\coordinate (main-vec) at ($(\N-\N.center)-(1-1.center)$);
\coordinate (secondary-vec) at ($(\N-1.center)-(1-\N.center)$);
% 处理副对角线方向的其他 \N-1 条虚线
\draw[orange,dashed,thick] (1-\N.center) -- (\N-1.center);
\int_step_inline:nn {\N-1} {
\draw[orange,dashed,thick,rounded~corners=5mm] (1-#1.center) --++(secondary-vec) --++($\ratio*(main-vec)$) -- (\int_eval:n{#1+1}-\N.center);
}
% 处理主对角线方向的其他 \N-1 条实线
\draw[magenta,thick] (1-1.center) -- (\N-\N.center);
\int_step_inline:nn {\N-1} {
\draw[magenta,thick,rounded~corners=5mm] (1-\int_eval:n{#1+1}.center) --++(main-vec) --++($\ratio*(secondary-vec)$) -- (\int_eval:n{\N-#1+1}-1.center);
}
\end{tikzpicture}
\end{vNiceMatrix}
\]
\ExplSyntaxOff
\end{document}
问 在`nicematrix`中,如何调整整个矩阵的高度和宽度,同时不影响元素水平、垂直方向居中?