From: Günter M. <mi...@us...> - 2025-07-30 09:19:54
|
- **status**: open-fixed --> closed-fixed - **Comment**: The issue is fixed in Docutils 0.22 released 2025-07-29. Thank you for reporting. --- **[feature-requests:#83] Support SVG images in LaTeX** **Status:** closed-fixed **Group:** Default **Created:** Sat Oct 09, 2021 12:05 AM UTC by Local State **Last Updated:** Tue Dec 17, 2024 09:08 AM UTC **Owner:** nobody Hi there, this is Local State. ## Motivation The current `Image` directive is not enough for svg files. Using `img` tag loses interactivities, and the width, and height can't be applied for svg files directly. It's better to use `style="width:50%"` instead. ## 2 New Options I'm hoping there could be 2 new options for `Image` directive. 1. `tag` This would determine the html tag used to render the image. The default value would be `img`, and we could also use `object`, `iframe` and `embed` as alternatives. Currently, all images are rendered with `img` tag, which loses some interactivities (e.g., the text in svg file). We could avoid this by using `object` tag. I see there are some similar work in `html4css1` about `object_image_types`. Example: ``` <img src="a.png" width="50%" alt="alt msg">` <object data="a.png" style="width:50%">alt msg</object> <iframe src="a.png" width="50%" title="alt msg"></iframe> <embed src="a.png" width="50%">` ``` 2. `embed` If enabled, this option would embed the image into the html file using base64 encoding. While I see there is already the if sentence in the `visit_image` function. ``` if self.settings.embed_images or ('embed' in node): ``` The `embed_images` could be set from command-line or setting, but I can't find how to satisfy the latter condition, since any node doesn't seem to have `embed` attribute. Could anyone tell me how to enable it? If we can't, then it's necessary to add the `embed` option, so that we could choose to embed one particular image or not. Especially, I notice there exist a `todo` item for svg embedding. I'd like to implement it if possible. But the first option is still in demand, because most times we don't want our html files to be so large and need separate svg files. ## Potential bugs svg files under `<img>` tag can't correctly render height and width if svg viewbox information is not contained in the file. It might be better to set the height and width in `style` indirectly. ## Contribution I would like to fix and implement all these things if possible. But I'm not quite familiar with SourceForge and don't know how to submit a PR like what we do in github. --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/feature-requests/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |