michal-h21 / tex4ebook

Converter from LaTeX to ebook formats (epub, mobi). Using tex4ht and texlua scripts.
307 stars 32 forks source link

Formatting issues #8

Open schaecsn opened 10 years ago

schaecsn commented 10 years ago

Hi there,

I try to simplify my latex document as much as possible to yield a beautiful look for both, latex (dvi) and ebook (epub). For viewing epubs, I use fbreader on a PC. I fail here:

Umlaute and special chars like "_" work in normal text, but not in {\tt ...} or {\em ...} etc. There is a space before the Umlaut. Try:

{\tt L\"astern} and L\"astern.

Note, there is also no space after closing \tt or \em.

The generated html code explains these two (wrong!) behaviors:

<span class="cmtt-10x-x-109" >L</span>
<span class="cmtt-10x-x-109" >ästern</span>and Lästern.

Can this be changed or worked around?

The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided? Try this:

\begin{verbatim}
The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided?

The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided?
\end{verbatim}

How can I change the div.verbatim in the .css file?

I use \coverimage{cover} as the first command to include a picture (cover.jpg or cover.png etc). http://validator.idpf.org/ complains that img tags (for cover.jpg or cover.png etc) is not valid. It's not easy to convert a full featured picture from .jpg/.png to .svg. How am I supposed to create a standard-conform title page?

Thanks for any help. Stefan

gbarnich commented 10 years ago

@Stephan : just a comment, not directly related though: best viewing results on the pc for me with firefox and epubreader as plugin or with azardi, fbreader cannot do formulas, of course this does not remove the extra space ...

@Michal : for small problems that can be removed by hand in the epub file , are you generally interested in feedback, or only for more serious errors ?

From: schaecsn Sent: ‎Monday‎, ‎October‎ ‎7‎, ‎2013 ‎2‎:‎38‎ ‎PM To: michal-h21/tex4ebook

Hi there,

I try to simplify my latex document as much as possible to yield a beautiful look for both, latex (dvi) and ebook (epub). For viewing epubs, I use fbreader on a PC. I fail here:

Umlaute and special chars like "_" work in normal text, but not in {\tt ...} or {\em ...} etc. There is a space before the Umlaut. Try: {\tt L\"astern} and L\"astern.

Note, there is also no space after closing \tt or \em.

The generated html code explains these two (wrong!) behaviors: L ästernand Lästern.

Can this be changed or worked around?

The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided? Try this: \begin{verbatim} The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided?

The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided? \end{verbatim}

How can I change the div.verbatim in the .css file?

I use \coverimage{cover} as the first command to include a picture (cover.jpg or cover.png etc). http://validator.idpf.org/ complains that img tags (for cover.jpg or cover.png etc) is not valid. It's not easy to convert a full featured picture from .jpg/.png to .svg. How am I supposed to create a standard-conform title page?

Thanks for any help. Stefan

— Reply to this email directly or view it on GitHub.

michal-h21 commented 10 years ago

Hello, I will provide you more elaborate answer later, but please see updated tex4ebook repo. I finally split tex4ebook and make4ht, so you will need to use both packages. Instructions are in the README.md file.

I created simple filter for cleaning spurious span elements to make4ht distribution - https://github.com/michal-h21/make4ht/blob/master/filters/cleanspan.lua Now you should be able to fix your first problem with make4ht makefile, like:

yourfilename.mk4:

local cleanspan = require "cleanspan"

Make:htlatex()

Make:match("html$", cleanspan)

(you may need to add more Make:htlatex() to get correrct links, this is just to show you how it can work)

Please let me know if it works well for you.

I hope I will get to answer other questions later tonight

Regards, Michal

2013/10/7 gbarnich notifications@github.com

@Stephan : just a comment, not directly related though: best viewing results on the pc for me with firefox and epubreader as plugin or with azardi, fbreader cannot do formulas, of course this does not remove the extra space ...

@Michal : for small problems that can be removed by hand in the epub file , are you generally interested in feedback, or only for more serious errors ?

From: schaecsn Sent: Monday, October 7, 2013 2:38 PM To: michal-h21/tex4ebook

Hi there,

I try to simplify my latex document as much as possible to yield a beautiful look for both, latex (dvi) and ebook (epub). For viewing epubs, I use fbreader on a PC. I fail here:

Umlaute and special chars like "_" work in normal text, but not in {\tt ...} or {\em ...} etc. There is a space before the Umlaut. Try: {\tt L\"astern} and L\"astern.

Note, there is also no space after closing \tt or \em.

The generated html code explains these two (wrong!) behaviors: L ästernand Lästern.

Can this be changed or worked around?

The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided? Try this: \begin{verbatim} The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided?

The verbatim environment indents the text somewhat. Interestingly text wraps around making the output look ugly. Can the indentation be avoided? \end{verbatim}

How can I change the div.verbatim in the .css file?

I use \coverimage{cover} as the first command to include a picture (cover.jpg or cover.png etc). http://validator.idpf.org/ complains that img tags (for cover.jpg or cover.png etc) is not valid. It's not easy to convert a full featured picture from .jpg/.png to .svg. How am I supposed to create a standard-conform title page?

Thanks for any help. Stefan

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/michal-h21/tex4ebook/issues/8#issuecomment-25812289 .

schaecsn commented 10 years ago

Hi Michal,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

A very few times, I need control over the layout. Going over the .css I figured out that it's best to use \framebox to center a text :)

\framebox[\textwidth][c]{centered text}

I also needed to have verbatim text aligned to the left. The .css file was of no help and so I included everything in {\tt ...} and "escaped" what needed to be escaped.

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Hello bgarnich,

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

michal-h21 commented 10 years ago

Helo Stefan,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

regarding closing space, the generated code I see now is in the form:

Lästern and

so there is space at the end of span element. As this is controlled by tex4ht conversion programme, only possible solution for this I can see is to provide another filter, which will move space after the closing element. But I am not sure that this wouldn't cause more troubles than it solves.

You can configure css styles and configuration of various elements with custom config files. This is mechanism provided by tex4ht. See:

http://tug.org/applications/tex4ht/mn-commands.html#QQ1-9-41 http://tug.org/applications/tex4ht/mn11.html#QQ1-11-61

For example, to style verbatim environment, which produces <div class="verbatim" ...> element, you can use following config file:

\Preamble{xhtml}
\begin{document}
\Css{div.verbatim{color:red;}}
\EndPreamble

name it myconfig.cfg for example and use -c command line option for tex4ebook:

tex4ebook -c mychonfig.cfg inputfile.tex

There are many other commands you can use in config files, see

http://www.cvr.cc/?p=323 http://www.cvr.cc/?p=362

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Yes, system is now working that everything in the OEBPS directory is copied to the epub file and the epub file is not deleted. As epub is basically only zipped files, the deleted files remains there, so in the case of troubles, it is best to delete OEBPS dir an the epub file.

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

I would recommend Azardi or Readium (which is extension for Google Chrome). These have full support for CSS and epub3 (which is must if you use math, because in the case of mobi and normal epub, math is converted to images and looks really bad in the readers)

Regards, Michal

2013/10/9 schaecsn notifications@github.com:

Hi Michal,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

A very few times, I need control over the layout. Going over the .css I figured out that it's best to use \framebox to center a text :)

\framebox[\textwidth][c]{centered text}

I also needed to have verbatim text aligned to the left. The .css file was of no help and so I included everything in {\tt ...} and "escaped" what needed to be escaped.

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Hello bgarnich,

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

— Reply to this email directly or view it on GitHub.

michal-h21 commented 10 years ago

And regarding centering text, you may use

\begin{center} .... \end{center}

2013/10/9 Michal Hoftich michal.h21@gmail.com:

Helo Stefan,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

regarding closing space, the generated code I see now is in the form:

Lästern and

so there is space at the end of span element. As this is controlled by tex4ht conversion programme, only possible solution for this I can see is to provide another filter, which will move space after the closing element. But I am not sure that this wouldn't cause more troubles than it solves.

You can configure css styles and configuration of various elements with custom config files. This is mechanism provided by tex4ht. See:

http://tug.org/applications/tex4ht/mn-commands.html#QQ1-9-41 http://tug.org/applications/tex4ht/mn11.html#QQ1-11-61

For example, to style verbatim environment, which produces <div class="verbatim" ...> element, you can use following config file:

\Preamble{xhtml}
\begin{document}
\Css{div.verbatim{color:red;}}
\EndPreamble

name it myconfig.cfg for example and use -c command line option for tex4ebook:

tex4ebook -c mychonfig.cfg inputfile.tex

There are many other commands you can use in config files, see

http://www.cvr.cc/?p=323 http://www.cvr.cc/?p=362

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Yes, system is now working that everything in the OEBPS directory is copied to the epub file and the epub file is not deleted. As epub is basically only zipped files, the deleted files remains there, so in the case of troubles, it is best to delete OEBPS dir an the epub file.

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

I would recommend Azardi or Readium (which is extension for Google Chrome). These have full support for CSS and epub3 (which is must if you use math, because in the case of mobi and normal epub, math is converted to images and looks really bad in the readers)

Regards, Michal

2013/10/9 schaecsn notifications@github.com:

Hi Michal,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

A very few times, I need control over the layout. Going over the .css I figured out that it's best to use \framebox to center a text :)

\framebox[\textwidth][c]{centered text}

I also needed to have verbatim text aligned to the left. The .css file was of no help and so I included everything in {\tt ...} and "escaped" what needed to be escaped.

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Hello bgarnich,

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

— Reply to this email directly or view it on GitHub.

michal-h21 commented 10 years ago

Hello Glenn,

for small problems that can be removed by hand in the epub file , are you generally interested in feedback, or only for more serious errors ?

I am interested in all problems, editing by hand is too much inelegant, it must be possible to solve all problems (at least I hope :)

Regards, Michal

2013/10/9 Michal Hoftich michal.h21@gmail.com:

And regarding centering text, you may use

\begin{center} .... \end{center}

2013/10/9 Michal Hoftich michal.h21@gmail.com:

Helo Stefan,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

regarding closing space, the generated code I see now is in the form:

Lästern and

so there is space at the end of span element. As this is controlled by tex4ht conversion programme, only possible solution for this I can see is to provide another filter, which will move space after the closing element. But I am not sure that this wouldn't cause more troubles than it solves.

You can configure css styles and configuration of various elements with custom config files. This is mechanism provided by tex4ht. See:

http://tug.org/applications/tex4ht/mn-commands.html#QQ1-9-41 http://tug.org/applications/tex4ht/mn11.html#QQ1-11-61

For example, to style verbatim environment, which produces <div class="verbatim" ...> element, you can use following config file:

\Preamble{xhtml}
\begin{document}
\Css{div.verbatim{color:red;}}
\EndPreamble

name it myconfig.cfg for example and use -c command line option for tex4ebook:

tex4ebook -c mychonfig.cfg inputfile.tex

There are many other commands you can use in config files, see

http://www.cvr.cc/?p=323 http://www.cvr.cc/?p=362

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Yes, system is now working that everything in the OEBPS directory is copied to the epub file and the epub file is not deleted. As epub is basically only zipped files, the deleted files remains there, so in the case of troubles, it is best to delete OEBPS dir an the epub file.

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

I would recommend Azardi or Readium (which is extension for Google Chrome). These have full support for CSS and epub3 (which is must if you use math, because in the case of mobi and normal epub, math is converted to images and looks really bad in the readers)

Regards, Michal

2013/10/9 schaecsn notifications@github.com:

Hi Michal,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

A very few times, I need control over the layout. Going over the .css I figured out that it's best to use \framebox to center a text :)

\framebox[\textwidth][c]{centered text}

I also needed to have verbatim text aligned to the left. The .css file was of no help and so I included everything in {\tt ...} and "escaped" what needed to be escaped.

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Hello bgarnich,

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

— Reply to this email directly or view it on GitHub.

gbarnich commented 10 years ago

Hi Michal,

Great, you really are motivated ...

Here you go then:

(i) section and subsection titles are very small, not clear to me why, see for instance the last 2 epub3 files here http://homepages.ulb.ac.be/~gbarnich/preprints.html (btw, the html mathjax version is produced by the script from here http://www.albany.edu/~hammond/demos/Html5/arXiv/ to which you also contributed ...:)

(ii) a citation command in a footnote always seems to produce an error, can provide examples if needed

(iii) I have run several times in the error below, it is not clear to me why,

source file https://dl.dropboxusercontent.com/u/35238591/asyeym.tex and result https://dl.dropboxusercontent.com/u/35238591/asyeym.epub

tidy error:

Parse LG Tidy: asyeym.html Copy: cp asyeym.html OEBPS Copy: cp asyeym.css OEBPS Mimetype for tmp is not registered Tidy: asyeymse1.html Copy: cp asyeymse1.html OEBPS Tidy: asyeymse2.html line 591 column 8 - Error: unexpected in line 592 column 43 - Error: unexpected

in line 873 column 1 - Error: unexpected in line 874 column 1 - Error: unexpected in Copy: cp asyeymse2.html OEBPS Tidy: asyeymse3.html Copy: cp asyeymse3.html OEBPS Tidy: asyeymse4.html Copy: cp asyeymse4.html OEBPS Tidy: asyeymse5.html Copy: cp asyeymse5.html OEBPS Tidy: asyeymse6.html Copy: cp asyeymse6.html OEBPS Copy: cp asyeym.ncx OEBPS Mimetype for opf is not registered Mimetype for opf is not registered Copy: cp content.opf OEBPS Tidy ncx 0 Tidy opf 0 Pack mimetype 0 Pack metadir 0 Pack outputdir 0 MBP-5:asyeym gbarnich$

Thanks for your help! Glenn

On 9 Oct 2013, at 14:53, Michal Hoftich wrote:

Hello Glenn,

for small problems that can be removed by hand in the epub file , are you generally interested in feedback, or only for more serious errors ?

I am interested in all problems, editing by hand is too much inelegant, it must be possible to solve all problems (at least I hope :)

Regards, Michal

2013/10/9 Michal Hoftich michal.h21@gmail.com:

And regarding centering text, you may use

\begin{center} .... \end{center}

2013/10/9 Michal Hoftich michal.h21@gmail.com:

Helo Stefan,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

regarding closing space, the generated code I see now is in the form:

Lästern and

so there is space at the end of span element. As this is controlled by tex4ht conversion programme, only possible solution for this I can see is to provide another filter, which will move space after the closing element. But I am not sure that this wouldn't cause more troubles than it solves.

You can configure css styles and configuration of various elements with custom config files. This is mechanism provided by tex4ht. See:

http://tug.org/applications/tex4ht/mn-commands.html#QQ1-9-41 http://tug.org/applications/tex4ht/mn11.html#QQ1-11-61

For example, to style verbatim environment, which produces <div class="verbatim" ...> element, you can use following config file:

\Preamble{xhtml} \begin{document} \Css{div.verbatim{color:red;}} \EndPreamble

name it myconfig.cfg for example and use -c command line option for tex4ebook:

tex4ebook -c mychonfig.cfg inputfile.tex

There are many other commands you can use in config files, see

http://www.cvr.cc/?p=323 http://www.cvr.cc/?p=362

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Yes, system is now working that everything in the OEBPS directory is copied to the epub file and the epub file is not deleted. As epub is basically only zipped files, the deleted files remains there, so in the case of troubles, it is best to delete OEBPS dir an the epub file.

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

I would recommend Azardi or Readium (which is extension for Google Chrome). These have full support for CSS and epub3 (which is must if you use math, because in the case of mobi and normal epub, math is converted to images and looks really bad in the readers)

Regards, Michal

2013/10/9 schaecsn notifications@github.com:

Hi Michal,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

A very few times, I need control over the layout. Going over the .css I figured out that it's best to use \framebox to center a text :)

\framebox[\textwidth][c]{centered text}

I also needed to have verbatim text aligned to the left. The .css file was of no help and so I included everything in {\tt ...} and "escaped" what needed to be escaped.

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Hello bgarnich,

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

michal-h21 commented 10 years ago

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

(ii) some example would be nice :)

(iii) in this case, this error was caused with:

$(\xi,\epsilon$)

when corrected to

$(\xi,\epsilon)$

the validation pass.

There were more problems with your file:

  1. newline in \title

    you used \title{main :\ subtitle} this causes problems with metadata xml files, because \\ generates html tags, which are not valid there. I don't know if it is possible to get contents of \title command and strip all LaTeX commands inside, so for this moment, it is best to avoid any formatting commands in the \title

  2. there was missing } in last bibitem

After correcting these issues, your file run validation without errors.

Best regards, Michal

2013/10/10 gbarnich notifications@github.com

Hi Michal,

Great, you really are motivated ...

Here you go then:

(i) section and subsection titles are very small, not clear to me why, see for instance the last 2 epub3 files here http://homepages.ulb.ac.be/~gbarnich/preprints.html (btw, the html mathjax version is produced by the script from here http://www.albany.edu/~hammond/demos/Html5/arXiv/ to which you also contributed ...:)

(ii) a citation command in a footnote always seems to produce an error, can provide examples if needed

(iii) I have run several times in the error below, it is not clear to me why,

source file https://dl.dropboxusercontent.com/u/35238591/asyeym.tex and result https://dl.dropboxusercontent.com/u/35238591/asyeym.epub

tidy error:

Parse LG Tidy: asyeym.html Copy: cp asyeym.html OEBPS Copy: cp asyeym.css OEBPS Mimetype for tmp is not registered Tidy: asyeymse1.html Copy: cp asyeymse1.html OEBPS Tidy: asyeymse2.html line 591 column 8 - Error: unexpected in line 592 column 43 - Error: unexpected

in line 873 column 1 - Error: unexpected in line 874 column 1 - Error: unexpected in Copy: cp asyeymse2.html OEBPS Tidy: asyeymse3.html Copy: cp asyeymse3.html OEBPS Tidy: asyeymse4.html Copy: cp asyeymse4.html OEBPS Tidy: asyeymse5.html Copy: cp asyeymse5.html OEBPS Tidy: asyeymse6.html Copy: cp asyeymse6.html OEBPS Copy: cp asyeym.ncx OEBPS Mimetype for opf is not registered Mimetype for opf is not registered Copy: cp content.opf OEBPS Tidy ncx 0 Tidy opf 0 Pack mimetype 0 Pack metadir 0 Pack outputdir 0 MBP-5:asyeym gbarnich$

Thanks for your help! Glenn

On 9 Oct 2013, at 14:53, Michal Hoftich wrote:

Hello Glenn,

for small problems that can be removed by hand in the epub file , are you generally interested in feedback, or only for more serious errors ?

I am interested in all problems, editing by hand is too much inelegant, it must be possible to solve all problems (at least I hope :)

Regards, Michal

2013/10/9 Michal Hoftich michal.h21@gmail.com:

And regarding centering text, you may use

\begin{center} .... \end{center}

2013/10/9 Michal Hoftich michal.h21@gmail.com:

Helo Stefan,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

regarding closing space, the generated code I see now is in the form:

Lästern and

so there is space at the end of span element. As this is controlled by tex4ht conversion programme, only possible solution for this I can see is to provide another filter, which will move space after the closing element. But I am not sure that this wouldn't cause more troubles than it solves.

You can configure css styles and configuration of various elements with custom config files. This is mechanism provided by tex4ht. See:

http://tug.org/applications/tex4ht/mn-commands.html#QQ1-9-41 http://tug.org/applications/tex4ht/mn11.html#QQ1-11-61

For example, to style verbatim environment, which produces <div class="verbatim" ...> element, you can use following config file:

\Preamble{xhtml} \begin{document} \Css{div.verbatim{color:red;}} \EndPreamble

name it myconfig.cfg for example and use -c command line option for tex4ebook:

tex4ebook -c mychonfig.cfg inputfile.tex

There are many other commands you can use in config files, see

http://www.cvr.cc/?p=323 http://www.cvr.cc/?p=362

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Yes, system is now working that everything in the OEBPS directory is copied to the epub file and the epub file is not deleted. As epub is basically only zipped files, the deleted files remains there, so in the case of troubles, it is best to delete OEBPS dir an the epub file.

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

I would recommend Azardi or Readium (which is extension for Google Chrome). These have full support for CSS and epub3 (which is must if you use math, because in the case of mobi and normal epub, math is converted to images and looks really bad in the readers)

Regards, Michal

2013/10/9 schaecsn notifications@github.com:

Hi Michal,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

A very few times, I need control over the layout. Going over the .css I figured out that it's best to use \framebox to center a text :)

\framebox[\textwidth][c]{centered text}

I also needed to have verbatim text aligned to the left. The .css file was of no help and so I included everything in {\tt ...} and "escaped" what needed to be escaped.

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Hello bgarnich,

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/michal-h21/tex4ebook/issues/8#issuecomment-26028030 .

michal-h21 commented 10 years ago

I modified the filter interface, now it is possible to construct filter chains. Please pull changes from make4ht repo.

Sample .mk4 file utilising this interface:

local filter = require "make4ht-filter" local jj = filter({"cleanspan",function(s) return s:gsub("a","z") end}) Make:htlatex() Make:match("html$",jj)

Parameters to filter function can be string, function, or array of strings and functions. Strings must point to modules in filter directory, right now, there is only "cleanspan" module. Sample function replaces all letters "a" to "z".

Michal

2013/10/10 Michal Hoftich michal.h21@gmail.com

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

(ii) some example would be nice :)

