From: André W. <co...@wo...> - 2021-06-24 18:42:00
|
Hi, I could reproduce it on Debian 11 (not yet released). It seems related to the upgrade to TeX Live 2020, which added the l3backend (was not present before). This package adds specials by \AtBeginDvi{...}, which unboxes the box send to \shipout and re-boxes it. By that the vertical alignment, which we set to zero height for the hbox passed to \shipout, gets lost at the first box shipped out by PyX. There is a simple solution in applying this vertical setting at the box nested inside, before we also fix the horizontal alignment according to the output requirements. This should not introduce any difference for regular use, although (as it is TeX/LaTeX) any difference can always be utilized (as the l3backend shows). Please try the attached patch. I hope it resolves the issue for you. (And we probably should release this soon ...) André PS: The additional special output (warning by PyX) has not yet been addressed/silenced. Also, I have not yet checked whether we can continue to use the pyx.def output driver as before. There are various open questions, which need further investigation ... Am 22.06.21 um 20:11 schrieb Thomas Bending: > I've used PyX happily for years, but I've recently noticed what seems to > be a bug in text placement when using LaTeX for text processing. Here's > my code: > > import pyx > pyx.text.set(engine = pyx.text.TexEngine) > c = pyx.canvas.canvas() > c.text(0, 0, 'A') > c.text(0, 0, 'B') > c.writePDFfile('out.pdf') > > This produces the file attached as out_tex.pdf, with the A and B > superimposed as I'd expect. However, if I change the engine specified in > line 2 to pyx.text.LatexEngine then > > 1. I see the warning /ignoring special 'header=l3backend-dvips.pro > <http://l3backend-dvips.pro>'/ > 2. The script produces the file attached as out_latex.pdf, with the A > displaced downwards (and hence almost off the page). > > I'm using PyX 0.15, Python 3.9.5, TeX = TeX 3.14159265 (TeX Live > 2020/Debian) and LaTeX = pdfTeX 3.14159265-2.6-1.40.21 (TeX Live > 2020/Debian), all running under Ubuntu 21.04. I believe that this issue > appeared when I upgraded to Ubuntu 21.04, which may also have involved > upgrades to some of these packages. > > Can anyone suggest what I can do to prevent this displacement of the > text when using the LaTeX engine, please? Is this displacement related > to the warning? Any advice welcomed, > > Thomas > > > > _______________________________________________ > PyX-user mailing list > PyX...@li... > https://lists.sourceforge.net/lists/listinfo/pyx-user > -- by _ _ _ / \ \ / ) Dr. André Wobst, co...@wo..., https://www.wobsta.de / _ \ \/\/ / wobsta GmbH, Ulmer Straße 248, 86156 Augsburg, Germany (_/ \_)_/\_/ Office: +49 (0)821 90796043, Mobile: +49 (0)160 93804217 |