mathjax / mathjax/MathJax

Enforce \sideset behavior compatible with LaTeX

Open
#1,202 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
JavaScript
Stars
10.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

From amsmath documentation

Note: this command is not designed to be applied to anything other than sum-class symbols.

So,

$ cat example.tex 
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \sideset{_*^*}{_*^*}\prod
\end{equation}
\end{document}
$ latexmk -pdf example.tex

works.

screen shot 2015-06-07 at 10 31 34

But

$ cat bug.tex 
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
  \sideset{_*^*}{_*^*}X
\end{equation}
\end{document}
$ latexmk -pdf bug.tex    
Latexmk: This is Latexmk, John Collins, 5 February 2015, version: 4.43a.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': Rules & subrules not known to be previously run:
   pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -recorder  "bug.tex"'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./bug.tex
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 21 languages loaded.
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2014/texmf-dist/tex/latex/amsmath/amsopn.sty)) (./bug.aux)
! Limit controls must follow a math operator.
<argument> X\nolimits 
                      _*^*
l.5   \sideset{_*^*}{_*^*}X

?

Unfortunately, MathJax isn't compatible with this behavior of LaTeX.

screen shot 2015-06-07 at 10 35 48

This creates problems when users have to create a PDF using LaTeX from a webpage that uses MathJax. Can MathJax be more compatible with LaTeX?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two \sideset examples from the issue in MathJax and compare their behavior with the shown LaTeX output. Trace the \sideset handling and determine how non-sum symbols are treated; done means the behavior matches LaTeX while preserving the working sum-symbol case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, latex
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.