View Single Post
Old 05-26-2016, 12:06 PM   #5
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,738
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by roger64 View Post
It mainly concerns:
- EPUB2 or EPUB3?
- values in px or cm
- one font-family for all the styles (and not for each style)
- Document division (splitting the html file along h1 or h2 headings, etc.)
- producing a toc.ncx

Have you an idea how to do it?
As I've mentioned in the plugin description, I'm only familiar with the basic feature of Writer2Latex and using an alpha version in a production environment is generally not advisable.

Hopefully, st_albert will chime in with some helpful feedback.

As for your points:

- EPUB2 or EPUB3?

For ePub3 output you'll need to change -epub command line parameter to epub3.

Locate the following block in plugin.py and replace it with the following version:

Spoiler:
Code:
        # define command line arguments
        if os.path.isfile(w2l_config_path) and os.path.isfile(w2l_css_path):
            args = ['java', '-jar', w2l_path, '-epub3', '-config=' + w2l_config_path, '-stylesheet=' + w2l_css_path, odt_file] 
        elif os.path.isfile(w2l_config_path) and not os.path.isfile(w2l_css_path):
            args = ['java', '-jar', w2l_path, '-epub3', '-config=' + w2l_config_path, odt_file]
        elif not os.path.isfile(w2l_config_path) and os.path.isfile(w2l_css_path):
            args = ['java', '-jar', w2l_path, '-epub3', '-stylesheet=' + w2l_css_path, odt_file] 
        else:
            args = ['java', '-jar', w2l_path, '-epub3', odt_file]


- values in px or cm

Should be enabled with the the following line in config.xml:

Code:
<option name="convert_to_px" value="true" />
(It was set to false in the sample config file.)

- one font-family for all the styles (and not for each style)

No idea. Why don't you define a document font for the body element?

- Document division (splitting the html file along h1 or h2 headings, etc.)

AFAIK, this is defined via the following config.xml parameter:

Code:
<option name="split_level" value="1" />
1 = h1; change this to the desired heading level number.

- producing a toc.ncx

Should be enabled by the following option:

Code:
<option name="include_ncx" value="true" />
Note that I haven't tested these settings with the alpha version.
Doitsu is offline   Reply With Quote