Commit ca0cb1b

HPCesia <me@hpcesia.com>
2026-09-16 16:17:05
Fix math style
1 parent b1a835a
Changed files (1)
src
styles
article
src/styles/article/math.scss
@@ -6,5 +6,28 @@ article math {
     /* See https://bugzilla.mozilla.org/show_bug.cgi?id=1928784 */
     overflow-x: auto;
     overflow-y: hidden;
+
+    margin-block: 1em;
+  }
+
+  /* See https://typst.app/docs/reference/math/#alignment */
+  /* In Typst, each alignment point simply alternates between right-aligned/left-aligned. */
+  mtable.aligned,
+  mtable.cases {
+    & > mtr > mtd {
+      &:only-child {
+        text-align: left;
+      }
+      &:not(:only-child) {
+        &:nth-child(odd) {
+          text-align: right;
+          padding-right: 0;
+        }
+        &:nth-child(even) {
+          text-align: left;
+          padding-left: 0;
+        }
+      }
+    }
   }
 }