Update
ConfigureMaTeX[
"pdfLaTeX" ->
"C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64",
"Ghostscript" -> "C:\\Program Files\\gs\\gs9.23\\bin"
]
CAN NOT work!!!! Help manual is misleading in this case. But I suppose the author only uses MAC OS and could not test it.
ConfigureMaTeX[
"pdfLaTeX" ->
"C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\pdflatex.exe",
"Ghostscript" -> "C:\\Program Files\\gs\\gs9.23\\bin\\gswin64c.exe"
]
Finally worked for MaTeX. But the main problem still remains.
I want to do something similar to here,
myplot[a_, b_] := Plot[a*Sin[b*x], {x, -Pi, Pi}, PlotLabel -> TeXForm["$a=" <> ToString[a] <> ", b=" <> ToString[b] <> "$"]];
myplot[5, 4]
Does not work.
Also tried something like this,
myplot2[a_, b_] := Plot[a*Sin[b*x], {x, -Pi, Pi}, PlotLabel -> ToExpression["k=" <> ToString[a] <> ", n=" <> ToString[a], TeXForm, HoldForm]];
myplot2[5, 4]
and lots of variations. None worked.
Or keep getting error messages,
ToExpression::esntx: Could not parse k=5, n=5 as input.
GhostScript (can't not configure properly)





MaTeX?TeXFormbyitself does nothing. It just gives the latex representation of a Mathematica expression. To render it, you need to compile the latex, which is whatMaTeXdoes. – Nasser Jul 17 '18 at 08:37MikTeXon system, which supportsGhostScript. butMaTeXstill couldn't use it. – Chen Stats Yu Jul 17 '18 at 08:42C:\Program Files\gs\gs9.23\binwhich containsgswin64c.exe. and it still says not properly configured ... very annoying. – Chen Stats Yu Jul 17 '18 at 08:50