(iii) in this case, this error was caused with:

$(\xi,\epsilon$)

when corrected to

$(\xi,\epsilon)$

the validation pass.

There were more problems with your file:

  1. newline in \title

    you used \title{main :\ subtitle} this causes problems with metadata xml files, because \\ generates html tags, which are not valid there. I don't know if it is possible to get contents of \title command and strip all LaTeX commands inside, so for this moment, it is best to avoid any formatting commands in the \title

  2. there was missing } in last bibitem

After correcting these issues, your file run validation without errors.

Best regards, Michal

2013/10/10 gbarnich notifications@github.com

Hi Michal,

Great, you really are motivated ...

Here you go then:

(i) section and subsection titles are very small, not clear to me why, see for instance the last 2 epub3 files here http://homepages.ulb.ac.be/~gbarnich/preprints.html (btw, the html mathjax version is produced by the script from here http://www.albany.edu/~hammond/demos/Html5/arXiv/ to which you also contributed ...:)

(ii) a citation command in a footnote always seems to produce an error, can provide examples if needed

(iii) I have run several times in the error below, it is not clear to me why,

source file https://dl.dropboxusercontent.com/u/35238591/asyeym.tex and result https://dl.dropboxusercontent.com/u/35238591/asyeym.epub

tidy error:

Parse LG Tidy: asyeym.html Copy: cp asyeym.html OEBPS Copy: cp asyeym.css OEBPS Mimetype for tmp is not registered Tidy: asyeymse1.html Copy: cp asyeymse1.html OEBPS Tidy: asyeymse2.html line 591 column 8 - Error: unexpected in line 592 column 43 - Error: unexpected

