Reputation
7,546
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
22 50
Impact
~479k people reached

Aug
30
comment Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
With experimentation, I found some minor improvements: row-spacing should be set to {\mtxrowsep,between borders} in order for the spacing to be correct at different typeface sizes; and the value of \mtxrowsep should be changed to \arraystretch\baselineskip as the first step in the wrapper environments to get the correct row-spacing. I found that inner ysep=0.7ex and inner xsep=0 to be better than a symmetric inner sep. Finally, depending on the font size, yshift values ranging from 0 to 1ex may be needed. This gives essentially robust results for different matrix dimensions.
Aug
30
revised What GUI applications are there to assist in generating graphics for TeX?
revision to clarify question
Aug
30
suggested approved edit on What GUI applications are there to assist in generating graphics for TeX?
Aug
30
comment Anonymous Functions (Closures) in LaTeX
@rcollyer: the answer then is "no": they're visible to anyone intrepid enough to browse your source-code. But the definition you give a macro may be limited by scope (within an environment, between a \bgroup and an \egroup, etc.), or may not be persistent (the macros \@tempa and friends are routinely cobbered as work-space by other macros); and in other ways may not be things which are reliably accessible outside of the context you use them in. Does that make them "practically anonymous"? That depends on who you're shielding your macros from. Just worry about robustness on your end!
Aug
30
comment Anonymous Functions (Closures) in LaTeX
I am no profound expert in TeX. Having said this: if there is any means of defining properly anonymous (e.g. purely lambda-expression-type) functions in TeX or LaTeX, it is an extremely well-hidden feature. You can certainly define macros which are overloaded (such as \@tempa, \@tempb, etc.) to do things that you want ad-hoc; but there is no means to describe "the function which does bla" without giving it at least a temporary name.
Aug
30
comment Smaller frame with listings
Nice tidy approach!
Aug
29
comment Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
This is a very, very good effort! I notice only a slight difference in the row-spacing between the two TiKZ variants and the AMS original in each case; and no significant differences otherwise, for these 2x2 examples. (One would hope that a suitable study of amsmath.sty, latex.ltx, or even more primordial source files might yield the precise row-spacing in any case.) Interestingly, I also do not notice any significant difference in the examples given between the first two matrices of each type. I also appreciate the effort taken into crafting wrapper environments!
Aug
29
comment Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
Yes --- the TiKZ documentation emphasizes that every row must terminate in \\, which while unfortunate is something one can hope to take care of with a wrapper environment of some sort.
Aug
29
comment Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
I'm not sure entirely what's going on with these examples; but if I leave in the \fill (0,0) circle [radius=2pt]; commands, it doesn't finish compiling in any short time, and if I remove that command I get a squashed matrix either well above or well below the baseline (i.e. even more poorly aligned than previously). Is there something missing?
Aug
29
comment Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
By cargo-cult coding with experimentation, it would seem that the column separation should be \arraycolsep plus the width of a single space, and the row separation is \arraystretch times the combined height and depth of \strutbox, divided by 2. I'll have to find out if there's any serious basis for these measures. I'll check again tomorrow.
Aug
29
comment Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
Hum, you've edited your answer. If you change bmatrix to just matrix, you probably get an answer which is similar to the one you had before with array; and certainly the result is about the same. (I want to be able to simulate matrix without delimiters as well.)
Aug
29
revised Smaller frame with listings
minor elaboration
Aug
29
comment Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
While a slightly more complex solution, this seems to get the vertical spacing almost exactly the way that matrix does (improving slightly over the vertical positioning of egreg's answer relative to the arms of the square brackets). Do you have any insights as to how to get the row/column spacing exactly the same as in the array environment (which lengths to use)?
Aug
29
awarded  Critic
Aug
29
revised Smaller frame with listings
minor revision to the code
Aug
29
revised Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes
removed incidental questions
Aug
29
comment Smaller frame with listings
@user7137: see my revised answer above for something ugly, but which works automatically.
Aug
29
revised Smaller frame with listings
found an improved solution
Aug
29
comment Smaller frame with listings
@user7137: Indeed. I am interested myself in whether there is a way to do this. However, the lstlisting environment seems to want to occupy as much horizontal space as it thinks is allowed.
Aug
29
answered Smaller frame with listings