You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a figure I create in latex using the tikz package. Is it possible to write it directly in the Rmarkdown document? (ie, the way equations can be written, if mathjax is specified as a widget).
The code I use to create my latex figure is below. I'm using the io2012 framework for my slides.
\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{pdflscape}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows, positioning, calc, plotmarks}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\pagenumbering{gobble}
\begin{landscape}
\pgfdeclarelayer{bg} % declare background layer\pgfsetlayers{bg,main} % set the order of the layers (main is the standard layer)
Some text
\tikzstyle{startstop3} = [rectangle, minimum width=5cm, line width=1mm,minimum height=2cm,text centered, font = \bf, draw=black, fill=white]
\tikzstyle{process3} = [rectangle, rounded corners, minimum width=4.2cm, text width = 4cm, minimum height=2cm, line width=1mm, text centered, draw=black, fill=white!100]
\tikzstyle{cloud3} = [draw, rectangle, rounded corners, fill=black!100, text width = 3.5cm, minimum width=4cm, minimum height = 1.5cm, text centered, text=white]
\tikzstyle{arrow} = [thick,->,>=stealth]
\tikzstyle{circle3} = [circle, fill = black, xshift = 0.1cm]
%\tikzset{every loop/.style={min distance=40mm,in=0,out=40,looseness=10}}\begin{tikzpicture}[remember picture,overlay,node distance=2cm]
\node (perch1) [process3] {};
%% regeneration framework\node (perch2) [process3, right of=perch1, xshift = 6cm] {};
\node (perch4) [process3, right of=perch2, xshift = 3cm, yshift = 2cm] {};
\node (perch3) [process3, right of=perch2, xshift = 3cm, yshift = -2cm] {};
\node (perch5) [process3, right of=perch4, xshift = 3cm, yshift = -2cm, label={[align=left]}] {};
\node (perch1n) [circle3, left of=perch1, text = white, yshift = 0.9cm, xshift = -0.1cm] {\textbf{\Large 1}};
\node (perch2n) [circle3, left of=perch2, text = white, yshift = 0.9cm, xshift = -0.1cm] {\textbf{\Large 2}};
\node (perch3n) [circle3, left of=perch4, text = white, yshift = 0.9cm, xshift = -0.1cm] {\textbf{\Large 3}};
\node (perch4n) [circle3, left of=perch3, text = white, yshift = 0.9cm, xshift = -0.1cm] {\textbf{\Large 4}};
\node (perch5n) [circle3, left of=perch5, text = white, yshift = 0.9cm, xshift = -0.1cm] {\textbf{\Large 5}};
\node (glyphosate) [right of=perch1, text = black, xshift = 1.8cm, yshift = 0.3cm] {};
\begin{pgfonlayer}{bg}
\draw[->,gray, >=angle 60, line width = 1mm, line cap=round] (perch1n) edge [out=105,in=170,looseness=20, min distance = 10mm] node[below] {} (perch1n);
\draw[->,black, >=angle 60, line width = 1mm, line cap=round, loosely dashed] ($(perch4.east)$) to [bend left] ($(perch5.north)$);
\draw[->,gray, >=angle 60, line width = 1mm, line cap=round] ($(perch4.west)$) to [bend right] ($(perch1.north)$);
\draw[->,gray, >=angle 60, line width = 1mm, line cap=round] ($(perch3.west)$) to [bend left] ($(perch1.south)$);
\draw[->,gray, >=angle 60, line width = 1mm, line cap=round] ($(perch2.east)+(0, -0.17)$) to [bend left] ($(perch3.north)$);
\draw[->,black, >=angle 60, line width = 1mm, line cap=round] ($(perch2.east)+(0, +0.17)$) to [bend right] ($(perch4.south)$);
\draw[->,black, >=angle 60, line width = 1mm, line cap=round] ($(perch1.east)$) -- ($(perch2.west)$);
\node (perch4I) [circle3, fill = white, right of=perch3, text = white, yshift = -0.74cm, xshift = -.26cm] {3};
\draw[->,gray, >=angle 60, line width = 1mm, line cap=round] (perch4I) edge [out=285,in=350,looseness=25, min distance = 10mm] node[below] {} (perch4I);
\node (perch5I) [circle3, fill = white, right of=perch5, text = white, yshift = 0.7cm, xshift = -0.33cm] {5};
\draw[->,black, >=angle 60, line width = 1mm, line cap=round, loosely dashed] (perch5I) edge [out=25,in=85,looseness=30, min distance = 10mm] node[below] {} (perch5I);
\end{pgfonlayer}
\end{tikzpicture}
\end{landscape}
\end{document}
The text was updated successfully, but these errors were encountered:
I have a figure I create in latex using the tikz package. Is it possible to write it directly in the Rmarkdown document? (ie, the way equations can be written, if mathjax is specified as a widget).
The code I use to create my latex figure is below. I'm using the io2012 framework for my slides.
The text was updated successfully, but these errors were encountered: