如何使用拼图包?

如何使用拼图包?

我想在 LaTeX 中使用 puzzlelogic 包,但由于我不知道如何定义环境,所以出现错误。你能帮忙吗?

\documentclass[tikz]{standalone}
\usepackage{logicpuzzle}

 \begin{document}
    \begin{sunandmoon}
\framepuzzle
\setrow{5}{{},{},{},{},\Moon}
\setrow{4}{{},{},\MoonTL}
\setrow{3}{\Moon}
\setrow{2}{{},\MoonR}
\setrow{1}{{},{},{},\MoonT}
\end{sunandmoon}
\hspace{1.5cm}
\begin{sunandmoon}
\framepuzzle
\setrow{5}{{},{},\Star,\Cloud,\Moon}
\setrow{4}{{},\Star,\MoonTL,{},\Cloud}
\setrow{3}{\Moon,\Cloud,{},{},\Star}
\setrow{2}{\Cloud,\MoonR,{},\Star}
\setrow{1}{\Star,{},\Cloud,\MoonT}
\end{sunandmoon}
\end{center}
\begin{center}
\begin{sunandmoon}
\framepuzzle
\setrow{5}{{},{},{},{},\Moon}
\setrow{4}{{},{},\MoonTL}
\setrow{3}{\Moon}
\setrow{2}{{},\MoonR}
\setrow{1}{{},{},{},\MoonT}
\end{sunandmoon}
\hspace{1.5cm}
\begin{sunandmoon}
\framepuzzle
\setrow{5}{{},{},\Star,\Cloud,\Moon}
\setrow{4}{{},\Star,\MoonTL,{},\Cloud}
\setrow{3}{\Moon,\Cloud,{},{},\Star}
\setrow{2}{\Cloud,\MoonR,{},\Star}
\setrow{1}{\Star,{},\Cloud,\MoonT}
\end{sunandmoon}

\end{document}

答案1

我不知道这是否有帮助,如果没有帮助,我当然很乐意删除这篇帖子。

  • 正如@cfr 指出的那样,您需要摆脱这些center语句才能使代码可编译。
  • 之后,我对结果感到困惑(因为它本身就是一个谜,所以超出了它应有的范围),但如果[tikz]从中移除\documentclass[tikz]{standalone},结果就会像它应该的那样令人困惑。

这引出了以下提议

\documentclass{standalone}
\usepackage{logicpuzzle}
\begin{document}
\begin{tabular}{cc}
\begin{sunandmoon}
\framepuzzle
\setrow{5}{{},{},{},{},\Moon}
\setrow{4}{{},{},\MoonTL}
\setrow{3}{\Moon}
\setrow{2}{{},\MoonR}
\setrow{1}{{},{},{},\MoonT}
\end{sunandmoon}
&  
\begin{sunandmoon}
\framepuzzle
\setrow{5}{{},{},\Star,\Cloud,\Moon}
\setrow{4}{{},\Star,\MoonTL,{},\Cloud}
\setrow{3}{\Moon,\Cloud,{},{},\Star}
\setrow{2}{\Cloud,\MoonR,{},\Star}
\setrow{1}{\Star,{},\Cloud,\MoonT}
\end{sunandmoon}\\
\begin{sunandmoon}
\framepuzzle
\setrow{5}{{},{},{},{},\Moon}
\setrow{4}{{},{},\MoonTL}
\setrow{3}{\Moon}
\setrow{2}{{},\MoonR}
\setrow{1}{{},{},{},\MoonT}
\end{sunandmoon}
&  
\begin{sunandmoon}
\framepuzzle
\setrow{5}{{},{},\Star,\Cloud,\Moon}
\setrow{4}{{},\Star,\MoonTL,{},\Cloud}
\setrow{3}{\Moon,\Cloud,{},{},\Star}
\setrow{2}{\Cloud,\MoonR,{},\Star}
\setrow{1}{\Star,{},\Cloud,\MoonT}
\end{sunandmoon}
\end{tabular}
\end{document}

enter image description here

相关内容