Skip to content

Commit 30e6bf2

Browse files
skotnicznymarijnh
authored andcommitted
Prevent <sup> and <sub> from affecting line-height
1 parent 4f9acdd commit 30e6bf2

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

04_data.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,10 @@ If we call that table _n_, we can compute _ϕ_ using the following formula:
536536
{{if html
537537

538538
<div>
539-
<style scoped="scoped">sub { font-size: 60%; }</style>
540539
<table style="border-collapse: collapse; margin-left: 1em;"><tr>
541540
<td style="vertical-align: middle"><em>ϕ</em> =</td>
542541
<td style="padding-left: .5em">
543-
<div style="border-bottom: 1px solid black; padding: 0 7px;"><em>n</em><sub>11</sub><em>n</em><sub>00</sub> -
542+
<div style="border-bottom: 1px solid black; padding: 0 7px;"><em>n</em><sub>11</sub><em>n</em><sub>00</sub>
544543
<em>n</em><sub>10</sub><em>n</em><sub>01</sub></div>
545544
<div style="padding: 0 7px;">√<span style="border-top: 1px solid black; position: relative; top: 2px;">
546545
<span style="position: relative; top: -4px"><em>n</em><sub>1•</sub><em>n</em><sub>0•</sub><em>n</em><sub>•1</sub><em>n</em><sub>•0</sub></span>
@@ -576,7 +575,7 @@ measurements where the second variable is false.
576575
{{index correlation, "phi coefficient"}}
577576

578577
So for the pizza table, the part above the division line (the
579-
dividend) would be 1×76 - 4×9 = 40, and the part below it (the
578+
dividend) would be 1×764×9 = 40, and the part below it (the
580579
divisor) would be the square root of 5×85×10×80, or [√340000]{if
581580
html}[[$\sqrt{340000}$]{latex}]{if tex}. This comes out to _ϕ_
582581
0.069, which is tiny. Eating ((pizza)) does not appear to have

epub/style.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ table {
133133
margin-left: 15px;
134134
}
135135

136+
sub, sup {
137+
line-height: 1;
138+
}
139+
140+
sub {
141+
font-size: 60%;
142+
}
143+
sup {
144+
font-size: 70%;
145+
}
146+
136147
/* Syntax highlighting */
137148
.cm-keyword {color: #506;}
138149
.cm-atom {color: #106;}

html/css/ejs.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,3 +439,15 @@ td + td {
439439
table {
440440
margin-left: 15px;
441441
}
442+
443+
sub, sup {
444+
line-height: 1;
445+
}
446+
447+
sub {
448+
font-size: 60%;
449+
}
450+
451+
sup {
452+
font-size: 70%;
453+
}

0 commit comments

Comments
 (0)