# Support href inside math expressions #788

Closed
opened this Issue Jul 17, 2016 · 2 comments

Projects
None yet
3 participants
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.

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).
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!