我想调整上图中时间符号的垂直位置。
这是使用的代码。
\documentclass[12pt]{article}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree = {math content},
where n children = 0 {tier = word} {}
[243
[3 [3^1]]
[81
[9 [3^2]]
[9 [3^2]]
]
]
\path (!11) -- (!211) node[midway]{$\times$};
\path (!211) -- (!221) node[midway]{$\times$};
\end{forest}
But we must have :
$3^1 \times 3^2 \times 3^2$
\end{document}
答案1
一种可能的解决方案是使用base
锚点。例如:
\documentclass[12pt]{article}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree = {math content},
where n children = 0 {tier = word} {}
[343
[3 [3^1]]
[81
[9 [3^2]]
[9 [3^2]]
]
]
\path (!11.base) -- (!211.base) node[midway,anchor=base]{$\times$};
\path (!211.base) -- (!221.base) node[midway,anchor=base]{$\times$};
\end{forest}
But we must have:
$3^1 \times 3^2 \times 3^2$
\end{document}