TransWikia.com

Draw a figure with text in Tikz

TeX - LaTeX Asked by oldenios on November 6, 2021

I need to make this figure in LaTeX:enter image description here
But i’m really noob using Tikz, I search in this page and some pages and this is what I got:
enter image description here

I know that the result is not very good but I don’t know how to improve it and I have the following problems and questions:

  1. Are the coordinates necessary? When this figure be ready I need to put it in a Beamer and I don’t know if I’ll have a problem when I try to do that.
  2. There is a way to more automatically the braces? (Like the arrows using the nodes that I’ve created just referencing the nodes created)
  3. How could I make the text "Relacion de Agencia" and "PROBLEMA DE AGENCIA" in 3 different lines (just as the photo) and also being centered?
  4. It is possible to make an aligned text with the text "(i) Conflicto de intereses" "(ii) Asimetría de información"? Because the original concept has an space between the "(i)" and "(ii)" respectively.
  5. Searching in this page I’ve found a package called Forest because a guy use it in this type of figures, is it recommendable?

This is my really basic code, thanks to anyone that could help me:

documentclass{article}
usepackage{tikz}
usetikzlibrary{decorations.pathreplacing}
begin{document}
begin{figure}
centering

begin{tikzpicture}
% nodes
node (M) at (-5, 0) {Monitor};
node (P) at (-3, 2) {Principal};
node (A) at (-3, -2) {Agente};
node (RDA) at (0, 0) {Relacion de Agencia};
node (i) at (3, 2) {(i) Conflicto de intereses};
node (ii) at (3, -2) {(ii) Asimetría de información};
node (PDA) at (6, 0) {PROBLEMA DE AGENCIA};


% arrows
draw[->] (P) -- (A);
draw[dashed, ->] (P) -- (M);
draw[dashed, -] (M) -- (A);
draw[->] (RDA) -- (i);
draw[->] (RDA) -- (ii);

% braces
draw[decoration={brace, amplitude=10pt}, decorate] (-2, 2) node {} -- (-2 , -2);
draw[decoration={brace, amplitude=10pt}, decorate] (5.5, 2) node {} -- (5.5 , -2);


end{tikzpicture}
end{figure}
end{document}

One Answer

Here is a starting point. I think you could improve it.

I changed the positioning of nodes and so its order of appearance. Also, I changed the arrow heads.

enter image description here

documentclass{article}
usepackage{tikz}
usetikzlibrary{decorations.pathreplacing,positioning,calc}
begin{document}
begin{figure}
centering

tikzset{
  every node/.style={baseline=base, node distance=5cm},
  arrow/.style={-latex, thick},
}

begin{tikzpicture}
node (M) {Monitor};
node[above right of = M] (P)  {Principal};
node[below right of = M] (A)  {Agente};

draw[decoration={brace,amplitude=10pt,raise=2pt}, decorate] (P.north east)  --node[right=.5cm,align=center] (RDA) {Relacion\ de\ Agencia} (A.south east -| P.east);

node[align=left,right of=P,yshift=-1.5cm] (i)  {llap{(i) }Conflicto de\ intereses};
node[align=left,right of=A,yshift=1.5cm] (ii)  {llap{(ii) }Asimetría de\ información};

draw[decoration={brace, amplitude=10pt,mirror,raise=2pt}, decorate] (ii.south east) --node[right=.5cm,align=center] (PDA)  {PROBLEMA\ DE\ AGENCIA} (i.north east -| ii.east)  ;

node at ($(i)!.5!(ii)$){$+$};

draw[arrow] (P) -- (A);
draw[arrow,dashed] (P.south west) -- (M);
draw[arrow,dashed] (M) -- (A.north west);
draw[arrow] (RDA) -- (i.south west);
draw[arrow] (RDA) -- (ii.north west);
end{tikzpicture}
end{figure}
end{document}

Answered by Sigur on November 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP