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

Missing autoref labels #822

Closed
teepeemm opened this Issue Dec 28, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@teepeemm
Contributor

teepeemm commented Dec 28, 2016

Hyperref has the convenient \autoref command, so that instead of Section \ref{mylabel}, I can type \autoref{mylabel}, and the entire text becomes a link, instead of the individual number. Using the attached tex file, it seems that:

  • LaTeXML autorefs correctly for chapters, figures, tables, and theorems
  • LaTeXML doesn't autoref for sections, subsections, equations, items, and footnotes
  • LaTeXML doesn't autoref for anything produced by \captionof (although the Info suggests that we shouldn't expect it to work)
  • LaTeXML and LaTeX don't autoref for subsubsections (we've passed secnumdepth?)
  • LaTeXML would autoref correctly for parts, but when I include parts, my xml has \xA0 characters sprinkled throughout the names, and latexmlpost refuses to run

For section and subsection (which I'm most interested in at the moment), having autoref work correctly appears to require an adjustment to \@startsection in LaTeX.pool.ltxml to include the correct frefnum (which would also make index entries display correctly). Failing that, a hack on the postprocessing end could be something like

  <xsl:template match="ltx:section[@refnum][not(@frefnum)]">
    <xsl:attribute name="frefnum">
      <xsl:text>Section </xsl:text>
      <xsl:value-of select="@refnum" />
    </xsl:attribute>
    <xsl:apply-templates/>
  </xsl:template>

but this crashes with the fatal error Cannot add attributes to an element if children have been already added to the element. (I also don't know xslt well enough to know if that's remotely correct.)

Would we be able to make autoref work for more of these options?
autoref.tex.zip

@dginev dginev added this to the LaTeXML-0.8.4 milestone Dec 28, 2016

@brucemiller

This comment has been minimized.

Owner

brucemiller commented Dec 30, 2016

'Twould be really helpful if you happened to have a small document that exercised the various ways that autoref should work; that would make it a lot easier to fix (I'm suspecting that if it partly works, it shouldn't be terribly hard to get the rest working?)

@teepeemm

This comment has been minimized.

Contributor

teepeemm commented Dec 30, 2016

Is there an aspect of autoref missing from the file I attached to the first comment here? That should have been showing what I was talking about (except for possibly \xA0 showing up).

@brucemiller

This comment has been minimized.

Owner

brucemiller commented Dec 30, 2016

Oh, that zip file? It was printed in invisible ink, before! That's my story and I'm sticking to it!!

@brucemiller

This comment has been minimized.

Owner

brucemiller commented Apr 7, 2018

Should work now; Thanks for the report!

@brucemiller brucemiller closed this Apr 7, 2018

@dginev dginev modified the milestones: LaTeXML-0.8.4, LaTeXML-0.8.3 Apr 16, 2018

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