1

I want to install a new package in Mathematica. If I understand the userguide right, I also have to edit the UnicodeCharacters.tr-File by another *.tr-File for example containing

0x2219 [InnerProduct] ($ip$) Infix 460 None 5 5

(Output from FilePrint[]). How can I do this?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Joju127
  • 11
  • 1

1 Answers1

1

As an author of the package I would like to give some explanation (too long for a comment). First, I completely agree with the opinion that modification of system files is a very bad idea and should be avoided. Despite this, in this forum your can find a number of suggestions to modify KeyEvents (add/modify keyboard shortcuts), change initialization files, or even global system options.

I modified the UnicodeCharacters.tr because I was not smart enough to find another way to introduce "nice" notations for so called "geometric product", "outer (wedge) product" and "inner (scalar) product" and (most difficult) how to set correct precedences for these operations. In particular, among these I want the "inner product" to have the highest precedence, followed by "outer product" and "geometric product", respectively. If somebody could show how to avoid the modification of UnicodeCharacters.tr while keeping the same functionality I would be very interested to learn. The need to modify a system file in particular doesn't allow me to make a "paclet" version or any other auto install, which is a serious restriction.

Too carry out the modification, I recommend using the simplest text editor your have. Examples could be notepad, gvim, nedit, or any listed here and many others. Even MS Word or open office will be ok. Just open UnicodeCharacters.tr with any of these editors, append the mentioned lines to the end of the file (you can remove comments from that add.tr file if you want to avoid a warning, which shows only once, the first time you run Mathematica after the modification).

IMPORTANT: DO NOT EDIT UnicodeCharacters.tr with Mathematica itself! Mathematica will automatically modify the file's content and the file will be corrupted!

Regarding the safety of these modification, of course I cannot provide any warranty. In principle, the modifications may interfere with some computations. In my own experience using Mathematica with the modified UnicodeCharacters.tr a few hours a day every day starting from Mathematica 7, I haven't noticed any problem. Of course, I would not recommend to use the package for critical calculations. Indeed, this is not even a proper package, strictly speaking: it is just another Mathematica notebook containing some context modification commands. Even more: the package will never be finished, and is continuously modified (i.e. it will always remain "experimental"). Nevertheless, I found it quite useful for the geometric (Clifford) algebra community and I decided to share it at the user's own risk (all this is clearly stated in the installation instruction).

MarcoB
  • 67,153
  • 18
  • 91
  • 189
Acus
  • 3,669
  • 14
  • 21
  • Perhaps this answer will give you some ideas for avoiding modification of UnicodeCharacters.tr. – Carl Woll Jun 26 '22 at 05:26
  • @CarlWoll The main problem is how to set proper precedences between product operators. Not about how to input them. – Acus Jun 26 '22 at 15:34
  • 1
    Just add a SyntaxForm option for that – Carl Woll Jun 26 '22 at 15:35
  • @CarlWoll The idea is interesting. Still cannot fully realize how different operations can be set to different precedences when interpretation have to occur simultaneously for few products. Please take a look at my old question https://mathematica.stackexchange.com/questions/89762/how-to-define-a-number-of-infix-operators-with-predefined-relative-precedences . The idea, though, is interesting and I will try to explore it. – Acus Jun 27 '22 at 09:35