Closed TonalidadeHidrica closed 3 years ago
\lower
produces smaller text.
Did you try the following code?
+math(${
\sum_{i=1}^n i^2 = k^2 + \lower{\sum_{i=1}^n}{i\neq k} i^2
});
Or, if you don't like that i=1
and i\neq k
are written far apart, you can write like this:
% `List` module is required
@require: list
...
+math(
let-math \stack-lower m msublst =
msublst |> List.fold-left math-lower m
in
${
\sum_{i=1}^n i^2
= k^2 + \lower{\sum_{i=1}^n}{i\neq k} i^2
= k^2 + \stack-lower{\sum^n}{| i = 1 | i\neq k |} i^2
= j^2 + k^2 + \stack-lower{\sum^n}{| i = 1 | i\neq j | i\neq k |} i^2
});
Thank you. So, I had to apply lower
outside the sigma, instead of applying inside _{ }
. Now it works, thanks.
@require: stdjabook
@require: list
let-math \stack-lower m msublst =
msublst |> List.fold-left math-lower m
in
document (|
title = {\SATySFi; Playground};
author = {Your Name};
show-title = true;
show-toc = false;
|) '<
+p {
\align[
${| \sum_{i = 1}^n i^2 |};
${| \sum_{\lower{i=1}{i \neq j}}^n i^2 |};
${| \lower{\sum_{i=1}^n}{i \neq j} i^2 |};
${| \stack-lower{\sum^n}{| i = 1 | i\neq j |} i^2 |};
];
}
>
By the way, isn't it possible to expand the grammar in the future so that we can someday use something like \sum_{| i=1 | i\neq j |}^n
? It'd be more concise and useful.
It may be technically possible, but I doubt the formula a_{| b | c |}
is used often enough to be specified in the SATySFi's grammar.
(This is just one user's opinion, and the decision on how to extend SATySFi's grammar should be made by the lead maintainer, @gfngfn .)
Just my two cents, that could be a use case of ad hoc polymorphism when it is introduced to SATySFi.
Current SaTySFi system does not accept two different types as an argument right?
How can I stack multiple lines in math mode, as in the following image?