Using Special Formats and Symbols
For some plot features you can use these LaTeX formatting modes for adding mathematical expressions to texts:
To use LaTeX Display math mode, put \\[ \\] around the LaTeX mathematical expression. This mode uses more vertical space for the math expression. For example, to plot the expression
use the following LaTeX text: \\[u+\\frac{\\log x^2}{4 \\pi}\\]
To use LaTeX Inline math mode, put \\$ \\$ around the LaTeX mathematical expression. This mode is meant to be included in line in the text (in normal LaTeX) and has a more compact presentation. To plot the same mathematical expression as in the other mode, use the following LaTeX text: \\$u+\\frac{\\log x^2}{4 \\pi}\\$
Note the use of double backslashes, which is needed in code for use with Java. In code for use with MATLAB only one backslash is needed.
Support for the LaTeX formatting Modes
Use the LaTeX formatting modes with the following features:
model.result(<pgtag>).set("title",<value>);
model.result(<pgtag>).feature(<ftag>).set("title",<value>);
model.result(<pgtag>).set("paramindicator",<value>);
For x-axis and y-axis labels in 1D and 2D plot groups when xlabelactive and ylabelactive are set to on:
model.result(<pgtag>).set("xlabel",<value>);
model.result(<pgtag>).set("ylabel",<value>);
For secondary y-axis labels in 1D plot groups when twoyaxes and yseclabel are set to on:
model.result(<pgtag>).set("yseclabel",<value>);
For color legend titles in plots when showlegendstitle in the parent plot group is set to true:
model.result(<pgtag>).feature(<ftag>).set("legendtitle",<value>);
For legends in graph plots when legendmethod is set to manual:
model.result(<pgtag>).feature(<ftag>).set("legends",<value>);
model.result(<pgtag>).feature(<ftag>).set("legendprefix",<value>);
model.result(<pgtag>).feature(<ftag>).set("legendsuffix",<value>);
Symbols and Special Characters in Annotations
You can also include, for example, mathematical symbols and Greek letters in annotation texts in Annotation or AnnotationData features when the latexmarkup property is set to on. To include such symbols, surround the LaTeX syntax with $ to indicate that the text inside of the $ signs is LaTeX. For example, $\\alpha = \\beta/\\pi$ appears as α = β/π. Note the use of double backslashes, which is needed in code for use with Java. If the latexmarkup property is on, you can also add line breaks as \\\\. To add an annotation text string that can contain special characters and symbols to an annotation data plot or annotation feature named <ftag>, use:
model.result(<pgtag>).feature(<ftag>).set("text",<value>);
See Also
See Mathematical Symbols and Special Characters and Using Special Formats and Symbols in Texts in the COMSOL Multiphysics Reference Manual for information about available LaTeX characters and HTML tags.