in line 873 column 1 - Error: unexpected in line 874 column 1 - Error: unexpected in Copy: cp asyeymse2.html OEBPS Tidy: asyeymse3.html Copy: cp asyeymse3.html OEBPS Tidy: asyeymse4.html Copy: cp asyeymse4.html OEBPS Tidy: asyeymse5.html Copy: cp asyeymse5.html OEBPS Tidy: asyeymse6.html Copy: cp asyeymse6.html OEBPS Copy: cp asyeym.ncx OEBPS Mimetype for opf is not registered Mimetype for opf is not registered Copy: cp content.opf OEBPS Tidy ncx 0 Tidy opf 0 Pack mimetype 0 Pack metadir 0 Pack outputdir 0 MBP-5:asyeym gbarnich$

Thanks for your help! Glenn

On 9 Oct 2013, at 14:53, Michal Hoftich wrote:

Hello Glenn,

for small problems that can be removed by hand in the epub file , are you generally interested in feedback, or only for more serious errors ?

I am interested in all problems, editing by hand is too much inelegant, it must be possible to solve all problems (at least I hope :)

Regards, Michal

2013/10/9 Michal Hoftich michal.h21@gmail.com:

And regarding centering text, you may use

\begin{center} .... \end{center}

2013/10/9 Michal Hoftich michal.h21@gmail.com:

