A LaTeX style file for typesetting logic puzzles

User Tools

Site Tools


How to create a Sudoku magazine

Create Sudokus

Here we use HoDoKu or qqwing for creating the Sudokus and the solutions.



To create the sudokus (command line options), we run:

hodoku /s /sl 0

This will create an Easy.txt in your working directory with the sudokus in the 81 format. You will have to close the opened window to stop the indefinite creation of sudokus! :-D You might also want to add HoDoKu to the PATH.


Alternatively, we can also use qqwing for the production of Sudoku puzzles.

qqwing --generate 6 --one-line --difficulty easy >page1.81

This will create 6 easy puzzles in file page1.81. See: qqwing command line options



To create the solutions, we run:

hodoku /vs /bs Easy.txt

This will create an Easy.txt.out.txt in your working directory with the solutions of our sudokus.


For qqwing we use:

cat page1.81 | qqwing --solve --one-line >page1_sol.81

Create lpsudoku environments

We simply run

createlpsudoku -o sudoku.lps -i Easy.txt

and get the following lpsudoku environments:




To get the solution environments:

createlpsudoku -o sudoku_sol.lps -i Easy.txt.out.txt

Et voilà:




Create the magazine

We now have the sudokus and their solutions in lpsudoku environments. We just need to include them into a LaTeX document using the lpsudoku style file. We leave it to the user to add some 'design' as exercise! ;-)

You might get something like this: TeXdoku Issue 0

Half automatic production with the lpsmag bash script

First of all, we need a config file for lpsmag:

page p1 easy
page p2 easy
typesetpage p1
typesetpage p2
typesetsolpage p1 p2 last

Here, we first “create” the pages p1 and p2 - with 61) easy puzzles each. Then, we start with the puzzles and typeset the pages p1 and p2. Finally, we want to typeset the solutions. Note, that solution pages have 12 puzzles. So, we should add two pages. We need to indicate last to avoid an unwanted \clearpage on the last page!

After running this config file through lpsmag,

lpsmag simple.smc

we finally get: lpsmag.pdf

Whenever you run the lpsmag script, you get a new Sudoku 'magazine'

Monthly magazine

Have fun with our open source monthly Sudoku magazine TeXdoku

design default of the script
sudoku_magazine.txt · Last modified: 2015/09/06 09:52 (external edit)