math.css 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. /*
  2. * math2html: convert LaTeX equations to HTML output.
  3. *
  4. * Copyright (C) 2009,2010 Alex Fernández
  5. * 2021 Günter Milde
  6. *
  7. * Released under the terms of the `2-Clause BSD license'_, in short:
  8. * Copying and distribution of this file, with or without modification,
  9. * are permitted in any medium without royalty provided the copyright
  10. * notice and this notice are preserved.
  11. * This file is offered as-is, without any warranty.
  12. *
  13. * .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause
  14. *
  15. * Based on eLyXer: convert LyX source files to HTML output.
  16. * http://elyxer.nongnu.org/
  17. *
  18. *
  19. * CSS file for LaTeX formulas.
  20. *
  21. * References: http://www.zipcon.net/~swhite/docs/math/math.html
  22. * http://www.cs.tut.fi/~jkorpela/math/
  23. */
  24. /* Formulas */
  25. .formula {
  26. text-align: center;
  27. margin: 1.2em 0;
  28. line-height: 1.4;
  29. }
  30. span.formula {
  31. white-space: nowrap;
  32. }
  33. div.formula {
  34. padding: 0.5ex;
  35. margin-left: auto;
  36. margin-right: auto;
  37. }
  38. /* Basic features */
  39. a.eqnumber {
  40. display: inline-block;
  41. float: right;
  42. clear: right;
  43. font-weight: bold;
  44. }
  45. span.unknown {
  46. color: #800000;
  47. }
  48. span.ignored, span.arraydef {
  49. display: none;
  50. }
  51. .phantom {
  52. visibility: hidden;
  53. }
  54. .formula i {
  55. letter-spacing: 0.1ex;
  56. }
  57. /* Alignment */
  58. .align-left, .align-l {
  59. text-align: left;
  60. }
  61. .align-right, .align-r {
  62. text-align: right;
  63. }
  64. .align-center, .align-c {
  65. text-align: center;
  66. }
  67. /* Structures */
  68. span.hspace {
  69. display: inline-block;
  70. }
  71. span.overline, span.bar {
  72. text-decoration: overline;
  73. }
  74. .fraction, .fullfraction, .textfraction {
  75. display: inline-block;
  76. vertical-align: middle;
  77. text-align: center;
  78. }
  79. span.formula .fraction,
  80. .textfraction,
  81. span.smallmatrix {
  82. font-size: 80%;
  83. line-height: 1;
  84. }
  85. span.numerator {
  86. display: block;
  87. line-height: 1;
  88. }
  89. span.denominator {
  90. display: block;
  91. line-height: 1;
  92. padding: 0ex;
  93. border-top: thin solid;
  94. }
  95. .formula sub, .formula sup {
  96. font-size: 80%;
  97. }
  98. sup.numerator, sup.unit {
  99. vertical-align: 80%;
  100. }
  101. sub.denominator, sub.unit {
  102. vertical-align: -20%;
  103. }
  104. span.smallsymbol {
  105. font-size: 75%;
  106. line-height: 75%;
  107. }
  108. span.boldsymbol {
  109. font-weight: bold;
  110. }
  111. span.sqrt {
  112. display: inline-block;
  113. vertical-align: middle;
  114. padding: 0.1ex;
  115. }
  116. sup.root {
  117. position: relative;
  118. left: 1.4ex;
  119. }
  120. span.radical {
  121. display: inline-block;
  122. padding: 0ex;
  123. /* font-size: 160%; for DejaVu, not required with STIX */
  124. line-height: 100%;
  125. vertical-align: top;
  126. vertical-align: middle;
  127. }
  128. span.root {
  129. display: inline-block;
  130. border-top: thin solid;
  131. padding: 0ex;
  132. vertical-align: middle;
  133. }
  134. div.formula .bigoperator,
  135. .displaystyle .bigoperator,
  136. .displaystyle .bigoperator {
  137. line-height: 120%;
  138. font-size: 140%;
  139. padding-right: 0.2ex;
  140. }
  141. span.fraction .bigoperator,
  142. span.scriptstyle .bigoperator {
  143. line-height: inherit;
  144. font-size: inherit;
  145. padding-right: 0;
  146. }
  147. span.bigdelimiter {
  148. display: inline-block;
  149. }
  150. span.bigdelimiter.size1 {
  151. transform: scale(1, 1.2);
  152. line-height: 1.2;
  153. }
  154. span.bigdelimiter.size2 {
  155. transform: scale(1, 1.62);
  156. line-height: 1.62%;
  157. }
  158. span.bigdelimiter.size3 {
  159. transform: scale(1, 2.05);
  160. line-height: 2.05%;
  161. }
  162. span.bigdelimiter.size4 {
  163. transform: scale(1, 2.47);
  164. line-height: 2.47%;
  165. }
  166. /* vertically stacked sub and superscript */
  167. span.scripts {
  168. display: inline-table;
  169. vertical-align: middle;
  170. padding-right: 0.2ex;
  171. }
  172. .script {
  173. display: table-row;
  174. text-align: left;
  175. line-height: 150%;
  176. }
  177. span.limits {
  178. display: inline-table;
  179. vertical-align: middle;
  180. }
  181. .limit {
  182. display: table-row;
  183. line-height: 99%;
  184. }
  185. sup.limit, sub.limit {
  186. line-height: 100%;
  187. }
  188. span.embellished,
  189. span.embellished > .base {
  190. display: inline-block;
  191. }
  192. span.embellished > sup,
  193. span.embellished > sub {
  194. display: inline-block;
  195. font-size: 100%;
  196. position: relative;
  197. bottom: 0.3em;
  198. width: 0px;
  199. }
  200. span.embellished > sub {
  201. top: 0.4em;
  202. }
  203. /* Environments */
  204. span.array, span.bracketcases, span.binomial, span.environment {
  205. display: inline-table;
  206. text-align: center;
  207. vertical-align: middle;
  208. }
  209. span.arrayrow, span.binomrow {
  210. display: table-row;
  211. padding: 0;
  212. border: 0;
  213. }
  214. span.arraycell, span.bracket, span.case, span.binomcell, span.environmentcell {
  215. display: table-cell;
  216. padding: 0ex 0.2ex;
  217. line-height: 1; /* 99%; */
  218. border: 0ex;
  219. }
  220. .environment.align > .arrayrow > .arraycell.align-l {
  221. padding-right: 2em;
  222. }
  223. /* Inline binomials */
  224. span.binom {
  225. display: inline-block;
  226. vertical-align: middle;
  227. text-align: center;
  228. font-size: 80%;
  229. }
  230. span.binomstack {
  231. display: block;
  232. padding: 0em;
  233. }
  234. /* Over- and underbraces */
  235. span.overbrace {
  236. border-top: 2pt solid;
  237. }
  238. span.underbrace {
  239. border-bottom: 2pt solid;
  240. }
  241. /* Stackrel */
  242. span.stackrel {
  243. display: inline-block;
  244. text-align: center;
  245. }
  246. span.upstackrel {
  247. display: block;
  248. padding: 0em;
  249. font-size: 80%;
  250. line-height: 64%;
  251. position: relative;
  252. top: 0.15em;
  253. }
  254. span.downstackrel {
  255. display: block;
  256. vertical-align: bottom;
  257. padding: 0em;
  258. }
  259. /* Fonts */
  260. .formula {
  261. font-family: STIX, "DejaVu Serif", "DejaVu Math TeX Gyre", serif;
  262. }
  263. span.radical, /* ensure correct size of square-root sign */
  264. span.integral { /* upright integral signs for better alignment of indices */
  265. font-family: "STIXIntegralsUp", STIX;
  266. /* font-size: 115%; match apparent size with DejaVu */
  267. }
  268. span.bracket {
  269. /* some "STIX" and "DejaVu Math TeX Gyre" bracket pieces don't fit */
  270. font-family: "DejaVu Serif", serif;
  271. }
  272. span.mathsf, span.textsf {
  273. font-family: sans-serif;
  274. }
  275. span.mathrm, span.textrm {
  276. font-family: STIX, "DejaVu Serif", "DejaVu Math TeX Gyre", serif;
  277. }
  278. span.mathtt, span.texttt {
  279. font-family: monospace;
  280. }
  281. span.text, span.textnormal,
  282. span.mathsf, span.mathtt, span.mathrm {
  283. font-style: normal;
  284. }
  285. span.fraktur {
  286. font-family: "Lucida Blackletter", eufm10, blackletter;
  287. }
  288. span.blackboard {
  289. font-family: Blackboard, msbm10, serif;
  290. }
  291. span.scriptfont {
  292. font-family: "Monotype Corsiva", "Apple Chancery", "URW Chancery L", cursive;
  293. font-style: italic;
  294. }
  295. span.mathscr {
  296. font-family: MathJax_Script, rsfs10, cursive;
  297. font-style: italic;
  298. }
  299. span.textsc {
  300. font-variant: small-caps;
  301. }
  302. span.textsl {
  303. font-style: oblique;
  304. }
  305. /* Colors */
  306. span.colorbox {
  307. display: inline-block;
  308. padding: 5px;
  309. }
  310. span.fbox {
  311. display: inline-block;
  312. border: thin solid black;
  313. padding: 2px;
  314. }
  315. span.boxed, span.framebox {
  316. display: inline-block;
  317. border: thin solid black;
  318. padding: 5px;
  319. }