Helo Stefan,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

regarding closing space, the generated code I see now is in the form:

Lästern and

so there is space at the end of span element. As this is controlled by tex4ht conversion programme, only possible solution for this I can see is to provide another filter, which will move space after the closing element. But I am not sure that this wouldn't cause more troubles than it solves.

You can configure css styles and configuration of various elements with custom config files. This is mechanism provided by tex4ht. See:

http://tug.org/applications/tex4ht/mn-commands.html#QQ1-9-41 http://tug.org/applications/tex4ht/mn11.html#QQ1-11-61

For example, to style verbatim environment, which produces <div class="verbatim" ...> element, you can use following config file:

\Preamble{xhtml} \begin{document} \Css{div.verbatim{color:red;}} \EndPreamble

name it myconfig.cfg for example and use -c command line option for tex4ebook:

tex4ebook -c mychonfig.cfg inputfile.tex

There are many other commands you can use in config files, see

http://www.cvr.cc/?p=323 http://www.cvr.cc/?p=362

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Yes, system is now working that everything in the OEBPS directory is copied to the epub file and the epub file is not deleted. As epub is basically only zipped files, the deleted files remains there, so in the case of troubles, it is best to delete OEBPS dir an the epub file.

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

I would recommend Azardi or Readium (which is extension for Google Chrome). These have full support for CSS and epub3 (which is must if you use math, because in the case of mobi and normal epub, math is converted to images and looks really bad in the readers)

Regards, Michal

2013/10/9 schaecsn notifications@github.com:

Hi Michal,

I installed the new version. The posted filter solves the Umlaut Problem. Thanks a lot for looking into this. There is still no space after closing \tt, \em etc.

A very few times, I need control over the layout. Going over the .css I figured out that it's best to use \framebox to center a text :)

\framebox[\textwidth][c]{centered text}

I also needed to have verbatim text aligned to the left. The .css file was of no help and so I included everything in {\tt ...} and "escaped" what needed to be escaped.

About the cover image issue: The problem is gone after removing the generated ebook and scratch files. New runs of tex4ebook generate now standard conform epubs. I was heavily changing the structure of my latex source files over and over. Guess something went wrong. Nevermind :).

Hello bgarnich,

I use fbreader as it has the least number of dependencies (on Debian). For the time being, it has everything I want. Perhaps later I look for alternatives.

— Reply to this email directly or view it on GitHub. — Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/michal-h21/tex4ebook/issues/8#issuecomment-26028030 .

