我怎样才能将以下两个图并排放置?

我怎样才能将以下两个图并排放置?
\documentclass[a4paper, 12pt]{article}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}

    \begin{tikzpicture}[scale=0.90,
acteur/.style = {circle, fill=black, thick,
                 inner sep=0.5pt, outer sep=0pt, minimum size=1.3mm},
   decoration = {markings, mark=at position 0.5cm with {\arrowreversed[semithick]{>}}},
every label/.append style = {font=\scriptsize},
     ]
\node (v2) at (0,0) [acteur,label=below:$v_2$]{};
\node (v1) at (0,1)[acteur,label=above:$v_1$]{};
\node (v3) at (1,0) [acteur,label=below:$v_3$]{};
\node (v4) at (2,0) [acteur,label=below:$v_4$]{};
\node (v5) at (2,1) [acteur,label=above:$v_5$]{};
\node (v6) at (1,1) [acteur,label=above:$v_6$]{};
%
\draw (v1) -- (v2);
\draw (v3) -- (v6);
\draw (v5) -- (v4);
\draw (v1) -- (v6);
\draw (v2) -- (v3);
\draw (v6) -- (v5);
\draw (v3) -- (v4);
%
\node at (-2.5,1) {\textit{$G_1$}};
\end{tikzpicture}





\begin{tikzpicture}[scale=0.90,
acteur/.style = {circle, fill=black, thick,
                 inner sep=0.5pt, outer sep=0pt, minimum size=1.3mm},
   decoration = {markings, mark=at position 0.5cm with {\arrowreversed[semithick]{>}}},
every label/.append style = {font=\scriptsize},
     ]
\node (v2) at (0,0) [acteur,label=left:$v_2$]{};
\node (v3) at (1,0)[acteur,label=right:$v_3$]{};
\node (v1) at (0.5,1) [acteur,label=above:$v_1$]{};

%
\draw (v1) -- (v2);
\draw (v2) -- (v3);
\draw (v3) -- (v1);

%
\node at (-2.5,1) {\textit{$G_2$}};
\end{tikzpicture}
\end{document}
How I can put the following two figure side by side?

















































答案1

一种方法是\hfill在它们之间添加:

\documentclass[a4paper, 12pt]{article}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}

    \begin{tikzpicture}[scale=0.90,
    acteur/.style = {circle, fill=black, thick,
        inner sep=0.5pt, outer sep=0pt, minimum size=1.3mm},
    decoration = {markings, mark=at position 0.5cm with {\arrowreversed[semithick]{>}}},
    every label/.append style = {font=\scriptsize},
    ]
    \node (v2) at (0,0) [acteur,label=below:$v_2$]{};
    \node (v1) at (0,1)[acteur,label=above:$v_1$]{};
    \node (v3) at (1,0) [acteur,label=below:$v_3$]{};
    \node (v4) at (2,0) [acteur,label=below:$v_4$]{};
    \node (v5) at (2,1) [acteur,label=above:$v_5$]{};
    \node (v6) at (1,1) [acteur,label=above:$v_6$]{};
    %
    \draw (v1) -- (v2);
    \draw (v3) -- (v6);
    \draw (v5) -- (v4);
    \draw (v1) -- (v6);
    \draw (v2) -- (v3);
    \draw (v6) -- (v5);
    \draw (v3) -- (v4);
    %
    \node at (-2.5,1) {\textit{$G_1$}};
    \end{tikzpicture}
\hfill
    \begin{tikzpicture}[scale=0.90,
    acteur/.style = {circle, fill=black, thick,
        inner sep=0.5pt, outer sep=0pt, minimum size=1.3mm},
    decoration = {markings, mark=at position 0.5cm with {\arrowreversed[semithick]{>}}},
    every label/.append style = {font=\scriptsize},
    ]
    \node (v2) at (0,0) [acteur,label=left:$v_2$]{};
    \node (v3) at (1,0)[acteur,label=right:$v_3$]{};
    \node (v1) at (0.5,1) [acteur,label=above:$v_1$]{};

    %
    \draw (v1) -- (v2);
    \draw (v2) -- (v3);
    \draw (v3) -- (v1);

    %
    \node at (-2.5,1) {\textit{$G_2$}};
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容