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

Got wrong space of LaTeX "\!=\!=\!="? #541

Closed
bzsy opened this issue Sep 29, 2016 · 4 comments
Closed

Got wrong space of LaTeX "\!=\!=\!="? #541

bzsy opened this issue Sep 29, 2016 · 4 comments
Labels

Comments

@bzsy
Copy link

bzsy commented Sep 29, 2016

hi all,

I have tried to render 2Na_2O_2+2H_2O\ \!=\!=\!=\ 4NaOH+O_2\uparrow by KaTeX and MathJax.
It looks like KaTeX ignored the\! before =.
Hope anyone can help, thanks a lot :)

KaTeX:
image

MathJax:
image

@sthoch
Copy link

sthoch commented Sep 29, 2016

Interesting: == results in less spacing between the equal signs than =\!= ...

As a workaround you can use {=}\!{=}\!{=}.

@gagern
Copy link
Collaborator

gagern commented Sep 29, 2016

I can think of two possible reasons.

  1. A binary operation which is not surrounded by stuff compatible with a binary operation gets demoted to an ordinary symbol. According to Convert Bin + Rel/Close/Punct to Ord + Rel/Close/Punct #4 we don't do that yet, although Fix #4 - Spacing interactions between atoms #492 contains a pull request for this which needs review.
  2. I'm not sure how spacing constructs factor into this Ord/Bin/… classification. It might well be that they are ignored for the sake of adjacency computation. (Someone should read this up in the TeX book but I don't have time just now.) If so, I guess our CSS doesn't reflect this fact.

@bzsy
Copy link
Author

bzsy commented Sep 30, 2016

Thank you guys. {=}\!{=}\!{=} works well.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants