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

MathML: cannot produce multi-letter math identifier #86

Closed
fatanassow opened this issue Feb 9, 2016 · 7 comments
Closed

MathML: cannot produce multi-letter math identifier #86

fatanassow opened this issue Feb 9, 2016 · 7 comments

Comments

@fatanassow
Copy link

This is not exactly a bug, but I suspect there may be no workaround, and is related to #83 and #85.

I'm using the MathML writer, and I have need for mathematical constants such as id. I need this to render as a constant, not an operator, since it can serve as an argument. If I simply write $id$, then the result is <mi>i</mi><mi>d</mi>, which is as it should be. What I need is something that translates to <mi>id</mi>.

I have been using \DeclareMathOperator or \operatorname for this, since it does indeed (wrongly) produce <mi>id</mi>, but I think because of other bugs I've reported this will be changed to produce <mo>id</mo> in the future...? Which leaves me with the problem of how to produce <mi>id</mi>.

In LaTeX I get this effect by doing something like

\newcommand{\id}{\mbox{id}}

but this produces

<mstyle mathvariant="normal">
    <mi>i</mi>
    <mi>d</mi>
</mstyle>

in Pandoc.

Is there a way to do this, or is it a genuine issue?

jgm added a commit that referenced this issue Feb 10, 2016
@jgm
Copy link
Owner

jgm commented Feb 10, 2016

I hadn't realized that mbox's argument was interpreted as text mode.
The fix in 6fcaaf6 should work for you, I think.
Let me know if it's still a problem. It doesn't produce quite what you wanted, <mi>id</mi>, but rather <mtext mathvariant="normal">id</mtext>.

@jgm
Copy link
Owner

jgm commented Feb 10, 2016

I could have mbox produce EIdentifier instead of EText.
Would that be better?

@jgm jgm closed this as completed Feb 10, 2016
@jgm jgm reopened this Feb 10, 2016
@jgm
Copy link
Owner

jgm commented Feb 10, 2016

As far a I can see from tex documentation and experimenting, treating this as text is correct.

@jgm jgm closed this as completed Feb 10, 2016
@fatanassow
Copy link
Author

You're right: it makes sense that \mbox produces mtext. I only mentioned \mbox to show how I might get the right rendering in TeX. But I still don't know the answer to my original question: how can I produce a multi-letter identifier like <mi>id</mi>?

@jgm
Copy link
Owner

jgm commented Feb 10, 2016

+++ Frank Atanassow [Feb 10 16 00:00 ]:

You're right: it makes sense that \mbox produces mtext. But how can I
produce something like id?

I don't think there's any way to do it.

@fatanassow
Copy link
Author

Since TeX doesn't really seem to distinguish semantics like the difference between an identifier and a box of text, maybe it is worth introducing a macro, say, \MathIdentifier, which translates to an EIdentifier?

@jgm
Copy link
Owner

jgm commented Feb 13, 2016

It's an artificial solution, but it makes sense to me.

+++ Frank Atanassow [Feb 10 16 10:39 ]:

Since TeX doesn't really seem to distinguish semantics like the
difference between an identifier and a box of text, maybe it is worth
introducing a macro, say \MathIdentifier, which translates to an
EIdentifier?


Reply to this email directly or [1]view it on GitHub.

References

  1. MathML: cannot produce multi-letter math identifier #86 (comment)

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

No branches or pull requests

2 participants