-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add png, pdf and jpeg image support to the latex backend #1297
base: master
Are you sure you want to change the base?
Conversation
Thanks a lot for the PR! Yes, I agree that it is the first thing we should do for images. (#1286) The main problem is deciding the syntax. There is no existing syntax for attributes so we have to create something new. I can't find issues with the discussion, it must have happened elsewhere, but we could not find a consensus on the syntax and decided to start without it (in the worst case, images themselves can be resized I think). I'll restart the discussion in #1286 with some propositions soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
I'm curious about the choice of extensions: shouldn't jpg
, and capitalized extensions, be allowed as well?
I suspect the list of supported format depends on the latex implementation.
Maybe the list taken from here could be be a valid choice:
.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2
Also I think it needs ocamlformatting! (maybe we should use this action?)
I don't have this in my head but I think this is no longer the case with the CSS |
I'm not sure to understand! But if the user can't decide the dimension of the bounding box, it does not help much? Also, it is hard for odoc to decide on a "good size for all": eg vg has small images, but in other contexts a big image makes sense. Am I missing something? |
IIRC for responsive images you basically want users to define one dimension with a relative unit. If it's horizontal it should be a percentage of the measure. If it's vertical a multiple of the leading, capped so that it doesn't overflow the measure. That's for running text but if you have a table for example then your box may already have constraints at which point (again IIRC) |
Basically user should work with the assumption that the
|
I have added support for all image formats supported by pdftex by default. |
This small PR adds support for images to the latex backed for png, pdf, and jpeg internal assets.
As a side-note, I am slightly surprised that there is no support for width information on the media tags since both image and video are hard to place properly without fixing their size.