gbarnich commented 10 years ago

Hi Michal,

Great, it now works, thanks !

G

More comments below

On 10 Oct 2013, at 13:41, Michal Hoftich wrote:

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

no, I use tex4ebook -c hej -t -f epub3 asyeym.tex ... but myabe I am missing some fonts ? (will look into that ...)

parts of the output on my system:

(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/auxhook.sty

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)

LaTeX Font Warning: Font shape U/stmry/b/n' undefined (Font) usingU/stmry/m/n' instead on input line 1375.

[57] [58] [59] [60](./asyeym.4ct [61]) [62] 63

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

) Output written on asyeym.dvi (320 pages, 340084 bytes).

) Searching lm-rep-cmrm.htf' forcmr6.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

Searching lm-rep-cmrm.htf' forcmr8.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/times/ptmr7t.htf) Searching pplri9t.htf' forptmr7t.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/adobe/palatino/pplri9t.htf) (/usr/local/texlive/2012/texmf-dist/fonts/tfm/public/cm/cmr12.tfm) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf) Searching lm-rep-cmrm.htf' forcmr12.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

(ii) some example would be nice :)

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

michal-h21 commented 10 years ago

Hi Glenn,

I still have no success with getting small sections, maybe try to add something like

\Css{h3.sectionHead{font-size:1.5em}}

to your custom config file and play with font-size value.

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

Here I have better success, problem was caused with local redefinition of link command, try to adapt your custom config file:

\Preamble{...} .... \newbox\footnotebox \LinkCommand\fnlink{aside,href,id,class="footnote" epub:type="footnote"} \Configure{footnotemark}{\NoFonts\Link[ epub:type="noteref"]{fn\FNnum x\minipageNum}{}}{\EndLink\EndNoFonts} \Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts% \ifvoid\footnotebox\Tg


\else\unvbox\footnotebox\fi% \IgnorePar% \bgroup% \fnlink{}{fn\FNnum x\minipageNum}\NoFonts\Tg

% }{\EndNoFonts} {% \HCode{

\Hnewline} \Endfnlink\egroup\egroup}%

\def\printfn{% \ifvoid\footnotebox\else% \HCode{<section epub:type="footnotes" class="footnotes">\Hnewline}\box\footnotebox\HCode{\Hnewline}% \fi% }

\Configure{HtmlPar} {\EndP\Tg

} {\EndP\Tg

} {\HCode{

\Hnewline}\printfn} {\HCode{

\Hnewline}\printfn}

\Css{.footnote{font-size:small;}}
\Css{.footnotes hr{width:30\%;margin:0 auto 0 0;}}

... \begin{document} ... \EndPreamble

This version should not break links and if it works correctly, I will add it to tex4ebook.4ht for epub3 documents.

Regards, Michal

2013/10/11 gbarnich notifications@github.com

Hi Michal,

Great, it now works, thanks !

G

More comments below

On 10 Oct 2013, at 13:41, Michal Hoftich wrote:

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

no, I use tex4ebook -c hej -t -f epub3 asyeym.tex ... but myabe I am missing some fonts ? (will look into that ...)

parts of the output on my system:

(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/auxhook.sty

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)

LaTeX Font Warning: Font shape U/stmry/b/n' undefined (Font) usingU/stmry/m/n' instead on input line 1375.

[57] [58] [59] [60](./asyeym.4ct [61]) [62] 63

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

) Output written on asyeym.dvi (320 pages, 340084 bytes).

) Searching lm-rep-cmrm.htf' forcmr6.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

Searching lm-rep-cmrm.htf' forcmr8.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/times/ptmr7t.htf) Searching pplri9t.htf' forptmr7t.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/adobe/palatino/pplri9t.htf) (/usr/local/texlive/2012/texmf-dist/fonts/tfm/public/cm/cmr12.tfm) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf) Searching lm-rep-cmrm.htf' forcmr12.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

(ii) some example would be nice :)

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

gbarnich commented 10 years ago

Hi Michal,

I will try this and the filters for the ligatures on a new file very soon, hopefully tonight. If the footnote issue is fixed, it means that I almost do not have to edit the source file any longer. For the moment, the only thing that I still have to do by hand is to remove the colons in all cite and bibitem commands. This is slightly painful because all bibtex entries provided by Inspire Hep have a format that involves colons. Any chance removing colons in \cite and \bibitem commands can be automated through a filter or the custom file ? If not, no problem, removing a couple of colons is a small price to pay ...

Best, Glenn

On 15 Oct 2013, at 17:26, Michal Hoftich wrote:

Hi Glenn,

I still have no success with getting small sections, maybe try to add something like

\Css{h3.sectionHead{font-size:1.5em}}

to your custom config file and play with font-size value.

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

Here I have better success, problem was caused with local redefinition of link command, try to adapt your custom config file:

\Preamble{...} .... \newbox\footnotebox \LinkCommand\fnlink{aside,href,id,class="footnote" epub:type="footnote"} \Configure{footnotemark}{\NoFonts\Link[ epub:type="noteref"]{fn\FNnum x\minipageNum}{}}{\EndLink\EndNoFonts} \Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts% \ifvoid\footnotebox\Tg


\else\unvbox\footnotebox\fi% \IgnorePar% \bgroup% \fnlink{}{fn\FNnum x\minipageNum}\NoFonts\Tg

% }{\EndNoFonts} {% \HCode{

\Hnewline} \Endfnlink\egroup\egroup}%

\def\printfn{% \ifvoid\footnotebox\else% \HCode{<section epub:type="footnotes" class="footnotes">\Hnewline}\box\footnotebox\HCode{\Hnewline}% \fi% }

\Configure{HtmlPar} {\EndP\Tg

} {\EndP\Tg

} {\HCode{

\Hnewline}\printfn} {\HCode{

\Hnewline}\printfn}

\Css{.footnote{font-size:small;}} \Css{.footnotes hr{width:30\%;margin:0 auto 0 0;}} ... \begin{document} ... \EndPreamble

This version should not break links and if it works correctly, I will add it to tex4ebook.4ht for epub3 documents.

Regards, Michal

2013/10/11 gbarnich notifications@github.com

Hi Michal,

Great, it now works, thanks !

G

More comments below

On 10 Oct 2013, at 13:41, Michal Hoftich wrote:

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

no, I use tex4ebook -c hej -t -f epub3 asyeym.tex ... but myabe I am missing some fonts ? (will look into that ...)

parts of the output on my system:

(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/auxhook.sty

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)

LaTeX Font Warning: Font shape U/stmry/b/n' undefined (Font) usingU/stmry/m/n' instead on input line 1375.

[57] [58] [59] [60](./asyeym.4ct [61]) [62] 63

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

) Output written on asyeym.dvi (320 pages, 340084 bytes).

) Searching lm-rep-cmrm.htf' forcmr6.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

