# Notation package with Traditional Form

I symbolize subscripted variables with the form TraditionalForm, to enable easy use of TeXForm as suggested here:

 Needs["Notation"]
Symbolize[ParsedBoxWrapper[SubscriptBox["_", "_"]],


However: note the following example:

rule = f -> ftest;
Subscript[f, a] /. rule


The rule replaces the "f" in Subscript[f,a]. This is of course not wanted, as I want to treat f and Subscript[f,a] as different entities. If I do not use the WorkingForm on TraditionalForm, this works as expected, but now for some reason, it has this behaviour???

• What is ftest? – Kuba Feb 15 at 21:26
• @Kuba Oh, a pure function in my code, such as: Function[{x},func[x]], and similarly Subscript[f,a] is really Subscript[f,a][x], but the example given here works as is, treating the rule like a change of label. At least, I presume that the problem is the same regardless? – Patrick.B Feb 15 at 21:59
• With the notation package, your input form and output form should both be the same. Try Subscript[f, a] /. rule, then before executing, use ctrl-t to change your input line to traditional form and then execute. – Bill Watts Feb 15 at 22:04
• I tried: TraditionalForm[Subscript[f, a]] /. rule, however this did not solve it I am afraid – Patrick.B Feb 15 at 22:11
• That doesn't work for me either, but ctrl-shift-t does. – Bill Watts Feb 15 at 22:45

If you always need TraditionalForm of output,
2. If you're in or after v11.1, execute SystemOpen@"init.m" to open the init.m file and save $PrePrint = TraditionalForm; in it. (There's a design change in v11.1, for more information check this post. ) • By applying //FullForm , it seems that it then treats the "Ctrl+Shift+t" symbol a_1 very much differently. Usually, I would just get Subscript[a,1], while here, I now get: a[UnderBracket]Subscript[UnderBracket]1 instead?? Does this mean that it treats them as different variables? – Patrick.B Feb 20 at 14:29 • @Patrick.B There seems to be a design change in v11.1: mathematica.stackexchange.com/q/140309/1871 In principle a solution is Ctril+Shift+O, then Cell Options ► New Cell Defaults ► CommonDefaultFormatTypes, but this doesn't work in 11.2 on my PC. Anyway, $PrePrint = TraditionalForm; works, you may place it in SystemOpen@"init.m". – xzczd Feb 20 at 14:30
• @Patrick.B Yes, notation package doesn't make Mathematica treat Subscript[a,1] as a symbol, it just internally creates a symbol a\[UnderBracket]Subscript\[UnderBracket]1` and make it diplay as $a_1$ in the front end. – xzczd Feb 20 at 14:35