I am trying to generate a notation system to handle a variety of things in chemistry-standard notation. One key aspect of this is to be able to define symbols that have multiple subscripts, parentheses, and superscripts. Something like C6H6O, or Mg(NO3)2, or SO42-. Mathematica naturally treats the first couple as multiplications, and chokes on the superscript in the third. I can enter this type of notation in a string, but what I would really like to do is to be able to enter them as symbols, probably using the Notation package. Is there a way to assign a keystroke to something like a TagBox (where the tag could be "chemical" or something), where the entry within the box would allow me to do subscripts, superscripts, parentheses, etc. without parsing, allowing the C6H6O, for example, to not have the multiplication spaces between C6 and H6 and O? Thanks!
Edited to clarify: Some aliases, such as those used by the Notation package, produce an altered-color box that is represented internally with some hidden tag information. I am looking for a way to do something similar, where I can use an alias, have an altered-color box indicating this is a chemical, enter something as if it were in a string (so that there is no parsing and I can get spacing right) but have it displayed without the quotation marks, and then use that in a Notation call so that I can assign an internal symbol to the string. Then I want to be able to use that altered-color, no-quotation mark string as something I enter to refer to the symbol.
Further edited to add context:
First, some setup.
That defines reaction arrow notation as well as some helper functions that extract information from a chemical reaction. Examples of usage will be shown below. Next...
That gives me a way to generate symbols for a couple of types of labels. I can do a chemical formula like C60, for example, as long as there is only one subscript and it comes at the end. There is a special case where I also put a superscripted asterisk. I also have a relatively flexible method (though not flexible enough) for using strings, which I will use for rate constants. Again, examples of usage will be shown below.
Now to set up the symbols I will be using.
At this point, I can now enter chemical reactions directly using this chemistry-standard notation. For example, here is a reaction mechanism:
Notice that I can enter the reactions in chemistry-standard notation, and that the displayed version is also in chemistry-standard notation, but that the internal representation is in simple symbols.
Next I identify my chemical species as chemicals; that adds two chemistry-standard notations. First, it adds [C60]t to be a time-dependent concentration of species C60, internally represented as C60[t]. Second, it adds the derivative notation for this same concentration, which you will see examples of in a moment.
Now the magic can start. Here is the automatic generation of the system of differential rate equations from this reaction mechanism, all in chemistry-standard notation.
I can then assign initial concentrations and values for the rate constants, and then do an NDSolve to give the concentrations of all of the species as a function of time.
The key is that this is part of course materials for classes I am teaching within a university Department of Chemistry. The more chemistry-standard notation I allow, the more easily I will be able to teach students to use Mathematica as a tool, and the easier I will be able to convince colleagues to use these tools I am developing.
Yet another edit:
Based on Somos's suggestion, I started playing with palettes. I thought that maybe something like this would work:
The distinction between the display form and the internal representation form looked good. (And I am not doing the palette bit yet, though that looks pretty straightforward.) But I missed that the pasted version would be going into an input cell, and so it ends up looking like:
Interpretation[Rasterize["C6H6O",C6H6O]
where the string has subscripted 6s? $\endgroup$