Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-20-2020, 11:35 AM   #1
7dau253mrwry4spf
Banned
7dau253mrwry4spf began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Apr 2020
Device: none
Formulas alignment

I am creating an epub3 of mathematical argument, using mathml for formulas.

How do you write a block of formulas one below the other all aligned on the left and not centered?
7dau253mrwry4spf is offline   Reply With Quote
Old 06-20-2020, 11:37 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by 7dau253mrwry4spf View Post
I am creating an epub3 of mathematical argument, using mathml for formulas.

How do you write a block of formulas one below the other all aligned on the left and not centered?
Is your eBook possibly going to be read on ePub readers that do not understand MathML, you'd be better off using SVG for the math.
JSWolf is offline   Reply With Quote
Advert
Old 06-21-2020, 08:42 AM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by 7dau253mrwry4spf View Post
I am creating an epub3 of mathematical argument, using mathml for formulas.

How do you write a block of formulas one below the other all aligned on the left and not centered?
Unfortunately a lot of readers have issues with SVG in the body of the book. Fairly soon you should have someone on here familiar with ePub3 and MathML that can answer your question...sorry it isn't me!
Turtle91 is offline   Reply With Quote
Old 06-21-2020, 02:45 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
Unfortunately a lot of readers have issues with SVG in the body of the book. Fairly soon you should have someone on here familiar with ePub3 and MathML that can answer your question...sorry it isn't me!
If you plan on this eBook being read on ePub 2 software that won't understand MathML, then SVG is the best solution. SVG will work in more situations where MathML won't.
JSWolf is offline   Reply With Quote
Old 06-21-2020, 04:59 PM   #5
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
There is a converter at https://sourceforge.net/projects/svgmath/ that will make SVG from MathML

Dale
DaleDe is offline   Reply With Quote
Advert
Old 06-22-2020, 05:36 AM   #6
7dau253mrwry4spf
Banned
7dau253mrwry4spf began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Apr 2020
Device: none
it seems to me that if i use an image to "draw" the formulas (svg or any other type) the Image remains the same size even if the user changes the font size, or am i wrong?

How can you keep the size of the image proportional to that of the font?
7dau253mrwry4spf is offline   Reply With Quote
Old 06-22-2020, 10:08 AM   #7
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Images can be resized if you define them relative to font-size:

Code:
img {width:2em}

<img alt="" src="test.png" />
I would only do that if it was an inline image such as a special symbol within the sentence.

Instead, I would define the image based on how much screen real-estate I wanted it to take up - in percent:

Code:
img {width:95%}

<img alt="" src="test.jpg" />
If you are using an svg image then it will scale without getting over-pixelated and fuzzy. For all other image types I put some protection in the css to prevent that. I set max-width to the maximum size in pixels I want the image to expand (usually I set the actual image width here)

Code:
img {width:95%; max-width:400px}

<img alt="" src="test.png" />

I would also add in other styling to make the image look good...of course, all that is strictly to what YOU think looks good. Here is an example:

Code:
div.image {margin:2em auto; font-size:.6em; text-indent:0; text-align:center}
div.image img {display:block; margin:0 0 .25em; width:95%; max-width:400px}

<div class="image"><img alt="" src="test.png" />Caption for this image</div>
Attached Thumbnails
Click image for larger version

Name:	Annotation 2020-06-22 100415.png
Views:	147
Size:	134.2 KB
ID:	180085  
Turtle91 is offline   Reply With Quote
Old 06-22-2020, 10:46 AM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
If you are using an svg image then it will scale without getting over-pixelated and fuzzy. For all other image types I put some protection in the css to prevent that. I set max-width to the maximum size in pixels I want the image to expand (usually I set the actual image width here)

Code:
img {width:95%; max-width:400px}

<img alt="" src="test.png" />
400px is awfully small for a 300dpi Reader. would go with...
Code:
img [
  max-width: 100%;
}
JSWolf is offline   Reply With Quote
Old 06-22-2020, 12:26 PM   #9
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by JSWolf View Post
400px is awfully small for a 300dpi Reader. would go with...
Code:
img [
  max-width: 100%;
}

Try actually reading what was posted....


Quote:
If you are using an svg image then it will scale without getting over-pixelated and fuzzy. For all other image types I put some protection in the css to prevent that. I set max-width to the maximum size in pixels I want the image to expand (usually I set the actual image width here)
max-width: 100%; is absolutely useless if you already set the width to 95%


In other words..... I don't CARE what resolution your screen is. If you have a 400 pixel wide image and you try to expand it to 1710 pixels (95% of an 1800 pixel wide screen) then it will get over-blown and pixelated and fuzzy...unless it's an SVG. (yes, I know you would say 'just use a higher resolution image'...but that's not the point if they don't have said higher resolution image!)


To protect against that...put a max-width....jeeze...i feel like I've said all this somewhere before...

Last edited by Turtle91; 06-22-2020 at 12:29 PM.
Turtle91 is offline   Reply With Quote
Old 06-22-2020, 12:40 PM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
400px is awfully small for a 300dpi Reader.
As explained elsewhere, "px" is an absolute unit, independent of the actual resolution. 400px is approximately 4.2 in or 10.5 cm. Whether or not is small depends on the distance you view it at, not on the resolution of the device... unless the device is defective/broken/non-compliant, then it could be whatever[*]
[*] I remember my first Cybook, it used to display PDFs as if the screen were A4 size (which it wasn't). I created a PDF set for its screen size (the usual 9x12 cm), and when displayed at "100%" magnification it was tiny. This was a defective device.
Jellby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Formulas to PNG Tex2002ans ePub 19 08-29-2014 07:10 PM
eBook with formulas aodor Workshop 13 11-18-2011 05:29 AM
Math formulas conversion help Sciamano Conversion 10 06-22-2011 06:33 AM
conversion of formulas paola Writer2ePub 5 01-03-2011 03:07 PM
What were the formulas for determining TOC lunixer Calibre 2 08-16-2010 11:14 AM


All times are GMT -4. The time now is 02:02 PM.


MobileRead.com is a privately owned, operated and funded community.