如何在图片中插入特殊符号

时间:2018-12-16 12:48:49

标签: latex

picture

我已经尝试过此代码,我希望图中的括号与附件中的图片一样。

\begin{figure}[hbt!]
\begin{center}

    \begin{tikzpicture}[
       thick,
       acteur/.style={
         circle,
         fill=black,
         thick,
         inner sep=2pt,
         minimum size=0.2cm
       }
     ] 

           \node (a1) at (-0.3,0.65) [acteur,label=below :\scriptsize{}]{};
           \node (a2) at (1,0)[acteur,label=below:\scriptsize{\hspace{0.3cm}$x_{0}$}]{}; 
           \node (a3) at (2,0) [acteur,label=below:\scriptsize{$x_{1}$}]{}; 
           \node (a4) at (3,0) [acteur,label=below:\scriptsize{$x_{2}$}]{};
           \node (a5) at (4,0) [acteur,label=above :\scriptsize{}]{};
           \node (a6) at (5,0) [acteur,label=below right :\scriptsize{\hspace{-0.9cm}$x_{k-s-t}$}]{};
           \node (a7) at (6.5,0) [acteur,label=below:\scriptsize{}]{}; 
           \node (a8) at (-0.3,-0.65) [acteur,label=above:\scriptsize{}]{}; 
           \node (a9) at (0.4,1.3) [acteur,label=above:\scriptsize{}]{};
           \node (a10) at (0.4,-1.3) [acteur,label=below:\scriptsize{}]{}; 
           \node (a11) at (6,1) [acteur,label=below:\scriptsize{}]{};
           \node (a12) at (6,-1) [acteur,label=below:\scriptsize{}]{};
           \node (a13) at (5.3,1.3) [acteur,label=below:\scriptsize{}]{};
           \node (a14) at (5.3,-1.3) [acteur,label=below:\scriptsize{}]{};



           \draw  (a1) -- (a2); 
           \draw  (a2) -- (a9); 
           \draw  (a2) -- (a8);
           \draw  (a2) -- (a10);
           \draw  (a2) -- (a3);
           \draw  (a3) -- (a4);
           \draw [dashed]  (a4) -- (a5);
           \draw  (a5) -- (a6);
           \draw  (a6) -- (a7);
           \draw  (a6) -- (a11);
           \draw  (a6) -- (a13);
           \draw  (a6) -- (a12);
           \draw  (a6) -- (a14);
\end{tikzpicture}
\end{center}

\caption{\small{The graph $\mathcal{P}(k,s,t)$}}
\end{figure}

1 个答案:

答案 0 :(得分:0)

您可以使用\documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{figure}[hbt!] \begin{center} \begin{tikzpicture}[ thick, acteur/.style={ circle, fill=black, thick, inner sep=2pt, minimum size=0.2cm } ] \node (a1) at (-0.3,0.65) [acteur,label=below :\scriptsize{}]{}; \node (a2) at (1,0)[acteur,label=below:\scriptsize{\hspace{0.3cm}$x_{0}$}]{}; \node (a3) at (2,0) [acteur,label=below:\scriptsize{$x_{1}$}]{}; \node (a4) at (3,0) [acteur,label=below:\scriptsize{$x_{2}$}]{}; \node (a5) at (4,0) [acteur,label=above :\scriptsize{}]{}; \node (a6) at (5,0) [acteur,label=below right :\scriptsize{\hspace{-0.9cm}$x_{k-s-t}$}]{}; \node (a7) at (6.5,0) [acteur,label=below:\scriptsize{}]{}; \node (a8) at (-0.3,-0.65) [acteur,label=above:\scriptsize{}]{}; \node (a9) at (0.4,1.3) [acteur,label=above:\scriptsize{}]{}; \node (a10) at (0.4,-1.3) [acteur,label=below:\scriptsize{}]{}; \node (a11) at (6,1) [acteur,label=below:\scriptsize{}]{}; \node (a12) at (6,-1) [acteur,label=below:\scriptsize{}]{}; \node (a13) at (5.3,1.3) [acteur,label=below:\scriptsize{}]{}; \node (a14) at (5.3,-1.3) [acteur,label=below:\scriptsize{}]{}; \draw (a1) -- (a2); \draw (a2) -- (a9); \draw (a2) -- (a8); \draw (a2) -- (a10); \draw (a2) -- (a3); \draw (a3) -- (a4); \draw [dashed] (a4) -- (a5); \draw (a5) -- (a6); \draw (a6) -- (a7); \draw (a6) -- (a11); \draw (a6) -- (a13); \draw (a6) -- (a12); \draw (a6) -- (a14); \draw[decorate,decoration={brace,amplitude=10pt}] (-0.5, -1) -- (-0.5, 1) node[left, midway, xshift = -10pt]{$s$ vertices}; \draw[decorate,decoration={brace,amplitude=10pt}] (6.5, 1) -- (6.5, -1) node[right, midway, xshift = 10pt]{$t$ vertices}; \end{tikzpicture} \end{center} \caption{\small{The graph $\mathcal{P}(k,s,t)$}} \end{figure} \end{document}

{{1}}

enter image description here