base.css 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. @import url("../fonts/cmu.css");
  2. /*******************/
  3. /* default lengths */
  4. /*******************/
  5. :root, :host {
  6. --size: 10pt;
  7. --line-height: 1.2;
  8. /* --linewidth makes no sense here; it is the width of the line in the current environment */
  9. --paperwidth: 100%; /* paper is the browser window */
  10. /* TeX's even/oddsidemargin are not available in CSS, the HtmlGenerator translates the relevant lengths
  11. * to marginleftwidth, marginrightwidth, and textwidth, as well as marginparwidth - all relative to the paper.
  12. * So if a fixed width page is desired, simply set --paperwidth to an absolute value.
  13. */
  14. --parindent: 1.5em;
  15. --parskip: 0px; /* needs to be a length, otherwise calc(2px + var(--parskip)) will return 0 */
  16. --smallskipamount: 0.3rem;
  17. --medskipamount: 0.6rem;
  18. --bigskipamount: 1.2rem;
  19. --listparindent: 0px;
  20. --itemindent: 0px;
  21. --leftmargini: 2.5em;
  22. --leftmarginii: 2.2em;
  23. --leftmarginiii: 1.87em;
  24. --leftmarginiv: 1.7em;
  25. --leftmarginv: 1em;
  26. --leftmarginvi: 1em;
  27. --leftmargin: var(--leftmargini);
  28. --labelsep: 0.5rem;
  29. --fboxrule: 0.4pt;
  30. --fboxsep: 3pt;
  31. /* multicols */
  32. --columnwidth: ;
  33. --columnsep: 35pt;
  34. --columnseprule: 0pt;
  35. --columnseprulecolor: black;
  36. --multicolsep: 12pt;
  37. }
  38. .twocolumn {
  39. --parindent: 1em;
  40. --marginparsep: 1rem;
  41. --leftmargini: 2em;
  42. --leftmarginv: 0.5em;
  43. --leftmarginvi: 0.5em;
  44. }
  45. .list {
  46. --topsep: 0.8rem;
  47. --parsep: 0.4rem;
  48. --itemsep: 0.4rem;
  49. --leftmargin: var(--leftmargini);
  50. }
  51. .list .list {
  52. --topsep: 0.4rem;
  53. --parsep: 0.2rem;
  54. --itemsep: var(--parsep);
  55. --leftmargin: var(--leftmarginii);
  56. }
  57. .list .list .list {
  58. --topsep: 0.2rem;
  59. --parsep: 0;
  60. --itemsep: var(--topsep);
  61. --leftmargin: var(--leftmarginiii);
  62. }
  63. .list .list .list .list {
  64. --topsep: 0;
  65. --leftmargin: var(--leftmarginiv);
  66. }
  67. .list .list .list .list .list {
  68. --leftmargin: var(--leftmarginv);
  69. }
  70. .list .list .list .list .list .list {
  71. --leftmargin: var(--leftmarginvi);
  72. }
  73. /***************/
  74. /* page layout */
  75. /***************/
  76. /* .page is the element when used as a web component */
  77. body, .page {
  78. display: grid;
  79. grid-template-columns: [margin-left] var(--marginleftwidth) [body] var(--textwidth) [margin-right] var(--marginrightwidth);
  80. grid-template-rows: auto;
  81. margin: 0;
  82. padding: 0;
  83. max-width: var(--paperwidth); /* elements wider than this overflow, but don't increase bodywidth */
  84. min-width: var(--paperwidth);
  85. }
  86. /* LaTeX page body */
  87. .body {
  88. grid-column: body;
  89. grid-row: 1;
  90. }
  91. /* LaTeX page margins */
  92. .margin-left {
  93. grid-column: margin-left;
  94. grid-row: 1;
  95. justify-self: end;
  96. display: flex;
  97. }
  98. .margin-right {
  99. grid-column: margin-right;
  100. grid-row: 1;
  101. justify-self: start;
  102. display: flex;
  103. }
  104. .marginpar {
  105. width: var(--marginparwidth); /* ideally in percent relative to margin */
  106. min-width: var(--marginparwidth); /* min-width if in grid/flex container, to force this width */
  107. margin-left: var(--marginparsep);
  108. margin-right: var(--marginparsep);
  109. }
  110. .marginpar > * {
  111. padding-bottom: var(--marginparpush); /* use padding, which is included in offsetHeight, margin is not */
  112. }
  113. /* columns */
  114. .onecolumn {
  115. column-count: 1;
  116. }
  117. .twocolumn {
  118. column-count: 2;
  119. }
  120. .multicols {
  121. margin-top: var(--multicolsep);
  122. margin-bottom: var(--multicolsep);
  123. column-gap: var(--columnsep);
  124. column-rule: var(--columnseprule) solid var(--columnseprulecolor);
  125. column-fill: balance;
  126. }
  127. .span-cols {
  128. column-span: all;
  129. }
  130. /*********/
  131. /* fonts */
  132. /*********/
  133. html, .page {
  134. font-family: "Computer Modern Serif", serif;
  135. font-size: var(--size);
  136. text-align: justify;
  137. line-height: var(--line-height);
  138. hyphens: manual;
  139. }
  140. .katex {
  141. font-size: 1em !important;
  142. }
  143. .katex,
  144. .katex .mainrm,
  145. .katex .mathit,
  146. .katex .mathbf {
  147. font-family: "Computer Modern Serif" !important; /* for KaTeX_Main */
  148. }
  149. .katex .mathdefault,
  150. .katex .boldsymbol {
  151. font-family: "Computer Modern Serif" !important; /* for KaTeX_Math */
  152. }
  153. .katex .mathsf,
  154. .katex .textsf,
  155. .katex .mathboldsf,
  156. .katex .textboldsf,
  157. .katex .mathitsf,
  158. .katex .textitsf {
  159. font-family: "Computer Modern Sans" !important; /* for KaTeX_SansSerif */
  160. }
  161. /* family */
  162. .rm {
  163. font-family: "Computer Modern Serif", serif;
  164. font-variant-ligatures: normal;
  165. }
  166. .sf {
  167. font-family: "Computer Modern Sans", sans-serif;
  168. font-variant-ligatures: normal;
  169. }
  170. .tt {
  171. font-family: "Computer Modern Typewriter", monospace;
  172. font-variant-ligatures: none;
  173. }
  174. /* weight */
  175. .md {
  176. font-weight: normal;
  177. }
  178. .bf {
  179. font-weight: bold;
  180. }
  181. /* shape - LaTeX doesn't support slanted small-caps by default */
  182. .up {
  183. font-family: "Computer Modern Serif", serif;
  184. font-style: normal;
  185. font-variant-caps: normal;
  186. }
  187. .it {
  188. font-style: italic;
  189. font-variant-caps: normal;
  190. }
  191. .sl {
  192. font-family: "Computer Modern Serif Slanted";
  193. font-style: oblique;
  194. font-variant-caps: normal;
  195. }
  196. .sf.sl {
  197. font-family: "Computer Modern Sans", sans-serif;
  198. font-style: oblique;
  199. font-variant-caps: normal;
  200. }
  201. .tt.sl {
  202. font-family: "Computer Modern Typewriter Slanted", monospace;
  203. font-style: oblique;
  204. font-variant-caps: normal;
  205. }
  206. .sc {
  207. font-family: "Computer Modern Serif", serif;
  208. font-style: normal;
  209. font-variant-caps: small-caps;
  210. }
  211. /* size */
  212. .tiny {
  213. font-size: .5rem;
  214. }
  215. .scriptsize {
  216. font-size: .7rem;
  217. }
  218. .footnotesize {
  219. font-size: .82rem;
  220. }
  221. .small {
  222. font-size: .91rem;
  223. }
  224. .normalsize {
  225. font-size: 1rem;
  226. }
  227. .large {
  228. font-size: 1.2rem;
  229. }
  230. .Large {
  231. font-size: 1.4rem;
  232. }
  233. .LARGE {
  234. font-size: 1.7rem;
  235. }
  236. .huge {
  237. font-size: 2rem;
  238. }
  239. .Huge {
  240. font-size: 2.5rem;
  241. }
  242. /**************/
  243. /* sectioning */
  244. /**************/
  245. h1, h2, h3, h4 {
  246. /* \normalfont */
  247. font-family: "Computer Modern Serif", serif;
  248. font-style: normal;
  249. font-variant-caps: normal;
  250. text-align: left;
  251. }
  252. .titlepage {
  253. height: 100vh;
  254. min-height: 20rem;
  255. }
  256. .title {
  257. font-size: 1.7rem; /* LARGE */
  258. }
  259. .author, .date {
  260. font-size: 1.2rem; /* large */
  261. }
  262. /*************/
  263. /* alignment */
  264. /*************/
  265. .centering, .list.center {
  266. text-indent: 0;
  267. text-align: center;
  268. }
  269. .raggedright, .list.flushleft {
  270. text-indent: 0;
  271. text-align: left;
  272. }
  273. .raggedleft, .list.flushright {
  274. text-indent: 0;
  275. text-align: right;
  276. }
  277. /* alignment environments are lists (trivlist), so margin has to be removed */
  278. .list.center, .list.flushleft, .list.flushright {
  279. margin-left: 0 !important;
  280. }
  281. /* a list on its own justifies */
  282. .list {
  283. text-align: justify;
  284. }
  285. /*********/
  286. /* boxes */
  287. /*********/
  288. .hbox {
  289. display: inline-block;
  290. white-space: nowrap;
  291. text-indent: 0;
  292. }
  293. .phantom {
  294. visibility: hidden;
  295. }
  296. .llap {
  297. display: inline-flex;
  298. flex-direction: column;
  299. width: 0;
  300. align-items: flex-end;
  301. }
  302. .clap {
  303. display: inline-flex;
  304. flex-direction: column;
  305. width: 0;
  306. align-items: center;
  307. }
  308. .rlap {
  309. display: inline-block;
  310. width: 0;
  311. }
  312. .stretch {
  313. display: inline-flex;
  314. flex-direction: row;
  315. justify-content: stretch;
  316. align-items: stretch;
  317. }
  318. .smash {
  319. display: inline-flex;
  320. flex-direction: row;
  321. height: 0px;
  322. align-items: flex-end;
  323. }
  324. /* a class to align text to the baseline, and a class to locate the baseline */
  325. .align-baseline {
  326. line-height: 0;
  327. }
  328. .align-baseline::after {
  329. content: '';
  330. display: inline-block;
  331. }
  332. .mpbaseline {
  333. line-height: 0;
  334. width: 0;
  335. height: 0;
  336. display: inline-block;
  337. }
  338. /* parbox/minipage */
  339. .parbox {
  340. display: inline-block;
  341. text-indent: 0;
  342. }
  343. /* pos: t (top) */
  344. .p-t {
  345. display: inline-flex;
  346. }
  347. /* pos: c (center) */
  348. .p-c {
  349. vertical-align: middle;
  350. }
  351. /* pos: b (bottom) */
  352. .p-b {
  353. /* default */
  354. vertical-align: baseline; /* TODO: what if llap inside?? */
  355. }
  356. /* if we want a fixed height *and* bottom alignment */
  357. .pbh.p-b {
  358. vertical-align: text-bottom;
  359. }
  360. /* the following are only possible if height was given, too */
  361. .p-t.p-ct {
  362. vertical-align: baseline;
  363. }
  364. .p-t.p-cc {
  365. vertical-align: text-top;
  366. align-items: center;
  367. }
  368. /* pos: top, inner-pos: bottom */
  369. .p-t.p-cb {
  370. vertical-align: text-top;
  371. display: inline-flex;
  372. align-items: flex-end;
  373. }
  374. /* pos and inner-pos: center */
  375. .p-c.p-cc {
  376. display: inline-flex;
  377. align-items: center;
  378. }
  379. .p-c.p-cb {
  380. display: inline-flex;
  381. align-items: flex-end;
  382. }
  383. .p-b.p-ct {
  384. display: inline-flex;
  385. align-items: flex-start;
  386. }
  387. .p-b.p-cc {
  388. display: inline-flex;
  389. align-items: center;
  390. }
  391. /* pos: bottom, inner-pos: bottom */
  392. .p-b.p-cb {
  393. vertical-align: baseline;
  394. display: inline-flex;
  395. align-items: flex-end;
  396. }
  397. .p-b.p-cb::before {
  398. /* move the baseline to the bottom of a flex item */
  399. content: "x";
  400. display: inline-block;
  401. width: 0;
  402. visibility: hidden;
  403. }
  404. .underline {
  405. border-bottom: 0.4pt solid;
  406. line-height: 1;
  407. }
  408. .frame {
  409. padding: var(--fboxsep);
  410. border: var(--fboxrule) solid;
  411. margin-top: 2px;
  412. margin-bottom: 2px;
  413. }
  414. /****************/
  415. /* environments */
  416. /****************/
  417. .pframe {
  418. border-style: solid;
  419. }
  420. .picture {
  421. display: inline-block; /* so that it can be given a fixed size */
  422. position: relative;
  423. vertical-align: bottom; /* needed for \put */
  424. text-indent: 0; /* pictures in a paragraph still should not have indentation */
  425. /* width: 0; */
  426. }
  427. /* the coordinate system of the picture */
  428. .picture-canvas {
  429. display: flex;
  430. align-items: flex-end;
  431. position: absolute;
  432. left: 0;
  433. bottom: 0;
  434. }
  435. /* cannot do this, it pushes the whole picture up by the depth of the font :(
  436. .picture-canvas > .hbox::after {
  437. content: "";
  438. display: inline;
  439. }
  440. */
  441. /* objects in a picture */
  442. .put-obj {
  443. display: block;
  444. position: relative;
  445. line-height: 0;
  446. /* width: 0; */ /* picture objects only have a height, but we cannot set the
  447. width to 0 directly because it breaks vertical baseline alignment of text */
  448. }
  449. /* make text align on the baseline in \put - needs line-height: 0 in .put-obj! */
  450. .put-obj:after {
  451. content: '';
  452. display: inline-block;
  453. }
  454. .strut {
  455. display: block;
  456. }
  457. .picture-object {
  458. position: absolute;
  459. display: flex; /* to align text and boxes at the bottom */
  460. /* line-height: 0px; works for boxes, but breaks text */
  461. }
  462. /**********/
  463. /* macros */
  464. /**********/
  465. code {
  466. white-space: pre;
  467. }
  468. /**********/
  469. /* spaces */
  470. /**********/
  471. /* reset */
  472. p, ul, ol, dl, div {
  473. margin: 0;
  474. padding: 0;
  475. }
  476. p {
  477. margin-top: var(--parskip);
  478. text-indent: var(--parindent);
  479. }
  480. h1 + p, h1 + * p:first-child,
  481. h2 + p, h2 + * p:first-child,
  482. h3 + p, h3 + * p:first-child,
  483. h4 + p, h4 + * p:first-child,
  484. .noindent,
  485. .continue {
  486. text-indent: 0;
  487. }
  488. /* predefined horizontal spaces */
  489. .negthinspace {
  490. margin-left: -0.16666667em;
  491. }
  492. /* vertical space - insert the actual space (negative or positive) with margin-bottom */
  493. .vspace {
  494. display: block;
  495. }
  496. /* vertical space that forces a linebreak */
  497. .breakspace {
  498. display: table;
  499. }
  500. /* inline vertical space - this cannot be negative */
  501. .vspace-inline {
  502. display: inline-block;
  503. height: calc(1em * var(--line-height)); /* full maximum height, including the leading: line-height * font-size */
  504. vertical-align: top; /* if bottom is used, space could be inserted above this line of text */
  505. }
  506. /* predefined vertical spaces */
  507. .smallskip {
  508. margin-bottom: var(--smallskipamount);
  509. }
  510. .medskip {
  511. margin-bottom: var(--medskipamount);
  512. }
  513. .bigskip {
  514. margin-bottom: var(--bigskipamount);
  515. }
  516. /****************/
  517. /* environments */
  518. /****************/
  519. /* lists */
  520. .list {
  521. margin: calc(var(--topsep) + var(--parskip)) 0;
  522. margin-left: var(--leftmargin);
  523. }
  524. .list p:first-of-type {
  525. text-indent: var(--itemindent);
  526. }
  527. .list p + p {
  528. margin-top: var(--parsep);
  529. text-indent: var(--listparindent);
  530. }
  531. .list li + li,
  532. .list dd + dt {
  533. margin-top: calc(var(--itemsep) + var(--parsep));
  534. }
  535. /* labels */
  536. li {
  537. list-style: none;
  538. }
  539. /* label should be next to the item, so the first element after the label needs to be inline */
  540. .itemlabel + * {
  541. display: inline;
  542. }
  543. .itemlabel > * {
  544. position: relative;
  545. right: var(--labelsep);
  546. }
  547. /* description */
  548. dd, dd > p:first-child {
  549. display: inline;
  550. }
  551. /* start a new line after dd and before dt */
  552. dd::after {
  553. content: "";
  554. display: block;
  555. }
  556. dt {
  557. display: inline-block;
  558. font-weight: bold;
  559. }
  560. .list dt {
  561. margin-left: calc(-1 * var(--leftmargin));
  562. }
  563. dd {
  564. margin-left: var(--labelsep);
  565. }
  566. /* quote, quotation, verse */
  567. .quote, .quotation, .verse {
  568. margin-left: var(--leftmargin);
  569. margin-right: var(--leftmargin);
  570. }
  571. .quotation {
  572. --parsep: 0px;
  573. --itemindent: 1.5em;
  574. --listparindent: var(--itemindent);
  575. }
  576. .verse {
  577. text-align: left;
  578. margin-left: calc(1.5em + var(--leftmargin));
  579. --itemindent: -1.5em;
  580. --listparindent: var(--itemindent);
  581. }
  582. /* the TeX and LaTeX logos */
  583. span.tex,
  584. span.latex {
  585. text-transform: uppercase;
  586. }
  587. span.latex > .a {
  588. font-size: 0.8em;
  589. vertical-align: 0.2em;
  590. margin-left: -0.45em;
  591. margin-right: -0.15em;
  592. }
  593. span.tex > .e,
  594. span.latex > .e {
  595. margin-left: -0.2em;
  596. margin-right: -0.2em;
  597. position: relative;
  598. top: 0.45ex;
  599. }