Searching lm-rep-cmrm.htf' forcmr8.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/times/ptmr7t.htf) Searching pplri9t.htf' forptmr7t.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/adobe/palatino/pplri9t.htf) (/usr/local/texlive/2012/texmf-dist/fonts/tfm/public/cm/cmr12.tfm) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf) Searching lm-rep-cmrm.htf' forcmr12.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

(ii) some example would be nice :)

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

michal-h21 commented 10 years ago

Hi Glenn,

yes it is possible to solve colons issue with filters. Try this:

local filter = require "make4ht-filter" local colonid = function(s) local colonreplace = "" -- string which will replace colon local id_match = "([^:]-):" local attr_match = function(c,attr, hash) local hash = hash or "" return c:gsub(attr..'="([^"]-)"', function(x) return attr..'="'..x:gsub(hash..id_match, hash.."%1"..colon_replace)..'"' end) end s = attr_match(s,"id","") return attr_match(s,"href",'#') end local process = filter{"cleanspan", "fixligatures", "hruletohr", colonid} Make:htlatex() Make:htlatex() Make:match("html$",process)

I hope this will solve all remaining issues.

Best, Michal

2013/10/15 gbarnich notifications@github.com

Hi Michal,

I will try this and the filters for the ligatures on a new file very soon, hopefully tonight. If the footnote issue is fixed, it means that I almost do not have to edit the source file any longer. For the moment, the only thing that I still have to do by hand is to remove the colons in all cite and bibitem commands. This is slightly painful because all bibtex entries provided by Inspire Hep have a format that involves colons. Any chance removing colons in \cite and \bibitem commands can be automated through a filter or the custom file ? If not, no problem, removing a couple of colons is a small price to pay ...

Best, Glenn

On 15 Oct 2013, at 17:26, Michal Hoftich wrote:

Hi Glenn,

I still have no success with getting small sections, maybe try to add something like

\Css{h3.sectionHead{font-size:1.5em}}

to your custom config file and play with font-size value.

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

Here I have better success, problem was caused with local redefinition of link command, try to adapt your custom config file:

\Preamble{...} .... \newbox\footnotebox \LinkCommand\fnlink{aside,href,id,class="footnote" epub:type="footnote"} \Configure{footnotemark}{\NoFonts\Link[ epub:type="noteref"]{fn\FNnum x\minipageNum}{}}{\EndLink\EndNoFonts}

\Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts% \ifvoid\footnotebox\Tg


\else\unvbox\footnotebox\fi% \IgnorePar% \bgroup% \fnlink{}{fn\FNnum x\minipageNum}\NoFonts\Tg

% }{\EndNoFonts} {% \HCode{

\Hnewline} \Endfnlink\egroup\egroup}%

\def\printfn{% \ifvoid\footnotebox\else% \HCode{<section epub:type="footnotes" class="footnotes">\Hnewline}\box\footnotebox\HCode{\Hnewline}% \fi% }

\Configure{HtmlPar} {\EndP\Tg

} {\EndP\Tg

} {\HCode{

\Hnewline}\printfn} {\HCode{

\Hnewline}\printfn}

\Css{.footnote{font-size:small;}} \Css{.footnotes hr{width:30\%;margin:0 auto 0 0;}} ... \begin{document} ... \EndPreamble

This version should not break links and if it works correctly, I will add it to tex4ebook.4ht for epub3 documents.

Regards, Michal

2013/10/11 gbarnich notifications@github.com

Hi Michal,

Great, it now works, thanks !

G

More comments below

On 10 Oct 2013, at 13:41, Michal Hoftich wrote:

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

no, I use tex4ebook -c hej -t -f epub3 asyeym.tex ... but myabe I am missing some fonts ? (will look into that ...)

parts of the output on my system:

(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/auxhook.sty

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)

LaTeX Font Warning: Font shape U/stmry/b/n' undefined (Font) usingU/stmry/m/n' instead on input line 1375.

[57] [58] [59] [60](./asyeym.4ct [61]) [62] 63

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

) Output written on asyeym.dvi (320 pages, 340084 bytes).

) Searching lm-rep-cmrm.htf' forcmr6.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

Searching lm-rep-cmrm.htf' forcmr8.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/times/ptmr7t.htf) Searching pplri9t.htf' forptmr7t.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/adobe/palatino/pplri9t.htf)

(/usr/local/texlive/2012/texmf-dist/fonts/tfm/public/cm/cmr12.tfm)

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf)

Searching lm-rep-cmrm.htf' forcmr12.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

(ii) some example would be nice :)

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

— Reply to this email directly or view it on GitHubhttps://github.com/michal-h21/tex4ebook/issues/8#issuecomment-26346925 .

schaecsn commented 10 years ago

For centering text, I claimed that I need

\framebox[\textwidth][c]{centered text}

Michal, you told me that this is enough

\begin{center}
text
\end{center}

I just observed, that I need the framebox for centering text for FBreader and the center environment for Azardi. It does not even look good vice versa.

Is that command that ebooks display so differently on different readers?

michal-h21 commented 10 years ago

Hi,

\framebox... produces this html:

and css: .framebox-c {text-align:center;} and `\begin{center}`

... css: div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;} So there should be no difference in formatting, `\begin{center}` only produces semantically better output. Maybe try to add \Css{.center p{text-align:center;}} to your custom config file to see if it helps with fbreader. > Is that command that ebooks display so differently on different readers? Different readers display really many things differently, which is surprising, because almost all of them are based on same technologies (web browser engine + some user interface). Maybe sometimes in the future rendering uniformity and standard support will be better. Michal 2013/10/16 schaecsn notifications@github.com: > For centering text, I claimed that I need > > \framebox[\textwidth][c]{centered text} > > Michal, you told me that this is enough > > \begin{center} > text > \end{center} > > I just observed, that I need the framebox for centering text for FBreader > and the center environment for Azardi. It does not even look good vice > versa. > > Is that command that ebooks display so differently on different readers? > > — > Reply to this email directly or view it on GitHub.

gbarnich commented 10 years ago

Hi Michal,

The fix below for the footnote citations in the config file works perfectly for me. Please do add it to tex4ebook.4ht for epub3 documents.

Best Glenn

On 15 Oct 2013, at 17:26, Michal Hoftich wrote:

Hi Glenn,

I still have no success with getting small sections, maybe try to add something like

\Css{h3.sectionHead{font-size:1.5em}}

to your custom config file and play with font-size value.

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

Here I have better success, problem was caused with local redefinition of link command, try to adapt your custom config file:

\Preamble{...} .... \newbox\footnotebox \LinkCommand\fnlink{aside,href,id,class="footnote" epub:type="footnote"} \Configure{footnotemark}{\NoFonts\Link[ epub:type="noteref"]{fn\FNnum x\minipageNum}{}}{\EndLink\EndNoFonts} \Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts% \ifvoid\footnotebox\Tg


