使用 Overleaf,我做了input
一个standalone
tikz 图形定义如下:
% File diagram.tex
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pfgplots}
\usetikzlibrary{external}
\usetikzlibrary{3d,calc}
\usepackage{tikz-3dplot}
\makeatletter
\def\@setOxy O(#1,#2,#3)x(#4,#5,#6)y(#7,#8,#9)%
{\def\tikz@plane@origin{\pgfpointxyz{#1}{#2}{#3}}%
\def\tikz@plane@x{\pgfpointxyz{(#1+#4)}{(#2+#5)}{(#3+#6)}}%
\def\tikz@plane@y{\pgfpointxyz{(#1+#7)}{(#2+#8)}{(#3+#9)}}%
\tikz@canvas@is@plane
}
\tikzoption{canvas is plane}[]{\@setOxy#1}
\makeatother
\begin{document}
\tdplotsetmaincoords{50}{70}
\begin{tikzpicture}[tdplot_main_coords]
\begin{scope}[canvas is plane={O(1,2,0)x(0.35,0.8,0)y(0,0,1)}]
\draw[dashed,lightgray] (0,0) rectangle (8,5);
\begin{axis}[hide axis, unit vector ratio=1 1 1]
% hidden for conciseness
\end{axis}
\end{scope}
\draw (0,0,0) -- (1,0,0) node[anchor=north] {$\hat{\textbf{x}}$};
\draw (0,0,0) -- (0,1,0) node[anchor=west] {$\hat{\textbf{y}}$};
\draw (0,0,0) -- (0,0,1) node[anchor=south] {$\hat{\textbf{z}}$};
\end{tikzpicture}
\end{document}
生成如下图像。
但是,当我将代码包含到我的主文件中时,它就canvas is plane
完全乱了。
\begin{figure}
\input{diagram}
\end{figure}
我该怎么做才能保持canvas is plane
独立编译的行为?