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
\underbrace and \overbrace should put their args into \displaystyle unconditionally #764
Comments
Don't think this is a correct analysis. The What really appears to be going on is that
pdftex output |
// Build the base group
const body = buildGroup(
group.value.base, options.havingStyle(style.cramp())); I'm not sure what cramped means, but I'm guessing we want to in addition / instead switch |
"Cramped" is a style modification in which exponents are not raised as high as they would be in in non-cramped style. "Cramped" is typically used in something like a fraction numerator or denominator, or in this case, a brace. I reckon that you are correct in saying that a style adjustment is needed here. If you would like to suggest something more detailed, that would be welcome. Otherwise I'll get some time for research in a few days. |
Definition of
|
I'm a little confused about cramped style. Does it correspond to something in LaTeX (perhaps defined in mathtools?) that you're reproducing? I looked at mathtools's definition of \def\overbrace#1{\mathop{\vbox{\m@th\ialign{##\crcr
\noalign{\kern.5\fontdimen5\textfont2}%
\downbracefill\crcr
\noalign{\kern.7\fontdimen5\textfont2\nointerlineskip}%
$\hfil\displaystyle{#1}\hfil$\crcr}}}\limits} Anyway, with the following change: diff --git a/src/buildHTML.js b/src/buildHTML.js
index 944fdc6..d9d8e9a 100644
--- a/src/buildHTML.js
+++ b/src/buildHTML.js
@@ -1516,7 +1516,7 @@ groupTypes.horizBrace = function(group, options) {
// Build the base group
const body = buildGroup(
- group.value.base, options.havingStyle(style.cramp()));
+ group.value.base, options.havingBaseStyle(Style.DISPLAY));
// Create the stretchy element
const braceBody = stretchy.svgSpan(group, options); I get the following |
Looks great! |
I do agree. |
FYI TeX commands such as |
Finally found "cramped" briefly mentioned on page 140 of the TeXbook.
Looks like #765, which uses |
Yep, that's "cramped". And KaTeX does use "cramped" to modify |
If there's a group that comes right after
\displaystyle
then we only apply its effects to that group instead of everything that follows\displaystyle
.LaTeX is in green, KaTeX is in red. Notice the size difference.
The text was updated successfully, but these errors were encountered: