-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.tex
More file actions
66 lines (59 loc) · 1.89 KB
/
Copy pathmain.tex
File metadata and controls
66 lines (59 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
% arara: pdflatex
\documentclass[border=1cm]{standalone}
\input{macros}
\begin{document}
\begin{tikzpicture}
%% matrix of letters
\pgfplotstabletypeset[
font=\sffamily,
assign column name/.style={%
/pgfplots/table/column name={\footnotesize\itshape\ttfamily\textcolor{gray}{#1}}
},
% header=true, % not work
% every head row/.style={output empty row}, % not work
string type,
skip coltypes=true,
typeset cell/.code={%
% this here is more-or-less the default implementation, but it
% substitutes '&' by '\pgfmatrixnextcell':
\ifnum\pgfplotstablecol=\pgfplotstablecols
\pgfkeyssetvalue{/pgfplots/table/@cell content}{#1\\}%
\else
\pgfkeyssetvalue{/pgfplots/table/@cell content}{#1\pgfmatrixnextcell}%
\fi
},
begin table={%
\matrix (board) [%
matrix of nodes,
store number of columns in=\lastcol,
store number of rows in=\lastrow,
column sep=2pt,
row sep=2pt,
cells={nodes={%
black!80,
text depth=0ex,
anchor=center,
minimum height=2em,
minimum width=2em,
align=center,
}}%
] \bgroup%
},
end table={\egroup;},
]{\mytable}
%% outer frame
\draw (board-1-1.south west) rectangle (board-\lastrow-\lastcol.south east);
%% frame numbers
\foreach [count=\i from 0] \y in {2,...,\lastrow}{%
\node[left row numbers] at ([xshift=-1em]board-\y-1.base){\i};
}
\foreach [count=\i from 0] \y in {\lastrow,...,2}{%
\node[right row numbers] at ([xshift=1em]board-\y-\lastcol.base){\i};
}
\foreach [count=\i from 0] \y in {\lastcol,...,1}{%
\node[bottom row numbers] at ([yshift=-.5em]board-\lastrow-\y.base){\i};
}
\input{./game_boards/current.info}
\input{./game_boards/current.solution} %% <- comment this to hide solutions
\end{tikzpicture}%
\end{document}