4

I have been looking at the logicpuzzle package with my MikTex installation.

I have tried to use some of the examples from the documentation

puzzle.tex

\documentclass[fontsize=12pt]{article}

\usepackage{logicpuzzle}

\begin{document}
    \begin{center}
        \begin{ddsudoku}
            \framepuzzle
            \filldiagonals[orange!50]
            \ddsudokucell{1}{5}{1}
            \ddsudokucell{1}{4}{3}
            \ddsudokucell{2}{3}{4}
            \ddsudokucell{4}{1}{3}
            \ddsudokucell{4}{3}{2}
            \ddsudokucell{5}{4}{4}
        \end{ddsudoku}
        \hspace{1.5cm}
        \begin{ddsudoku}
            \framepuzzle
            \filldiagonals[orange!50]
            \setrow{5}{1,3,4,5,2}
            \setrow{4}{3,2,5,1,4}
            \setrow{3}{5,4,3,2,1}
            \setrow{2}{2,5,1,4,3}
            \setrow{1}{4,1,2,3,5}
        \end{ddsudoku}
    \end{center}
\end{document}

However, when I try to build a PDF from this source, I get the following error:

puzzle.tex:7: LaTeX Error: Environment ddsudoku undefined.

When I compiled my source, I was asked to install the missing packages and confirmed those, so they should be available.

Am I missing anything else in my preamble that is required for this package to work? I have tried using other puzzle examples than ddsudoku but they cause the same error (undefined environment).

schtandard
  • 14,892
Urs Beeli
  • 143
  • Welcome to TeX-SE! I cannot reproduce this issue when compiling your code on my TeXLive2019 installation with pdflatex. –  Jun 04 '19 at 15:04
  • Do you get any errors in your log file? Maybe you are compiling with nonstopmode (which skips over errors)? – Marijn Jun 04 '19 at 15:08
  • @Marijn, looking at the log file, the first error that I find there is the one I quoted above: puzzle.tex:7: LaTeX Error: Environment ddsudoku undefined.

    After that, there are a number of Undefined control sequence entries, but I suspect these are a consequence of the commands inside the ddsudoku environment...

    – Urs Beeli Jun 04 '19 at 15:30

1 Answers1

5

Update: The bug has been fixed in not even 20 minutes! A MiKTeX update will resolve the issue.


[original answer]

This is due to a name clash in the MiKTeX texmf tree. There is another package battleship that contains a file logicpuzzle.sty which shadows the desired package file. It looks to me like this is an older version of today's logicpuzzle package (battleship contains verion 1.0 from 2013, the current version is 2.5).

I opened a bug report regarding this with the MiKTeX people.

Since MiKTeX will never look for logicpuzzle.sty beyond battleship, even when that package is not installed but logicpuzzle is, there is currently only one way around it: Create a coopy of logicpuzzle that is located before battleship on the search path. To do this, do the following (see this answer for details):

  1. Create a directory for your local texmf tree, for example C:\local_texfm\.
  2. In that directory, create the subdirectory tex\latex\logicpuzzle and copy the files from the corresponding folder in your MiKTeX installation directory there.
  3. Add the directory to your MiKTeX TEXMF root directories (go to Settings → Directories in the MiKTeX console).
  4. Refresh your file name database (in the Tasks menu of the MiKTeX console).

This should make it work.

Note that you will have to update this local version of the package yourself and remove it manually once the MiKTeX bug has been fixed.

schtandard
  • 14,892
  • thank you for figuring this out and for reporting the bug. I have manually uninstalled the battleship package, updated my MikTeX installation and now everything works as expected! – Urs Beeli Jun 05 '19 at 09:06