Skip to content
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

Bit of an odd question: Forced orientation of images on ebook readers? #103

Open
hanetzer opened this issue Mar 20, 2023 · 1 comment
Open

Comments

@hanetzer
Copy link

So, given any ebook reader, usually they have some non-square resolution to their display.
Lets call it 1920x1080 for the sake of argument.
Supposing I wish to include an image with the same 16:9 aspect ratio onto its own page
in an ebook, it would obviously be better to keep this image aligned with the same orientation
as the display, regardless of what settings one may use on their ebook reader. (for instance,
I keep mine in landscape mode as its a bit easier on my eyes and reading style).
Is this possible in ebooks in general, and can one set this up using tex4ebook somehow?

@michal-h21
Copy link
Owner

If your Epub reader supports CSS, you can set all images to have a max-width same as is the width of the reader. In this way, images will be not cropped. Images smaller than the display are displayed in their full size. This can be done using this configuration:

\Preamble{xhtml} 
\Configure{Gin-dim}{} 
\Css{img { 
    max-width: 100\%; 
    height: auto; 
}} 
\begin{document} 
\EndPreamble

See also this how-to for more tricks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants