-
Notifications
You must be signed in to change notification settings - Fork 0
/
unstaggered_div2.lua
32 lines (29 loc) · 931 Bytes
/
unstaggered_div2.lua
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
imax=2
jmax=2
tex.sprint('\\begin{center}')
tex.sprint('\\\scalebox{0.7}{')
tex.sprint('\\begin{tikzpicture}[x=2cm,y=2cm]')
for i=0,imax do
for j=0,jmax do
tex.sprint('\\draw ('..i..','..j..') rectangle ('..(i+1)..','..(j+1)..');')
end
end
for i=0,imax+1 do
for j=0,jmax+1 do
if i%2==0 and j%2==0 then
tex.sprint('\\node[] at ('..i..','..j..') {$(\\textcolor{red}{2},\\textcolor{blue}{3})$};')
end
if i%2==0 and j%2==1 then
tex.sprint('\\node[] at ('..i..','..j..') {$(\\textcolor{red}{2},\\textcolor{green}{5})$};')
end
if i%2==1 and j%2==0 then
tex.sprint('\\node[] at ('..i..','..j..') {$(\\textcolor{magenta}{7},\\textcolor{blue}{3})$};')
end
if i%2==1 and j%2==1 then
tex.sprint('\\node[] at ('..i..','..j..') {$(\\textcolor{magenta}{7},\\textcolor{green}{5})$};')
end
end
end
tex.sprint('\\end{tikzpicture}')
tex.sprint('}')
tex.sprint('\\end{center}')