2

I am working on a paper and I need in the introduction to put a diagram. The diagram is the following (or something similar) and I was wondering how can I reproduce it in LaTeX code.Diagram of a string scattering process

2 Answers 2

7

Using Andrew Stacey's purpose-built tqft library:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{tqft}
\begin{document}
\begin{tikzpicture}[tqft/cobordism/.style={draw},tqft/every boundary component/.style={draw}]
\pic [tqft/pair of pants];
\end{tikzpicture}

enter image description here

There are many customization options as well as other shapes and connection methods, if you need a substantial number of these diagrams. You may refer to the manual for complete details.

2

A TikZ solution:

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
  \draw (0,0) ellipse (.5 and .25);
  \draw (-1,-2) ellipse (.5 and .25);
  \draw (1,-2) ellipse (.5 and .25);
  \draw (-.5,0) to[out=-90,in=90] (-1.5,-2);
  \draw (.5,0) to[out=-90,in=90] (1.5,-2);
  \draw (-.5,-2) to[out=90,in=90] (.5,-2);
\end{tikzpicture}
\end{document}

enter image description here

With some pseudo-3D

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[x={(1cm,0cm)},y={(-.2cm,-.2cm)},z={(0cm,1cm)}]
  \draw (0,0,0) circle (.5);
  \draw (-1,0,-2) circle (.5);
  \draw (1,0,-2) circle (.5);
  \draw (-.5,0,0) to[out=-90,in=90] (-1.5,0,-2);
  \draw (.5,0,0) to[out=-90,in=90] (1.5,0,-2);
  \draw (-.5,0,-2) to[out=90,in=90] (.5,0,-2);
\end{tikzpicture}
\end{document}

enter image description here

2
  • Thanks a lot. What if I want rotate it? like by 90°. Can Simply I change the coordinates in draw commands, right?
    – Oscar
    Commented Jul 15, 2014 at 14:31
  • Just add [rotate=90] to the tikzpicture environment like in \begin{tikzpicture}[rotate=90]. Also try reading the TikZ manual (At least chapters 2-7). It contains a vast amount of examples and tutorials. Commented Jul 15, 2014 at 18:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .