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

adding \invisibletimes and potentially other uses of intent #1627

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

davidcarlisle
Copy link
Member

Internal housekeeping

Status of pull request

  • Feedback wanted

Checklist of required changes before merge will be approved

  • Test file(s) added
  • Version and date string updated in changed source files
  • Relevant \changes entries in source included
  • Relevant changes.txt updated
  • Rollback provided (if necessary)?
  • ltnewsX.tex (and/or latexchanges.tex) updated

This adds a new latex-lab file for handling intent, currently just used to define \invisibletimes and \functionapplication which, if luamml is loaded, inserts
<mo intent="times">U+2062</mo> into the generated MathML.

Copy link
Member

@FrankMittelbach FrankMittelbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel that confident to approve or disapprove here, but I wonder about the names.
Is it really useful to have basically random names, or would irt be better to consider providing some uniformity, like

\intent{times}
\intent{applied to}

or \mathintent.

@davidcarlisle
Copy link
Member Author

@FrankMittelbach my thought was that the current names are more adding operator names (which could be in amsmath or unicode-math) with the fact that they use intent more or less hidden in the tagging code. the names match the html/mathml names eg \invisibletimes corresponds to &InvisibleTimes;

Longer term I'd like something like \intent{...} or \sum[intent=formal power series] or some such syntax that annotates an existing math atom with an additional attribute, but here \invisibletimes isn't adding an attribute to something that was there: it's just inserting a new operator <mo intent="times"></mo> in the same way that \times inserts <mo>×</mo>

Comment on lines +78 to +85
\protected\def\invisibletimes{
\if_cs_exist:N\luamml_annotate:en
\luamml_annotate:en {
core = {[0] = 'mo', intent="times","^^^^2062"},
}{
\latelua{}
}
\fi:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't these be \cs_new_protected? Also, can't this be done late enough that they are expanded to a single definition rather than re-checking every time they are used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the end, probably yes (but in the end they wouldn't be in latex-lab either) the timing is a bit tricky as luamml is (normally) only implicitly loaded if suitable tagging options are set up and unicode-math has been loaded by begin document, so you'd have to delay the definition until then, which is possible of course, although the main concern here was finding something that works, ie passing luamml information without affecting the typeset result. I started with \protected\def as I was going to suggest it as an addition for amsmath so it was always available (as a no-op (but then I needeed to test for the l3 luamml any anyway so it's a bit hybrid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants