0
$\begingroup$

To produce a graphics grid, I would like the PlotLabel to be a concatenation of graphics such as "y="//MaTeX and the value of an expression like f[i,j], the latter value depending on the values of the indices i,j indexing pictures in the graphics grid. So, if e.g. f[3,2]=0.7, then the desired label for the picture in row 3 and column 2 of the grid should be "y=0.7"//MaTeX.

Or, rather, I would like the PlotLabel to be two such concatenations put one above the other -- or maybe one to the right of the other, with the two concatenations separated by a comma.

Can this be done?


To clarify, the command MaTeX that is a part of the PlotLabel command occurs in a module, say

plot[i_,j_]:=Module[{...}, ..., MaTeX[...]; ...]

and the function f[i_,j_] is defined outside the module plot[i_,j_] or, anyway, outside the PlotLabel command. The command plot[i_,j_] is then used to produce a graphics grid, where the indices i,j index the pictures in the grid.

The value of f[i,j] must be computed inside the PlotLabel command, depending on the values of i,j that plot[i_,j_] receives. I have tried, naively, to write things like PlotLabel->"y=f[i,j]"//MaTeX, but nothing has worked.

$\endgroup$

1 Answer 1

1
$\begingroup$

Either construct an expression in HoldForm,

MaTeX@With[{rhs = 0.7}, HoldForm[y = rhs]]

MaTeX output

or construct the TeX code directly.

MaTeX@With[{rhs = 0.7}, "y=" <> ToString[rhs, TeXForm]]

MaTeX output

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.