Hi Friedrich, and welcome to the forum!
The table function takes a variable amount of entries as its arguments, which are then laid out row by row. To pass the data as a list of tuples (like you currently do), you can use the flatten
method to convert that list to a one-dimensional array, where the tuple structure is removed.
Now, since the table function does not take an array as its argument, but a variable amount of values (as in #table(first, second, third, ...)
, you can use the spreading operator ..
, which spreads the contents of the array into the arguments of a function call.
The moves
argument of the mainline
function is of type arguments
, which can contain both named and positional arguments. As we only care about the positional ones, you can use the pos
function to get them as an array.
In total, you only need to add a very small piece to what you already have:
#let mainline(..moves) = align(center, table(
columns: (2.6cm, 2.6cm),
stroke: none,
align: (left, right),
..moves.pos().flatten()
))
I also removed a bit of nesting to avoid unnecessary swapping between content mode and code mode. This doesn’t mean that there was anything wrong with it, it’s mostly just personal preference.