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

Cannot use non-html5 equations #809

Closed
ianhbell opened this issue Nov 2, 2016 · 6 comments

Comments

@ianhbell
Copy link
Contributor

@ianhbell ianhbell commented Nov 2, 2016

First off, excellent work with this package. I am able to convert a rather complex document to html5 with lots of equations and images. Ultimately my target is to get back to a Word document from a latex document. I think I am not far off.

That said, latexml always borks when I try to tell it to use svg or png equations (with --mathsvg or --mathimages respectively). The HTML5 equations will obviously be no good in Word.

I always get this error:

Fatal:perl:die Perl died
	Postprocessing LaTeXML::Post::MathML::Presentation Paper.html
	Wide character in subroutine entry at /usr/share/perl5/LaTeXML/Post.pm line 1188.

It would be nicer if the error would not kill LateXML, rather it would just skip that equation.

@dginev dginev added this to the LaTeXML-0.8.3 milestone Nov 2, 2016
@ianhbell

This comment has been minimized.

Copy link
Contributor Author

@ianhbell ianhbell commented Nov 2, 2016

It turns out the offending character was a en-dash from the cp1252 character set (as in not the ASCII dash). This bad guy: http://unicode-table.com/en/2013/

@dginev

This comment has been minimized.

Copy link
Collaborator

@dginev dginev commented Nov 3, 2016

Was that character in the original input document, or it was created internally during math parsing?

Very valid bug report here, will be fixed.

@ianhbell

This comment has been minimized.

Copy link
Contributor Author

@ianhbell ianhbell commented Nov 3, 2016

It was in the original LaTeX document. Actually, I had converted a Word document to LaTeX by copy-paste (not the most elegant solution, but the fine-tuning was simple enough). I think that's how the character ended up there. The en-dash are a real pain from the copy-paste standpoint.

@dginev

This comment has been minimized.

Copy link
Collaborator

@dginev dginev commented Nov 3, 2016

That said, it shouldn't really break latexml, which is unicode-aware. Could you share the formula that had the unicode dash with us? Maybe we can use it to reproduce and find an elegant fix.

@ianhbell

This comment has been minimized.

Copy link
Contributor Author

@ianhbell ianhbell commented Nov 3, 2016

Perhaps this would do it (it was actually an inline equation, but I think the problem is the same):

$s_{\rm res}(T,\rho) = s(T,\rho) – s^0(T,\rho)$

@brucemiller

This comment has been minimized.

Copy link
Owner

@brucemiller brucemiller commented Nov 27, 2016

hmm, it seems that tied hashes don't like to get utf passed to them? I've patched that up and it runs without error (or even warning). However, I wonder that it gives what you want: LaTeX (even outside of LaTeXML) essentially ignores the en-dash; perhaps it was intended to be a minus?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.