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

code for scaling calls Reprocess() not Rerender() [was: Scale problem] #944

Closed
quazar18 opened this issue Oct 24, 2014 · 10 comments

Comments

Projects
None yet
3 participants
@quazar18
Copy link

commented Oct 24, 2014

Hi I have a problem: the function "Scale all math" works properly only for inline equations, when I use it in the other case it only show me the latex code.

Thank you for the support

@pkra

This comment has been minimized.

Copy link
Member

commented Oct 24, 2014

Hi. Can you provide more information? Check our guidelines at https://github.com/mathjax/MathJax/blob/master/CONTRIBUTING.md#bug-reports -- they include a template for bug reports and a list of the information we need to track down bugs. Thanks.

@quazar18

This comment has been minimized.

Copy link
Author

commented Oct 26, 2014

I'm sorry, i'm new.
I've downloaded the latest version less then a week ago.
This an example of the code that is not working:

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
        tex2jax: {
            inlineMath: [['$','$']],
            processEscapes: false,
        },
        TeX: { equationNumbers: { autoNumber: "AMS" } },
    });
  </script>
  <script type="text/javascript" src="/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</head>
<body>
    <p>
    \begin{equation}
    \label{eq:gs}
    g^{\mu\nu}=\begin{pmatrix}
    -1 & 0 & 0 & 0 \\
    0 & \frac{1}{a^{2}(t)} & 0 & 0 \\
    0 & 0 & \frac{1}{a^{2}(t)} & 0 \\
    0 & 0 & 0 & \frac{1}{a^{2}(t)}
    \end{pmatrix}
    \end{equation}
    </p>
</body>
</html>

When use scale all math it shows me only the latex:
image

Thank you for the help

@pkra

This comment has been minimized.

Copy link
Member

commented Oct 26, 2014

Whoa! I see it now -- weird! We'll look into it.

It seems to be a problem with \label. Does it render ok for you if you drop it?

The corresponding MathML does not pose any problems so this probably down to the internals of \label.

Thanks for reporting!

@pkra pkra added Accepted and removed Cannot Reproduce labels Oct 26, 2014

@pkra pkra added this to the MathJax 2.5 milestone Oct 26, 2014

@quazar18

This comment has been minimized.

Copy link
Author

commented Oct 26, 2014

Yes, after I dropped it out everything worked properly. But I noted also another thing: when I scale the math the equation number change.

Before scaling:
image
After scaling:
image

Is this ok?

@pkra

This comment has been minimized.

Copy link
Member

commented Oct 26, 2014

Ah, excellent. No that's absolutely not ok and confirms that the problem most probably lies with the code for \label -- it looks like it erroneously thinks the (1) labels is taken and thus takes (2) -- and this probably explains the error because with a fixed \label there might be a clash of id's.

Thanks for the additional information!

@dpvc

This comment has been minimized.

Copy link
Member

commented Oct 26, 2014

I suspect the code that handles the scaling calls MathJax.Hub.Reprocess(), but that it should probably call MathJax.Hub.Rerender() (which wasn't available when the menu code was originally written). That would avoid re-running the TeX processor, and that would prevent the id clash and renumbering problem.

@pkra

This comment has been minimized.

Copy link
Member

commented Oct 27, 2014

I suspect the code that handles the scaling calls MathJax.Hub.Reprocess(),

Ah, that's it https://github.com/mathjax/MathJax/blob/master/unpacked/extensions/MathMenu.js#L809

@pkra pkra changed the title Scale problem code for scaling calls Reprocess() not Rerender() [was: Scale problem] Nov 26, 2014

dpvc pushed a commit to dpvc/MathJax that referenced this issue Dec 4, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Dec 4, 2014

This is fixed in the issue944 branch of my fork of MathJax.

@dpvc

This comment has been minimized.

Copy link
Member

commented Dec 7, 2014

=> Merged.

@dpvc dpvc added Merged and removed Ready for Review labels Dec 7, 2014

@dpvc dpvc closed this Dec 7, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Jan 15, 2015

==> In Testsuite

UI/math-menu/issue944.html

@dpvc dpvc added Fixed v2.5 and removed Merged labels Jan 30, 2015

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