LaTeX image generation error

83 views
Skip to first unread message

ksk...@gmail.com

unread,
Jul 4, 2022, 6:41:53 PM7/4/22
to PreTeXt support
I just updated a project to run with the latest CLI (0.8.1), and mostly things are working except for "pretext generate latex-image": I get an error of the form

...
converting image-5.tex to image-5.pdf
cropping image-5.pdf to cropped-image-5.pdf
critical: Not encrypted file
Failed to generate latex-image elements.  Exiting...

I'm guessing the issue is hiding somewhere else (maybe in the project configuration), but where?

Kiran

Valerio Monti

unread,
Jul 5, 2022, 1:52:27 AM7/5/22
to PreTeXt support
Hi Kiran,
yesterday I got a new computer and I started to install PreTeXt and friends and I get the same error message. Luckily, I remembered of this thread


so the only things you should need is run this command (ignore the warnings about incompatibility with pdfcropmargins)

pip install pypdf2==1.26

After that, you should be able to generate images again.

Hope this helps.

Valerio

Juan Carlos Bustamante

unread,
Jul 5, 2022, 9:34:43 AM7/5/22
to PreTeXt support
Hello,
Thanks Valerio, that works, I ran in the same problem after updating. But there's something that looks quite odd to me : besides the latex figures, the fiox you suggest also allows to obtein the sage-generated, and the asymptote generated elements. While I can guess that this may be needed to obtain the pdf images, I find it pretty strange that this package is also needed for the 3d sage plot. Is that normal?

JC

Sean Fitzpatrick

unread,
Jul 5, 2022, 9:49:27 AM7/5/22
to pretext...@googlegroups.com
Asymptote images are generated on a remote server, so they should work regardless of what additional programs are installed.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/5911155e-6109-4808-a0fa-aef67ce9771bn%40googlegroups.com.

Juan Carlos Bustamante

unread,
Jul 5, 2022, 4:46:15 PM7/5/22
to PreTeXt support
Yes Sean, that's the point. It looks that the asset generation crashes as a whole whenever there is a piece of it not working. One would expect that sage and asymptote are independent from pypdf2, but this is not the case.

Oscar Levin

unread,
Jul 6, 2022, 12:11:43 AM7/6/22
to PreTeXt support
This was a design decision, but we made it without too much thought, so do try to convince us we are wrong.  The idea is that if a user wants to generate all assets, if any fails, then we might as well stop and fix it.  If you just wanted asymptote, use pretext generate asymptote.  But like I said, we could change this if you think it is important.

Juan Carlos Bustamante

unread,
Jul 6, 2022, 9:48:18 AM7/6/22
to pretext...@googlegroups.com
I see. Maybe a reasonable improvement would be to have a more detailed error message, it took me a while to understand that the pdf problem was also affecting sage3d. As the error message was about pdf images only. Perhaps the error message should include "to generate sage elements try pretext generate sage"... 

JC

You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/wLnnb_3KJCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/59e36000-c407-47fc-89a1-261df4ddcef2n%40googlegroups.com.

Steven Clontz

unread,
Jul 6, 2022, 4:06:50 PM7/6/22
to PreTeXt support
I'm inclined to try to buid everything first, and if something fails, we exit with an error code and list the failed components. E.g. if `pretext generate` failed on sageplots and asymptote, but latex-images worked and there were no other kinds of generated assets, we would tell the best error message we can, so folks can try to fix issues and `pretext build sageplot` and `pretext build asymptote`.
Reply all
Reply to author
Forward
0 new messages