shadow
shadow
这个人懒得不得了,竟然啥也没写

注册于 4年前

回答
32
文章
0
关注者
0

查看 abstract 宏包的环境定义,可能和内部调用 center 环境有关

\if@titlepage \renewenvironment{abstract}{%
  \titlepage \null\vfil \@beginparpenalty\@lowpenalty
  \begin{center}%
    \bfseries \abstractname \@endparpenalty\@M
\end{center}}%
{\par\vfil\null\endtitlepage}
\else \renewenvironment{abstract}{%
  \if@twocolumn
  \section*{\abstractname}%
  \else \small
  \begin{center}%
    {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
  \end{center}%
\quotation \fi} {\if@twocolumn\else\endquotation\fi}
\fi

将 MWE 中的 abstract 环境改为 center 环境

\documentclass{article}

\usepackage{showframe}
\usepackage{lipsum}

\usepackage{abstract}
\setlength{\absleftindent}{0pt} %取消左边距
\setlength{\absrightindent}{0pt} %取消右边距
\renewcommand{\abstracttextfont}{\normalsize} %确保摘要环境内外字号一致

\usepackage{enumitem}
\setlist{
  itemindent=\parindent,
}

\begin{document}

\begin{center}

  \lipsum[2]

  \begin{enumerate}
    \item this is text. this is text. this is text. this is text. this is text. this is text. this is text. this is text.
    \item this is text. this is text. this is text. this is text. this is text. this is text. this is text. this is text.
  \end{enumerate}

\end{center}

\lipsum[2]

\begin{enumerate}
  \item this is text. this is text. this is text. this is text. this is text. this is text. this is text. this is text.
  \item this is text. this is text. this is text. this is text. this is text. this is text. this is text. this is text.
\end{enumerate}

\end{document}

image.png
效果和以上展示的一致,初步判断就是 center 所致。

用 tikz 的 matrix 实现。思路是先画顶部两行表格,再画左边绿色区域的表格,最后画中间的带彩色数据条的表格,中间表格分块画,每一块都是一个 matrix. 中间表格先输入内容,然后用 foreach 加 fill 填充彩色数据条,最后给表格整体用绿色背景,然后在中间区域覆盖白色背景。中间表格我做了一部分,剩余内容和前两行的同理,有兴趣可以自己补充。

\documentclass[border=1cm,tikz]{standalone}
\usepackage{xcolor}
\usetikzlibrary{scopes,matrix,calc,backgrounds,fit}

\definecolor{blue1}{RGB}{51,204,255}
\definecolor{blue2}{RGB}{51,153,255}

\begin{document}
\begin{tikzpicture}[thick]

  % 顶部表格
  {[thick]
    \matrix(m)[matrix of nodes,nodes={minimum width=5.4cm, minimum height=0.7cm}, ]{
      \hskip-1.4cm Parameter & Ep1 $(b_p=0.04)$ & Ep2 $(b_p=0.02)$ & Ep3 $(b_p=0.01)$\\
      \hskip-1.4cm Strategy & S1 \hskip3.6em S2 \hskip3.6em S3 &  S1 \hskip3.6em S2 \hskip3.6em S3 &  S1 \hskip3.6em S2 \hskip3.6em S3\\
    };

    \draw(m-1-4.south east)--++(-23.2,0);
    \draw[line width=1.3pt](m-2-4.south east)--++(-23.2,0);
    \draw[line width=1pt,double](m-1-4.north east)--++(-23.2,0);
    \draw(m-1-1.north east)--(m-2-1.south east)--++(0,-13.6) (m-1-2.north east)--(m-2-2.south east)--++(0,-13.6) (m-1-3.north east)--(m-2-3.south east)--++(0,-13.6);
  }

  % 左边表格
  {[shift={(-8.2,-7.4)}]
    \matrix(n) [matrix of nodes,nodes={text width=2.5cm,text height=0.5cm,execute at begin node={\setlength{\baselineskip}{4ex}}, anchor=center, },align=center] {
      {Efficiency \\ change [pu]}  & {Avg-HPP 1\\Min-HPP 1\\Avg-Hpp 2\\Min-HPP 2} \\
      {GV movement\\ {[/]}}  & {Distance\\Amount} \\
      {RB movement\\ {[pu]}}  & {Dist.-HPP 1\\Dist.-HPP 2\\Amount-HPP 1\\Amount-HPP 2} \\
      {Frequency \\ quanlity [pu]}  & {HPP 1\\HPP 2} \\
      {Mileage\\ {[MW]}}  & {HPP 1\\HPP 2} \\
      Strength [pu] & {HPP 1\\HPP 2} \\
      Mileage [pu] & {HPP 1\\HPP 2} \\
      Contributiuon [pu] & {HPP 1\\HPP 2} \\
    };

    \draw[line width=1pt,double](n-8-1.south west) ++(0,-2mm)--++(21.775,0) (n-8-1.south west) ++(0,-2mm)--++(-1.5,0);
    \draw[line width=1.3pt] (n-8-1.south west) ++(0,-2mm)--(n-1-1.north west)--++(0,0.5);
    \draw(n-2-1.north west)++(0,-2mm)--++(21.775,0) (n-2-1.south west)++(0,-1mm)--++(21.775,0)
    (n-5-1.north west)++(0,-2mm)--++(21.775,0) (n-6-1.north west)++(0,1mm)--++(21.775,0) (n-6-1.north west)++(0,1mm)--++(-1.5,0);
    \draw[line width=1.3pt](n-4-1.north west)++(0,-2mm)--++(21.775,0) (n-4-1.north west)++(0,-2mm)--++(-1.5,0);

    \node[rotate=90]at ($(n-2-1.west)+(-8mm,-1.5mm)$){\large Burden};
    \node[rotate=90,align=center,font=\large]at ($(n-4-1.west)+(-8mm,-9mm)$){Regulation\\performance};
    \node[rotate=90]at ($(n-7-1.west)+(-8mm,-1.5mm)$){\large Payment};
  }

  % 中间第一行表格
  {[shift={(m-2-2.south)}, yshift=-1.35cm]
    \matrix(p1)[matrix of nodes, nodes={minimum width=1.8cm, minimum height=0.6cm,}, column sep=0.cm]{
      -0.079\% & -0.097\% & -0.144\%\\
      -0.268\% & -0.297\% & -0.304\%\\
      -0.030\% & -0.061\% & -0.196\%\\
      -0.435\% & -0.472\% & -0.638\%\\
    };
    \foreach \x/\y in{%
      1-1/0.079, 1-2/0.087, 1-3/0.12,
      2-1/0.19, 2-2/0.19, 2-3/0.21,
      3-1/0.030, 3-2/0.041, 3-3/0.13,
      4-1/0.28, 4-2/0.3, 4-3/0.35
    }
    {\fill[red, opacity=0.55](p1-\x.north east) rectangle ++ (-\y,-0.5);
    }
  }

  {[shift={(m-2-3.south)}, yshift=-1.35cm]
    \matrix(p1)[matrix of nodes, nodes={minimum width=1.8cm, minimum height=0.6cm,}, column sep=0.cm]{
      -0.217\% & -0.249\% & -0.535\%\\
      -0.493\% & -0.535\% & -0.729\%\\
      -0.125\% & -0.153\% & -0.743\%\\
      -0.627\% & -0.653\% & -1.369\%\\
    };
    \foreach \x/\y in{%
      1-1/0.199, 1-2/0.207, 1-3/0.37,
      2-1/0.35, 2-2/0.35, 2-3/0.43,
      3-1/0.070, 3-2/0.071, 3-3/0.44,
      4-1/0.38, 4-2/0.4, 4-3/0.75
    }
    {\fill[red, opacity=0.55](p1-\x.north east) rectangle ++ (-\y,-0.5);
    }
  }

  {[shift={(m-2-4.south)}, yshift=-1.35cm]
    \matrix(p1)[matrix of nodes, nodes={minimum width=1.8cm, minimum height=0.6cm,}, column sep=0.cm]{
      -0.0726\% & -0.771\% & -1.941\%\\
      -1.034 \% & -1.069\% & -2.232\%\\
      -0.528\% & -0.555\% & -2.505\%\\
      -1.276\% & -1.300\% & -3.182\%\\
    };
    \foreach \x/\y in{%
      1-1/0.4, 1-2/0.42, 1-3/1.1,
      2-1/0.6, 2-2/0.6, 2-3/1.3,
      3-1/0.32, 3-2/0.35, 3-3/1.42,
      4-1/0.68, 4-2/0.7, 4-3/1.65
    }
    {\fill[red, opacity=0.55](p1-\x.north east) rectangle ++ (-\y,-0.5);
    }
  }

  % 中间第二行表格
  {[shift={(m-2-2.south)}, yshift=-3.35cm]
    \matrix(p1)[matrix of nodes, nodes={minimum width=1.8cm, minimum height=0.6cm,}, column sep=0.cm]{
      7.610 & 7.610 & 7.610\\
      2066 & 2066 & 2066\\
    };
    \foreach \x/\y in{%
      1-1/0.4, 1-2/0.4, 1-3/0.4
    }
    {\fill[blue1,opacity=0.4](p1-\x.north west)++(0.04,0.05) rectangle ++ (\y,-0.6);}
    \foreach \x/\y in{%
      2-1/1.3, 2-2/1.3, 2-3/1.3
    }
    {\fill[blue!80!green, opacity=0.4](p1-\x.north west)++(0.01,-0.05) rectangle ++ (\y,-0.5);}

  }

  {[shift={(m-2-3.south)}, yshift=-3.35cm]
    \matrix(p1)[matrix of nodes, nodes={minimum width=1.8cm, minimum height=0.6cm,}, column sep=0.cm]{
      15.634 & 15.634 & 15.634\\
      2343 & 2343 & 2343\\
    };
    \foreach \x/\y in{%
      1-1/0.7, 1-2/0.7, 1-3/0.7
    }
    {\fill[blue1,opacity=0.4](p1-\x.north west)++(0.04,0.05) rectangle ++ (\y,-0.6);}
    \foreach \x/\y in{%
      2-1/1.5, 2-2/1.5, 2-3/1.5
    }
    {\fill[blue!80!green, opacity=0.4](p1-\x.north west)++(0.01,-0.05) rectangle ++ (\y,-0.5);}

  }

  {[shift={(m-2-4.south)}, yshift=-3.35cm]
    \matrix(p1)[matrix of nodes, nodes={minimum width=1.8cm, minimum height=0.6cm,}, column sep=0.cm]{
      31.829 & 31.829 & 31.829\\
      2676 & 2676 & 2676\\
    };
    \foreach \x/\y in{%
      1-1/1.6, 1-2/1.6, 1-3/1.6
    }
    {\fill[blue1,opacity=0.4](p1-\x.north west)++(0.04,0.05) rectangle ++ (\y,-0.6);}
    \foreach \x/\y in{%
      2-1/1.75, 2-2/1.75, 2-3/1.75
    }
    {\fill[blue!80!green, opacity=0.4](p1-\x.north west)++(0.01,-0.05) rectangle ++ (\y,-0.5);}

  }

  % 背景
  {[on background layer]
    \fill[green!40,opacity=0.3](current bounding box.south east)++(0.2,-0.2) rectangle +(-23.8,15.6);
    \fill[white](current bounding box.south east)++(-0.3,0.25) rectangle +(-16.2,13.6);
  }
\end{tikzpicture}
\end{document}

image.png

以上过程是平凡但较繁琐的。

本质上你并没有提出一个 LaTeX 绘图的问题。提问要描述清楚你要绘制什么图。以下采用 tzplot 绘制:

\documentclass[border=1cm]{standalone}
\usepackage{tzplot}
\usetikzlibrary{scopes}

\begin{document}
\begin{tikzpicture}[scale=0.8, thick]
  \draw[->] (-5,0) -- (5,0) node[right]{$x$};
  \draw[->] (0,-3) -- (0,5) node[above]{$y$};
  \tzcoors(0,0)(O){$O$}[-135] (0,4)(A){$A$}[170] (-4,0)(B){$B$}[150] (4,0)(C){$C$}[30] (2,0)(D){$D$}[-30] (-2,-2)(E){$E$}[-90] ;
  \draw(A)--(B)--(E)--(D)--(A) (A)--(C);

  {[shift={(12,0)}]
    \draw[->] (-5,0) -- (5,0) node[right]{$x$};
    \draw[->] (0,-3) -- (0,5) node[above]{$y$};
    \tzcoors(0,0)(O){$O$}[-135] (0,4)(A){$A$}[170] (-4,0)(B){$B$}[-150] (4,0)(C){$C$}[30] (2,0)(D){$D$}[-30] (-2.5,-1.5)(E){$E$}[-150] (-4.8,0.8)(a){} (-1.8,-2.2)(b){};
    \tzdot*[fill=red](0,3){$F$}[l](3.5pt)
    \draw(A)--(B)--(E)--(D)--(A) (A)--(C) (a)--(b);
  }
\end{tikzpicture}
\end{document}

image.png

此外,tikz 绘图不一定需要精确计算坐标,很多时候坐标可以目测,最终实现的结果观感不错就行,毕竟是在绘图而不是做数学题,而要完成以上数学题实际上并不需要图形。

  1. 读宏包手册,在终端输入:texdoc package name,需要什么就看什么。
  2. 如果想进一步了解 LaTeX2e,可以看看 The TeXbook 这本书,讲较底层的排版内容。如果觉得比较难看懂,可以看一部分或者直接看 TeX by Topic 这本书,算是详细版的 The TeXbook.
  3. 如果对 LaTeX2e 不感兴趣,可以学学 LaTeX3,它对 LaTeX 中的编程较友好,但如果仅是使用者,可以不学。如果想学,可以先从 interface3 入手。
  4. 如果想进一步了解某个宏包或者命令的原理和用法,在手册不够用的情况下,可以看宏包的源码,查看对应命令的定义,仿照制作类似的命令。
  5. 多与别人交流、提问。本网站和 texstackexchange 是不错的交流平台。

给个简单方法,对0-99,更大数字同理:

\documentclass[border=5pt,tikz]{standalone}

\begin{document}
\begin{tikzpicture}[x=0.53cm, y=0.53cm, nodes={draw,circle,minimum size=5mm,inner sep=0pt}]
  \foreach \x in {0,1,...,9}
  {%
    \node[font=\Large] at(\x,0){\x};
    \foreach \y in {1,...,9}
    {\node at(\x,\y){\y\x};}
  }
\end{tikzpicture}
\end{document}

image.png

\documentclass[tikz,border=1cm]{standalone}
\begin{document}

\begin{tikzpicture}[nodes={draw,fill=gray!50,circle,inner sep=1pt}]
  
\foreach \x in {0,2,...,14}
{%
  \begin{scope}[xshift=\x cm]
    \node (a) at (0,0) {};
    \node (b) at (1,2) {};
    \node (c) at (2,0) {};
    \draw (a) -- (b) -- (c);
  \end{scope}
}

\end{tikzpicture}

\end{document}

image.png

用 tzplot 还能更短,但似乎没必要

用极坐标很容易

\documentclass[border=1cm]{standalone}

\usepackage{tkz-euclide}

\begin{document}

\begin{tikzpicture}[font=\small]

  \tkzDefPoint(0,0){B}
  \tkzDefShiftPoint[B](60:2){A}
  \tkzDefShiftPoint[B](0:2){C}
  \tkzDefShiftPoint[B](60:5){E}
  \tkzDefShiftPoint[B](0:3){D}

  \tkzDrawPolygon[thick](A,B,C)
  \tkzDrawSegments[thick](C,D A,E E,C E,D)

  \tkzLabelPoints[below](B,C,D)
  \tkzLabelPoints[above](E)
  \tkzLabelPoints[above left](A)

\end{tikzpicture}

\end{document}

image.png

若 BD 已知,则 AE 的长就是 BD - BC.
若 BD 未知,则先定义 AE 的长,比如为 x, 则 BD 就是 2+x (BC = 2).

此外,如果对极坐标定义点觉得麻烦,可以自定义一个命令:

\newcommand{\myPolarPoints}[2]{%
    \foreach \ang/\r/\name in {#2}{%
      \tkzDefShiftPoint[#1](\ang:\r){\name}%
    }
  }

这样就可以用类似直角坐标的方法批量定义点:

\documentclass[border=1cm]{standalone}

\usepackage{tkz-euclide}

\newcommand{\myPolarPoints}[2]{%
  \foreach \ang/\r/\name in {#2}{%
    \tkzDefShiftPoint[#1](\ang:\r){\name}%
  }
}

\begin{document}

\begin{tikzpicture}[font=\small]
  \tkzDefPoint(0,0){B}
  \myPolarPoints{B}{60/2/A,0/2/C,60/5/E,0/3/D}

  \tkzDrawPolygon[thick](A,B,C)
  \tkzDrawSegments[thick](C,D A,E E,C E,D)

  \tkzLabelPoints[below](B,C,D)
  \tkzLabelPoints[above](E)
  \tkzLabelPoints[above left](A)
\end{tikzpicture}

\end{document}

给个笨办法:用 tikz 的 node 一一绘制

\documentclass{article}
\usepackage{ctex, tikz}

\newcommand{\yi}[1][0.1]{
  \tikz[baseline={(0,-#1)}]\node[draw,circle,thick,inner sep=0.8pt,font={\bfseries\small},text height=1.5ex,
  text depth=0.25ex]{一};
}

\newcommand{\er}[1][0.1]{
  \tikz[baseline={(0,-#1)}]\node[draw,circle,thick,inner sep=0.8pt,font={\bfseries\small},text height=1.3ex,
  text depth=0.25ex]{二};
}

\newcommand{\shiyi}[1][0.1]{
  \tikz[baseline={(0,-#1)}]\node[align=center,draw,circle,thick,inner sep=1pt,font={\bfseries\tiny}]{十 \\[-.5em] 一};
}

\newcommand{\sijiu}[1][0.1]{
  \tikz[baseline={(0,-#1)}]\node[align=center,draw,circle,thick,inner sep=0.8pt,font={\bfseries\tiny}]{卌 \\[-.5em] 九};
}

\begin{document}

文字文字文 \shiyi 文字文字 \yi 文字文字 \er \sijiu 文字文字文字文字

\end{document}

image.png

如果经常使用,可以全部绘制好之后封装成一个宏包供以后使用。

给一个思路,自己可以尝试:

  1. 用tikz 的 matrix 库,不用手动排布坐标,缺点是 matrix 内 node 中的 aligned 环境不能用 & 对齐,改用 array 环境可以指定左(右)对齐.
  2. 直接用 node + foreach, node 内的公式可以用 & 对齐,缺点是需要手动排布 node 坐标。

以上不论哪一种,对多行的多项式的同幂次对齐都比较麻烦。

本质上与 tkz-euclide 无关,给几个简单的办法:

\documentclass{article}
\usepackage{lipsum,tikz,tkz-euclide}
\usetikzlibrary{scopes}

\begin{document}
\lipsum[1][1-3]
\vskip2em

% 方法一 scopes

\begin{tikzpicture}
  {[]
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(2.5,0){B}
    \tkzDefPoint(1.5,2){C}
    \tkzDrawPolygon(A,B,C)
    \tkzLabelPoints(A,B,C)
  }

  {[xshift=3.5cm]
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(3.5,0){B}
    \tkzDefPoint(1.5,2){C}
    \tkzDrawPolygon(A,B,C)
    \tkzLabelPoints(A,B,C)
  }

  {[xshift=8cm]
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(3,0){B}
    \tkzDefPoint(1.5,2){C}
    \tkzDrawPolygon(A,B,C)
    \tkzLabelPoints(A,B,C)
  }
\end{tikzpicture}

\vskip2em
\lipsum[1][1-3]
\vskip2em

% 方法二 tabular

\begin{tabular}{ccc}
  \begin{tikzpicture}
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(2.5,0){B}
    \tkzDefPoint(1.5,2){C}
    \tkzDrawPolygon(A,B,C)
    \tkzLabelPoints(A,B,C)
  \end{tikzpicture}
  &
  \begin{tikzpicture}
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(3.5,0){B}
    \tkzDefPoint(1.5,2){C}
    \tkzDrawPolygon(A,B,C)
    \tkzLabelPoints(A,B,C)
  \end{tikzpicture}
  &
  \begin{tikzpicture}
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(3,0){B}
    \tkzDefPoint(1.5,2){C}
    \tkzDrawPolygon(A,B,C)
    \tkzLabelPoints(A,B,C)
  \end{tikzpicture}
\end{tabular}

\vskip2em
\lipsum[1][1-3]
\vskip2em

% 方法三 \hfill

\begin{tikzpicture}
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(1.5,0){B}
  \tkzDefPoint(1.5,2){C}
  \tkzDrawPolygon(A,B,C)
  \tkzLabelPoints(A,B,C)
\end{tikzpicture}
\hfill
\begin{tikzpicture}
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(1.5,0){B}
  \tkzDefPoint(1.5,2){C}
  \tkzDrawPolygon(A,B,C)
  \tkzLabelPoints(A,B,C)
\end{tikzpicture}
\hfill
\begin{tikzpicture}
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(1.5,0){B}
  \tkzDefPoint(1.5,2){C}
  \tkzDrawPolygon(A,B,C)
  \tkzLabelPoints(A,B,C)
\end{tikzpicture}
\hfill
\begin{tikzpicture}
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(1.5,0){B}
  \tkzDefPoint(1.5,1.5){C}
  \tkzDrawPolygon(A,B,C)
  \tkzLabelPoints(A,B,C)
\end{tikzpicture}

\end{document}

image.png

\documentclass{article}
\usepackage{amsmath, empheq,lipsum}

\begin{document}
\lipsum[1][1-4]
\begin{empheq}[left=\empheqlbrace]{align}
  a + b = c \tag{label 1}\\
  a + b = c \tag{label 2}\\
  a + b = c \tag{label 3}
\end{empheq}
\lipsum[1][1-4]

\end{document}

image.png

建议阅读 tkz-euclide 宏包手册与 pgf-tikz宏包手册第三部分

用纯 tikz 给一个弱的解答。思路是先求出多边形的重心,然后在重心到顶点射线的方向上的合适位置放置标签,用 calc 库计算坐标。

\documentclass[tikz,border=1cm]{standalone}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}
  \foreach \x/\y in {%
    (0,0)/a,
    (1,1)/b,
    (3,2)/c,
    (4,-1)/d,
  (2,-2)/e}
  { \node[fill, circle, inner sep =0pt, minimum size = 3pt] (\y) at \x {}; }
  \draw plot coordinates {(a) (b) (c) (d) (e) (a)};

  \coordinate (O) at ($0.2*(a)+ 0.2*(b)+ 0.2*(c)+ 0.2*(d)+ 0.2*(e)$);

  \fill[red] (O) circle(2pt);% 重心

  \foreach \x in {a,c,d,e}
  {\node at ($(O)!1.15!(\x)$){$\x$};}

  \node at ($(O)!1.22!(b)$){$b$};

\end{tikzpicture}

\end{document}

image.png

不难看到,用重心作为射线的起点并不完美,上图中的 b 标签就不能合适放置,故而只能单独绘制。

对于在圆上的凸多边形,存在到所有顶点距离相等的点,用该点作为射线起点比较合适,但对应一般的凸多边形不存在这样的点,所以仅仅用重心并不合适。

以上操作,本质上和逐个绘制标签没有区别,仅仅是用 foreach 简化操作。

给一个用 tikz 的 matrix 实现的方法,和上面的回答一致,但大括号用 \big 配合 \delimitershortfall 命令实现,主要用一下 \delimitershortfall

\documentclass[border=1cm,tikz]{standalone}

\usetikzlibrary {matrix, calc}

\begin{document}

\begin{tikzpicture}

  \matrix (m) [minimum width = 2em, minimum height = 3.5ex, matrix of nodes] {
    1 & 0 & 2 & 0 & -3\\

    0 & 1 & -1 & 0 & 4 \\

    0 & 0 & 0 & 1 & 1 \\

    0 & 0 & 0 & 0 & 0 \\
  };

  \draw[red, dashed] ($(m-1-1.north west)+(0.17,-0.13)$) |- (m-2-1.north east) |-(m-3-3.north east) |-($(m-4-5.north east)-(0.16,0)$);

  \delimitershortfall=-42pt
  \node at($(m.west)+(0.1,0)$) {$\big($ };
  \node at($(m.east)-(0.15,0)$) {$\big)$ };
\end{tikzpicture}

\end{document}

image.png

以上采用 node 的参数 minimum width, minimum height 控制元素的间距,使元素的间距更加均匀,也更容易控制虚线位于两列元素之间的中线位置。

使用 calc 库方便精调括号的位置。

实践中看到,delimitershortfall 的参数对括号的长度控制成梯状,比如 \delimitershortfall=-37\delimitershortfall=-42 大括号没有变化,但 \delimitershortfall=-43就会变长。

tikz 相较于 nicematrix 输出矩阵效率低,但可以调细节,各取所需。

针对等号上下的公式,给两种方法:

1. 借助 extarrows 宏包的 \xlongequal 命令

% \usepackage{extarrows}

\[
A \xlongequal[r_2 - r_1]{\substack{\scalebox{0.7}{$r_4 + 2r_3$} \\[1ex]r_2 + r_1\\[1ex]}} B
\]

image.png

2. 使用 array 环境,不过还需要 mathtools 宏包:

% \usepackage{mathtools,extarrows}

\[
A \xlongequal[r_2 - r_1]{\scalebox{0.8}{$\begin{array}{c}
\scalebox{0.9}{$r_4 + 2r_3$}\\[0.5ex]
r_2 + r_1\\[0.5ex]
\end{array}$}} B
\]

image.png

此外,还可以使用 tikz 局部造符号,有兴趣可以自己试试。

发布
问题