答案1
除了输入文本外,这很容易做到。
\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
highlight/.style={fill=cyan,fill opacity=0.4,rounded corners},
forked edges,
for tree={folder,grow'=0,font=\ttfamily,where n children=0{highlight}{}}
[question/
[mes-exercises/
[/]
[unnecessary/]
[\textunderscore id/]
]
[mes-exercises/
[/]
[unnecessary/]
[\textunderscore id/]
]
[profil]
]
\end{forest}
\end{document}
这是一个更为严格的版本。
\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
highlight/.style={fill=cyan,fill opacity=0.4,rounded corners,inner sep=1pt,
outer sep=1pt},
forked edges,
for tree={folder,grow'=0,font=\ttfamily,s sep=0.4ex,
where n children=0{highlight}{}},
[question/
[mes-exercises/
[/]
[unnecessary/]
[\textunderscore id/]
]
[mes-exercises/
[/]
[unnecessary/]
[\textunderscore id/]
]
[profil]
]
\end{forest}
\end{document}