2013 0001 0029
For my comprehensive exam, I needed to quickly convert some NumPy
arrays into nice-looking LaTeX array
elements. The TeX Stack
Exchange site has a good answer for tabular
environments, but
wasn’t quite suited to the array
environment. The usual answer here
would be Pweave but, being short on time, I ended up rolling my
own function instead:
Here’s an incomplete snippet of it in action, where I convolve an
array t
with four different filters, producing a latex formula for
each result:
I’ll likely get around to expanding this into a full package sometime
in the future, since there’s a lot that is hard coded (the \[ \]
environment, stringification of the array, the fact that all columns
are centered, etc.). A gist of the function is available here.