3
0
Fork 0
mirror of https://github.com/fsr/nopanic synced 2024-11-15 17:03:13 +01:00
nopanic/raetsel/picross.tex

74 lines
1.2 KiB
TeX
Raw Normal View History

2023-09-20 13:45:54 +02:00
\documentclass[class=minimal,border=0pt]{standalone}
\usepackage{tikz}
\usepackage{fontspec}
\setmainfont[
Scale=0.90,
BoldFeatures={Scale=1.0}
]{Open Sans}
\def\cols{
{},
{},
{},
{2},
{5},
{1,2,1},
{2,1,2},
{16},
{2,1,2},
{1,3,1},
{5},
{3},
{},
{},
{},
{}
}
% (sublists have to be REVERSED so the for loop makes sense!!!)
\def\rows{
{1},
{3},
{5},
{1},
{3,1},
{3,1,1},
{3,1,3},
{1,1,3},
{1,1,1},
{1,1,1},
{2,1},
{2},
{1},
{3},
{3},
{1}
}
\begin{document}
\begin{tikzpicture}[
every node/.style={rectangle, draw=black, semithick, minimum size=5mm, node font=\bfseries},
num/.style={draw=none, minimum size=4mm}
]
\node
foreach \list [count=\x] in \cols
foreach \val [count=\y] in \list
[num] at (\x/2, 0.35*\y+0.15) {\val};
\node
foreach \list [count=\y] in \rows
foreach \val [count=\x] in \list
[num] at (-0.3*\x-0.2, 0.5-\y/2) {\val};
% grid
\node
foreach \a [count=\y] in \rows
foreach \b [count=\x] in \cols
at (\x/2-0.5, 0.5-\y/2) {};
\end{tikzpicture}
\end{document}