diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2023-04-25 05:24:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-25 11:24:07 +0200 |
| commit | 62361b4127c39fc1b165b81f24f52b14ddaa41db (patch) | |
| tree | 830f1ef69e77c9e9fbab2337f05136fa69ed0755 /library/src/lib.rs | |
| parent | fb99090208c9aface707f9d4526f411fcb67f705 (diff) | |
Support indices preceding the base symbol, revamping #699 (#825)
Breaking change: abbreviate attach() attachment params, top -> t, bottom -> b
Diffstat (limited to 'library/src/lib.rs')
| -rw-r--r-- | library/src/lib.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/library/src/lib.rs b/library/src/lib.rs index 98ec121a..e7a23cd7 100644 --- a/library/src/lib.rs +++ b/library/src/lib.rs @@ -227,13 +227,25 @@ fn items() -> LangItems { equation: |body, block| math::EquationElem::new(body).with_block(block).pack(), math_align_point: || math::AlignPointElem::new().pack(), math_delimited: |open, body, close| math::LrElem::new(open + body + close).pack(), - math_attach: |base, bottom, top| { + math_attach: |base, top, bottom, topleft, bottomleft, topright, bottomright| { let mut elem = math::AttachElem::new(base); + if let Some(top) = top { + elem.push_t(Some(top)); + } if let Some(bottom) = bottom { - elem.push_bottom(Some(bottom)); + elem.push_b(Some(bottom)); } - if let Some(top) = top { - elem.push_top(Some(top)); + if let Some(topleft) = topleft { + elem.push_tl(Some(topleft)); + } + if let Some(bottomleft) = bottomleft { + elem.push_bl(Some(bottomleft)); + } + if let Some(topright) = topright { + elem.push_tr(Some(topright)); + } + if let Some(bottomright) = bottomright { + elem.push_br(Some(bottomright)); } elem.pack() }, |
