Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 5 down vote accepted

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.

share|improve this answer

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

share|improve this answer
    
Thanks a lot. What if I want rotate it? like by 90°. Can Simply I change the coordinates in draw commands, right? –  Oscar Jul 15 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. –  Henri Menke Jul 15 at 18:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.