Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 04-26-2019, 01:29 PM   #1
ZioNemo
Enthusiast
ZioNemo began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
Conversion Latex to ebook

I am trying to convert a novel I wrote (in Italian) from current PDF format to any format suitable for self-publishing on Amazon (I assume ebook, mobi and azw3 are ok).

I wrote novel in LaTeX and thus I have full (?) control on PDF generation.
I tried to find a way to directly generate [x]html, but I failed because of fonts I'm using.

ebook-viewer can show the generated PDF apparently without any problem.

Using either Calibre or ebook-convert results in error at the very end of document:

Spoiler:
calibre, version 3.39.1 (linux2, embedded-python: False)
Conversion error: Failed: Convert book 1 of 1 (Cronache della Nuova Terra)

Convert book 1 of 1 (Cronache della Nuova Terra)
Conversion options changed from defaults:
verbose: 2
read_metadata_from_opf: u'/tmp/calibre_3.39.1_tmp_eQ7uEV/q6PZTT.opf'
output_profile: 'kindle'
cover: u'/tmp/calibre_3.39.1_tmp_eQ7uEV/tXbXhU.jpeg'
Resolved conversion options
calibre version: 3.39.1
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0.0,
'book_producer': None,
'change_justification': u'original',
'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|pr ologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']",
'chapter_mark': u'pagebreak',
'comments': None,
'cover': u'/tmp/calibre_3.39.1_tmp_eQ7uEV/tXbXhU.jpeg',
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_compress': False,
'duplicate_links_in_toc': False,
'embed_all_fonts': False,
'embed_font_family': None,
'enable_heuristics': False,
'expand_css': False,
'extra_css': None,
'extract_to': None,
'filter_css': u'',
'fix_indents': True,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x7fef7c446150>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0.0,
'linearize_tables': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'mobi_toc_at_start': False,
'new_pdf_engine': False,
'no_chapters_in_toc': False,
'no_images': False,
'no_inline_navbars': False,
'no_inline_toc': False,
'output_profile': <calibre.customize.profiles.KindleOutput object at 0x7fef7c446810>,
'page_breaks_before': u"//*[name()='h1' or name()='h2']",
'prefer_author_sort': False,
'prefer_metadata_cover': False,
'pretty_print': False,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': u'/tmp/calibre_3.39.1_tmp_eQ7uEV/q6PZTT.opf',
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': u'',
'search_replace': '[]',
'series': None,
'series_index': None,
'share_not_sync': False,
'smarten_punctuation': False,
'sr1_replace': None,
'sr1_search': None,
'sr2_replace': None,
'sr2_search': None,
'sr3_replace': None,
'sr3_search': None,
'start_reading_at': None,
'subset_embedded_fonts': False,
'tags': None,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'toc_title': None,
'transform_css_rules': '[]',
'unsmarten_punctuation': False,
'unwrap_factor': 0.45,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: PDF Input running
on /tmp/calibre_3.39.1_tmp_eQ7uEV/ExIvpU.pdf
Converting file to html...
pdftohtml log:
Page-1
Page-2
Page-3
Page-4
Page-5
Page-6
Page-7
Page-8
Page-9
Page-10
Page-11
Page-12
Page-13
Page-14
Page-15
Page-16
Page-17
Page-18
Page-19
Page-20
Page-21
Page-22
Page-23
Page-24
Page-25
Page-26
Page-27
Page-28
Page-29
Page-30
Page-31
Page-32
Page-33
Page-34
Page-35
Page-36
Page-37
Page-38
Page-39
Page-40
Page-41
Page-42
Page-43
Page-44
Page-45
Page-46
Page-47
Page-48
Page-49
Page-50
Page-51
Page-52
Page-53
Page-54
Page-55
Page-56
Page-57
Page-58
Page-59
Page-60
Page-61
Page-62
Page-63
Page-64
Page-65
Page-66
Page-67
Page-68
Page-69
Page-70
Page-71
Page-72
Page-73
Page-74
Page-75
Page-76
Page-77
Page-78
Page-79
Page-80
Page-81
Page-82
Page-83
Page-84
Page-85
Page-86
Page-87
Page-88
Page-89
Page-90
Page-91
Page-92
Page-93
Page-94
Page-95
Page-96
Page-97
Page-98
Page-99
Page-100
Page-101
Page-102
Page-103
Page-104
Page-105
Page-106
Page-107
Page-108
Page-109
Page-110
Page-111
Page-112
Page-113
Page-114
Page-115
Page-116
Page-117
Page-118
Page-119
Page-120
Page-121
Page-122
Page-123
Page-124
Page-125
Page-126
Page-127
Page-128
Page-129
Page-130
Page-131
Page-132
Page-133
Page-134
Page-135
Page-136
Page-137
Page-138
Page-139
Page-140
Page-141
Page-142
Page-143
Page-144
Page-145
Page-146
Page-147
Page-148
Page-149
Page-150
Page-151
Page-152
Page-153
Page-154
Page-155
Page-156
Page-157
Page-158
Page-159
Page-160
Page-161
Page-162
Page-163
Page-164
Page-165
Page-166
Page-167
Page-168
Page-169
Page-170
Page-171
Page-172
Page-173
Page-174
Page-175
Page-176
Page-177
Page-178
Page-179
Page-180
Page-181
Page-182
Page-183
Page-184
Page-185
Page-186
Page-187
Page-188
Page-189
Page-190
Page-191
Page-192
Page-193
Page-194
Page-195
Page-196
Page-197
Page-198
Page-199
Page-200
Page-201
Page-202
Page-203
Page-204
Page-205
Page-206
Page-207
Page-208
Page-209
Page-210
Page-211
Page-212
Page-213
Page-214
Page-215
Page-216
Page-217
Page-218
Page-219
Page-220
Page-221
Page-222
Page-223
Page-224
Page-225
Page-226
Page-227
Page-228
Page-229
Page-230
Page-231
Page-232
Page-233
Page-234
Page-235
Page-236
Page-237
Page-238
Page-239
Page-240
Page-241
Page-242
Page-243
Page-244
Page-245
Page-246
Page-247
Page-248
Page-249
Page-250
Page-251
Page-252
Page-253
Page-254
Page-255
Page-256
Page-257
Page-258
Page-259
Page-260
Page-261
Page-262
Page-263
Page-264
Page-265
Page-266
Page-267
Page-268
Page-269
Page-270
Page-271
Page-272
Page-273
Page-274
Page-275
Page-276
Page-277
Page-278
Page-279
Page-280
Page-281
Page-282
Page-283
Page-284
Page-285
Page-286
Page-287
Page-288
Page-289
Page-290
Page-291
Page-292
Page-293
Page-294
Page-295
Page-296
Page-297
Page-298
Page-299
Page-300
Page-301
Page-302
Page-303
Page-304
Page-305
Page-306
Page-307
Page-308
Page-309
Page-310
Page-311
Page-312
Page-313
Page-314
Page-315
Page-316
Page-317
Page-318
Page-319
Page-320
Page-321
Page-322
Page-323
Page-324
Page-325
Page-326
Page-327
Page-328
Page-329
Page-330
Page-331
Page-332
Page-333
Page-334
Page-335
Page-336
Page-337
Page-338
Page-339
Page-340
Page-341
Page-342
Page-343
Page-344
Page-345
Page-346
Page-347
Page-348
Page-349
Page-350
Page-351
Page-352
Page-353
Page-354
Page-355
Page-356
Page-357
Page-358
Page-359
Page-360
Page-361
Page-362
Page-363
Page-364
Page-365
Page-366
Page-367
Page-368
Page-369
Page-370
Page-371
Page-372
Page-373
Page-374
Page-375
Page-376
Page-377
Page-378
Page-379
Page-380
Page-381
Page-382
Page-383
Page-384
Page-385
Page-386
Page-387
Page-388
Page-389
Page-390
Page-391
Page-392
Page-393
Page-394
Page-395
Page-396
Page-397
Page-398
Page-399
Page-400
Page-401
Page-402
Page-403
Page-404
Page-405
Page-406
Page-407
Page-408
Page-409
Page-410
Page-411
Page-412
Page-413
Page-414
Page-415
Page-416
Page-417
Page-418
Page-419
Page-420
Page-421
Page-422
Page-423
Page-424
Page-425
Page-426
Page-427
Page-428
Page-429
Page-430
Page-431
Page-432
Page-433
Page-434
Page-435
Page-436
Page-437
Page-438
Page-439
Page-440
Page-441
Page-442
Page-443
Page-444
Page-445
Page-446
Page-447
Page-448
Page-449
Page-450
Page-451
Page-452
Page-453
Page-454
Page-455
Page-456
Page-457
Page-458
Page-459
Page-460
Page-461
Page-462
Page-463
Page-464
Page-465
Page-466
Page-467
Page-468
Page-469
Page-470
Page-471
Page-472
Page-473
Page-474
Page-475
Page-476
Page-477
Page-478
Page-479
Page-480
Page-481
Page-482
Page-483
Page-484
Page-485
Page-486
Page-487
Page-488
Page-489
Page-490
Page-491
Page-492
Page-493
Page-494
Page-495
Page-496
Page-497
Page-498
Page-499
Page-500
Page-501
Page-502
Page-503
Page-504
Page-505
Page-506
Page-507
Page-508
Page-509
Page-510
Page-511
Page-512
Page-513
Page-514
Page-515
Page-516
Page-517
Page-518
Page-519
Page-520
Page-521
Page-522
Page-523
Page-524
Page-525
Page-526
Page-527
Page-528
Page-529
Page-530
Page-531
Page-532
Page-533
Page-534
Page-535
Page-536
Page-537
Page-538
Page-539
Page-540
Page-541
Page-542
Page-543
Page-544
Page-545
Page-546
Page-547
Page-548
Page-549
Page-550
Page-551
Page-552
Page-553
Page-554
Page-555
Page-556
Page-557
Page-558
Page-559
Page-560
Page-561
Page-562
Page-563
Page-564
Page-565
Page-566
Page-567
Page-568
Page-569
Page-570
Page-571
Page-572
Page-573
Page-574
Page-575
Page-576
Page-577
Page-578
Page-579
Page-580
Page-581
Page-582
Page-583
Page-584
Page-585
Page-586
Page-587
Page-588
Page-589
Page-590
Page-591
Page-592
Page-593
Page-594
Page-595
Page-596
Page-597
Page-598
Page-599
Page-600
Page-601
Page-602
Page-603
Page-604
Page-605
Page-606
Page-607
Page-608
Page-609
Page-610
Page-611
Page-612
Page-613
Page-614
Page-615
Page-616
Page-617
Page-618
Page-619
Page-620
Page-621
Page-622
Page-623
Page-624
Page-625
Page-626
Page-627
Page-628
Page-629
Page-630
Page-631
Page-632
Page-633
Page-634
Page-635
Page-636
Page-637
Page-638
Page-639
Page-640
Page-641
Page-642
Page-643
Page-644
Page-645
Page-646
Page-647
Page-648
Page-649
Page-650
Page-651
Page-652
Page-653
Page-654
Page-655
Page-656
Page-657
Page-658
Page-659
Page-660
Page-661
Page-662
Page-663
Page-664
Page-665
Page-666
Page-667
Page-668
Page-669
Page-670
Page-671
Page-672
Page-673
Page-674
Page-675
Page-676
Page-677
Page-678
Page-679
Page-680
Page-681
Page-682
Page-683
Page-684
Page-685
Page-686
Page-687
Page-688
Page-689
Page-690
Page-691
Page-692
Page-693
Page-694
Page-695
Page-696
Page-697
Page-698
Page-699
Page-700
Page-701
Page-702
Page-703
Page-704
Page-705
Page-706
Page-707
Page-708
Page-709
Page-710
Page-711
Page-712
Page-713
Page-714
Page-715
Page-716
Page-717
Page-718
Page-719
Page-720
Page-721
Page-722
Page-723
Page-724
Page-725
Page-726
Page-727
Page-728
Page-729
Page-730
Page-731
Page-732
Page-733
Page-734
Page-735
Page-736
Page-737
Page-738
Page-739
Page-740
Page-741
Page-742
Page-743
Page-744
Page-745
Page-746
Page-747
Page-748
Page-749
Page-750
Page-751
Page-752
Page-753
Page-754
Page-755
Page-756
Page-757
Page-758
Page-759
Page-760
Page-761
Page-762
Page-763
Page-764
Page-765
Page-766
Page-767
Page-768
Page-769
Page-770
Page-771
Page-772
Page-773
Page-774
Page-775
Page-776
Page-777
Page-778
Page-779
Page-780
Page-781
Page-782
Page-783
Page-784
Page-785
Page-786
Page-787
Page-788
Page-789
Page-790
Page-791
Page-792
Page-793
Page-794
Page-795
Page-796
Page-797
Page-798
Page-799
Page-800
Page-801
Page-802
Page-803
Page-804
Page-805
Page-806
Page-807
Page-808
Page-809
Page-810
Page-811
Page-812
Page-813
Page-814
Page-815
Page-816
Page-817
Page-818
Page-819
Page-820
Page-821
Page-822
Page-823
Page-824
Page-825
Page-826
Page-827
Page-828
Page-829
Page-830
Page-831
Page-832
Page-833
Page-834
Page-835
Page-836
Page-837
Page-838
Page-839
Page-840
Page-841
Page-842
Page-843
Page-844
Page-845
Page-846
Page-847
Page-848
Page-849
Page-850
Page-851
Page-852
Page-853
Page-854
Page-855
Page-856
Page-857
Page-858
Page-859
Page-860
Page-861
Page-862
Page-863
Page-864
Page-865
Page-866
Page-867
Page-868
Page-869
Page-870
Page-871
Page-872
Page-873
Page-874
Page-875
Page-876
Page-877
Page-878
Page-879
Page-880
Page-881
Page-882
Page-883
Page-884
Page-885
Page-886
Page-887
Page-888
Page-889
Page-890
Page-891
Page-892
Page-893
Page-894
Page-895
Page-896
Page-897
Page-898
Page-899
Page-900
Page-901
Page-902
Page-903
Page-904
Page-905
Page-906
Page-907
Page-908
Page-909
Page-910
Page-911
Page-912
Page-913
Page-914
Page-915
Page-916
Page-917
Page-918
Page-919
Page-920
Page-921
Page-922
Page-923
Page-924
Page-925
Page-926
Page-927
Page-928
Page-929
Page-930
Page-931
Page-932
Page-933
Page-934
Page-935
Page-936
Page-937
Traceback (most recent call last):
File "/usr/bin/calibre-parallel", line 20, in <module>
sys.exit(main())
File "/usr/lib/calibre/calibre/utils/ipc/worker.py", line 199, in main
result = func(*args, **kwargs)
File "/usr/lib/calibre/calibre/gui2/convert/gui_conversion.py", line 42, in gui_convert_override
override_input_metadata=True)
File "/usr/lib/calibre/calibre/gui2/convert/gui_conversion.py", line 27, in gui_convert
plumber.run()
File "/usr/lib/calibre/calibre/ebooks/conversion/plumber.py", line 1106, in run
accelerators, tdir)
File "/usr/lib/calibre/calibre/customize/conversion.py", line 244, in __call__
log, accelerators)
File "/usr/lib/calibre/calibre/ebooks/conversion/plugins/pdf_input.py", line 52, in convert
pdftohtml(os.getcwdu(), stream.name, options.no_images)
File "/usr/lib/calibre/calibre/ebooks/pdf/pdftohtml.py", line 98, in pdftohtml
raw = i.read().decode('utf-8')
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xfa in position 799750: invalid start byte


