# Concatenating MaTeX with a computable expression in PlotLabel

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.

## 1 Answer

Either construct an expression in HoldForm,

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


or construct the TeX code directly.

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