\else\unvbox\footnotebox\fi% \IgnorePar% \bgroup% \fnlink{}{fn\FNnum x\minipageNum}\NoFonts\Tg

% }{\EndNoFonts} {% \HCode{

\Hnewline} \Endfnlink\egroup\egroup}%

\def\printfn{% \ifvoid\footnotebox\else% \HCode{<section epub:type="footnotes" class="footnotes">\Hnewline}\box\footnotebox\HCode{\Hnewline}% \fi% }

\Configure{HtmlPar} {\EndP\Tg

} {\EndP\Tg

} {\HCode{

\Hnewline}\printfn} {\HCode{

\Hnewline}\printfn}

\Css{.footnote{font-size:small;}} \Css{.footnotes hr{width:30\%;margin:0 auto 0 0;}} ... \begin{document} ... \EndPreamble

This version should not break links and if it works correctly, I will add it to tex4ebook.4ht for epub3 documents.

Regards, Michal

2013/10/11 gbarnich notifications@github.com

Hi Michal,

Great, it now works, thanks !

G

More comments below

On 10 Oct 2013, at 13:41, Michal Hoftich wrote:

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

no, I use tex4ebook -c hej -t -f epub3 asyeym.tex ... but myabe I am missing some fonts ? (will look into that ...)

parts of the output on my system:

(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/auxhook.sty

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)

LaTeX Font Warning: Font shape U/stmry/b/n' undefined (Font) usingU/stmry/m/n' instead on input line 1375.

[57] [58] [59] [60](./asyeym.4ct [61]) [62] 63

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

) Output written on asyeym.dvi (320 pages, 340084 bytes).

) Searching lm-rep-cmrm.htf' forcmr6.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

Searching lm-rep-cmrm.htf' forcmr8.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/times/ptmr7t.htf) Searching pplri9t.htf' forptmr7t.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/adobe/palatino/pplri9t.htf) (/usr/local/texlive/2012/texmf-dist/fonts/tfm/public/cm/cmr12.tfm) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf) Searching lm-rep-cmrm.htf' forcmr12.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

(ii) some example would be nice :)

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

gbarnich commented 10 years ago

Hi Michal,

this indeed solves colon issues !

G On 15 Oct 2013, at 21:16, Michal Hoftich wrote:

Hi Glenn,

yes it is possible to solve colons issue with filters. Try this:

local filter = require "make4ht-filter" local colonid = function(s) local colonreplace = "" -- string which will replace colon local id_match = "([^:]-):" local attr_match = function(c,attr, hash) local hash = hash or "" return c:gsub(attr..'="([^"]-)"', function(x) return attr..'="'..x:gsub(hash..id_match, hash.."%1"..colon_replace)..'"' end) end s = attr_match(s,"id","") return attr_match(s,"href",'#') end local process = filter{"cleanspan", "fixligatures", "hruletohr", colonid} Make:htlatex() Make:htlatex() Make:match("html$",process)

I hope this will solve all remaining issues.

Best, Michal

2013/10/15 gbarnich notifications@github.com

Hi Michal,

I will try this and the filters for the ligatures on a new file very soon, hopefully tonight. If the footnote issue is fixed, it means that I almost do not have to edit the source file any longer. For the moment, the only thing that I still have to do by hand is to remove the colons in all cite and bibitem commands. This is slightly painful because all bibtex entries provided by Inspire Hep have a format that involves colons. Any chance removing colons in \cite and \bibitem commands can be automated through a filter or the custom file ? If not, no problem, removing a couple of colons is a small price to pay ...

Best, Glenn

On 15 Oct 2013, at 17:26, Michal Hoftich wrote:

Hi Glenn,

I still have no success with getting small sections, maybe try to add something like

\Css{h3.sectionHead{font-size:1.5em}}

to your custom config file and play with font-size value.

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

Here I have better success, problem was caused with local redefinition of link command, try to adapt your custom config file:

\Preamble{...} .... \newbox\footnotebox \LinkCommand\fnlink{aside,href,id,class="footnote" epub:type="footnote"} \Configure{footnotemark}{\NoFonts\Link[ epub:type="noteref"]{fn\FNnum x\minipageNum}{}}{\EndLink\EndNoFonts}

\Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts% \ifvoid\footnotebox\Tg


\else\unvbox\footnotebox\fi% \IgnorePar% \bgroup% \fnlink{}{fn\FNnum x\minipageNum}\NoFonts\Tg

% }{\EndNoFonts} {% \HCode{

\Hnewline} \Endfnlink\egroup\egroup}%

\def\printfn{% \ifvoid\footnotebox\else% \HCode{<section epub:type="footnotes" class="footnotes">\Hnewline}\box\footnotebox\HCode{\Hnewline}% \fi% }

\Configure{HtmlPar} {\EndP\Tg

} {\EndP\Tg

} {\HCode{

\Hnewline}\printfn} {\HCode{

\Hnewline}\printfn}

\Css{.footnote{font-size:small;}} \Css{.footnotes hr{width:30\%;margin:0 auto 0 0;}} ... \begin{document} ... \EndPreamble

This version should not break links and if it works correctly, I will add it to tex4ebook.4ht for epub3 documents.

Regards, Michal

2013/10/11 gbarnich notifications@github.com

Hi Michal,

Great, it now works, thanks !

G

More comments below

On 10 Oct 2013, at 13:41, Michal Hoftich wrote:

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

no, I use tex4ebook -c hej -t -f epub3 asyeym.tex ... but myabe I am missing some fonts ? (will look into that ...)

parts of the output on my system:

(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/auxhook.sty

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)

LaTeX Font Warning: Font shape U/stmry/b/n' undefined (Font) usingU/stmry/m/n' instead on input line 1375.

[57] [58] [59] [60](./asyeym.4ct [61]) [62] 63

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

) Output written on asyeym.dvi (320 pages, 340084 bytes).

) Searching lm-rep-cmrm.htf' forcmr6.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

Searching lm-rep-cmrm.htf' forcmr8.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/times/ptmr7t.htf) Searching pplri9t.htf' forptmr7t.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/adobe/palatino/pplri9t.htf)

(/usr/local/texlive/2012/texmf-dist/fonts/tfm/public/cm/cmr12.tfm)

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf)

Searching lm-rep-cmrm.htf' forcmr12.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

(ii) some example would be nice :)

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

— Reply to this email directly or view it on GitHubhttps://github.com/michal-h21/tex4ebook/issues/8#issuecomment-26346925 .

— Reply to this email directly or view it on GitHub.

gbarnich commented 10 years ago

Hi Michal,

Works great, I also adjusted subsections accordingly, \Css{h4.subsectionHead{font-size:1em}}

Thanks !

