4

I tried the solutions given in How do I remove the little × that shows up in the frontend when typing? and Getting rid of the horrible Times x in Mathematica 12.3.

They work for standard expressions: no little x shows up any more. But for Inactivated expressions the little x still shows up. How to remove the little x in this case as well?

Sin[2*x]
Inactivate[Sin[2*x]]

example of inactivated code in which the little x for times still appears

it looks like Inactivate prevents formatting settings to be applied as well. So I need a way to override this.

Using V 13.0 on windows 10

MarcoB
  • 67,153
  • 18
  • 91
  • 189
Nasser
  • 143,286
  • 11
  • 154
  • 359
  • it's really annoying! Try Inactive[Sin][2 x] – rmw Dec 27 '21 at 13:55
  • Yes, it works now. But this will not work for large inactivate expression when I have many things inside it. I can't really change it this way. For example Inactivate[Integrate[Sin[2 x], x]] The Sin[2*x] was a simple example. – Nasser Dec 27 '21 at 14:02
  • @Nasser Would inactivating only certain heads be an acceptable workaround? Like Inactivate[Integrate[Sin[2 x], x], Integrate], which does not show the x – MarcoB Dec 27 '21 at 14:06
  • @MarcoB it should really work for any Valid Mathematica input, just like outside Inactivate. ie. the little x should not show up in both cases. Now it still shows up inside Activates making it hard to read. I do not know where the * will show in generate, it can be anywhere. – Nasser Dec 27 '21 at 14:09
  • and how about this? Inactivate[Sin[2 x], Sin] or Inactivate[Integrate[Sin[2 x], x], Sin | Integrate] or Inactivate[Integrate[Sin[2 x], x], Sin] Happy New Year! – rmw Dec 27 '21 at 14:10
  • 2
    Or perhaps activating only multiplication: Activate[Inactivate[Integrate[Sin[2 x], x]], Times]. – Domen Dec 27 '21 at 14:11
  • @Domen this looks like a good solution. – Nasser Dec 27 '21 at 14:13
  • 2
    Why not? Inactivate[Sin[2*x], Except[Times]]? – chuy Dec 27 '21 at 15:13
  • 3
    In Mathematica Preferences | Appearance | Formatting | Multiplication you can select the symbol used from {Space, Center Dot, *, x} – Bob Hanlon Dec 27 '21 at 15:45

1 Answers1

5

Method 1 – Activate Times

Activate[Inactivate[Integrate[Sin[2 x], x]], Times]

Method 2 – Change the behaviour of TagBox

I am not completely sure this is the right way to change the behaviour of boxes, but it does the job.

Unprotect[TagBox];
TagBox["\[Times]", "InactiveToken", __] = "";
Protect[TagBox];

Inactivate[Integrate[Sin[2 x], x]]

enter image description here

Domen
  • 23,608
  • 1
  • 27
  • 45