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

href: LaTeXML failing on URLs containing underscores #831

Closed
goska opened this issue Mar 6, 2017 · 3 comments
Closed

href: LaTeXML failing on URLs containing underscores #831

goska opened this issue Mar 6, 2017 · 3 comments

Comments

@goska
Copy link
Contributor

goska commented Mar 6, 2017

I have a problem with conversion of documents using href with URLs containing underscores with LaTeXML 0.8.2. As my LaTeX document contains a large number of such URLs, this results in a failure to generate XML version of the document because of a fatal error due to the number of errors exceeding the set limit. The conversion works with unescaped underscores with 0.8.1, with 0.8.2 after escaping underscores in URLs, and also with unescaped underscores with 0.8.2 when hyperref.sty.ltxml from 0.8.1 in placed the directory where the conversion is being run.
It looks a though the problem is caused by the use of Verbatim on line 125 of hyperref.sty.ltxml in \href constructor:
DefConstructor('\href Verbatim {}',,
which replaced Semiverbatim in 0.8.1 version:
DefConstructor('\href Semiverbatim {}',
The error is:
Error:unexpected:_ Script _ can only appear in math mode at /Users/goska/CU9/GDR1-0-8-2/cu9/cu9gat.tex; line 169 col 174 In Core::Definition::Primitive[Subscript] from TeX.pool.ltxml line 3583 <= Core::Stomach[@0x7f8844ae7f20] <= Core::Gullet[@0x7f8845119b98] <= Core::Stomach[@0x7f8844ae7f20] <= ...
I am working on MacBook, on which I have two versions of LaTeXML installed. The 0.8.1 is the default; I export PATH to 0.8.2 installation when I need to work with 0.8.2 version.
I am sure my system is running LaTeXML 0.8.2:
Malgorzatas-MacBook-Pro:GDR1-0-8-2 goska$ latexml --dest=master-test-06-03-17.xml GDR1_master-06-03-17.tex latexml (LaTeXML version 0.8.2) processing started Mon Mar 6 11:00:21 2017

(Digesting TeX GDR1_master-06-03-17... (Loading /Users/goska/LaTeXML-0.8.2/blib/lib/LaTeXML/Package/TeX.pool.ltxml...

@dginev dginev added this to the LaTeXML-0.8.3 milestone Mar 6, 2017
@brucemiller
Copy link
Owner

Not sure what the problem could be: such a thing is so common that it should have worked in all versions; it certainly works in the development version. Perhaps you're getting a mismatched combination of some bindings loaded from one version and some from another?

@goska
Copy link
Contributor Author

goska commented May 10, 2017

Thanks. I would like to reopen this issue. I have done more testing and I am able to confirm that correct bindings were used. My latest test results indicate that there are no problems with conversion using LaTeXML 0.8.2 when \href{} with URLs containing underscores as arguments occur in normal text. However, when they occur in figure captions latexml raises errors.
For example,
Histogram of correlation between $\varpi$ and $\mu_\delta$ \href{http://gaia.esac.esa.int/documentation/GDR1/large/cu9/cu9gat_astroCorr_AstroCorrStats_HistoCorParallaxPmDec_HistoSAM_large.png}{(larger)}

is OK when used in a normal paragraph, but causes errors when used in a caption:

\begin{figure}[H] \begin{center} \includegraphics[width=0.24\textwidth]{cu9/Figures/gat/cu9gat_skydensity_healpix_stat_TotalSkyDensityCount-ECL_HealpixMapSAM.png} \caption[Healpix map of total density count]{ Healpix map of total density count in ecliptic coordinates \href{http://gaia.esac.esa.int/documentation/GDR1/large/cu9/cu9gat_skydensity_healpix_stat_TotalSkyDensityCount-ECL_HealpixMapSAM_large.png}{(larger)}.} \label{fig:cu9gat_skydensity_healpix_stat_TotalSkyDensityLogCount-GAL_HealpixMapSAM} \end{center} \end{figure}
The errors reported by LaTeXML were (the \href{} was at line 341):
Error:unexpected:_ Script _ can only appear in math mode
at test.tex; line 341 col 211
In Core::Definition::Primitive[Subscript] from TeX.pool.ltxml line 3583
<= Core::Stomach[@0x7fa6dbea4720] <= Core::Gullet[@0x7fa6db83c798] <= Core::Stomach[@0x7fa6dbea4720] <= ...

Error:unexpected:_ Script _ can only appear in math mode
at test.tex; line 341 col 211
In Core::Definition::Primitive[Subscript] from TeX.pool.ltxml line 3583
<= Core::Stomach[@0x7fa6dbea4720] <= Core::Gullet[@0x7fa6db83c798] <= Core::Stomach[@0x7fa6dbea4720] <= ...

Error:unexpected:_ Script _ can only appear in math mode
at test.tex; line 341 col 211
In Core::D

@dginev dginev reopened this May 10, 2017
@dginev
Copy link
Collaborator

dginev commented May 10, 2017

Oh, I just saw you made a new issue, I guess that one is better

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

No branches or pull requests

3 participants