-
Notifications
You must be signed in to change notification settings - Fork 0
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
xrightarrow not nice #8
Comments
huh, I didn't know that command before, but it seems like
|
I would recommend this option, as MathML3 spec §3.2.5.8 Stretching of operators, fences and accents specifies the attribute That said, the example mentioned in MathML spec (§3.2.5.8.3 Horizontal Stretching Rules) does not explicitly mention the |
yeah, munder seems to occasionally (but not always) stretch automatically - depending on the rendering engine and the precise unicode characters involved. I can't claim to fully understand all the details. Either way, we likely need special support for \xrightarrow, which is what I usually try to avoid in rustex -.- |
Ok; could you explain what is meant by needing special support? |
\xrightarrow is not a TeX primitive - it is a defined macro in some package somewhere. RusTeX attempts to operate entirely on TeX primitives, expanding defined macros as pdflatex would do. The "morally best" way to deal with this would be to fiddle with the spacing with the dashes, because I assume that the same problem will occur with other symbols as well - i.e. it would not just solve \xrightarrow, but a whole bunch of similar macros at once. The alternative is to implement a special treatment for \xrightarrow. That solve this particular problem, but ultimately just kicks the can down the road until the next macro that does something similar shows up ;) |
Understood. \ams@def\relbar{\mathrel{\mathpalette\mathsm@sh\std@minus}}
\ams@def\Relbar{\mathrel\std@equal}
\def\arrowfill@#1#2#3#4{%
$\m@th\thickmuskip0mu\medmuskip\thickmuskip\thinmuskip\thickmuskip
\relax#4#1\mkern-7mu%
\cleaders\hbox{$#4\mkern-2mu#2\mkern-2mu$}\hfill
\mkern-7mu#3$%
}
\def\rightarrowfill@{\arrowfill@\relbar\relbar\rightarrow}
\newcommand{\xrightarrow}[2][]{\ext@arrow 0359\rightarrowfill@{#1}{#2}} My (potentially incorrect/incomplete) reading is that as you mention the So this could very well be rendering engine issue; this is how Firefox 114 renders the page — notice there are no breaks in the long minus (so The generated MathML looks far too nested which may (or may not) cause the spacing between long minus and arrow... |
It's worse than that:
This is worse, because it means a) the result will be an ungodly nesting of |
...I have no idea though why thefirst part of the arrow is, like, significantly higher up than the remainder - Chrome doesn't do that. That seems like a problem with Firefox's MathML rendering engine |
Thanks for the insight. Taking a step back; one could perceive this as an implementation detail (that |
More generally: There is not a one-to-one correspondance between TeX primitives and HTML+MathML. That is not surprising, and I was aware of that, but I will still try to solve problems ideally in generality in terms of primitives, rather than having to solve lots of special cases for individual packages/macros ;) |
Ok; if you plan to implement a separate MathML translation in RusTeX; how would the approach be? Would you, when implemented, add the details in commit log so that it could act as an education point for someone who want to contribute enhancements? |
Oh, there already are a couple of those :) They are implemented here: https://github.com/slatex/RusTeX/blob/master/rustex/src/commands/latex_bindings.rs They idea is to provide a Keep in mind, that the CommandListener has to be "registered" with the state, e.g. by adding it to the all_listeners() method at the end of the file |
It should be noted that the whole API for adding macro implementations is not very programmer-friendly or nice - it's more like "what is the minimum I need to implement to get the functionality I need right now". If I had the time to do so, I should definitely overhaul that at some point, but... yeah. |
In
MiKoMH/AI/source/game-play/slides/game-formalization.en.tex
we seeIt comes from
\symdef{withaction}[args=3]{#2\xrightarrow{#1}#3}
The text was updated successfully, but these errors were encountered: