[Tex/LaTex] How to draw -> in forest

forest

I want to draw like -> 123 in this forest by $\overset{\downarrow }{\mathop{123}}\,$none as defaut
This is my code

\documentclass[12pt]{standalone}
\usepackage{amsmath}
\usepackage{forest}
\begin{document}
\begin{forest}
[1[2[3[123]][4[124]][5[125]]]
[3[2[132]][4[134]][5[135]]]
[4[2[142]][3[143]][5[145]]]
[5[2[152]][3[153]][4[154]]]]
\end{forest}
\end{document}

enter image description here

How can I get like this, for example?

enter image description here

Best Answer

You can do it all at once or do it node wise:

\documentclass[preview]{standalone}
\usepackage{amsmath}
\usepackage{forest}

\begin{document}
\begin{forest}
for tree={
if n children=0{edge={->}}{},
},
[1[2[3[123]][4[124]][5[125]]]
[3[2[132]][4[134]][5[135]]]
[4[2[142]][3[143]][5[145]]]
[5[2[152]][3[153]][4[154]]]]
\end{forest}

\begin{forest}
[1[2[3[123,edge={->}]][4[124,edge={->}]][5[125,edge={->}]]]
[3[2[132,edge={->}]][4[134,edge={->}]][5[135,edge={->}]]]
[4[2[142,edge={->}]][3[143,edge={->}]][5[145,edge={->}]]]
[5[2[152,edge={->}]][3[153,edge={->}]][4[154,edge={->}]]]]
\end{forest}
\end{document}

enter image description here

Related Question