TeX - LaTeX Asked by cProg on September 1, 2021
How can I draw the horizontal edges as shown of the picture below? My code is as below. Thank you.
documentclass[12pt]{book}
usepackage[paperwidth=16cm, paperheight=24cm]{geometry}
usepackage[T1]{fontenc}
usepackage[french]{babel}
usepackage{tabularx,ragged2e}
newcolumntype{R}{>{RaggedLeft}X}
usepackage{tikz}
usetikzlibrary{arrows,automata,matrix,positioning}
begin{document}
begin{tikzpicture} [every node/.style={block}, block/.style={minimum height=1.5em,outer sep=0pt,draw,rectangle,node distance=1 cm}]
node (A){Source code};
node (B) [below=of A] {Lexical analysis};
node (C) [below=of B] {Syntaxical analysis};
node (D) [below=of C] {Semantical analysis};
node (E) [below=of D] {Code generation};
node (F) [below=of E] {Code optimization};
node (G) [below=of F] {Code generation};
node (H) [below=of G] {Object code};
path[->] (A) edge (B);
path[->] (B) edge (C);
path[->] (C) edge (D);
path[->] (D) edge (E);
path[->] (E) edge (F);
path[->] (F) edge (G);
path[->] (G) edge (H);
end{tikzpicture}
end{document}
Thank you to Muzimuzhi for his comment. In case it could be useful to someone else, I am posting below the full code of what I was expecting, based on Muzimuzhi comment:
documentclass[12pt]{book}
usepackage[paperwidth=16cm, paperheight=24cm]{geometry}
usepackage[T1]{fontenc}
usepackage[french]{babel}
usepackage{tabularx,ragged2e}
newcolumntype{R}{>{RaggedLeft}X}
usepackage{tikz}
usetikzlibrary{arrows,automata,matrix,positioning,calc}
begin{document}
begin{tikzpicture} [every node/.style={block}, block/.style={minimum height=1.5em,outer sep=0pt,draw,rectangle,node distance=1 cm}]
node (A){Source code};
node (B) [below=of A] {Lexical analysis};
node (C) [below=of B] {Syntaxical analysis};
node (D) [below=of C] {Semantical analysis};
node (E) [below=of D] {Code generation};
node (F) [below=of E] {Code optimization};
node (G) [below=of F] {Code generation};
node (H) [below=of G] {Object code};
path[->] (A) edge (B);
path[->] (B) edge (C);
path[->] (C) edge (D);
path[->] (D) edge (E);
path[->] (E) edge (F);
path[->] (F) edge (G);
path[->] (G) edge (H);
draw[->] ($ (A)!.5!(B) $) -- +(3, 0) node[align=center, right] {textmore text};
draw[->] ($ (B)!.5!(C) $) -- +(3, 0) node[align=center, right] {textmore text};
draw[->] ($ (C)!.5!(D) $) -- +(3, 0) node[align=center, right] {textmore text};
draw[->] ($ (D)!.5!(E) $) -- +(3, 0) node[align=center, right] {textmore text};
draw[->] ($ (E)!.5!(F) $) -- +(3, 0) node[align=center, right] {textmore text};
draw[->] ($ (F)!.5!(G) $) -- +(3, 0) node[align=center, right] {textmore text};
draw[->] ($ (G)!.5!(H) $) -- +(3, 0) node[align=center, right] {textmore text};
end{tikzpicture}
end{document}
Answered by cProg on September 1, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP