12-05-2016, 09:54 AM | #1 |
Enthusiast
Posts: 48
Karma: 854254
Join Date: Nov 2016
Device: none
|
LATEX>PDF>EPUB and KICKASS TOC
Hallo alle,
I would like to have a pdf in the device library listed with title and whatever additional info is possible rather than its filename. Is this possible? My second question is bit more trickier, is it possible to make an ereader optimized TOC for pdf and how to do this in latex? And my third question is that I would like to have a the PDF dimensions according to my device which I got from another of my posts: https://www.mobileread.com/forums/sho...d.php?t=281284 Approx: "118 x 157mm" "Going by the screen resolution (1404x1872) and ppi (300), the screen should be 4.68" or 118.872mm by 6.24" or 158.496mm." How to do this in latex? Lastly, what some general guidelines to follow when using latex for ereader pdf? If you have some snippets plz share!! thansk Last edited by pluma; 12-10-2016 at 08:50 AM. Reason: change title. |
12-05-2016, 06:09 PM | #2 |
Wizard
Posts: 2,986
Karma: 18343081
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Here's what the latex preamble looks like for my PDFs:
Code:
\documentclass[11pt,a5paper,openany,oneside]{book} \usepackage[a5paper]{geometry} \usepackage[pdftex,pdftitle={The Title Goes Here},pdfauthor={Last_name, First_name}]{hyperref} \usepackage[pdftex]{color,graphicx} \usepackage{mathpazo} \textwidth 128mm \topmargin -15mm \textheight 175mm \evensidemargin -15mm \oddsidemargin -15mm Code:
#!/bin/sh # Pass in the name of the top-level TeX file, or "main.tex" # will be assumed. if test $# -eq 0 then SOURCE=main.tex else SOURCE="$1" fi latex2html -nonavigation -nobottom_navigation -noaddress -noinfo -math -math_parsing -accent_images 'large' "$SOURCE" cd `basename "$SOURCE" .tex` fontresize.sh Code:
#!/bin/sh for i in *.html do sed -e 's/+2/+0/' < $i > j.j mv j.j $i done |
12-06-2016, 04:14 PM | #3 |
Fanatic
Posts: 531
Karma: 5060708
Join Date: Oct 2016
Device: Forma, iPad Air 4
|
The TeX Users Group published a formal(ish) workflow for converting LaTeX documents to ePub. It's similar to rkomar's workflow: convert TeX/LaTeX to XML via TeX4ht and then convert that to ePub.
I've had good results converting HTML to ePub with Calibre's ebook-convert: Code:
ebook-convert in.foo out.epub --remove-paragraph-spacing --max-toc-links=999 \ --flow-size=9999 --output-profile=tablet --title="Foo" |
12-07-2016, 12:57 PM | #4 |
Guru
Posts: 631
Karma: 7544080
Join Date: Apr 2013
Location: Berlin
Device: PRS 350, Kobo Aura
|
You need to look at the geometry package. It allows you to set arbitrary page sizes.
For conversion another software worth a look is pandoc. It can convert latex to pdf and to epub. It should convert most formats to pdf through using latex in the background too. |
12-10-2016, 08:47 AM | #5 |
Enthusiast
Posts: 48
Karma: 854254
Join Date: Nov 2016
Device: none
|
KICKASS TOC??
hallo,
thanks for all the replies. I found out that "PALATINO" font in latex is called "TeX Gyre Pagella". Important detail to know in order to have it working. Where I am having troubles now is with the navigable TOC for pdf. None of the \chapters are being shown in the TOC, in other words my TOC only has this: Code:
Contents How is people using the \chapter to create a proper Ereader compatible TOC? Also I am confused about \section, it trips up with an error about needing \item. When making pdf TOC should I use \chapter and \section? Lastly there's something called 'bookmarks' which require some other syntax in latex. Are bookmarks useful in a Ereader device?? danke. Last edited by pluma; 12-10-2016 at 08:48 AM. Reason: incorrect tags |
12-10-2016, 10:52 PM | #6 | ||||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Sometimes when complicated things are being done (Bookmarks, Cross-references, TOCs, Indexes, [...]) you have to compile the document multiple times. The first compile sets up the temporary files, then the second/third time reimplements that info into the final PDF. Quote:
Quote:
It is helpful when you need to use an (almost) dropin replacement: Helvetica ~= TeX Gyre Heros = \usepackage{helvet} Times New Roman ~= TeX Gyre Termes = \usepackage{mathptmx} Palatino ~= TeX Gyre Pagella = \usepackage{mathpazo} [...] To the normal human (and for most projects), they are equivalent, but some extremely minor things might be different:
If you wanted to use specific fonts directly in LaTeX, you would have to use the fontspec package: Code:
\usepackage{fontspec} \setmainfont{Times New Roman} <h1> ~= \part{} <h2> ~= \chapter{} <h3> ~= \section{} <h4> ~= \subsection{} <h5> ~= \subsubsection{} <h6> ~= \paragraph{} Quote:
If you included hyperref in your preamble and used all of the \part + \chapter + \section correctly, it should just work. If the PDF Reader supports PDF Bookmarks, then sure... if they don't, then it won't help. PDFs are pretty crappy to read on dedicated ereaders. It is typically very slow to turn pages, clunky, doesn't allow you to change fonts + font sizes, you have to pinch/zoom, searching/highlighting is crap, etc. etc. On the tablet/smartphone end, the PDF Reader selection is better, but personally, I wouldn't read PDFs on my phone (although many others do). If I had the choice, I would always go with EPUB/MOBI instead. If you are creating a "Mobile-Friendly" version of the PDF, me + RbnJrg figured out that a paper size of 5.5"x8.5" with small margins + 12pt font is still very readable on very small devices (smartphone) to very large (PC monitor). The amount of text you can shove per page can be roughly equivalent to your typical 7"x10" book. Here is a comparison between a 5.5"x8.5" (tiny margins, "Mobile-Friendly") + 6"x9" + 7"x10": Or here is a comparison of a two-page spread of the 5.5"x8.5" + 7"x10": Of course you can tweak any of the variables... but I still think it would be an inferior experience compared to a proper EPUB. Side Note: Jellby used LaTeX to create a "Mobile-Friendly" 9cm x 12cm "Alice's Adventures in Wonderland": https://www.mobileread.com/forums/showthread.php?t=21584 You can download that PDF and check it out. Absolutely fantastic work he did on that one. :P Last edited by Tex2002ans; 12-10-2016 at 11:55 PM. |
||||
12-20-2016, 03:25 PM | #7 |
Enthusiast
Posts: 48
Karma: 854254
Join Date: Nov 2016
Device: none
|
danke alle,
I got it working, I would like to point out the solution between latex options and ereaders. Because /documentclass{book} doesn't allow custom documen sizes when using 'extarticle' or some other /chapter will be DISABLED. I realized after changing all /chapter to /section and magically my TOC was rendered. peace |
12-20-2016, 04:20 PM | #8 |
Wizard
Posts: 2,986
Karma: 18343081
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Yes, chapters don't work in articles. Do you absolutely need to have a custom geometry? Your given dimensions are pretty close to A6 paper size. You could try using the "a6paper" geometry and see if it fits your needs. That way, you could use the "book" documentclass and keep the chapters.
|
12-20-2016, 08:08 PM | #9 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
What you want is to work from book class as a base. If you are working on creating a book, these are the three popular LaTeX classes that are used:
You could read more detailed comparisons here: https://tex.stackexchange.com/questi...ipt-and-memoir Last edited by Tex2002ans; 12-20-2016 at 08:13 PM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
LaTeX, vector graphics, PDF, and EPUB | Frotz | Writers' Corner | 7 | 02-24-2013 05:59 PM |
EPUB, MOBI, PDF... LaTeX! | Katsunami | Workshop | 8 | 02-07-2012 02:28 PM |
Créer des epub à partir d'une syntaxe wiki (chaîne d'édition vers PDF (LaTeX), xHTML | farvardin | Software | 1 | 04-03-2011 12:49 PM |
505 TOC from PDF to EPUB/LRF | wayamauro | Sony Reader | 18 | 09-27-2009 04:21 AM |
Chaîne complète d'édition : HTML, LaTeX, PDF, EPUB à venir. | Randy11 | Software | 2 | 04-05-2009 11:42 AM |