Skip to content

Commit 13a1191

Browse files
committedJan 17, 2023
use STIX for caligraphic; tweaks for minipage tables; tweaks for MathML in Chrome; some markup guards;
1 parent 09aa3ef commit 13a1191

File tree

1 file changed

+68
-7
lines changed

1 file changed

+68
-7
lines changed
 

‎css/ar5iv.css

+68-7
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
/* fonts */
77
--headings-font-family: "Noto Sans", sans-serif;
88
--text-font-family: "Noto Serif", serif;
9-
--math-font-family: "STIX Two Math", "Cambria Math", "Noto Serif", serif;
10-
--math-caligraphic-font-family: "Lucida Calligraphy", "Zapf Chancery","URW Chancery L";
9+
--math-font-family: "STIX Two Math", "Cambria Math", math;
10+
/* Should we do anything special for caligraphic?
11+
e.g. "Lucida Calligraphy","Zapf Chancery","URW Chancery L", TeX Gyre Termes...*/
12+
--math-caligraphic-font-family: "STIX Two Math", "Cambria Math", math;
1113
--code-font-family: "Noto Sans Mono", monospace;
1214
/* default color theme is light */
1315
--background-color: white;
@@ -170,10 +172,6 @@ section.ltx_indent_first > .ltx_title+.ltx_para>.ltx_p { text-indent:2em!importa
170172
display:block;
171173
}
172174

173-
/* TODO: need to pick+deploy some math fonts... */
174-
/* math.ltx_Math, semantics, mrow, mpadded, mover, munder, mi, mn, mo, msup, msub, msqrt, munder, mtext, mfrac, mmultiscripts, msubsup {
175-
background-color: white;
176-
} */
177175
math,
178176
mjx-container {
179177
font-family: var(--math-font-family);
@@ -291,6 +289,13 @@ span.ltx_personname > br.ltx_break + span {
291289
span.ltx_personname > .ltx_break + .ltx_break {
292290
display: none;
293291
}
292+
/* The person name metadata is not the best place to do math-based scripted "dagger" marks.
293+
The precise sizing tricks for PDF don't really work well in HTML. Ignore them.
294+
see arXiv:2006.13760 */
295+
.ltx_personname math mtext[mathsize] {
296+
font-size: inherit !important;
297+
}
298+
294299
/* also avoid paragraphs that just contain a break, our CSS margins can be trusted. */
295300
.ltx_para > .ltx_break:first-child:last-child {
296301
display: none;
@@ -1457,6 +1462,18 @@ foreignObject .ltx_text {
14571462
.ltx_minipage > .ltx_graphics {
14581463
max-width:100%;
14591464
}
1465+
/* minipages need some dedicated work (ar5iv#83),
1466+
but for now we can accommodate with a bit of special-case padding; */
1467+
.ltx_flex_size_2 .ltx_tabular.ltx_minipage {
1468+
margin: 1rem;
1469+
}
1470+
.ltx_flex_size_3 .ltx_tabular.ltx_minipage {
1471+
margin: 0.66rem;
1472+
}
1473+
.ltx_flex_size_4 .ltx_tabular.ltx_minipage {
1474+
margin: 0.5rem;
1475+
}
1476+
14601477
.ltx_listing {
14611478
display: block;
14621479
max-width: var(--main-width);
@@ -1816,7 +1833,6 @@ dl.ltx_description dl.ltx_description dd {
18161833

18171834
/*======================================================================
18181835
Misc */
1819-
/* .ltx_verbatim*/
18201836
.ltx_verbatim {
18211837
text-align:left;
18221838
font-size: 90%;
@@ -1843,4 +1859,49 @@ merror.ltx_ERROR {
18431859
}
18441860
mjx-merror {
18451861
background-color: var(--background-color) !important;
1862+
}
1863+
1864+
/*======================================================================
1865+
Fine-tuning for the state of MathML in 2023
1866+
1867+
When a formula starts approaching half the line in horizontal width,
1868+
today's "text-align: justify" tends to fail pretty miserably
1869+
(adding large wells of whitespace),
1870+
as we have no way of reflowing/breaking the formula.
1871+
Meanwhile, "text-align: left" remains reliable in its simplicity.
1872+
1873+
We us a latexml-specific heuristic of "7 mrows" for formulas of this quality.
1874+
An example is item 2.9 in section 2.6 of arXiv:2105.10386 */
1875+
.ltx_item:has(> .ltx_para > .ltx_p > math mrow:nth-of-type(7)),
1876+
.ltx_p:has(> math mrow:nth-of-type(7)) {
1877+
text-align: left;
1878+
}
1879+
1880+
/* see discussion at github.com/w3c/mathml-core/issues/39 */
1881+
mfrac > * {
1882+
font-size: inherit;
1883+
padding: 0.1em;
1884+
}
1885+
1886+
/*======================================================================
1887+
Fixes for known markup Bugs
1888+
1889+
B1. We have certain semi-supported bindings where a bibliography will be detected, but a paper
1890+
will also mark it manually as e.g. \section{Bibliography}.
1891+
(see arXiv:astro-ph/0001001)
1892+
Detect: A section with only a title (no content) as a previous sibling to a bibliography
1893+
Resolution: hide the extra section element. */
1894+
.ltx_section:has(> .ltx_title_section:only-child):has(+ .ltx_bibliography) {
1895+
display: none;
1896+
}
1897+
1898+
/* B2. Bibitems whose bib blocks are entirely empty are better hidden (maybe?)
1899+
best avoided entirely in latexml
1900+
.ltx_bibitem:not(:has(> .ltx_bibblock > *)) {
1901+
display: none;
1902+
} */
1903+
1904+
/* B3. ltx_parbox having too narrow widths in tables (see ar5iv#191) */
1905+
.ltx_th .ltx_parbox, .ltx_tr .ltx_parbox {
1906+
width: initial !important;
18461907
}

0 commit comments

Comments
 (0)
Please sign in to comment.