我需要使用 LaTeX 绘制加权图,但我不知道如何将数字放在边缘上。这些数字就像每条边的成本。可以这样绘制图形:
\begin{tikzpicture}
\draw
(1, 1) node[circle, black, draw](m){M}
(1, 3) node[circle, black, draw](i){I}
(1, 5) node[circle, black, draw](e){E}
(1, 7) node[circle, black, draw](a){A}
(3, 1) node[circle, black, draw](n){N}
(3, 3) node[circle, black, draw](j){J}
(3, 5) node[circle, black, draw](f){F}
(3, 7) node[circle, black, draw](b){B}
(5, 1) node[circle, black, draw](o){O}
(5, 3) node[circle, black, draw](k){K}
(5, 5) node[circle, black, draw](g){G}
(5, 7) node[circle, black, draw](c){C}
(7, 1) node[circle, black, draw](p){P}
(7, 3) node[circle, black, draw](l){L}
(7, 5) node[circle, black, draw](h){H} …Run Code Online (Sandbox Code Playgroud) 我正在使用 LaTeX 使用该包编写伪算法algorithm。我想以一种对齐的方式在代码上添加注释。以下几行是我可以做的,但注释不一致。我怎么做?
\begin{algorithm}[H]
\caption{}
\label{}
\begin{tabbing}
quad \=\quad \=\quad \kill
\keyw{for} each a $\in$ A \keyw{do} \\
\> command; \qquad \qquad $\blacktriangleright$ add text here \\
\keyw{end} \\
\end{tabbing}
\end{algorithm}
The comments are like that:
one comment here\\
other here\\
other here\\
Run Code Online (Sandbox Code Playgroud)
我该如何对齐它们?
我正在使用命令 \begin{subfigure}...\end{subfigure} 并排插入三张图片。但我想知道如何在两者之间留出空间,因为它们彼此太近了。
\begin{figure}
\begin{subfigure}
here's the first image
\end{subfigure}
\begin{subfigure}
here's the second image
\end{subfigure}
\begin{subfigure}
here's the third image
\end{subfigure}
\end{figure}
Run Code Online (Sandbox Code Playgroud)