Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sum not vertically centered #10

Closed
larseggert opened this issue Feb 1, 2023 · 2 comments
Closed

Sum not vertically centered #10

larseggert opened this issue Feb 1, 2023 · 2 comments

Comments

@larseggert
Copy link

larseggert commented Feb 1, 2023

utftex '\\sum_{i=6}^{10}\\left[\\binom{A}{i} \\binom{L}{10-i}\\right]
produces

10
⎯⎯
╲  ⎡⎛A⎞ ⎛ L  ⎞⎤
╱  ⎢⎜ ⎟ ⎜    ⎟⎥
⎺⎺ ⎣⎝i⎠ ⎝10-i⎠⎦
i=6

Also, the bottom of the sum (⎺⎺) is using a different dash than the top (⎯⎯)?

@bartp5
Copy link
Owner

bartp5 commented Feb 1, 2023

That would be tweaking a bit. I use center aligning for the "drawn" symbols. The sum symbol here is 4 characters high, so it is aligned at the second character. As you noted correctly, I use different characters for the bottom and top line. This way the bottom line is a bit higher and the top line a bit lower, so these lines stay close to the rest of the symbol. However, as the bottom line is high, the alignment seems off.

The best way to fix that would be to draw the sum character differently. This is not so hard to do, I already have different "styles" for such drawn symbols. If you run ufftex with the -A option utftex will draw (often ugly) ASCII symbols. In the ASCII style you will see that at least the alignment is better:

utftex -A '\sum_{i=6}^{10}\binom{A}{i}'

10
__ /A\
\  | |
/_ \i/
i=6

vs

utftex '\sum_{i=6}^{10}\binom{A}{i}'

10
⎯⎯
╲  ⎛A⎞
╱  ⎜ ⎟
⎺⎺ ⎝i⎠

i=6

I could go for the ASCII version, or come up with some other way to draw a sum symbol. I once started with using the unicode Summation Top and Bottom symbols, which appear to be made for this. However, In many fonts these look awful, so it depends also on that.

utftex '⎲\\⎳'
⎲
⎳

@bartp5
Copy link
Owner

bartp5 commented Jun 3, 2023

I figured I cannot really take into account that there are fonts for which the unicode Summation Top and Bottom symbols look terrible. I added suggestions in the README for a good font to use. I close this issue.

@bartp5 bartp5 closed this as completed Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants