(See the next iteration.)The result looks likeand my code is:\documentclass[10pt]{article}\usepackage{amsmath}\usepackage[ruled,vlined,linesnumbered]{algorithm2e}\begin{document}  \begin{algorithm}    \SetKw{Nil}{nil}    \SetKw{Is}{is}    \SetKw{Not}{not}    \SetKw{Mapped}{mapped}    \SetKw{In}{in}    \SetKw{ChildNode}{child node}    \SetKw{Of}{of}    \SetKw{Continue}{continue}    $\text{OPEN} = \{ s \}$ \\    $\text{CLOSED} = \emptyset$ \\    $\pi = \{ (s \mapsto$ \Nil $)\}$ \\    $g = \{ (s \mapsto 0) \}$ \\    \While{$|\text{OPEN}| > 0$}{      $u = \textsc{ExtractMinimum}(\text{OPEN})$ \\      \If{$u$ \Is $t$}{        \KwRet \textsc{TracebackPath}$(u, \pi)$ \\      }      $\text{CLOSED} = \text{CLOSED} \cup \{ u \}$ \\      \ForEach{\ChildNode $v$ \Of $u$}{        \If{$v \in \textsc{CLOSED}$}{          \Continue \\        }        $c = g(u) + w(u, v)$ \\        \If{$v$ \Is \Not \Mapped \In $g$}{          $g(v) = c$ \\          $\pi(v) = u$ \\          \textsc{Insert}$(\text{OPEN}, v, c + h(v))$ \\        }        \ElseIf{$g(v) > c$}{          $g(v) = c$ \\          $\pi(v) = u$ \\          \textsc{DecreaseKey}$(\text{OPEN}, v, c + h(v))$ \\        }      }    }    \KwRet $\langle \rangle$    \caption{\textsc{AStarPathFinder}$(s, t, w, h)$}  \end{algorithm}  \begin{algorithm}    \SetKw{Is}{is}    \SetKw{Not}{not}    \SetKw{Nil}{nil}    $p = \langle \rangle$ \\    \While{$u$ \Is \Not \Nil}{      $p = u \circ p$ \\      $u = \pi(u)$ \\    }    \KwRet $p$  \caption{\textsc{TracebackPath}$(u, \pi)$}  \end{algorithm}\end{document}Can I make my code better? For example, is there a way to defined custom keywords in a global scope so that I don't have to repeat myself?
Typesetting A* in LaTeX using algorithm2e
tex;a star