TraditionalForm seems not to be working properly on Mathematica 11.3 when used in Graph. The following MWE

edges = {1 \[UndirectedEdge] 2};
GraphicsRow[{Graph[edges, VertexLabels -> ρ,
   VertexLabelStyle -> Directive["StandardForm", 30]],
  Graph[edges, VertexLabels -> ρ, 
   VertexLabelStyle -> Directive["TraditionalForm", 30]], 
  Graph[edges, VertexLabels -> ρ, 
   VertexLabelStyle -> Directive["DisplayForm", 30]]}]

Produces the following output (I'm putting StandardForm for comparison)


However, when I do


The character output is that in the left image of the character description.

Then, I began to wonder, is it possible to use characters in TraditionalForm inside Graphs?

  • $\begingroup$ Should this work? "TraditionalForm" is not a graphics directive. $\endgroup$
    – Jason B.
    Jun 25, 2019 at 15:55
  • $\begingroup$ Thank you for the answer. I think it should, since for instance "StandardForm" does work. I have updated the question to show this. $\endgroup$
    – Alex
    Jun 25, 2019 at 16:06

2 Answers 2


When you put "StandardForm" or "TraditionalForm" inside the directive, it's using them as named styles, not as StandardForm or TraditionalForm.

The reason they look different, is because "StandardForm" (as a style) includes a specific font, while "TraditionalForm" doesn't:

In[122]:= Lookup[
 CurrentValue[{StyleDefinitions, "StandardForm"}], FontFamily]

Out[122]= "Source Code Pro"

In[121]:= Lookup[
 CurrentValue[{StyleDefinitions, "TraditionalForm"}], FontFamily]

Out[121]= Missing["KeyAbsent", FontFamily]

(Note that the font for "StandardForm" is actually a dynamic value; I hacked in what it looks like for me.)

This is why

Style[TraditionalForm[Sin[x]], FontFamily -> "Comic Sans MS"]

will show up in Comic Sans, while

Style[StandardForm[Sin[x]], FontFamily -> "Comic Sans MS"]


enter image description here

What "form" is used for the labels is determined by the FormatType option, using the default font for text in graphics:

Graph[{1 -> 2}, VertexLabels -> {1 -> x^2, 2 -> Sqrt[x]}, FormatType -> TraditionalForm]
Graph[{1 -> 2}, VertexLabels -> {1 -> x^2, 2 -> Sqrt[x]}, FormatType -> StandardForm]
Graph[{1 -> 2}, VertexLabels -> {1 -> x^2, 2 -> Sqrt[x]}, FormatType -> InputForm]

enter image description here


It seems that Graph doesn't propagate the FormatType to the InsetBox objects used to typeset the labels. You can workaround this by including the right FontFamily explicitly:

    {1 \[UndirectedEdge] 2},
    VertexLabels -> ρ, 
    VertexLabelStyle -> Directive[FontFamily->"Times", "TraditionalForm", 30]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.