# How to draw this diagram in tikz? I'm a Latex beginner, could you please help me to draw this diagram in tikz?

• Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. – Stefan Pinnow Oct 7 '17 at 10:37
• Because of the regular layout, you might want to use the matrix tikzlibrary. You still need to draw all the connecting lines, but each node will automatically be given a name like A-1-1 for [name=A]. – John Kormylo Oct 7 '17 at 14:25

## 1 Answer

Just as exercise:

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usetikzlibrary{positioning, calc, arrows.meta}
\tikzset{
mynode/.style={draw=red, rounded corners, thick},
myredline/.style={draw=red, thick},
}

\begin{document}
\begin{tikzpicture}
\matrix[
matrix of nodes,
column sep=6em,
nodes in empty cells,
nodes={
text centered,
text width=6em,
text height=1.75ex,
text depth=.25ex,
},
] (m) {
100\% & |[mynode]|Next Coupon & |[mynode]|\dots & |[mynode]|100\% + \dots \\[5ex]
0 & & \dots & \dots \\
LCD & NCD && \\
};
\foreach \pos in {1,2,3,4}{
\draw (m-1-\pos) -- (m-2-\pos);
}
\foreach \pos in {2,3,4}{
\draw[myredline] (m-1-\pos) -- +(0,4ex);
}
\draw ($(m-1-1)!0.5!(m-2-1)$) -- ($(m-1-4)!0.5!(m-2-4)$);
\draw[myredline] ($(m-1-4)+(0,4ex)$) -- node[red, above] {Atualiza\c c\~ao} ($(m-1-2)+(0,4ex)$);
\coordinate (between1and2) at ($(m-1-1)!0.5!(m-1-2)$);
\draw[myredline, -Latex] ($(m-1-2)+(0,4ex)$) -- ($(between1and2)+(0,4ex)$) -- (between1and2) -- (m-1-1);
\end{tikzpicture}
\end{document} 