ODTImport: Import ODT documents into Sigil as epubs.
(based on Writer2LaTeX)
Current Version: "0.1"
This plugin is a very simple Writer2LaTeX 1.4
wrapper, which allows you to import OpenOffice ODT files.
Since I'm not that familiar with the ODT file format and Writer2LaTeX, I asked st_albert
for help with the configuration and stylesheet files and he kindly provided sample configuration/stylesheet files (config.xml and epub.css) as well as an ODF text document template file (custom-styles.ott).
If you want to test the template file, unzip Custom-Stylesheet.zip and add the custom styles in LibreOffice/OpenOffice via Styles > Load Styles > From file > ODF Text Document Template > custom-styles.ott. This will add a number of custom styles that all start with custom
, e.g. custom-body-text
Note that these styles are not intended as all purpose styles, they're merely provided to demonstrate how to map custom styles to stylesheet classes.
For example, the following line in config.xml maps the LibreOffice/OpenOffice custom-body-text
style to the p.custom-bodytext
class in epub.css.
<xhtml-style-map name="custom-body-text" family="paragraph" element="p" css="custom-bodytext" />
If you don't want to use the default config/css files, you can simply delete them from the plugin folder to force Writer2LaTeX to use the default settings. (To display the ODTImport plugin folder select Edit > Preferences > Open Preferences Location.)
In this case you might find the RemoveInLineStyles
plugin helpful, which will allow you to convert all inline styles to classes.
Like all other input plugins this plugin will destroy the contents of the currently loaded ePub; make sure to only run it when no epub is loaded.
If you're using an older Sigil version, you'll need to install a Python interpreter and select its path in the Manage Plugins dialog box. Since Writer2LaTeX is a Java app, you'll also need to install Java, if you haven't already done so and the Java executable path must be added to the system path. I.e., if you enter java -version
in a DOS/terminal window you should get a version number. Otherwise the plugin won't work.
If you don't get a version number, please read the troubleshooting section of the epubcheck (Java) plugin
1. Select Manage Plugins from the Plugins menu. In the Manage Plugins dialog box, select Use Bundled Python
, if it isn't already selected. (If your Sigil version doesn't have a Use Bundled Python
option, click one of the Auto buttons to detect the path or Set to manually select the Python interpreter path. )
2. Click Add Plugin and select ODTImport_v0.1.zip
. This will install the plugin, which you can select via Plugins > input