Math & SciencetikZ | Connecting Lines with Circle

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

tikZ | Connecting Lines with Circle

Post by ghostanime2001 »

How do I connect the two lines with the circle?

Code: Select all

\documentclass[fleqn]{article}
\usepackage{enumitem}
\usepackage{fullpage}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{intersections}
\usepackage[makeroom]{cancel}
\pagestyle{empty}
\setlength{\mathindent}{0pt}
\usepackage[version=3]{mhchem}
\usepackage{chemfig}
\setenumerate[2]{label=\alph*),leftmargin=0.5cm,font=\sffamily}
\setenumerate[1]{label=A-\arabic*.,leftmargin=-1cm,font=\sffamily}
\allowdisplaybreaks
\begin{document}
\begin{tikzpicture}[>=triangle 60]
\draw [<-] (-5,0) -- (-1,0);
\draw [<-] (5,0) -- (1,0);
\node [circle,draw,inner sep=0pt] {\begin{tikzpicture}[scale=0.4] \draw (-1,0) -- (1,0); \draw (0,1) -- (0,-1); \end{tikzpicture}};
\end{tikzpicture}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tikZ | Connecting Lines with Circle

Post by localghost »

Code: Select all

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}
  \begin{tikzpicture}[>=triangle 60]
    \node[circle,draw,inner sep=0pt] (oplus) at (0,0) {%
      \begin{tikzpicture}[scale=0.4]
        \draw (-1,0) -- (1,0);
        \draw (0,1) -- (0,-1);
      \end{tikzpicture}
    };
    \draw[<-] (-5,0) -- (oplus);
    \draw[<-] (5,0) -- (oplus);
  \end{tikzpicture}
\end{document}

Thorsten
Post Reply