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

Configuration file causes weird tilde $y$-characters #125

Closed
togrul-topal opened this issue Jul 11, 2023 · 1 comment
Closed

Configuration file causes weird tilde $y$-characters #125

togrul-topal opened this issue Jul 11, 2023 · 1 comment

Comments

@togrul-topal
Copy link

Weird \tilde{y} in the following LaTeX

\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{amsmath,amssymb}

\begin{document}
Numbers $(\tilde{x},\tilde{y})$ satisfy
$$\tilde{x}=x, \quad \tilde{y} = y + x^3.$$
\end{document}

image

when running together with make4ht.cfg

\Preamble{xhtml,mathml,mathjax}

% Table fix last row (in the meantime)
\Css{.hline + .vspace:last-child{display:none;}}
\Css{.hline:first-child, .array-hline:first-child{border-bottom:1px solid black;border-top:none;}}

% \includegraphics relative width (will be included as an option in compile command)
\makeatletter
\ExplSyntaxOn
\Configure{Gin-dim}{style="width:\fp_eval:n{round(\Gin@req@width/\textwidth*100,2)}\char_generate:nn { `\% } { 12 }"}
\ExplSyntaxOff
\makeatother


% \implies, \impliedby, \iff (in the meantime)
\MathSymbol\mathrel{Longleftarrow}
\Configure{Longrightarrow}        {\expandafter\csname x:unicode\endcsname{27F9}}
\Configure{Longleftarrow}         {\expandafter\csname x:unicode\endcsname{27F8}}

%% \boxed command (in the meantime)
\catcode`\:=11
\Configure{boxed}
   {\ifmathml \Tg<\a:mathml menclose \a:mathml notation="box">\Tg<\a:mathml mrow>%
    \else     \HCode{<span class="boxed">}\IgnorePar\fi}
   {\ifmathml \Tg</\a:mathml mrow>\Tg</\a:mathml menclose>%
    \else \HCode{</span>}\fi}
\catcode`\:=12

%% Font: \mathcal characters
\catcode`\:=11
\renewcommand\mathcal[1]{\bgroup\HCode{<\a:mathml mi\Hnewline  data-mjx-variant="-tex-calligraphic" mathvariant="script">}#1\HCode{</\a:mathml mi>}\egroup}
\catcode`\:=12

%% Font change: {\bf E} (in the meantime)
\catcode`\:=11
\makeatletter
\def\:closemi{\HCode{</\a:mathml mi>}\EndPauseMathClass}
\def\bf{\ifmmode\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{\PauseMathClass\HCode{<\a:mathml mi mathvariant="bold">}\aftergroup\:closemi}{\bfseries}}
\makeatother
\catcode`\:=12

%% Long division sign
\catcode`\:=11
\Configure{gather*}
   {\HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \mml:class="gather-star">}}
   {\HCode{</\a:mathml mtable>}}
   {\HCode{<\a:mathml mtr>}}    {\HCode{</\a:mathml mtr>}}
   {\HCode{\Hnewline<\a:mathml mtd>}}   {\HCode{</\a:mathml mtd>}}
\catcode`\:=12


\begin{document}

\EndPreamble
@michal-h21
Copy link
Owner

It seems that there a different configuration for \tilde{y} is picked from somewhere. This configuration should fix it:

\Preamble{xhtml,mathml,mathjax}

% Table fix last row (in the meantime)
\Css{.hline + .vspace:last-child{display:none;}}
\Css{.hline:first-child, .array-hline:first-child{border-bottom:1px solid black;border-top:none;}}

% \includegraphics relative width (will be included as an option in compile command)
\makeatletter
\ExplSyntaxOn
\Configure{Gin-dim}{style="width:\fp_eval:n{round(\Gin@req@width/\textwidth*100,2)}\char_generate:nn { `\% } { 12 }"}
\ExplSyntaxOff
\makeatother


% \implies, \impliedby, \iff (in the meantime)
\MathSymbol\mathrel{Longleftarrow}
\Configure{Longrightarrow}        {\expandafter\csname x:unicode\endcsname{27F9}}
\Configure{Longleftarrow}         {\expandafter\csname x:unicode\endcsname{27F8}}

%% \boxed command (in the meantime)
\catcode`\:=11
\Configure{boxed}
   {\ifmathml \Tg<\a:mathml menclose \a:mathml notation="box">\Tg<\a:mathml mrow>%
    \else     \HCode{<span class="boxed">}\IgnorePar\fi}
   {\ifmathml \Tg</\a:mathml mrow>\Tg</\a:mathml menclose>%
    \else \HCode{</span>}\fi}
\catcode`\:=12

%% Font: \mathcal characters
\catcode`\:=11
\renewcommand\mathcal[1]{\bgroup\HCode{<\a:mathml mi\Hnewline  data-mjx-variant="-tex-calligraphic" mathvariant="script">}#1\HCode{</\a:mathml mi>}\egroup}
\catcode`\:=12

%% Font change: {\bf E} (in the meantime)
\catcode`\:=11
\makeatletter
\def\:closemi{\HCode{</\a:mathml mi>}\EndPauseMathClass}
\def\bf{\ifmmode\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{\PauseMathClass\HCode{<\a:mathml mi mathvariant="bold">}\aftergroup\:closemi}{\bfseries}}
\makeatother
\catcode`\:=12

%% Long division sign
\catcode`\:=11
\Configure{gather*}
   {\HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \mml:class="gather-star">}}
   {\HCode{</\a:mathml mtable>}}
   {\HCode{<\a:mathml mtr>}}    {\HCode{</\a:mathml mtr>}}
   {\HCode{\Hnewline<\a:mathml mtd>}}   {\HCode{</\a:mathml mtd>}}

\Configure{accent}\tilde\tilde{{}{}}
  {}
  {\HCode{<\a:mathml mover\Hnewline accent="false"><\a:mathml mrow\Hnewline>}#2\HCode{</\a:mathml mrow>}%
    \:tilde:over  \HCode{</\a:mathml mover>}}
\catcode`\:=12


\begin{document}

\EndPreamble

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