![Cómo dibujar un diagrama de bloques como este en LaTeX](https://rvso.com/image/405356/C%C3%B3mo%20dibujar%20un%20diagrama%20de%20bloques%20como%20este%20en%20LaTeX.png)
Intenté dibujar un diagrama de bloques similar al que se muestra en el diagrama, pero no puedo hacerlo. Por favor, alguien sugiera una forma de dibujar dicho diagrama de bloques. Gracias
Lo intenté hasta ahora
\usepackage{forest}
\useforestlibrary{edges}
\begin{forest}
for tree={draw, minimum width=2cm, minimum height=1cm, rounded corners},
forked edges,
[IDS for Automotive CAN Bus System [Deployment Strategy[ECU][CAN][Gateway]][Detection Approach[Specification Based][Anomaly Based[Machine Learning][Hybrid Based][Frequency Based]][Signature Based]][Attacking Technique[DoS][Replay]]]
\end{forest}
Obtengo este tipo de resultado en pdf.salida incorrecta]1
Respuesta1
Esto es en gran medida una adaptación deaquí. Debe inyectar for tree={folder, grow'=0}
cada vez que desee iniciar una carpeta. Su árbol es demasiado ancho, por lo que reduje el ancho del texto para todos menos los nodos raíz.
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{forest}
\useforestlibrary{edges}
\makeatletter
% remove the stray space https://tex.stackexchange.com/a/513549
\patchcmd{\pgfutilsolvetwotwoleqfloat}
{ \noexpand\pgfmathfloatdivide@}
{\noexpand\pgfmathfloatdivide@}
{}{}
\makeatother
\begin{document}
\noindent\begin{forest}
before typesetting nodes={
if={isodd(n_children("!r"))}{
for nodewalk/.wrap pgfmath arg={{fake=r,n=#1}{calign with current edge}}{int((n_children("!r")+1)/2)},
}{},
},
forked edges,
for tree={draw, minimum width=2cm, minimum height=1cm, rounded corners,
if level=0{}{text width=2cm}},
[IDS for Automotive CAN Bus System
[Deployment Strategy,for tree={folder, grow'=0}
[ECU]
[CAN]
[Gateway]
]
[Detection Approach
[Specification Based]
[Anomaly Based,for tree={folder, grow'=0}
[Machine Learning]
[Hybrid Based]
[Frequency Based]
]
[Signature Based]
]
[Attacking Technique,for tree={folder, grow'=0}
[DoS]
[Replay]
]
]
\end{forest}
\end{document}
showframe
es solo para mostrar que este árbol encaja (sin embargo, simplemente cargar el paquete de geometría hace que la página sea un poco más ancha).
EDITAR: Eliminado tempcounta/.max={level}{tree},
que no se usó, muchas gracias a @cfr.
2da EDICIÓN: Corrección agregada dehttps://tex.stackexchange.com/a/513549, siguiendo una sugerencia de @cfr.