Apparently no output is generated (in the /tmp directory I see several files, including a 'index.html' with the full content of my novel, but no font info).

I am at a loss to understand what went wrong (apparently some iso-8859 char slipped in, but that's not in my source!) or even to map "position 799750" to a specific location in my text.

If needed I can attach input PDF (You are welcome to proofread it ), but it is rather large (~4.5M) and I'm unsure about attachment limits.

If relevant: I'm working on a fairly up-to-date Debian Sid box running on an amd_64 i7 with 32GRam.

Any hint on how to bypass problem will be very welcome.

Last edited by theducks; 04-26-2019 at 02:16 PM. Reason: Use SPOILER, not quote for logs
ZioNemo is offline   Reply With Quote
Old 04-26-2019, 03:14 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,167
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
I've no experience with LaTex but have you tried PanDoc http://pandoc.org ? It claims to do LaTex to Epub
PeterT is offline   Reply With Quote
Advert
Old 04-26-2019, 04:05 PM   #3
ZioNemo
Enthusiast
ZioNemo began at the beginning.
 
Posts: 48
Karma: 10
Join Date: Mar 2008
Device: HTC-p3000
Angry pandoc does not work (for me)

Quote:
Originally Posted by PeterT View Post
I've no experience with LaTex but have you tried PanDoc http://pandoc.org ? It claims to do LaTex to Epub
I've never been able to use pandoc for anything but most trivial translations.
In the specific case it fails to understand direct speech quoting, so resulting .html is completely devoid of dialogues.

Thanks anyways.
ZioNemo is offline   Reply With Quote
Old 04-26-2019, 05:51 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,572
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Moderator Notice
This issue would be better asked in the Workshop forum, so I'm moving it there.

Calibre is just one of several tools/processes to get from a LatTex generated a PDF to ebook formats.

For personal use I would convert the LaTex output (.tex ?) to DOCX, then use Writer to edit/style the document, and then convert DOCX to flowable formats.

The professional bookmakers, who inhabit the Workshop forum and who are familiar with LaTex will undoubtedly have alternative ideas.

BR
BetterRed is offline   Reply With Quote
Old 04-27-2019, 08:09 AM   #5
Sarmat89
Evangelist
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
But why use PDF as a source? The more reasonable way would be the straight latex->xhtml conversion, which some simple script could do.
Sarmat89 is offline   Reply With Quote
Advert
Old 04-27-2019, 08:45 AM   #6
orebmur
Veteran Linux user
orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.
 
Posts: 144
Karma: 678910
Join Date: Mar 2017
Location: Barcelona/Spain
Device: Boyue Likebook Note & Mimas, Hisense A5, hopefully soon a PineNote
When writing in LaTeX with the explicit intention to later convert into epub, then this here might be helpful to consider for inclusion in the source files:

github.com/michal-h21/tex4ebook

On Debian, it is included in the 'texlive-extra-utils' package.
orebmur is offline   Reply With Quote
Old 04-27-2019, 02:48 PM   #7
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Also try asking the question from the other side; find TeX and LaTeX forums and ask them how you can convert to an ebook.
lumpynose is offline   Reply With Quote
Old 04-27-2019, 08:50 PM   #8
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by ZioNemo View Post
I am trying to convert a novel I wrote (in Italian) from current PDF format to any format suitable for self-publishing on Amazon (I assume ebook, mobi and azw3 are ok).

I wrote novel in LaTeX and thus I have full (?) control on PDF generation.
I tried to find a way to directly generate [x]html, but I failed because of fonts I'm using.
For LaTeX -> HTML, there are a handful of different tools/workflows.

Depending on how complicated the code of your book is, some of these may work better than others:
  • tex4ebook
  • LaTeXML
  • htlatex
  • pandoc

As you mentioned, pandoc is okay for trivial LaTeX->HTML conversions, but more complicated text (especially macro-heavy) will break.

There's lots of information on the TeX Stack Exchange. Here's some of the latest discussions:

Use LaTeX to produce Epub
LaTeX document to epub or mobi ebook formats (with mathematical formulas)

There's also a few older discussions:

Use LaTeX to produce Epub
https://www.mobileread.com/forums/sh...51#post3800751

where these tools are mentioned:
  • plastex
  • tex2ebook.py
  • tex4ht

Perhaps you'll have better luck with some of those other tools.

Although note, some of these tools haven't been updated in quite a long while.

Quote:
Originally Posted by ZioNemo View Post
I am at a loss to understand what went wrong (apparently some iso-8859 char slipped in, but that's not in my source!) or even to map "position 799750" to a specific location in my text.
What document class are you using (book, memoir, koma-script, [...])?

Is your source document UTF-8?

What are you using to compile (pdfLaTeX, LuaLaTeX, XeLaTeX, [...])?

Last edited by Tex2002ans; 04-27-2019 at 09:01 PM.
Tex2002ans is offline   Reply With Quote
Old 06-06-2019, 04:33 PM   #9
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
I also ran across this user on Reddit + Stack Exchange:

https://www.reddit.com/user/michal_h21
https://tex.stackexchange.com/users/2891/michal-h21

who is the maintainer of tex4ht + tex4ebook + make4ht.

Looks like he posts lots of helpful info as well.
Tex2002ans is offline   Reply With Quote
Old 06-06-2019, 05:34 PM   #10
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
Our wiki on LaTeX might be useful here.

Dale
DaleDe is offline   Reply With Quote
Old 06-06-2019, 10:47 PM   #11
lumpynose
Wizard
lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.lumpynose ought to be getting tired of karma fortunes by now.
 
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
Quote:
Originally Posted by Tex2002ans View Post
I also ran across this user on Reddit + Stack Exchange:

https://www.reddit.com/user/michal_h21
https://tex.stackexchange.com/users/2891/michal-h21

who is the maintainer of tex4ht + tex4ebook + make4ht.

Looks like he posts lots of helpful info as well.
It warms my heart to see that TeX/LaTeX is getting used. It was my first exposure to typography back in the early 1980s.
lumpynose is offline   Reply With Quote
Old 06-07-2019, 03:03 PM   #12
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Also, this one might be of interest.

At TUG 2018, Will Robertson gave a talk showing off how he uses LaTeXML to generate LaTeX->HTML:

The Canvas Management System and LaTeXML

He discusses why he settled on LaTeXML + shows many of the commands he uses.

I've had this in my pile for months (been meaning to write a blog post summarizing all the talks).

Quote:
Originally Posted by lumpynose View Post
It warms my heart to see that TeX/LaTeX is getting used. It was my first exposure to typography back in the early 1980s.
It's still the best. :P

Last edited by Tex2002ans; 06-07-2019 at 03:06 PM.
Tex2002ans is offline   Reply With Quote
Reply

Tags
pdf, pdftoazw3, unicode


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Conversion Input] LaTeX Formulas Input Conversion Plugin sevyls Plugins 0 03-23-2015 05:52 AM
.epub to LaTeX Conversion _savage ePub 4 11-07-2013 04:06 PM
Conversion of odt produced from latex dawood Conversion 11 10-19-2013 01:38 AM
LaTeX to HTML conversion kongzifan Conversion 9 12-14-2011 04:41 PM
ebook from LaTeX rplantz Workshop 2 03-17-2011 03:29 PM


All times are GMT -4. The time now is 12:15 PM.


MobileRead.com is a privately owned, operated and funded community.