I use LaTeX for taking quick (physics) notes that involve tons of equations and I'd be interested in developing some LaTeX code to automatically beautify equations in order to increase readability. A lot of times in physics write up there show up equations of the following form.

i \hbar \partial_t \psi

That involve both constants (

`i`

, `\hbar`

), differential operators (`\partial_t`

) and physically meaningful quantities (`\psi`

). when you just string them together like in the example above, everything gets mashed up together.

i \hbar \partial_t \psi

Whereas ideally you'd like to adjust the spacing between the symbols to indicate their meaning and improve readability.

i \, \hbar \; \partial_t \psi

Inserting of

`\,`

, `\;`

and `\quad`

gets clumsy and annoying real quick when scribing live. At the same time, the rules for inserting the spacing are pretty algorithmic (at least within a given field).I'd like to develop a set of rules that'd adjust the spacing at typeset time, but I have never open Pandora's box that LaTeX is and have no clue where to start. I could probably put together a quick and dirty reg-ex pre-processing script to insert the spacing symbols, but that's, well, dirty. I'd appreciate any pointers, and I can probably take it from there.