On 15 Oct 2013, at 17:26, Michal Hoftich wrote:

Hi Glenn,

I still have no success with getting small sections, maybe try to add something like

\Css{h3.sectionHead{font-size:1.5em}}

to your custom config file and play with font-size value.

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

Here I have better success, problem was caused with local redefinition of link command, try to adapt your custom config file:

\Preamble{...} .... \newbox\footnotebox \LinkCommand\fnlink{aside,href,id,class="footnote" epub:type="footnote"} \Configure{footnotemark}{\NoFonts\Link[ epub:type="noteref"]{fn\FNnum x\minipageNum}{}}{\EndLink\EndNoFonts} \Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts% \ifvoid\footnotebox\Tg


\else\unvbox\footnotebox\fi% \IgnorePar% \bgroup% \fnlink{}{fn\FNnum x\minipageNum}\NoFonts\Tg

% }{\EndNoFonts} {% \HCode{

\Hnewline} \Endfnlink\egroup\egroup}%

\def\printfn{% \ifvoid\footnotebox\else% \HCode{<section epub:type="footnotes" class="footnotes">\Hnewline}\box\footnotebox\HCode{\Hnewline}% \fi% }

\Configure{HtmlPar} {\EndP\Tg

} {\EndP\Tg

} {\HCode{

\Hnewline}\printfn} {\HCode{

\Hnewline}\printfn}

\Css{.footnote{font-size:small;}} \Css{.footnotes hr{width:30\%;margin:0 auto 0 0;}} ... \begin{document} ... \EndPreamble

This version should not break links and if it works correctly, I will add it to tex4ebook.4ht for epub3 documents.

Regards, Michal

2013/10/11 gbarnich notifications@github.com

Hi Michal,

Great, it now works, thanks !

G

More comments below

On 10 Oct 2013, at 13:41, Michal Hoftich wrote:

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

no, I use tex4ebook -c hej -t -f epub3 asyeym.tex ... but myabe I am missing some fonts ? (will look into that ...)

parts of the output on my system:

(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/auxhook.sty

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)

LaTeX Font Warning: Font shape U/stmry/b/n' undefined (Font) usingU/stmry/m/n' instead on input line 1375.

[57] [58] [59] [60](./asyeym.4ct [61]) [62] 63

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

) Output written on asyeym.dvi (320 pages, 340084 bytes).

) Searching lm-rep-cmrm.htf' forcmr6.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

Searching lm-rep-cmrm.htf' forcmr8.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/times/ptmr7t.htf) Searching pplri9t.htf' forptmr7t.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/adobe/palatino/pplri9t.htf) (/usr/local/texlive/2012/texmf-dist/fonts/tfm/public/cm/cmr12.tfm) (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf) Searching lm-rep-cmrm.htf' forcmr12.htf' (/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

(ii) some example would be nice :)

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

michal-h21 commented 10 years ago

Hello Glenn, I added epub3 footnotes to devel branch of tex4ebook.

Michal

2013/10/17 gbarnich notifications@github.com

Hi Michal,

The fix below for the footnote citations in the config file works perfectly for me. Please do add it to tex4ebook.4ht for epub3 documents.

Best Glenn

On 15 Oct 2013, at 17:26, Michal Hoftich wrote:

Hi Glenn,

I still have no success with getting small sections, maybe try to add something like

\Css{h3.sectionHead{font-size:1.5em}}

to your custom config file and play with font-size value.

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

Here I have better success, problem was caused with local redefinition of link command, try to adapt your custom config file:

\Preamble{...} .... \newbox\footnotebox \LinkCommand\fnlink{aside,href,id,class="footnote" epub:type="footnote"} \Configure{footnotemark}{\NoFonts\Link[ epub:type="noteref"]{fn\FNnum x\minipageNum}{}}{\EndLink\EndNoFonts}

\Configure{footnotetext}{\global\setbox\footnotebox=\vtop\bgroup\NoFonts% \ifvoid\footnotebox\Tg


\else\unvbox\footnotebox\fi% \IgnorePar% \bgroup% \fnlink{}{fn\FNnum x\minipageNum}\NoFonts\Tg

% }{\EndNoFonts} {% \HCode{

\Hnewline} \Endfnlink\egroup\egroup}%

\def\printfn{% \ifvoid\footnotebox\else% \HCode{<section epub:type="footnotes" class="footnotes">\Hnewline}\box\footnotebox\HCode{\Hnewline}% \fi% }

\Configure{HtmlPar} {\EndP\Tg

} {\EndP\Tg

} {\HCode{

\Hnewline}\printfn} {\HCode{

\Hnewline}\printfn}

\Css{.footnote{font-size:small;}} \Css{.footnotes hr{width:30\%;margin:0 auto 0 0;}} ... \begin{document} ... \EndPreamble

This version should not break links and if it works correctly, I will add it to tex4ebook.4ht for epub3 documents.

Regards, Michal

2013/10/11 gbarnich notifications@github.com

Hi Michal,

Great, it now works, thanks !

G

More comments below

On 10 Oct 2013, at 13:41, Michal Hoftich wrote:

Hi Glenn,

(i) your issue with small sections is really strange, do you use custom config file with some css declarations? When I compile your file on my machine, sections are bigger than main text.

no, I use tex4ebook -c hej -t -f epub3 asyeym.tex ... but myabe I am missing some fonts ? (will look into that ...)

parts of the output on my system:

(/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/auxhook.sty

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

(/usr/local/texlive/2012/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/local/texlive/2012/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)

LaTeX Font Warning: Font shape U/stmry/b/n' undefined (Font) usingU/stmry/m/n' instead on input line 1375.

[57] [58] [59] [60](./asyeym.4ct [61]) [62] 63

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

) Output written on asyeym.dvi (320 pages, 340084 bytes).

) Searching lm-rep-cmrm.htf' forcmr6.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

Searching lm-rep-cmrm.htf' forcmr8.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/times/ptmr7t.htf) Searching pplri9t.htf' forptmr7t.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/adobe/palatino/pplri9t.htf)

(/usr/local/texlive/2012/texmf-dist/fonts/tfm/public/cm/cmr12.tfm)

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/alias/lm/lm-rep-cmrm/cmr.htf)

Searching lm-rep-cmrm.htf' forcmr12.htf'

(/usr/local/texlive/2012/texmf-dist/tex4ht/ht-fonts/unicode/lm/lm-rep-cmrm.htf)

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

(ii) some example would be nice :)

here you go

https://dl.dropboxusercontent.com/u/35238591/footnote.epub https://dl.dropboxusercontent.com/u/35238591/footnote.tex

arse LG Tidy: footnote.html line 21 column 122 - Warning:

— Reply to this email directly or view it on GitHubhttps://github.com/michal-h21/tex4ebook/issues/8#issuecomment-26529394 .