3

latex code for this linear combination:enter image description here

I have this code for the cyclic text but I have no idea how to make a bunch of them as a linear combination.

\documentclass[tikz,border=2pt]{standalone}
\begin{document}

\begin{tikzpicture}[->] \node (a) at (90:2cm) {Democrat}; \node (b) at (-30:2cm) {Republician}; \node (c) at (210:2cm) {Third};

\draw (-20:2cm) arc (-20:60:2cm) node[midway, right] {{\footnotesize 1}};
\draw (120:2cm) arc (120:200:2cm) node[midway, left] {{\footnotesize -1}};
\draw (220:2cm) arc (220:320:2cm) node[midway, below] {{\footnotesize 1}};

\end{tikzpicture}

\end{document}

parsap1378
  • 55
  • 4

3 Answers3

4

Each tikzpicture can be its own atom in a larger mathematical construct. In this case, I also used \raisebox to get better centering.

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\begin{document}
$
5\cdot
\raisebox{-1.5cm}{\begin{tikzpicture}[scale=.6,->]
    \node (a) at (90:2cm)  {Democrat};
    \node (b) at (-30:2cm) {Republician};
    \node (c) at (210:2cm) {Third};
\draw (-20:2cm) arc (-20:60:2cm) node[midway, right] {{\footnotesize 5 voters}};
\draw (120:2cm) arc (120:200:2cm) node[midway, left] {{\footnotesize 7 voters}};
\draw (220:2cm) arc (220:320:2cm) node[midway, below] {{\footnotesize 1 voter}};

\end{tikzpicture}} +4\cdot \raisebox{-1.5cm}{\begin{tikzpicture}[scale=.6,->] \node (a) at (90:2cm) {Democrat}; \node (b) at (-30:2cm) {Republician}; \node (c) at (210:2cm) {Third};

\draw (-20:2cm) arc (-20:60:2cm) node[midway, right] {{\footnotesize 5 voters}};
\draw (120:2cm) arc (120:200:2cm) node[midway, left] {{\footnotesize 7 voters}};
\draw (220:2cm) arc (220:320:2cm) node[midway, below] {{\footnotesize 1 voter}};

\end{tikzpicture}} +\cdots + 2\cdot \raisebox{-1.5cm}{\begin{tikzpicture}[scale=.6,->] \node (a) at (90:2cm) {Democrat}; \node (b) at (-30:2cm) {Republician}; \node (c) at (210:2cm) {Third};

\draw (-20:2cm) arc (-20:60:2cm) node[midway, right] {{\footnotesize 5 voters}};
\draw (120:2cm) arc (120:200:2cm) node[midway, left] {{\footnotesize 7 voters}};
\draw (220:2cm) arc (220:320:2cm) node[midway, below] {{\footnotesize 1 voter}};

\end{tikzpicture}} $ \end{document}

enter image description here

4

enter image description here

\documentclass{article}
\usepackage[left=1.5cm,right=1.5cm,
top=1.5cm,bottom=2cm,bindingoffset=0cm]{geometry}
\usepackage{float}
\usepackage{array, makecell}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{booktabs}

\usepackage{multirow} \usepackage{pdflscape} \usepackage{longtable, array}

\begin{document}

\begin{longtable}{@{} {1}{m{0.4cm}}{1}{m{2cm}} {1}{m{0.8cm}}{1}{m{2cm}} {1}{m{1.8cm}}{1}{m{3cm}}*{1}{m{3cm}} @{}}

5 $\cdot$& \begin{tikzpicture}[->,scale=.7] \node (i) at (90:1cm) {$T$}; \node (j) at (-30:1cm) {$D$}; \node (k) at (210:1cm) {$R$}; \draw (70:1cm) arc (70:-10:1cm) node[midway, right] {{\footnotesize 1}}; \draw (-50:1cm) arc (-50:-130:1cm) node[midway, below] {{\footnotesize 1}}; \draw (190:1cm) arc (190:110:1cm) node[midway, left] {{\footnotesize -1}}; \end{tikzpicture} &+ 4 $\cdot$& \begin{tikzpicture}[->,scale=.7] \node (i) at (90:1cm) {$T$}; \node (j) at (-30:1cm) {$D$}; \node (k) at (210:1cm) {$R$}; \draw (70:1cm) arc (70:-10:1cm) node[midway, right] {{\footnotesize 1}}; \draw (-50:1cm) arc (-50:-130:1cm) node[midway, below] {{\footnotesize 1}}; \draw (190:1cm) arc (190:110:1cm) node[midway, left] {{\footnotesize -1}}; \end{tikzpicture} &+ $ \ldots $ + 2 $\cdot$ & \begin{tikzpicture}[->,scale=.7] \node (i) at (90:1cm) {$T$}; \node (j) at (-30:1cm) {$D$}; \node (k) at (210:1cm) {$R$}; \draw (70:1cm) arc (70:-10:1cm) node[midway, right] {{\footnotesize 1}}; \draw (-50:1cm) arc (-50:-130:1cm) node[midway, below] {{\footnotesize 1}}; \draw (190:1cm) arc (190:110:1cm) node[midway, left] {{\footnotesize -1}}; \end{tikzpicture} \

\end{longtable}

\end{document}

WinnieNotThePooh
  • 3,008
  • 1
  • 7
  • 14
3

Welcome to TeX.SE!!!

Another approach with a macro for the cyclic text:

\documentclass{article}
\usepackage   {lipsum} % dummy text
\usepackage   {tikz}   % nice drawings

\newcommand{\cyclic}[3]% numbers: top right, bottom, top left {% \begin{tikzpicture}[->,baseline=(center.base)]% <-- to fix the baseline \useasboundingbox (-1.4,-1.2) rectangle (1.2,1.2); \node (center) at (0,0) {\strut}; \foreach[count=\ii]\i/\j in {D/#1,T/#2,R/#3} { \draw (120\ii-20:1) arc (120\ii-20:120\ii+80:1); \node at (120\ii-30:1) {$\i$}; \node at (120*\ii+30:1.3) {\footnotesize\strut$\j\ifnum\j<0\hphantom{-}\fi$}; }% this provides some symmetry ^^^^^^^^^^^^^^^^^^^^^^^^ \end{tikzpicture}% }

\begin{document} \lipsum[1] See the following equation: [5\cdot\cyclic{-1}{1}{1}+4\cdot\cyclic{-1}{-1}{1}+\cdots+2\cdot\cyclic{1}{-1}{-1}.]

\lipsum[2] \end{document}

enter image description here

Of course, you can add more parameters if you need to change the letters D,T,R, the size, etc.

Juan Castaño
  • 28,426