最近在学习用LaTeX中的TikZ包画图 (graph), 必须要用LuaLaTeX编译. 然而却出现了奇怪的错误.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{graphdrawing, graphs}
\usegdlibrary{trees, layered, force}

\begin{document}
	\begin{tikzpicture}[rounded corners]
	\graph[layered layout, nodes={circle, draw}]
	{
		2->{3->{4->{6, 5}}, 5 };
		5->{1->3, 6, 4};
		6->{3}; 
	};
	\end{tikzpicture}
\end{document}

错误信息

! Undefined control sequence.
\sa@placebox ->\newpage \global \pdfpagewidth 
                                              =\wd \sa@box \global \pdfpageh...

l.16 \end{document}

看起来很奇怪, 貌似是LuaLaTeX不支持standalone.
我用的LuaTeX的版本是

$ lualatex --version
This is LuaTeX, Version 0.95.0 (TeX Live 2016/Debian)

查了一下, 解决办法是在源文件开头加上一行
RequirePackage{luatex85}
详情请见此链接.

相关文章:

  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-10-18
  • 2021-08-23
猜你喜欢
  • 2021-09-09
  • 2022-01-27
  • 2021-09-29
  • 2021-12-28
  • 2022-01-04
  • 2021-08-17
相关资源
相似解决方案