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

Support href inside math expressions #788

Closed
fred-wang opened this Issue Jul 17, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@fred-wang
Contributor

fred-wang commented Jul 17, 2016

Minimal testcase:

\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\begin{document}
  $$\binom{k}{n} = \frac{\href{https://en.wikipedia.org/wiki/Factorial}{n!}}{k!{(n-k)!}}$$
\end{document}

This works with pdflatex / xelatex. LaTeXML returns error regarding malformed XML output and the final MathML uses HTML hyperlink instead of the href attribute.

@dginev dginev added this to the LaTeXML-0.8.3 milestone Jul 17, 2016

@brucemiller

This comment has been minimized.

Owner

brucemiller commented Dec 5, 2016

Surprisingly less straightforward than you'd think. Not clear how to adjust LaTeXML's schema to record the url (on what?). And your example highlights that the url applies to the whole subtree of n!; presumably the href should be on the m:mrow (which isn't guaranteed to exist in general).

@brucemiller

This comment has been minimized.

Owner

brucemiller commented May 6, 2018

Well, the solution was relatively easy, even though it makes me slightly uncomfortable; just allow href attribute on XMath elements. I'd have generalized further to allow idref and labelref, but am concerned about the clash with the different meaning of those on shared elements.

Hopefully better late than never; Thanks for the request!

@brucemiller brucemiller closed this May 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment