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

Errors thrown by latexml when URLs defined in baseurl contain unescaped underscores #950

goska opened this issue Feb 9, 2018 · 4 comments


Copy link

goska commented Feb 9, 2018

LaTeXML 0.8.2
I am experiencing another problem with underscores in URLs when attempting to convert LaTeX document to XML, this time when they are used in baseurl definitions, e.g.
causes in error:
Error:unexpected:_ Script _ can only appear in math mode at /somelocation/mydoc.tex; line 404 col 79 In Core::Definition::Primitive[Subscript] from TeX.pool.ltxml line 3583 <= Core::Stomach[@0x29d60c8] <= Core::Gullet[@0x298b9a8] <= Core::Stomach[@0x29d60c8] <= ...

Copy link

dginev commented Feb 10, 2018

The definition may need to be switched to Semiverbatim, it's an easy one-line fix. You should be cautioned that latexml ignores hypersetup entirely, from what I see in the binding:

# \hypersetup{keyvals} configures various parameters,
# I think none matter much to latexml, but we do need to at least ignore it.
DefMacro('\hypersetup{}', '');

CC @brucemiller here

@dginev dginev added this to the LaTeXML-0.8.3 milestone Feb 10, 2018
Copy link

dginev commented Feb 10, 2018

That said, your use of the baseurl parameter may just be meaningful enough that we may want to support it in latexml? Then it goes from a one-line fix to a small enhancement project.

Copy link
Contributor Author

goska commented Feb 11, 2018

I use baseurl in the following scenario:
In text we have hyperlinks to large (very large) hi-resolution versions of some images, which need to work in the published version as well as in the private test version available at a different URL before publication. These images cannot be made publicly visible before the publication and, as there are a lot of them, we would like to use relative URLs in the links, so only baseurl needs changing when documents are published at a different destination URL.
We generate PDF and HTML versions from the same LaTeX source.
Do you know of a different, not involving baseurl, way of achieving our objective?

Copy link

Interestingly, most of the code for this was in place, just perhaps not in the right place. It should work now; Thanks for the report!

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

No branches or pull requests

3 participants