|
5 | 5 | * commands for typesetting functions (\sin, \cos etc.), |
6 | 6 | * commands for changing the current font (\rm, \cal etc.), |
7 | 7 | * Space/kern commands "\ ", \thinspace |
| 8 | + * \frac |
8 | 9 |
|
9 | 10 | Small TO-DO's: |
10 | 11 | -------------- |
|
16 | 17 |
|
17 | 18 | TO-DO's: |
18 | 19 | -------- |
19 | | - * \frac, \over, \above, \choose etc. |
20 | | - * Implement classes for Line, Fraction etc |
21 | | - * Change env to be a new class, not a dict. |
| 20 | + * \over, \above, \choose etc. |
22 | 21 | * Add support for other backends |
23 | 22 |
|
24 | 23 | """ |
@@ -425,12 +424,19 @@ def __init__(self, env, nuc=None, type="ord", sub=None, |
425 | 424 | # below the origin of the nucleus (the descent of the letter "j"). |
426 | 425 | # TO-DO: Change with a better alternative. Not working: F_1^1y_1 |
427 | 426 | c = TexCharClass(env, "j") |
| 427 | + C = TexCharClass(env, "M") |
| 428 | + |
428 | 429 | self.subpad = c.height - c.bearingy |
| 430 | + # If subscript is complex (i.e. a large Hbox - fraction etc.) |
| 431 | + # we have to aditionaly lower the subscript |
| 432 | + if sub.ymax > (C.height/2.1 + self.subpad): |
| 433 | + self.subpad = sub.ymax - C.height/2.1 |
| 434 | + |
429 | 435 | #self.subpad = max(self.subpad) |
430 | 436 | #self.subpad = 0.5*sub.height |
431 | 437 | # Similar for the superscript |
432 | | - C = TexCharClass(env, "M") |
433 | | - self.suppad = max(nuc.height/2., C.ymax/2.)# - C.bearingy |
| 438 | + self.suppad = max(nuc.height/1.9, C.ymax/1.9) - sup.ymin# - C.bearingy |
| 439 | + |
434 | 440 |
|
435 | 441 | #self.advance = nuc.advance + max((sub.advance, sup.advance)) |
436 | 442 |
|
|
0 commit comments