Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.


Can I use Latex to format labels?

+1 vote
in Help by (3.3k points)

1 Answer

+1 vote
Best answer

Unfortunately, there is no direct support for Latex in yEd. the indirect way to use such labels nonetheless is to first convert Latex to SVG using an external tool, and then to import the SVG and use it as a node or edge label.

A pretty convient way to generate SVG from Latex is to use the test page of the SVGLatex open source project. For example, if you want to generate an SVG representing the latex expression \int_{-N}^{N} e^x\, dx replace the expression x + 7 in the text field that is labeled 0:simple with that expression. Then press the Do It button. As a result you will see the rendered SVG of that expression to the right. To save that SVG first press the Update button, then press the svg button to display the SVG on a separate page in your browser. Now save this page to your local disk.

Once you have the SVG on disk, you can easily import it into yEd by following the instructions given in the answer to How can I use my own node symbols in yEd?. Finally, to convert the Latex-SVG node to a node or edge label place the symbol on top of a node or edge, then choose "Convert to Label" from the context menu of the node or edge.

Attached you will find the resulting GraphML file that includes a Latex label generated the way just described.



by [yWorks] (23.6k points)
edited by
There is a workaround. Try html unicode characters such as , for \mathcal{B}, use

"<html> <span style="font-size:100%">&#x0212C</span> </html>".

The only problem is, you have to find the corresponding unicode characters.
Legal Disclosure | Privacy Policy