2

I want to use the puzzlelogic package in LaTeX but it has an error because I dont know how to define an environment. Can you help?

\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}
Epa
  • 3,449
  • Environment sunandmoon was undefined but I dont know how to define it. – Epa Nov 29 '18 at 02:49
  • 1
    Did you try with article? You shouldn't have center if using standalone. That said, it works fine for me. I just get a blank first page. Please give the exact error i.e. copy and page it. This will include a line number and a precise message. – cfr Nov 29 '18 at 03:02
  • Well, I guess that's why it's a puzzle. ;-) More seriously, if you remove \end{center} \begin{center}, as pointed out by @cfr, your code compiles. Whether or not the output makes sense is another question (at least I am a bit puzzled by the output ;-) –  Nov 29 '18 at 03:27

1 Answers1

5

I don't know if this helps and will, of course, be happy to remove this post if it doesn't.

  • As pointed out by @cfr, you need to get rid of the center statements to make the code compilable.
  • After that I was puzzled by the outcome (beyond the way it should be because it is a puzzle), but if one removes [tikz] from \documentclass[tikz]{standalone}, the outcome is just as puzzling as it is supposed to be.

This leads to the proposal

\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

  • I have copied the whole of your code but after compilation, the message is still that the sunandmoon environment is not defined. – Epa Nov 29 '18 at 16:10
  • @Thumbolt Well, one possible interpretation is that you do not have the standard logicpuzzle package installed. How did you install it? Is it part of your LaTeX installation? When was the last time you updated your LaTeX installation? –  Nov 29 '18 at 16:14
  • I just use it without any updates for two years. My friend gave me a (USB) portable version of Miktex for my windows. I even dont know how to get it updated. – Epa Nov 29 '18 at 16:21
  • @Thumbolt Do you have a LaTeX installation, e.g. MikTeX or TeXLive? These come with update managers. See e.g. here how to update MikTeX and here for a general overview. –  Nov 29 '18 at 16:25
  • I used Miktex with a very small version portable. It requires to pin on the desktop every six months. – Epa Nov 29 '18 at 16:32
  • @Thumbolt Sorry, what am I supposed to do with that information? –  Nov 29 '18 at 16:33
  • 1
    Incidentally, removing the tikz option is expected to help for the same reason switching to article will help. – cfr Nov 30 '18 at 01:53
  • 1
    @Thumbolt Do you have logicpuzzle.sty installed? Which version? – cfr Nov 30 '18 at 01:54
  • I am not sure. I have just download the zip file to my C disk on my laptop. There are just dtx file and pdf in this package, no sty file found. https://ctan.org/tex-archive/graphics/pgf/contrib/logicpuzzle?lang=en – Epa Nov 30 '18 at 02:58
  • I was able to use this package today after the new texlive was installed. Thank you. – Epa Dec 02 '18 at 02:01