Improve rule coding, including for \sqrt. (#776)

* Improve rule coding.

* Rule widths (overline, underline, fraction, sqrt) actually scale
  with the current font size in AMS-TeX. Implement that. (Sqrt is
  a special case: the rule width depends on the font size *of the
  surd*.)
* Change the CSS coding for rules. The old, complex coding prevented
  variable-width lines and may have contributed to issues like #696.
  Its purpose, according to 0a3a2271f4,
  was IE8 support; but KaTeX no longer supports IE8.

* The 0.5px offset makes larger sizes better, smaller sizes worse.

Smaller sizes seem more important.

* Cleanup (intended to be squashed).
This commit is contained in:
Eddie Kohler
2017-08-06 15:11:23 -04:00
committed by Kevin Barabash
parent 766487bfe3
commit dcdca732a3
14 changed files with 49 additions and 72 deletions

View File

@@ -289,22 +289,9 @@
}
.frac-line {
display: inline-block;
width: 100%;
&:before {
border-bottom-style: solid;
border-bottom-width: 1px;
content: "";
display: block;
}
&:after {
border-bottom-style: solid;
border-bottom-width: 0.04em;
content: "";
display: block;
margin-top: -1px;
}
border-bottom-style: solid;
}
}
@@ -406,22 +393,9 @@
.overline .overline-line,
.underline .underline-line {
display: inline-block;
width: 100%;
&:before {
border-bottom-style: solid;
border-bottom-width: 1px;
content: "";
display: block;
}
&:after {
border-bottom-style: solid;
border-bottom-width: 0.04em;
content: "";
display: block;
margin-top: -1px;
}
border-bottom-style: solid;
}
.sqrt {
@@ -430,22 +404,10 @@
}
.sqrt-line {
display: inline-block;
position: relative;
width: 100%;
&:before {
border-bottom-style: solid;
border-bottom-width: 1px;
content: "";
display: block;
}
&:after {
border-bottom-style: solid;
border-bottom-width: 0.04em;
content: "";
display: block;
margin-top: -1px;
}
border-bottom-style: solid;
}
> .root {