Skip to content
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

Incorrect html5 figure breaks css #1005

teepeemm opened this issue Jun 7, 2018 · 1 comment


Copy link

@teepeemm teepeemm commented Jun 7, 2018

Continuing my adventures with the caption package, the following tex



\marginpar{\captionsetup{type=figure}\caption{good caption}}

\marginpar{\captionsetup{type=figure}\caption{bad caption}}


produces html I would expect, but that turns out to be incorrect. A simplified version of that html is the following:

<!doctype html>
<meta charset='utf-8'>
<style type="text/css">
span figure { border: 1px solid green; }
body > figure { border: 1px solid red; }
<span><figure>good content</figure></span>
<p><span><figure>bad content</figure></span></p>

The problem is that it seems figure tags aren't allowed in p tags (a severely out of date source). Therefore, Chrome and Firefox (at least) treat the second figure as if it were

<figure>bad content</figure>

This means that the default css for margin notes no longer applies. (The W3C validator also complains about the first span > figure, but Chrome and Firefox at least render it correctly.)

@dginev dginev added this to the LaTeXML-0.8.4 milestone Jun 7, 2018

This comment has been minimized.

Copy link

@brucemiller brucemiller commented Jun 16, 2018

yeah; another one of those situations where you have to fall-back to span-soup. Fixed in the xslt (but note that the figure will end up as a span with class=ltx_figure). Thanks for the report.

@dginev dginev modified the milestones: LaTeXML-0.8.4, LaTeXML-0.8.3 Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.