Basic Examples (2)
Use SymbolToSubscript with an unprotected symbol:
Use SymbolToSubscript with a list of unprotected symbols:
Scope (9)
Use SymbolToSubscript with a list of functions with protected heads:
Use SymbolToSubscript with the default form for the ith constant C[i]:
Use SymbolToSubscript with a symbolic matrix:
Use SymbolToSubscript with a tensor of rank 3:
Use SymbolToSubscript with a tensor of rank 4:
If the expression contains symbols with a capital C, the format for the other indexed symbols is the same as ith constant C[i]:
Use SymbolToSubscript with a nonlinear system of ordinary differential equations:
Use SymbolToSubscript with a system of partial differential equations:
Both the base and subscript in the output are symbols and inherit any existing definitions:
Applications (3)
Format a symbolic polynomial:
Format a symbolic matrix:
Use SymbolToSubscript and TeXForm:
Define a function for making a Vandermonde matrix:
Format a Vandermonde matrix:
The SymbolToSubscript command allows TeXForm to be used correctly when we have expressions with subscripts that are written as symbols:
Possible Issues (2)
Before getting the subscript format, SymbolToSubscript separates the expression x1y2 as {"x","1y2"}, and then passes each part to input form using ToExpression. Therefore, with the expression x1y2, we get x{XMLElement[span, {class -> stylebox}, {XMLElement[i, {class -> ti}, {y}], 2}]} instead of x1y2:
To handle the above problem, SymbolToSubscript has the "ToStringFormat" option: