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

'mathml,mathjax' causing problems with ' as \prime #130

Closed
yalguzaq opened this issue Aug 12, 2023 · 2 comments
Closed

'mathml,mathjax' causing problems with ' as \prime #130

yalguzaq opened this issue Aug 12, 2023 · 2 comments

Comments

@yalguzaq
Copy link

yalguzaq commented Aug 12, 2023

Is there a way to address the issue that make4ht produces errors when faced with expressions of the type $f''$ instead of $f^{\prime\prime}$? I would have simply replaced all repeating occurrences of '...' with ^{\prime...\prime}, but there are text-mode primes that need to be taken into consideration.

make4ht

make4ht --config make4ht.cfg file.tex 'mathjax'
make4ht file.tex 'mathjax'

config.cfg

\Preamble{xhtml,mathml,mathjax}

\begin{document}

\EndPreamble

file.tex

\documentclass{article}
\usepackage{amsmath,amssymb,amsthm}
\begin{document}
$$f''$$
\end{document}

image

@michal-h21
Copy link
Owner

Thanks for the report. Try this configuration file, it seems to fix the issue:


\Preamble{xhtml,mathml,mathjax}

\catcode`\:=11
\Configure{'}
   {\let\:primes=\empty}
   {\relax \csname SUB:prime\endcsname\sp{%
      \global\let\SUB:prime=\:UnDef
      \def\:tempa{\prime\prime}\ifx \:tempa\:primes
              \mathop{\HCode{<\a:mathml mi>\string&\#x2033;</\a:mathml mi>}}\else
      \def\:tempa{\prime\prime\prime}\ifx \:tempa\:primes
              \mathop{\HCode{<\a:mathml mi>\string&\#x2034;</\a:mathml mi>}}\else
              \:primes \fi\fi}%
   }
   {\let\prime=\relax \xdef\:primes{\:primes\prime}}
\catcode`\:=12
\begin{document}
\EndPreamble

If it works, I will add it to TeX4ht sources.

@yalguzaq
Copy link
Author

Yes, this solved the problem. Thanks a lot.

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

No branches or pull requests

2 participants