4
Hello! Probably this question has already been addressed here but I did not find... I use R Markdonw to generate manuals on certain R commands, but I made a diagram in Latex and wanted to know if there is any way to import it to R Markdown. Thank you!
I would like to insert this.
% arara: pdflatex
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[hmargin=2cm,vmargin=1cm]{geometry}
\renewcommand{\rmdefault}{bch} % change default font
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}
[% style definitions
,every node/.style={node distance=3, font=\footnotesize}
,comment/.style={font=\scriptsize\sffamily}
,force/.style={rectangle, draw, fill=black!10, inner sep=5pt, text width=3cm, text badly centered, minimum height=1.2cm, font=\bfseries\footnotesize\sffamily}
,on grid
]
% Draw forces
\node [force] (z) {Dados Arvore};
\node [force, above = of z] (y) {Dados Originais};
\node [force, right = 5 of z] (x) {Secção};
\node [force, below = of z] (v) {Dados Arvore II};
\node [force, right = 5 of v] (b) {Cubagem};
\node [force, below = 4 of v] (w) {Arquivo Final};
\node [force, below left = 2 and 2.5 of v] (c) {Modelos de Relaçao Hisométrica};
\node [force, below right = 2 and 2.5 of v] (e) {Modelos de Volume};
% Draw the links between forces
\path[->,thick,every node/.append style={comment,anchor=base, fill=white}]
(y) edge node {Avaliação} (z) edge node {Avaliação} (x)
(z) edge node {Inconsistências e Manipulação} (v)
(v) edge (w) edge node {Ajuste} (c) edge node {Ajuste} (e)
(c) edge node {Predição} (w)
(e) edge node {Predição} (w)
(x) edge node {Inconsistências e Manipulação} (b)
(b) edge node {Manipulação} (e);
\end{tikzpicture}
\caption[Diagrama do Script de ajuste de relação hipsométrica]{Diagrama do Script de ajuste de relação hipsométrica, volume cubado e equações de volumetria da empresa FLORESTECA.}
\label{fig:6forces}
\end{figure}
\end{document}
It may be easier for you to turn your Rmarkdown into Latex, this will do?
– Daniel Falbel
Rmarkdown files accept Latex commands directly, have you tried to put it that way? For example, put
$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$
in a document and do the Knit.– Molx
Hello, I edited my question.
– Marco Machado