![]() |
#1 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Oct 2013
Device: none
|
Conversion of odt produced from latex
I don't know if anyone else has come across this. I usually write documents in latex and use a couple of commands on the source files that output an .odt:
latexmk file.tex mk4ht ebook file.tex Works fine, except that calibre fails to convert it. Calibre works fine if I create a new odt in libreoffice however, so mk4ht is failing to do something. This is the output from the conversion that fails: Code:
Extracting ODT file... Traceback (most recent call last): File "/usr/bin/calibre-parallel", line 20, in <module> sys.exit(main()) File "/usr/lib64/calibre/calibre/utils/ipc/worker.py", line 189, in main result = func(*args, **kwargs) File "/usr/lib64/calibre/calibre/gui2/convert/gui_conversion.py", line 31, in gui_convert_override override_input_metadata=True) File "/usr/lib64/calibre/calibre/gui2/convert/gui_conversion.py", line 25, in gui_convert plumber.run() File "/usr/lib64/calibre/calibre/ebooks/conversion/plumber.py", line 1035, in run accelerators, tdir) File "/usr/lib64/calibre/calibre/customize/conversion.py", line 241, in __call__ log, accelerators) File "/usr/lib64/calibre/calibre/ebooks/conversion/plugins/odt_input.py", line 23, in convert return Extract()(stream, '.', log) File "/usr/lib64/calibre/calibre/ebooks/odt/input.py", line 263, in __call__ mi = get_metadata(stream, 'odt') File "/usr/lib64/calibre/calibre/ebooks/metadata/odt.py", line 165, in get_metadata parser.parse(StringIO(content)) File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "/usr/lib64/python2.7/xml/sax/xmlreader.py", line 123, in parse self.feed(buffer) File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 207, in feed self._parser.Parse(data, isFinal) File "/usr/lib64/python2.7/xml/sax/expatreader.py", line 381, in external_entity_ref "") File "/usr/lib64/python2.7/xml/sax/saxutils.py", line 304, in prepare_input_source f = urllib.urlopen(source.getSystemId()) File "/usr/lib64/python2.7/urllib.py", line 86, in urlopen return opener.open(url) File "/usr/lib64/python2.7/urllib.py", line 207, in open return getattr(self, name)(url) File "/usr/lib64/python2.7/urllib.py", line 462, in open_file return self.open_local_file(url) File "/usr/lib64/python2.7/urllib.py", line 476, in open_local_file raise IOError(e.errno, e.strerror, e.filename) IOError: [Errno 2] No such file or directory: 'office.dtd' *Edit: I did find this: /opt/libreoffice3.6/share/dtd/officedocument/1_0/office.dtd |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,198
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#3 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Oct 2013
Device: none
|
Thanks, that worked. But it leads to another error:
Code:
Traceback (most recent call last): File "/usr/bin/calibre-parallel", line 20, in <module> sys.exit(main()) File "/usr/lib64/calibre/calibre/utils/ipc/worker.py", line 189, in main result = func(*args, **kwargs) File "/usr/lib64/calibre/calibre/gui2/convert/gui_conversion.py", line 31, in gui_convert_override override_input_metadata=True) File "/usr/lib64/calibre/calibre/gui2/convert/gui_conversion.py", line 25, in gui_convert plumber.run() File "/usr/lib64/calibre/calibre/ebooks/conversion/plumber.py", line 1035, in run accelerators, tdir) File "/usr/lib64/calibre/calibre/customize/conversion.py", line 241, in __call__ log, accelerators) File "/usr/lib64/calibre/calibre/ebooks/conversion/plugins/odt_input.py", line 23, in convert return Extract()(stream, '.', log) File "/usr/lib64/calibre/calibre/ebooks/odt/input.py", line 268, in __call__ self.filter_load(stream, mi, log) File "/usr/lib64/calibre/calibre/ebooks/odt/input.py", line 241, in filter_load self.document = odLoad(odffile) File "/usr/lib64/calibre/odf/opendocument.py", line 610, in load mimetype = z.read('mimetype') File "/usr/lib64/python2.7/zipfile.py", line 869, in read return self.open(name, "r", pwd).read() File "/usr/lib64/python2.7/zipfile.py", line 892, in open zinfo = self.getinfo(name) File "/usr/lib64/python2.7/zipfile.py", line 859, in getinfo 'There is no item named %r in the archive' % name) KeyError: "There is no item named 'mimetype' in the archive" |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,198
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Oct 2013
Device: none
|
Getting closer:
Code:
File "/usr/lib64/calibre/calibre/ebooks/odt/input.py", line 284, in __call__ self.extract_pictures(zf) File "/usr/lib64/calibre/calibre/ebooks/odt/input.py", line 31, in extract_pictures with open(name, 'wb') as f: IOError: [Errno 21] Is a directory: u'Pictures/' I'm wondering about converting latex -> html now since it's higher in the prefered input format list Last edited by dawood; 10-19-2013 at 12:32 AM. |
![]() |
![]() |
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,198
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Why dont you just post one of these odt files, it will go a lot faster that way. And yes, feel free to use html.
|
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Oct 2013
Device: none
|
Hmm it seems htlatex can't do filenames with spaces...
odt attached *Had to upload a new one - the old one was using a custom mk4ht method I fixed the Manifest.dtd problem myself but it will stop at that error. Last edited by dawood; 10-19-2013 at 12:48 AM. |
![]() |
![]() |
![]() |
#8 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Oct 2013
Device: none
|
This one is using an improved m4ht config:
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,198
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#10 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Oct 2013
Device: none
|
It didn't reproduce my image
|
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,198
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Works for me.
|
![]() |
![]() |
![]() |
#12 |
Enthusiast
![]() Posts: 26
Karma: 10
Join Date: Oct 2013
Device: none
|
It does
![]() Thanks for all your work ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
.epub to LaTeX Conversion | _savage | ePub | 4 | 11-07-2013 04:06 PM |
Image Lost During ODT > ePub Conversion | Foothills | Conversion | 12 | 08-24-2012 08:26 AM |
LaTeX to HTML conversion | kongzifan | Conversion | 9 | 12-14-2011 04:41 PM |
Footnotes in odt->epub conversion | Bidibulle | Calibre | 4 | 01-18-2011 12:07 PM |