View Single Post
Old 04-23-2016, 08:53 AM   #2
GeoffR
Wizard
GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.GeoffR ought to be getting tired of karma fortunes by now.
 
GeoffR's Avatar
 
Posts: 3,821
Karma: 19162882
Join Date: Nov 2012
Location: Te Riu-a-Māui
Device: Kobo Glo
As to the equation size: does the size of the equation change when you change the font size? If not then it is most likely a common publishing mistake where the equations are set at a fixed (pixel) size, and so will always look too small on high-dpi screens or when a larger font size is selected..

If that is the problem then the only solution is to edit the book to fix the mistakes. There are two approaches: one is to use image tools such as imagemagick to increase the size of the bitmap images to suit the device and selected font size; another (better but more time-consuming) approach is to edit the stylesheet and set the height and width of each image so that they resize automatically in proportion to the font size.

Edit: If you have the ImageMagick tools, then resizing the images might (depending on how the publisher has set the image sizes in the stylesheet) be as simple as using Calibre to unpack the ePub, running the following command in the directory containing the images, and then rebuilding the ePub:
Code:
mogrify -resize 150% *.png
Edit: If you want to make the equations scale proportional to the font size, the basic idea is to set the image size (in the html or css stylesheet, depending on how the publiaher has arranged the ePub) to { height:auto; width:Xem; max-width:100%; } where X = N*W/H, N = number of text lines in the equation, W = pixel width of image, H = pixel height of image. A slightly simpler way is to set { height:Nem; width:auto; } but this has the problem that the image will either be clipped or squashed when increasing the font size results in the equation to becoming too wide to fit on the screen, whereas the first method will cause the equation to simply stop increasing in size once it reaches maximum width.

As to the alignment. Do the equations become centred again when you set the justification button (Aa menu) to "Off"? (I guess this is a KePub book?)

Last edited by GeoffR; 04-23-2016 at 10:12 AM. Reason: added more detail about the two approaches to fixing the size problem
GeoffR is offline   Reply With Quote