Closed pablgonz closed 3 years ago
The example works fine with PS where we have only six decimals by default! But Lua has some more, so you need to modify valuewidth
which is preset to 10 which is too less here. Or you have to limit the number of decimals. I'll have a closer look tomorrow. However, see test1111 on https://hvoss.org/PSTexa/
The example works fine with PS where we have only six decimals by default! But Lua has some more, so you need to modify
valuewidth
which is preset to 10 which is too less here. Or you have to limit the number of decimals. I'll have a closer look tomorrow. However, see test1111 on https://hvoss.org/PSTexa/
I changed the number formatting to only use 6 significant digits for now. Feel free to revert that if you come up with a better solution.
@zauguin On win10
[1{c:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map}./luapstricks
.lua:1249: rangecheck
stack traceback:
[C]: in function 'error'
./luapstricks.lua:1249: in function <./luapstricks.lua:1217>
(...tail calls...)
./luapstricks.lua:2926: in upvalue 'execute_ps'
./luapstricks.lua:2987: in function <./luapstricks.lua:2984>
[C]: in function 'vf.node'
./luapstricks.lua:2977: in function <./luapstricks.lua:2968>.
<inserted text> BAD
l.47 \end{center}
?
Font name problem?
(dvips>ps2pdf OK)
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
EFRDCM+NimbusRomNo9L-ReguItal Type 1C WinAnsi yes yes yes 25 0
LRNOLL+NimbusSanL-Regu Type 1C WinAnsi yes yes yes 23 0
NMRYAS+Palatino-Roman Type 1C WinAnsi yes yes yes 27 0
RHFXTB+CMR8 Type 1C WinAnsi yes yes no 17 0
PQRSOF+CMMI10 Type 1C WinAnsi yes yes no 15 0
QMCRNC+NimbusRomNo9L-Regu Type 1C WinAnsi yes yes yes 19 0
UFIGRG+CMSY10 Type 1C Custom yes yes no 11 0
IXTCRV+CMR10 Type 1C WinAnsi yes yes yes 9 0
TDRURT+NimbusMonL-Regu Type 1C WinAnsi yes yes yes 21 0
@zauguin On win10
[1{c:/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map}./luapstricks .lua:1249: rangecheck stack traceback: [C]: in function 'error' ./luapstricks.lua:1249: in function <./luapstricks.lua:1217> (...tail calls...) ./luapstricks.lua:2926: in upvalue 'execute_ps' ./luapstricks.lua:2987: in function <./luapstricks.lua:2984> [C]: in function 'vf.node' ./luapstricks.lua:2977: in function <./luapstricks.lua:2968>. <inserted text> BAD l.47 \end{center} ?
Font name problem? (dvips>ps2pdf OK)
No, it's still a number formatting problem, here caused by slight rounding in cos
messing things up. Basically calculating cos(90)
in Lua involves converting 90 degrees in radians and then calculating the cosine in radians. Normally this isn't an issue, but 90 degree in radians is pi/2 which has to be rounded in order to be stored as a floating point value. Then the cosine of this rounded value is calculated which is roughly 6.12323*10^{-17} formatted as 6.12323e-17
.(This is the same way GhostScript would format this value, so that isn't the issue) This again has more than 10 digits. (The fun of working with floating point values...) I guess values like 90 degree have to be special cased to give more precise answers.
No, it's still a number formatting problem, here caused by slight rounding in
cos
messing things up. Basically calculatingcos(90)
in Lua involves converting 90 degrees in radians and then calculating the cosine in radians. Normally this isn't an issue, but 90 degree in radians is pi/2 which has to be rounded in order to be stored as a floating point value. Then the cosine of this rounded value is calculated which is roughly 6.12323*10^{-17} formatted as6.12323e-17
.(This is the same way GhostScript would format this value, so that isn't the issue) This again has more than 10 digits. (The fun of working with floating point values...) I guess values like 90 degree have to be special cased to give more precise answers.
More fun :D
Should be better now.
Done!
The
pst-tools
package is loaded by thepst-plot
package (one of the "Big Four" along withpstricks
,pstricks-add
andpst-node
) and several others, at the moment it is partially supported.Expected output:
NOTE: Font problem solved in https://github.com/zauguin/luapstricks/commit/f63f471d87950224f64eb4dfc7a3dbb67a98b0aa