mirror of
https://github.com/typst/typst
synced 2025-05-20 20:15:29 +08:00
Always attach primes as scripts by default (#3437)
This commit is contained in:
parent
196c144d8f
commit
6402bdacc7
@ -55,7 +55,7 @@ impl Eval for ast::MathAttach<'_> {
|
|||||||
if let Some(expr) = self.top() {
|
if let Some(expr) = self.top() {
|
||||||
elem.push_t(Some(expr.eval_display(vm)?));
|
elem.push_t(Some(expr.eval_display(vm)?));
|
||||||
} else if let Some(primes) = self.primes() {
|
} else if let Some(primes) = self.primes() {
|
||||||
elem.push_t(Some(primes.eval(vm)?));
|
elem.push_tr(Some(primes.eval(vm)?));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(expr) = self.bottom() {
|
if let Some(expr) = self.bottom() {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
@ -37,7 +37,7 @@ $a'$, $a'''_b$, $'$, $'''''''$
|
|||||||
$a' ' '$, $' ' '$, $a' '/b$
|
$a' ' '$, $' ' '$, $a' '/b$
|
||||||
|
|
||||||
---
|
---
|
||||||
// Test complex prime combilnations
|
// Test complex prime combinations
|
||||||
$a'_b^c$, $a_b'^c$, $a_b^c'$, $a_b'^c'^d'$
|
$a'_b^c$, $a_b'^c$, $a_b^c'$, $a_b'^c'^d'$
|
||||||
|
|
||||||
$(a'_b')^(c'_d')$, $a'/b'$, $a_b'/c_d'$
|
$(a'_b')^(c'_d')$, $a'/b'$, $a_b'/c_d'$
|
||||||
@ -46,4 +46,24 @@ $∫'$, $∑'$, $ ∑'_S' $
|
|||||||
|
|
||||||
---
|
---
|
||||||
// Test attaching primes only
|
// Test attaching primes only
|
||||||
$a' = a^', a_', a_'''^''^'$
|
$a' = a^', a_', a_'''^''^'$
|
||||||
|
|
||||||
|
---
|
||||||
|
// Test primes always attaching as scripts
|
||||||
|
$ x' $
|
||||||
|
$ x^' $
|
||||||
|
$ attach(x, t: ') $
|
||||||
|
$ <' $
|
||||||
|
$ attach(<, br: ') $
|
||||||
|
$ op(<, limits: #true)' $
|
||||||
|
$ limits(<)' $
|
||||||
|
|
||||||
|
---
|
||||||
|
// Test forcefully attaching primes as limits
|
||||||
|
$ attach(<, t: ') $
|
||||||
|
$ <^' $
|
||||||
|
$ attach(<, b: ') $
|
||||||
|
$ <_' $
|
||||||
|
|
||||||
|
$ limits(x)^' $
|
||||||
|
$ attach(limits(x), t: ') $
|
||||||
|
Loading…
x
Reference in New Issue
Block a user