我仔细研究了这里,但无法解决我的问题。我有 6 个数字,我想用足够的空间将它们分开,以避免混淆。我有 2 个数字,在另两个数字下面,在另两个数字下面,但是 1 列中的 1 个数字与另一列混合在一起。我想知道如何将它们分开以获得更好的可视化效果。我尝试使用 hspace,但没有结果。我不得不说我也在使用 tikzpicture。
这是我的代码:
\documentclass{article}
\usepackage{tikz}
\centering
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{figure}[ht]
\begin{minipage}[b]{0.5\linewidth}
\centering
\makebox[0pt]{%
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (-10,4) {N5192};
\node (B) at (-7,3) {Menor};
\node (C) at (-7,6) {Mayor};
\node (D) at (-5,4) {No CRG};
\end{scope}
\begin{scope}[>={Stealth[black]},
center coordinate every node/.style={fill=white,circle},
% every edge/
.style={draw=red,very thick}
]
\path [->] (A) edge[near start,sloped,bend right = 15, blue,very thick] node [black, fill = white] {53} (B);
\path [->] (A) edge[sloped,bend left = 15, blue,very thick] node [black, fill = white] {$3301$} (C);
\path [->] (A) edge[sloped, bend left = 15, blue,very thick] node [black, fill = white]{$48$} (D);
\end{scope}
\end{tikzpicture}%
}\par
\caption{This is my Caption}
\vspace{8ex}
\end{minipage}
\begin{minipage}[b]{0.5\linewidth}
\centering
\makebox[0pt]{%
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (-10,4) {N5192};
\node (B) at (-7,3) {Menor};
\node (C) at (-7,6) {Mayor};
\node (D) at (-5,4) {No CRG};
\end{scope}
\begin{scope}[>={Stealth[black]},
center coordinate every node/.style={fill=white,circle},
% every edge/.style={draw=red,very thick}
]
\path [->] (A) edge[near start,sloped,bend right = 15, blue,very thick] node [black, fill = white] {53} (B);
\path [->] (A) edge[sloped,bend left = 15, blue,very thick] node [black, fill = white] {$3301$} (C);
\path [->] (A) edge[sloped, bend left = 15, blue,very thick] node [black, fill = white]{$48$} (D);
\end{scope}
\end{tikzpicture}%
}\par
\caption{This is my second Caption}
\vspace{8ex}
\end{minipage}
\begin{minipage}[b]{0.5\linewidth}
\centering
\makebox[0pt]{%
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (-10,4) {N5192};
\node (B) at (-7,3) {Menor};
\node (C) at (-7,6) {Mayor};
\node (D) at (-5,4) {No CRG};
\end{scope}
\begin{scope}[>={Stealth[black]},
center coordinate every node/.style={fill=white,circle},
% every edge/.style={draw=red,very thick}
]
\path [->] (A) edge[near start,sloped,bend right = 15, blue,very thick] node [black, fill = white] {53} (B);
\path [->] (A) edge[sloped,bend left = 15, blue,very thick] node [black, fill = white] {$3301$} (C);
\path [->] (A) edge[sloped, bend left = 15, blue,very thick] node [black, fill = white]{$48$} (D);
\end{scope}
\end{tikzpicture}%
}\par
\caption{This is my third Caption}
\vspace{8ex}
\end{minipage}
\begin{minipage}[b]{0.5\linewidth}
\centering
\makebox[0pt]{%
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (-10,4) {N5192};
\node (B) at (-7,3) {Menor};
\node (C) at (-7,6) {Mayor};
\node (D) at (-5,4) {No CRG};
\end{scope}
\begin{scope}[>={Stealth[black]},
center coordinate every node/.style={fill=white,circle},
% every edge/.style={draw=red,very thick}
]
\path [->] (A) edge[near start,sloped,bend right = 15, blue,very thick] node [black, fill = white] {53} (B);
\path [->] (A) edge[sloped,bend left = 15, blue,very thick] node [black, fill = white] {$3301$} (C);
\path [->] (A) edge[sloped, bend left = 15, blue,very thick] node [black, fill = white]{$48$} (D);
\end{scope}
\end{tikzpicture}%
}\par
\caption{This is my fourth Caption}
\vspace{8ex}
\end{minipage}
\begin{minipage}[b]{0.5\linewidth}
\centering
\makebox[0pt]{%
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (-10,4) {N5192};
\node (B) at (-7,3) {Menor};
\node (C) at (-7,6) {Mayor};
\node (D) at (-5,4) {No CRG};
\end{scope}
\begin{scope}[>={Stealth[black]},
center coordinate every node/.style={fill=white,circle},
% every edge/.style={draw=red,very thick}
]
\path [->] (A) edge[near start,sloped,bend right = 15, blue,very thick] node [black, fill = white] {53} (B);
\path [->] (A) edge[sloped,bend left = 15, blue,very thick] node [black, fill = white] {$3301$} (C);
\path [->] (A) edge[sloped, bend left = 15, blue,very thick] node [black, fill = white]{$48$} (D);
\end{scope}
\end{tikzpicture}%
}\par
\caption{This is my fifth Caption}
\vspace{8ex}
\end{minipage}
\begin{minipage}[b]{0.5\linewidth}
\centering
\makebox[0pt]{%
\begin{tikzpicture}
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (-10,4) {N5192};
\node (B) at (-7,3) {Menor};
\node (C) at (-7,6) {Mayor};
\node (D) at (-5,4) {No CRG};
\end{scope}
\begin{scope}[>={Stealth[black]},
center coordinate every node/.style={fill=white,circle},
% every edge/.style={draw=red,very thick}
]
\path [->] (A) edge[near start,sloped,bend right = 15, blue,very thick] node [black, fill = white] {53} (B);
\path [->] (A) edge[sloped,bend left = 15, blue,very thick] node [black, fill = white] {$3301$} (C);
\path [->] (A) edge[sloped, bend left = 15, blue,very thick] node [black, fill = white]{$48$} (D);
\end{scope}
\end{tikzpicture}%
}\par
\caption{This is my sixth Caption}
\vspace{8ex}
\end{minipage}
\end{figure}
\end{document}
答案1
tikzpicture
您可以通过scale=<number>
向环境选项中添加来缩放,例如\begin{tikzpicture}[scale=0.75,...]
。另一种方法是更改单位向量,例如\begin{tikzpicture}[x=0.8cm,y=0.8cm]
。两者的默认值均为 1cm
。
对于这种情况,您也可以更改节点的坐标,使它们更接近一些。例如,将Menor
和的x 坐标更改为,将 的x 坐标更改为 。或者类似的东西,还没有测试过。Mayor
-8
No CRG
-6
正如您所发现的,您可以在同一行上的 s\hspace{<length>}
之间添加。但是,您的日志中会有很多溢出的 hbox 警告。如果您关心这些,请如上所述稍微减小 s 的大小,然后执行类似以下代码的操作:将s 的宽度减小到略小于 s并在它们之间添加。这样它们之间就会有一点空间,它们不会溢出行。minipage
tikzpicture
minipage
0.5\linewidth
\hfill
如果您减小 s 的尺寸,那么tikzpicture
您也不需要这个\makebox
技巧。
\documentclass{article}
\usepackage{showframe} % prints a frame around the text area
\usepackage{tikz}
\centering
\usetikzlibrary{arrows.meta}
\newcommand\ThisAddsTheFigure{%
\begin{tikzpicture}[
%x=0.75cm,y=0.75cm
scale=0.8
]
\begin{scope}[every node/.style={circle,thick,draw}]
\node (A) at (-10,4) {N5192};
\node (B) at (-7,3) {Menor};
\node (C) at (-7,6) {Mayor};
\node (D) at (-5,4) {No CRG};
\end{scope}
\begin{scope}[>={Stealth[black]},
center coordinate every node/.style={fill=white,circle},
% every edge/.style={draw=red,very thick}
]
\path [->] (A) edge[near start,sloped,bend right = 15, blue,very thick] node [black, fill = white] {53} (B);
\path [->] (A) edge[sloped,bend left = 15, blue,very thick] node [black, fill = white] {$3301$} (C);
\path [->] (A) edge[sloped, bend left = 15, blue,very thick] node [black, fill = white]{$48$} (D);
\end{scope}
\end{tikzpicture}}
\begin{document}
\begin{figure}[ht]
\begin{minipage}[b]{0.48\linewidth}
\centering
\ThisAddsTheFigure%
\caption{This is my Caption}
\end{minipage}\hfill
\begin{minipage}[b]{0.48\linewidth}
\centering
\ThisAddsTheFigure
\caption{This is my second Caption}
\end{minipage}
\bigskip
\begin{minipage}[b]{0.48\linewidth}
\centering
\ThisAddsTheFigure
\caption{This is my third Caption}
\end{minipage}\hfill
\begin{minipage}[b]{0.48\linewidth}
\centering
\ThisAddsTheFigure
\caption{This is my fourth Caption}
\end{minipage}
\bigskip
\begin{minipage}[b]{0.48\linewidth}
\centering
\ThisAddsTheFigure
\caption{This is my fifth Caption}
\end{minipage}\hfill
\begin{minipage}[b]{0.48\linewidth}
\centering
\ThisAddsTheFigure
\caption{This is my sixth Caption}
\end{minipage}
\end{figure}
\end{document}
答案2
只需输入\hspace{0.5cm}
after\end{minipage}
和 before即可\begin{minipage}
。