how to include images

12 views
Skip to first unread message

Miko

unread,
Nov 11, 2025, 7:01:18 AMNov 11
to PreTeXt support
Hi! Im new to pretext, I want to include images in my pretext document. I saw this,  https://pretextbook.org/doc/guide/html/topic-images.html ,  but Im not sure how to do it. The images are on my device and will be loaded locally. 

I need a step by step on what I have to do and where to put the image. Thank you!

David Austin

unread,
Nov 11, 2025, 7:19:24 AMNov 11
to pretext...@googlegroups.com
I assume that you're probably using PreTeXt through the CLI.  If so, you will want to place your images in the "assets" directory.  I typically create a sub-directory called "images" so images go in "assets/images".  

Best practices are to include each image in a variety of formats (svg, pdf, etc) to facilitate conversions to HTML, print, and so forth, but that's not strictly necessary.

In your PreTeXt source, you will use an #image tag with the @source attribute pointing to the location of the image inside the assets directory.  For instance, you could say something like

<image source="images/my_image.jpg"/>

assuming my_image.jpg is in the assets/images folder.  If you have provided my_image.svg and my_image.pdf, you can say

<image source="images/my_image"/>

and PreTeXt will choose the appropriate image type for the conversion.

On Tue, Nov 11, 2025 at 7:01 AM Miko <miko2...@gmail.com> wrote:
Hi! Im new to pretext, I want to include images in my pretext document. I saw this,  https://pretextbook.org/doc/guide/html/topic-images.html ,  but Im not sure how to do it. The images are on my device and will be loaded locally. 

I need a step by step on what I have to do and where to put the image. Thank you!

--
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/0c3ddd8e-3371-4990-bc1c-d2b41e781192n%40googlegroups.com.

Miko

unread,
Nov 11, 2025, 7:53:13 AMNov 11
to PreTeXt support
Thank you!
Reply all
Reply to author
Forward
0 new messages