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

using "tex-...-full.js" still needs extensions being loaded and added ... #2328

Closed
parhizkari opened this issue Feb 11, 2020 · 6 comments
Closed

Comments

@parhizkari
Copy link

The following minimal test code doesn't typeset the equations:

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width">
  <title>MathJax v3 with TeX input and SVG output</title>
  <script>
  MathJax = {
    tex: {
    	inlineMath: [['$', '$']],
		tagFormat: {
			number: function(n){
				return String(n).replace(/0/g,"00");
			}
		}
    },
    svg: {fontCache: 'global'}
  };
  </script>
  <script id="MathJax-script" async src="tex-svg-full.js"></script>
</head>
<body>
   When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are
    $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
</body>
</html>

The problem is resolved if one adds the extension, loads it inside the loader, and adds it as a package to the config setup of Mathjax; but isn't "...-full.js" package expected to be single-file solutions?

@dpvc
Copy link
Member

dpvc commented Feb 12, 2020

You are right, the tagFormat extension is not included in the -full versions. The idea was that they would include all the extensions that could be used with \require{}, and since tagFormat is only useful when there is additional configuration (the tagFormat block in the tex configuration), it doesn't make sense for use with \require{}. But I see your point. We should probably include it in the -full TeX components.

@parhizkari
Copy link
Author

Any chance your modified version of mhchem here can also be added to the main stream and the full version?

@dpvc
Copy link
Member

dpvc commented Mar 9, 2020

@parhizkari, no, that version will not become part of the MathJax distribution.

What I recommend is that you open an issue on the mhchem GitHub page requesting that the number patterns be made configurable, like the one for the TeX input jax. That way, you would be able to configure mhchem to meet your needs without having to have multiple copies of mhchem in the distribution.

@parhizkari
Copy link
Author

This issue again persists in version 3.1, is tagFormat intentionally missed from this version?

@dpvc
Copy link
Member

dpvc commented Sep 1, 2020

is tagFormat intentionally missed from this version?

No, tagformat is there, but version 3.1 normalized the package names to all lower case. We tried to make it as backward compatible as possible, but some places need to be made lower case. This apparently is one of them.

See the documentation for more details.

@dpvc
Copy link
Member

dpvc commented Sep 1, 2020

There is code to rename the configuration block for the extension (see mathjax/MathJax-src#485), but it turns out only to be applied when the package is loaded as an external component, not in the combined components, which is an oversight. I will make a new issue for that problem. For now, you will need to rename the configuration block by hand.

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

2 participants