Hi John, Can you clarify your work around here? I wasn't able to follow. I have a similar problem converting from LaTeX to HTML5 - \label and \ref for equations don't work. I'd be super grateful for any advice you could offer. Thanks! Leena On Tuesday, 29 June 2021 at 11:23:40 UTC-7 John MacFarlane wrote: > > This isn't yet supported, really. But you might be able to > work around it. > > Note: > > % pandoc -f latex -t native > \ref{foo} > ^D > [Para [Link ("",[],[("reference-type","ref"),("reference","foo")]) [Str > "[foo]"] ("#foo","")]] > > So when pandoc parses \ref{foo}, it doesn't just create a string > [foo]; it creates a link with attributes. You could use a lua > filter to turn this into something that mathjax can consume > (raw tex, I would imagine). > > Just let us know what you want to appear in the HTML, and we can > show you how to do it. > > Ian Price writes: > > > Hello, > > My university is looking into the options for converting various notes, > > exercises sheets, presentations, etc. from latex generated pdf into a > more > > accessible format. This basically means converting to html + mathjax > > because this tends to work better for screen readers. Converting beamer > > seems to be impossible, but for notes pandoc (and some others like > latexml) > > is generally giving good output, however the major issue is cross > > referencing between text and maths blocks. > > > > In short, mathjax can handle internal links from maths blocks to other > > maths blocks, and pandoc can handle links to other parts of pandoc > > documents, except when a document makes specific reference to an > equation. > > For example, suppose we have the following mwe.tex cut out from some > > electromagnetism notes > > --- > > \documentclass[12pt]{article} > > \begin{document} > > \begin{equation} > > J \equiv \frac{dI}{da_{\perp}} = \rho v. > > \label{volume-current-density} > > \end{equation} > > The total current crossing a surface $S$ can be calculated by > integrating > > Eq. (\ref{volume-current-density}): > > \end{document} > > --- > > When converted to markdown, we get the following > > --- > > $$J \equiv \frac{dI}{da_{\perp}} = \rho v. > > \label{volume-current-density}$$ > > > > The total current crossing a surface $S$ can be calculated by > > integrating Eq. > > > ([\[volume-current-density\]](#volume-current-density){reference-type="ref" > > reference="volume-current-density"}): > > --- > > The link to the label volume-current-density is clearly broken and when > I > > get my html file it does nothing in particular. > > > > One solution I've seen is to convert the label references to the syntax > > used by, e.g., pandoc-crossref, but this involves me editing the > markdown > > by hand. Is there an automatic way to convert these? > > > > -- > > You received this message because you are subscribed to the Google > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/733e0d35-b1c4-4380-bf9f-7d6523c55162n%40googlegroups.com > . > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d3a1fa02-147c-45c2-8ee1-462db48baa44n%40googlegroups.com.