Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prescripts and postscripts #113

Open
runarberg opened this issue Dec 2, 2023 · 0 comments
Open

Prescripts and postscripts #113

runarberg opened this issue Dec 2, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@runarberg
Copy link
Owner

runarberg commented Dec 2, 2023

Currently it is possible to write prescripts and postscripts (e.g. tensors) using empty groups {::}_a{::}^b C {::}_d {::}^e. Not only is the syntax clunky, but the markup this generates is wrong which might have accessibility implication.

Proposal

A proposed tensor notation would fix that:

  • All groups that start with ^ or _ will be parsed as pre- or postscripts.
  • Any ^ within the group will start a new upper index and any _ will start a lower index.
  • , will skip to the next index position. That is without the comma, a lower and upper index are allowed in the same index position, with it you can move straight to the next position (see examples).
  • If preceded by a whitespace (or first in a group/sentence) the group will be prescripts, otherwise it will be postscripts.

Examples

(^a_b^c_d)E(^f_g^h_i)

(^a_b^c_d)E(^f_g^h_i)
<mmultiscripts>
  <mi>E</mi>

  <mi>g</mi>
  <mi>f</mi>

  <mi>i</mi>
  <mi>h</mi>

  <mprescripts />

  <mi>b</mi>
  <mi>a</mi>

  <mi>d</mi>
  <mi>c</mi>
</mmultiscripts>

Use , to skip to next index position (i.e. normal tensor indices).

(_a,^b,_c,^d)E(^f,_g,^h,_i)

(_a,^b,_c,^d)E(^f,_g,^h,_i)
<mmultiscripts>
  <mi>E</mi>

  <mrow></mrow>
  <mi>f</mi>

  <mi>g</mi>
  <mrow></mrow>

  <mrow></mrow>
  <mi>h</mi>

  <mi>i</mi>
  <mrow></mrow>

  <mprescripts />

  <mi>a</mi>
  <mrow></mrow>

  <mrow></mrow>
  <mi>b</mi>

  <mrow></mrow>
  <mrow></mrow>

  <mi>c</mi>
  <mrow></mrow>

  <mrow></mrow>
  <mi>d</mi>
</mmultiscripts>

Gamma(^mu, _nu, _rho)

Gamma(^mu, _nu, _rho)
<mmultiscripts>
  <mi mathvariant="normal">Γ</mi>

  <mrow></mrow>
  <mi>μ</mi>

  <mi>ν</mi>
  <mrow></mrow>

  <mi>ρ</mi>
  <mrow></mrow>
</mmultiscripts>

(^14_6)rm C

(^14_6)rm C
<mmultiscripts>
  <mi mathvariant="normal">C</mi>
  <mprescripts />
  <mi>6</mi>
  <mi>14</mi>
</mmultiscripts>
@runarberg runarberg added the enhancement New feature or request label Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant