On 15/03/2015 18:29, Jean-Marc Lasgouttes wrote:
Le 15/03/15 08:44, Abdelrazak Younes a écrit :
Comments?

You use lots of hardcoded constants nobody except you will understand 1
month from now, and not even you 1 year from now :-P

What is the LaTeX source code good for?

I didn't know that... I am not literate in Latex as you may know :-)


I added some documentation, although I am not sure that it will help you more.

It helped me understand the roots of the code, indeed. And I think this reference is valuable in the code, thanks!


It helped me to notice a couple oversights. Thanks.

Thanks.


At least those are used 4 times and should use meaningfully named
constants: 0.16667 and 0.125.

These are just numbers: 1/6em and 1/8em. Ask Knuth for their proper names.

Didn't know that. Still ugly though :-)



Nitpick: 0.16667 ~= 1/6 so if you want to be more accurate you'd better
use division per 6.

Being accurate in this case is doing what TeX does.

I see.

Nitpick 2: You are using floating point calculation while you could
fixed point calculation easily. Not a problem on PC but on some ARM
systems (eg older Raspberry Pi).

As Knuth wrote, "premature optimization is the root of all evil".

Which is maybe the reason why LateX code is so ugly. I guess LaTeX has some special way to do fixed point calculation based on floating point representation, hasn't it?

Thanks,
Abdel.

Reply via email to