Reading and loading image in Sage

12 views
Skip to first unread message

Ajit Kumar

unread,
Aug 9, 2025, 1:42:02 AMAug 9
to PreTeXt support
Hi
I wish to import an image inside <sage><input> ...</input></sage>
and apply some transformation. How do I do?
I tries putting the image in /assets/images directory but it is not working.

Regards
Ajit

Oscar Levin

unread,
Aug 9, 2025, 10:01:31 AMAug 9
to PreTeXt support
I don't know if this would work for a sage element, but there was some recent work done to allow "external" data to be used in images.  There is some discussion in the sample article here: Paragraph

D. Brian Walton

unread,
Aug 9, 2025, 11:25:57 AMAug 9
to pretext-support
The input code probably needs to refer to a url for the image that is passed to an external Sage server. I don't know of a way in the input code to access the current base url, so relative references probably won't work. (Hoping to be corrected.)

You might need to hard code a resource url as in the following example. 

Good luck, 
Brian

--
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 visit https://groups.google.com/d/msgid/pretext-support/e07da5ec-bfa9-4954-97b2-b3a5e3b6137an%40googlegroups.com.

Ajit Kumar

unread,
Aug 9, 2025, 4:36:31 PMAug 9
to pretext...@googlegroups.com, Oscar Levin
Dear Brian 
The url 

you shared also worked for me.

@Oscar Levin Thanks for sharing this. It is interesting, I shall try it out.

Thanks
Regards
Ajit



--
Dr. Ajit Kumar
Professor and Head
Department of Mathematics
Institute of Chemical Technology (ICT)
Nathalal Parekh Road, Matunga (E),
Mumbai 400 019

Telephone +91 22 3361  2681, Telefax: +91 22 3361 1020
Mobile: 09969031202

Web: http://ajitmathsoft.wordpress.com/
         www.ictmumbai.edu.in
         www.mtts.org.in/
Reply all
Reply to author
Forward
0 new messages