This module provides two commands and two command handlers, as well as two Metafun macros:
\magicsquaretypesets a magic square.\latinsquaretypesets a (random) Latin square.\setuplatinsquare\setupmagicsquare
\latinsquare understands the following set of parameters.
\latinsquare
[ n=5,
size=2em,
alternative=none,
rulethickness=.5bp]lmt_latinsquare has a similar interface:
picture p;
p := image(
lmt_latinsquare [
n = 5,
size = 2EmWidth,
alternative = "none", % none, color
rulethickness = .5bp
];
);
\magicsquare understands the following set of parameters:
\magicsquare
[ n=5,
size=2em,
alternative=color, % none, color
rotation=0, % 90, 180, 270
reverse=vertical, % none, vertical, horizontal, both
rulethickness=.5bp]lmt_magicsquare has a similar interface:
picture p;
p := image(
lmt_magicsquare [
n = 5,
size = 2EmWidth,
alternative = "none", % "none", "color"
rotation = 0,
reverse = "none", % "none", "vertical", "horizontal", "both"
rulethickness = .5bp
];
);
Caveat emptor: this module is only for ConTeXt LMTX. I no longer use ConTeXt MKIV, so no support is provided, sorry. Moreover, I'm using cutting-edge features, such as new macro extensions. An updated distribution is recommended.