LaTeX string rendered as math in a point label

I want to label a point in a graph component with a math-rendered LaTeX string from an expression input component. Suppose my expression input component is named “ExpInp.” Then the line

pointLabel(“A”): ExpInp.latex

written in the CL script of the graph component will give point A the label of the LaTeX string from ExpInp that is not rendered as math. The label will render as math if the input in the expression input component is wrapped in backticks, but I don’t want students to have to do that. I would think that something like

pointLabel(“A”): `ExpInp.latex`


pointLabel(“A”): `${ExpInp.latex}`

would render the LaTeX string as math in the label, but in both cases the backtick yields an unexpected token syntax error.

Any suggestions? Thanks!

1 Like

I answered my own question. The correct script is:

pointLabel(“A”): “`${ExpInp.latex}`”

1 Like