Re: lyxhtml and calibre and mobi and epub
On 04/05/2012 02:45 AM, Guenter Milde wrote: On 2012-04-03, Richard Heck wrote: On 04/03/2012 01:34 PM, Jeremy C. Reed wrote: On Tue, 3 Apr 2012, Richard Heck wrote: I made that change. And the new xhtml displayed as: 1 - 3 (long vertical vinculum) Fractions in HTML are not an easy thing to do, I'm afraid. eLyXer does a good job in translating Math to CSS-styled HTML. Maybe the native exporter can learn/borrow from it. It did. But there are real limits to how well HTML can do here. Richard
Re: lyxhtml and calibre and mobi and epub
On 2012-04-03, Richard Heck wrote: > On 04/03/2012 01:34 PM, Jeremy C. Reed wrote: >> On Tue, 3 Apr 2012, Richard Heck wrote: >> I made that change. And the new xhtml displayed as: >>1 >> - >>3 >> (long vertical vinculum) > Fractions in HTML are not an easy thing to do, I'm afraid. eLyXer does a good job in translating Math to CSS-styled HTML. Maybe the native exporter can learn/borrow from it. Günter
Re: lyxhtml and calibre and mobi and epub
On 04/03/2012 06:33 PM, Jeremy C. Reed wrote: On Tue, 3 Apr 2012, Richard Heck wrote: Oversight. I've just fixed it for 2.0.4, but it's a source issue. You can download the current version from git if you wish and compile that. Can someone point me to anonymous GIT details? http://wiki.lyx.org/Devel/LyXGit rh
Re: lyxhtml and calibre and mobi and epub
On Tue, 3 Apr 2012, Richard Heck wrote: > Oversight. I've just fixed it for 2.0.4, but it's a source issue. You can > download the current version from git if you wish and compile that. Can someone point me to anonymous GIT details? I found http://wiki.lyx.org/Devel/Git if I need an account then who do I send a public SSH key to?
Re: lyxhtml and calibre and mobi and epub
On 04/03/2012 04:39 PM, Jeremy C. Reed wrote: On Tue, 3 Apr 2012, Richard Heck wrote: It would help me debug it if you could produce a small example file that makes this happen. I'm not sure why the output mechanism is choking. http://reedmedia.net/~reed/tmp/sample1.lyx http://reedmedia.net/~reed/tmp/sample1.xhtml(see the extra links in ToC) What's causing the problem is that the horizontal line is itself in a \section* environment, which means that LaTeX thinks you have two \section*'s in a row. That doesn't matter very much, it turns out, from LaTeX's point of view, but it's probably not what you want. (If you look at the HTML, you'll see that the rule is in an .) I'd put the rule just in a Standard environment. If you do that, then it works as you'd want, I think. From the point of view of XHTML output, what's happening is that LyX doesn't try to put the rule itself in the TOC, but then it sees no content there at all, and that makes it unhappy. Richard
Re: lyxhtml and calibre and mobi and epub
On 04/03/2012 04:33 PM, Jeremy C. Reed wrote: Another issue with lyxhtml export: 7) Index is sorted with uppercase before lowercase; that is all A-Z before any a-z. Anyway to configure it so it will consider the uppercase/lowercase the same for sort comparisons? Oversight. I've just fixed it for 2.0.4, but it's a source issue. You can download the current version from git if you wish and compile that. Richard
Re: lyxhtml and calibre and mobi and epub
On Tue, 3 Apr 2012, Richard Heck wrote: > It would help me debug it if you could produce a small example file that makes > this happen. I'm not sure why the output mechanism is choking. http://reedmedia.net/~reed/tmp/sample1.lyx http://reedmedia.net/~reed/tmp/sample1.xhtml(see the extra links in ToC)
Re: lyxhtml and calibre and mobi and epub
Another issue with lyxhtml export: 7) Index is sorted with uppercase before lowercase; that is all A-Z before any a-z. Anyway to configure it so it will consider the uppercase/lowercase the same for sort comparisons?
Re: lyxhtml and calibre and mobi and epub
On 04/03/2012 01:34 PM, Jeremy C. Reed wrote: (responding to a single point) On Tue, 3 Apr 2012, Richard Heck wrote: 1) the XHTML has: http://www.w3.org/1998/Math/MathML";> 1 3 but the epub shows "13" and mobi has nothing. Does mobi handle MathML? Maybe you should try using HTML for math export (under Document> Settings> Output). I don't think any devices support MathML yet. I made that change. And the new xhtml displayed as: 1 - 3 (long vertical vinculum) Fractions in HTML are not an easy thing to do, I'm afraid. So I removed these math fractions from my lyx document and replaced with the special symbol from the Number Forms category. This now works for my XHTML and the EPUB and MOBI converted from it. The XHTML now contains this character: ??? Did the character go missing, or...? Richard
Re: lyxhtml and calibre and mobi and epub
On 04/03/2012 03:07 PM, Jeremy C. Reed wrote: (responding to one item below) On Tue, 3 Apr 2012, Richard Heck wrote: 6) The xhtml output had links to horizontal rules in my table of contents: > I simple removed that line for each. Can you provide a simple file showing the problem? This kind of thing is also fairly easy to fix, usually. I didn't notice before ... but now I realize that all my Section* (note the asterisk) were added to my table of contents. I had the following code to put a horizontal rule before my summary at end of each chapter. (It looks nice in my PDF.) This is what caused the above error. It would help me debug it if you could produce a small example file that makes this happen. I'm not sure why the output mechanism is choking. Regarding the Section* stuff in the TOC, I'm moderately surprised it did that. Does it seem right that itt should do it, or wrong? Or should it maybe be configurable? Richard
Re: lyxhtml and calibre and mobi and epub
On 04/03/2012 02:47 PM, Jeremy C. Reed wrote: (responding to single discussion item...) On Tue, 3 Apr 2012, Richard Heck wrote: 5) My footnotes work with the xhtml ... when I hover over them they popup. But these hover style footnotes don't work in the calibre viewer. The document shows the small underlined number but clicking or hovering on it does nothing. The xhtml has: div.foot:hover div.foot_inner { display: block; border: 1px double black; margin: 0em 1em; padding: 1em; } This was missing from the epub stylesheet. I think the epub and mobi don't support hovering footnotes. This can be easily customized, and maybe we should just make a module for it. Do something like this in your LyX file, under Document> Settings> Local Layout: Format 31 InsetLayout Foot HTMLStyle now put here whatever CSS you'd like to shape the footnotes... EndHTMLStyle End At some point, we'll also provide the possibility to export footnotes as endnotes instead. There's some code for this already, in fact, but I have been too busy to finish it. Thank you. I set it to: InsetLayout Foot HTMLStyle span.foot_label { vertical-align: super; font-size: smaller; font-weight: bold; text-decoration: underline; } div.foot { display: inline; font-size: small; font-weight: medium; font-family: serif; font-variant: normal; font-style: normal; } div.foot_inner { font-size: small; text-indent: 0em; margin-right: 15mm; margin-left: 15mm; margin-top: 5pt; margin-bottom: 5pt; } EndHTMLStyle End And that worked for me for the XHTML and my epub and mobi files. Good. I tried hard to make this easily customizable. (By the way, the \newcommand junk left in my XHTML file as mentioned in previous email caused calibre to not recognize my footnotes and converted foot to standard, footlabel to flexurl and footinner to standard. Once I manually removed that line from the XHTML file, then it worked.) I'll try to figure out why that was there. By the way, my lyx file doesn't seem to have any way to remove the "Local Layout". Even if I clear it, press validate and click ok, then go back to settings it is there again. | I thought I'd fixed that. Fixed now. Richard
Re: lyxhtml and calibre and mobi and epub
(responding to one item below) On Tue, 3 Apr 2012, Richard Heck wrote: > > 6) The xhtml output had links to horizontal rules in my table of > > contents: > > > >> href='#magicparlabel-236' class='tocarrow'>> > > > > I simple removed that line for each. > > > Can you provide a simple file showing the problem? This kind of thing is also > fairly easy to fix, usually. I didn't notice before ... but now I realize that all my Section* (note the asterisk) were added to my table of contents. I had the following code to put a horizontal rule before my summary at end of each chapter. (It looks nice in my PDF.) This is what caused the above error. \begin_layout Section* \noindent \begin_inset CommandInset line LatexCommand rule offset "0.5ex" width "100line%" height "1pt" \end_inset \end_layout I don't mind that lyxhtml exported all my Section* (except the horizontal rule above) into my ebook table of contents. It looks useful. But that is different that my PDF.
Re: lyxhtml and calibre and mobi and epub
(responding to single discussion item...) On Tue, 3 Apr 2012, Richard Heck wrote: > > 5) My footnotes work with the xhtml ... when I hover over them they > > popup. But these hover style footnotes don't work in the calibre viewer. > > The document shows the small underlined number but clicking or hovering > > on it does nothing. > > > > The xhtml has: > > > > div.foot:hover div.foot_inner { > > display: block; > > border: 1px double black; > > margin: 0em 1em; > > padding: 1em; > > } > > > > This was missing from the epub stylesheet. > > > > I think the epub and mobi don't support hovering footnotes. > > > This can be easily customized, and maybe we should just make a module for it. > Do something like this in your LyX file, under Document> Settings> Local > Layout: > > Format 31 > > InsetLayout Foot > HTMLStyle > now put here whatever CSS you'd like to shape the footnotes... > EndHTMLStyle > End > > At some point, we'll also provide the possibility to export footnotes as > endnotes instead. There's some code for this already, in fact, but I have been > too busy to finish it. Thank you. I set it to: InsetLayout Foot HTMLStyle span.foot_label { vertical-align: super; font-size: smaller; font-weight: bold; text-decoration: underline; } div.foot { display: inline; font-size: small; font-weight: medium; font-family: serif; font-variant: normal; font-style: normal; } div.foot_inner { font-size: small; text-indent: 0em; margin-right: 15mm; margin-left: 15mm; margin-top: 5pt; margin-bottom: 5pt; } EndHTMLStyle End And that worked for me for the XHTML and my epub and mobi files. (By the way, the \newcommand junk left in my XHTML file as mentioned in previous email caused calibre to not recognize my footnotes and converted foot to standard, footlabel to flexurl and footinner to standard. Once I manually removed that line from the XHTML file, then it worked.) So I don't have "foot" notes, but simply a note in smaller font and indented on next line after the superscript number. Thanks again for the lyx hint. By the way, my lyx file doesn't seem to have any way to remove the "Local Layout". Even if I clear it, press validate and click ok, then go back to settings it is there again.
Re: lyxhtml and calibre and mobi and epub
(responding to a single point) On Tue, 3 Apr 2012, Richard Heck wrote: > > 1) the XHTML has: > > > > http://www.w3.org/1998/Math/MathML";> > > > > > > 1 > > > > 3 > > > > > > > > > > but the epub shows "13" and mobi has nothing. > > > Does mobi handle MathML? Maybe you should try using HTML for math export > (under Document> Settings> Output). I don't think any devices support MathML yet. I made that change. And the new xhtml displayed as: 1 - 3 (long vertical vinculum) So I removed these math fractions from my lyx document and replaced with the special symbol from the Number Forms category. This now works for my XHTML and the EPUB and MOBI converted from it. The XHTML now contains this character: ??? This adds one issue -- I now have some Lyx/LaTeX in my XHTML output (and EPUB and MOBI): \newcommand*\LyXonethird{\mbox{\raisebox{.8ex}{1}\kern-.175em\raisebox{.2ex}{/}\kern-.18em\raisebox{-.2ex}{3}}} That line is included as content at the start of my document. I can easily remove it to workaround this issue.
Re: lyxhtml and calibre and mobi and epub
On 04/03/2012 01:10 AM, Jeremy C. Reed wrote: I am using LyX 2.0.0 (2011-04-29) on a Ubuntu system with lyx 2.0.0-1 packages. I export XHTML using the lyxhtml export. My goal is to create mobi (for kindle) and epub (for nook)files. I am using calibre 0.8.8 for conversion from the XHTML file. Here are my issues: 1) the XHTML has: http://www.w3.org/1998/Math/MathML";> 1 3 but the epub shows "13" and mobi has nothing. Does mobi handle MathML? Maybe you should try using HTML for math export (under Document> Settings> Output). 2) Some lyx/tex sections are like "First~Second~Third" but the lyxhtml output in my table of contents is "FirstSecondThird" (no spaces). So I manually fixed them. Please report this as a bug on trac and attach a simple example file. Should be an easy fix. 3) My print cross references say "See page elsewhere". I fixed this with: sed -e 's,on page \(\)elsewhere,\1here,' -e 's,page \(\)elsewhere,\1here,' -e 's,pages \(\)elsewhere and \(\)elsew,\1here and \2,' I'd be open to suggestions about what this should say. The problem, obviously, is that XHTML has no concept of pages. 5) My footnotes work with the xhtml ... when I hover over them they popup. But these hover style footnotes don't work in the calibre viewer. The document shows the small underlined number but clicking or hovering on it does nothing. The xhtml has: div.foot:hover div.foot_inner { display: block; border: 1px double black; margin: 0em 1em; padding: 1em; } This was missing from the epub stylesheet. I think the epub and mobi don't support hovering footnotes. This can be easily customized, and maybe we should just make a module for it. Do something like this in your LyX file, under Document> Settings> Local Layout: Format 31 InsetLayout Foot HTMLStyle now put here whatever CSS you'd like to shape the footnotes... EndHTMLStyle End At some point, we'll also provide the possibility to export footnotes as endnotes instead. There's some code for this already, in fact, but I have been too busy to finish it. 6) The xhtml output had links to horizontal rules in my table of contents: > I simple removed that line for each. Can you provide a simple file showing the problem? This kind of thing is also fairly easy to fix, usually. Richard
lyxhtml and calibre and mobi and epub
I am using LyX 2.0.0 (2011-04-29) on a Ubuntu system with lyx 2.0.0-1 packages. I export XHTML using the lyxhtml export. My goal is to create mobi (for kindle) and epub (for nook)files. I am using calibre 0.8.8 for conversion from the XHTML file. Here are my issues: 1) the XHTML has: http://www.w3.org/1998/Math/MathML";> 1 3 but the epub shows "13" and mobi has nothing. 2) Some lyx/tex sections are like "First~Second~Third" but the lyxhtml output in my table of contents is "FirstSecondThird" (no spaces). So I manually fixed them. 3) My print cross references say "See page elsewhere". I fixed this with: sed -e 's,on page \(\)elsewhere,\1here,' -e 's,page \(\)elsewhere,\1here,' -e 's,pages \(\)elsewhere and \(\)elsew,\1here and \2,' 4) I made some hyperlinks back into hyperlinks: sed -e 's,\([^<]*\),\1,g' 5) My footnotes work with the xhtml ... when I hover over them they popup. But these hover style footnotes don't work in the calibre viewer. The document shows the small underlined number but clicking or hovering on it does nothing. The xhtml has: div.foot:hover div.foot_inner { display: block; border: 1px double black; margin: 0em 1em; padding: 1em; } This was missing from the epub stylesheet. I think the epub and mobi don't support hovering footnotes. I see elyxer supports different footnote features. I didn't try all the elyxer features yet. (I see it has graphical arrow links I want to remove and also some "index" tags are left in my main content.) 6) The xhtml output had links to horizontal rules in my table of contents: > I simple removed that line for each. Anyways what do you all do to generate good epub and/or mobi files from LyX? I also tried lyx2ebook but it crashed when I used it. (I sent traceback and example lyx file to the developer.) Thank you