我发现这个例子使用lua node
。输出Va
他们有:
\documentclass{minimal}
\begin{document}
\directlua{
local g1 = node.new("glyph")
g1.font = font.current()
g1.lang = tex.language
g1.char = 86
local g2 = node.new("glyph")
g2.font = font.current()
g2.lang = tex.language
g2.char = 97
g1.next = g2
g2.prev = g1
local hbox = node.hpack(g1)
local vbox = node.vpack(hbox)
node.write(vbox)
}
\end{document}
我们可以tikz
像这样绘制节点吗:
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\tikz[node distance = 3cm]{
\node (a) at (0,0) [draw, circle] {A};
\node (b) [below of = a, draw, circle] {B};
\draw [<->] (a) to (b);
}
\end{document}
生成如下内容:
使用lua node
?
答案1
像这样?
\documentclass{minimal}
\usepackage{tikz}
\usepackage{luacode}
\begin{document}
\luaexec{
tp=tex.print
tp("\\begin{tikzpicture}")
tp("\\node (a) at (0,0) [draw, circle] {A};")
tp("\\node (b) [below of = a, draw, circle,node distance=3cm] {B};")
tp("\\draw [<->] (a) to (b);")
tp("\\end{tikzpicture}")
}
\end{document}