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

\mathbf with subscripts/superscripts causes incorrect spacing #534

Closed
jason-s opened this issue Sep 17, 2016 · 5 comments
Closed

\mathbf with subscripts/superscripts causes incorrect spacing #534

jason-s opened this issue Sep 17, 2016 · 5 comments

Comments

@jason-s
Copy link

jason-s commented Sep 17, 2016

\[ A*B+C-D = E \]
\[ A_1 * B^2 + C_3^4 + D^5_6 = E_0 \]
\[ \mathbf{A}*\mathbf{B}+\mathbf{C}-\mathbf{D} = \mathbf{E} \]
\[ \mathbf{A}_1 * \mathbf{B}^2 + \mathbf{C}_3^4 + \mathbf{D}^5_6 = \mathbf{E}_0 \]

KaTeX on Chrome 52.0.2743.116 m:

image

MathJax on Chrome 52.0.2743.116 m:

image

@kevinbarabash
Copy link
Member

@jason-s thanks for the bug report. I feel like this and #533 probably have the same root cause.

kohler added a commit to kohler/KaTeX that referenced this issue Nov 20, 2016
The type of a font group is the type of its body.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 21, 2016
kohler added a commit to kohler/KaTeX that referenced this issue Nov 21, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 21, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 21, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 21, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 22, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 22, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 23, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 26, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 26, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 27, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kohler added a commit to kohler/KaTeX that referenced this issue Nov 28, 2016
- KaTeX#534: Implement getTypeOfGroup for font groups.
- KaTeX#533, KaTeX#541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.
kevinbarabash pushed a commit that referenced this issue Nov 28, 2016
* Internal: Pass full `options` objects to makeSpan/makeSymbol.

Not just the current color. This will facilitate applying options
to built nodes in a standardized way, rather than changing all
callsites.

* Add style switching test: text and scriptstyle in the same group.

* Apply style-specific spacing using different CSS coding.

Specifically, infer style from a class on the *current* element,
rather than the parent element. Use "mtight" class to denote elements
with tight spacing (scriptstyle or scriptscriptstyle). Apply that
class automatically based on options.

* Fix #533, #534, #541.

- #534: Implement getTypeOfGroup for font groups.
- #533, #541: Improve the ways spaces are applied to lists. Since
  CSS adjacency implements mathematical spacing, it's incorrect to
  introduce "convenience spans" for spaces and display changes into
  the generated HTML -- those spans break adjacency. Apply display
  changes directly, and shift space spans into adjacent atoms.

Requires updates to two screenshotter tests, LimitControls and
SupSubLeftAlignReset. The new results for these tests are closer
to TeX output than the old results.

Also requires updates to Jasmine tests, since those assumed output
structures that have changed.

* Fix #136: Size commands generate fragments, not spans.

This is so the size commands don't hide the types of their enclosed
atoms. Addresses #136.

This slightly changes the vertical position of the Sizing test. Not
sure the vertical position matters, so change the test.
@kevinbarabash
Copy link
Member

Fixed on master.

@jason-s
Copy link
Author

jason-s commented Dec 8, 2016

excellent... is there a release plan or roadmap for upcoming releases of KaTeX? (just wondering when this propagates to the default version available on the webpage https://khan.github.io/KaTeX/ )

@jason-s
Copy link
Author

jason-s commented Dec 8, 2016

I rewrote test case for one equation (so it can be easily tested on the KaTeX page https://khan.github.io/KaTeX/)

\begin{aligned}
A*B+C-D = E \cr
A_1 * B^2 + C_3^4 + D^5_6 = E_0 \cr
\mathbf{A}*\mathbf{B}+\mathbf{C}-\mathbf{D} = \mathbf{E} \cr
\mathbf{A}_1 * \mathbf{B}^2 + \mathbf{C}_3^4 + \mathbf{D}^5_6 = \mathbf{E}_0
\end{aligned}

@kevinbarabash
Copy link
Member

@jason-s upcoming release either before end-of-year, or early in the new year. Updating the site is a separate step.

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