07-29-2014, 07:20 PM | #16 | |
null operator (he/him)
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I've used TeXstudio a little, from it I created PDF's. I haven't tried to convert the PDF's, there are too many tables, infographics etc. I think member Tex2002ans also has some experience with LaTeX. BR |
|
07-29-2014, 11:09 PM | #17 | |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
Advert | |
|
07-30-2014, 07:59 AM | #18 |
Wizard
Posts: 1,234
Karma: 3350652
Join Date: Feb 2008
Device: Amazon Kindle Paperwhite (300ppi), Samsung Galaxy Book 12
|
Using Plain TeX is not really recommended for the typical user, esp. if one needs to interchange w/ others, or make use of pre-made code / formats.
LaTeX is the most prevalent TeX macro package, and well-suited for most users who need math. Read over _The not so Short Introduction to LaTeX_ to get a feel for using it directly: http://www.ctan.org/tex-archive/info/lshort/english/ Alternately, there's a very good graphical front-end, LyX: http://www.lyx.org/ which has had some work done recently on making it round-trip w/ Word --- might be you could import the files into it and then export them from that. Last edited by WillAdams; 07-30-2014 at 10:09 AM. |
07-30-2014, 12:25 PM | #19 |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
@elearner --
On my Kindle's Font's menu, there is a [Publisher Font] option that is available IF there are embedded fonts in the document. The Nook might be the same. |
08-13-2014, 01:51 AM | #20 | |||||||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Side Note: This was the post I was looking for! https://www.mobileread.com/forums/sho...6&postcount=58 Front (LaTeX/Formula) Matter I wouldn't say I am fantastic at LaTeX, but I have been dabbling enough to create some pretty dang good fiction PDFs + (decent) non-fiction. I still have a lot of tweaks to iron out though... so I wouldn't call any of the PDF stuff I work on production ready. When I first started, I used LyX, which seems to be an ok introduction. I didn't find it any harder than fiddling around/learning with Sigil. I then read The Not so Short Introduction to LaTeX. (Now I just would type everything directly in LaTeX. The GUI stuff felt too limiting.). Another fantastic resource is the TeX Stack Exchange: https://tex.stackexchange.com/ and the LaTeX Wiki: https://en.wikibooks.org/wiki/LaTeX/ And let me give credit where credit is due. It was user Jellby who got me interested in this LaTeX stuff, and pointed me to lots of resources. Getting nice formulas into EPUBs is definitely the area where I am quite interested in. I mean, I wrote a Formula -> PNG tutorial: https://www.mobileread.com/forums/sho...d.php?t=223254 Plus I typed out a few tiny posts tomes discussing OCRing math books: https://www.mobileread.com/forums/sho...d.php?t=228413 I recently just digitized ~81 more equations using LaTeX using the CodeCogs site that Toxaris mentioned in my Tutorial. I was able to use CodeCogs to recreate the formula in LaTeX, and then export as a PDF. I was then able to feed it into a .bat file to process all of the formulas using Imagemagick. (See attached ZIP file for the images, and further down in the post for a few samples). I still have to iron out the workflow, and will probably tack all that info into my Tutorial. Perhaps as a more "Advanced" method. Meat and Potatoes Anyway, the way I see it, there are 2 different versions of formulas:
Simple You should be able to keep those as normal HTML. This will allow it to scale up/follow with the user's settings. This also allows them to be easily searchable/copy/pastable. I would just do something along these lines: Code:
<div class="formula"> <p class="math"><span class="math">∂[U(φ).V(x)] → U(φ). ∂V(x),</span></p> </div> Code:
div.formula { margin-top: 1em; margin-bottom: 1em; page-break: avoid; text-indent: 0; text-align: center; } p.math { text-indent: 0; text-align: center; } span.math { font-family: 'CharisSIL', serif; } Then you can subset the font using Calibre, which will try to minimize the size it adds to the EPUB. And if you use <span class="math"> sparingly, it shouldn't effect the look of the rest of your document. Side Note: You may also want to use <span class="math"> in any inline equations as well. I also do something quite similar with a lot of the more obscure Greek accented words: Quote:
Complex There is no other way to handle these that would work across all devices besides an image of the formula (PNG or GIF). In this case, I would go for consistency, and just convert ALL formulas to images. It looks a little odd if you would have Complex formulas as images, while the Simple ones were normal HTML. Although that is a decision left up to you. Side Note: Ok I lied, maybe not ALL formulas. Those formulas that are in the normal flow of the text, I would try to keep/reduce those to their "Simple" equivalents. Inline PNGs/GIFs of formulas are HORRIBLE, and really mess with the flow of the document. I attached a ZIP file of 81 formulas at 350dpi I just generated using LaTeX (using the CodeCogs GUI) + Imagemagick. The same sort of thing can be accomplished using my Tutorial.... although I am now seeing the superiority of LaTeX in this case, because I can shove LaTeX right in the alt attribute. This makes it super easy for me to plop it back into LaTeX, do any corrections, and generate a new formula if needed. Or in the future, quickly converting the image into a more PROPER formula (SVG, MathML, straight LaTeX), or being able to easily update math fonts/kerning/typography at the flip of a switch. This is what I settled on, with the LaTeX used to get the formula in RED: Quote:
Quote:
Quote:
Quote:
Quote:
Probably memory restrictions. So my recommendation would be:
In the future, MathML seems like it would be a decent choice, although it won't be a good choice until long into the future.... because barely any reading devices support it. (You have to know your customers, and who this book will be geared towards. If you knew everyone would read it in Calibre, AZARDI, iBooks (?) then MathML would probably be a great choice, although if everyone will be reading it on Kindles, Nooks, Kobos, etc. etc. MathML is a non-choice.). SVG would also be able to generate crisper/cleaner formulas than PNG/GIF, and would DEFINITELY be superior to the HTML versions. Although SVG support on devices isn't the greatest either, and you STILL have to do all the work to generate a PNG/GIF fallback. We hashed out a lot of SVG + inline SVG stuff in this topic: https://www.mobileread.com/forums/sho...d.php?t=222825 Quote:
"So many cross-references [...] difficult to start all over again"? Sounds to me like you are causing your own Word headaches already! Can you do this in Word? (See topic, your head will EXPLODE): https://tex.stackexchange.com/questi...tures-show-off Edit: Also, I had trouble Copying/Pasting equations out of your Word DOC. The symbols were completely mangled. I saved your DOC file in Word, and exported to HTML, and saw this HORROR as the first equation (the rest are equally as abysmal): Spoiler:
You can see in RED that the pilcrow '¶' was overwritten to display as a partial derivative '∂'. (The rest of the symbols were just as bad). This horror should be a much closer to what I posted above (I manually recreated this): Quote:
ALSO, I would avoid using whatever you used to insert Symbols. As you can see above, it seems as if Microsoft Word inserted them as a dreaded "Symbols" font (seems to only work in Microsoft Word and IE?). It looks to me like it is overriding the letters "a-z" + "A-Z" with the lower/uppercase Greek symbols. Instead, you would want the PROPER unicode character. This is also just going to cause tons of headaches for you when trying to move this document ANYWHERE besides Word. (Like me trying to copy/paste info into the forums, or convert to EPUB). Last edited by Tex2002ans; 08-13-2014 at 06:46 AM. |
|||||||||
Advert | |
|
08-13-2014, 02:07 PM | #21 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
What you can also do, is wait for the next version of my Word add-in (about two weeks). It will convert formula's like you used. I will convert the characters used from the symbol font to their unicode equivalents.
|
08-13-2014, 03:07 PM | #22 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
I've managed to create most of the complex equation types mentioned by Tex2002ans. I have to use a custom font so I can be reasonably certain that font metrics are consistent, but then I've created reasonably decent fractions, integrals, combined sub/superscripts etc.
|
08-13-2014, 03:53 PM | #23 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
|
||
08-14-2014, 10:25 AM | #24 | |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
Quote:
CSS written with little premeditation, but I believe it displays OK in ADE despite not being strictly EPUB2 conformant, I think (inline-block isn't in the spec, is it?) Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> div { display:inline; border-width:1px; } div.index,div.frac { display:inline-block; } div.index { vertical-align:-10%; margin-left:-0.2em; } div.sup, div.sub, div.denominator, div.numerator { display:block; } div.denominator, div.numerator { text-align:center; } div.sup, div.sub { text-align:left; font-size:0.5em; } div.numerator { border-bottom-style:solid; } div.surd { margin-right:-0.2em; vertical-align:10% } div.bigsurd { margin-right:-0.15em; font-size:2.3em; vertical-align:-20%; } div.surdkernel { padding:0 0.2em; margin-top:0.3em; display:inline-block; border-top-style:solid; } div.bigsurd+div.surdkernel { vertical-align:-49%; } </style> </head> <body> <div class="math"> x = <div class="bigsurd">√</div> <div class="surdkernel"> <div class="frac"> <div class="numerator">π </div> <div class="denominator">x <div class="index"> <div class="sup">n</div> <div class="sub">i+1</div> </div> </div> </div> </div> </div> </body> </html> |
|
08-15-2014, 04:02 AM | #25 | |
Wizard
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Quote:
ADE behavior is different to programs like Word or calibre. These programs will use (if needed) all installed fonts they can find in your OS. ADE displays only a fonts-/character set what is compatible to Adobe RMSDK. This is why a lot people use ADE for a final EPUB-test. An EPUB what will render correctly in ADE will work for most of e-book reader hardware. If you want to find out what fonts and character set ADE use, this is maybe a good point to look at: c:\Program Files (x86)\Adobe\Adobe Digital Editions 2.0\resources\fonts\ c:\Program Files (x86)\Adobe\Adobe Digital Editions 3.0\resources\fonts\ |
|
08-15-2014, 04:50 PM | #26 | |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
However, upon export to HTML, it is converted to the Symbol font. That is because Word only supports an old version of HTML and CSS. Back then Unicode was not that well supported yet and using the Symbol font was a much used fallback (although not recommended by W3C). So, only during the export it is actually changed to the Symbol font. Still, that does not solve the problem though. That is why I made an improvement to my ePUB export in the tools to ensure that the entered symbols remain their Unicode equivalent. |
|
08-15-2014, 06:18 PM | #27 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Thanks for the information on Word and the Symbols font! I didn't know that.
And thank you for the example SBT. Last edited by Tex2002ans; 08-15-2014 at 06:25 PM. |
05-13-2017, 03:08 AM | #28 |
Member
Posts: 14
Karma: 10
Join Date: Nov 2015
Location: INDIA
Device: none
|
MathML coding are supported in Ipad, Kindle devices. But it will not work the Nook, Kobo and sony reader
|
06-20-2017, 08:13 AM | #29 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jun 2017
Device: samsung
|
Basically, 'math' is quite complicated in ebooks (and a bit in html, too).
Depending on 'your math', you might have to include mathjax. The problem is that many ebook readers do not support mathjax, and you might need to include (a downsized) javascript in you book since the original is too big. After a lot of fuss, I managed to get this working (in a few readers): https://github.com/espenmn/medialog....bok/MathJax.js Another option would be to convert all the math to images. ----------- To covert word math to 'something you can use on the web', I use Mathtype |
06-20-2017, 01:29 PM | #30 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
The 'best' method besides MathML (only ePUB3 and not supported that well) is still using SVG images because they can scale with the text without pixelating.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Converting Word-> HTML -> Epub | arturox | Conversion | 37 | 07-18-2012 10:29 AM |
Fun converting Word to epub | DebbyS | Conversion | 2 | 10-09-2011 03:27 AM |
Converting Word Doc with Tables to Epub? | dhume01 | ePub | 8 | 12-28-2010 08:02 PM |
Converting from Word Perfect to epub | PhishStyx | Sigil | 10 | 05-17-2010 04:49 PM |