hmemcpy / milewski-ctfp-pdf

Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source
https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
Other
11.01k stars 594 forks source link

PDF is great but ePub is even better (on e-ink devices) #256

Open Zingam opened 4 years ago

Zingam commented 4 years ago

There are alot of big screen ereaders these days but reading PDF on them is not very comfortable experience. ePub format is supported and much better on e-ink devices. It will be great if there is a epub version of the book with a proper Table of Contents (TOC).

chriseyre2000 commented 4 years ago

I have found out how to use pandoc to generate the epub:

pandoc -o ../out/CategoryTheory.epub ctfp.tex --resource-path=.:images

It does require copying all of the images to an images folder within the src directory.

I will be making this into a proper PR over the next few days.

andyleejordan commented 3 years ago

@chriseyre2000 Any chance you’ll get to that? I’d love an epub of this too.

chriseyre2000 commented 3 years ago

My nix skills are lacking. I will get back to this.

The above script does work for now.

MartinSeeler commented 3 years ago

Any progress on this? Would be great to have an epub for downloads. 😍

drupol commented 3 years ago

It is super easy to do with Github actions and pandoc.

Glidos commented 3 years ago

@drupol would be great if you would expand on that for those less familiar with exactly how Github actions work.

Glidos commented 3 years ago

@chriseyre2000 When I run that command I see many warnings, some "Could not load include file" and "Could not convert TeX math". The resulting file has in many places the rendered TeX followed by the TeX source. Is that what you see too?

drupol commented 3 years ago

@Glidos How can I help?

Glidos commented 3 years ago

@drupol have you tried this conversion? If so, I'd be interested to know if you see the same problems I've just posted.

drupol commented 3 years ago

@drupol have you tried this conversion? If so, I'd be interested to know if you see the same problems I've just posted.

No, I haven't tried yet, I'm sorry.

chriseyre2000 commented 3 years ago

I solved it by moving the images to an appropriate location, this is why I have had trouble generalising it.

On Fri, 28 May 2021 at 21:30, Paul Gardiner @.***> wrote:

@chriseyre2000 https://github.com/chriseyre2000 When I run that command I see many warnings, some "Could not load include file" and "Could not convert TeX math". The resulting file has in many places the rendered TeX followed by the TeX source. Is that what you see too?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hmemcpy/milewski-ctfp-pdf/issues/256#issuecomment-850655305, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIMRXY25DQNLDXMVDO3QN3TP74PNANCNFSM4RJFJS3A .

Glidos commented 3 years ago

I followed that part of the instructions... well I created hard links to all the images in a dir under src called "images". It wasn't image files that were mentioned in the errors. Thanks for the reply, all the same.

Glidos commented 3 years ago

I ended up just adding a new paper size appropriate for my kindle paperwhite, with very small margins, and building a pdf file. Here's the contents of the opt- file in case it's useful to anyone else:

% !TEX root = ctfp.tex

% Options for kindle paperwhite

\def\OPTmodes{oneside,openany,11pt}

% PAGE FORMAT
%
% Page geometry
\def\OPTpaperesize{90mm,120mm} % Page size
\def\OPTtopmargin{5mm}        % Margin at the top of the page
\def\OPTbottommargin{5mm}     % Margin at the bottom of the page
\def\OPTinnermargin{5mm}    % Margin on the inner side of the page
\def\OPToutermargin{5mm}    % Margin on the outer side of the page
\def\OPTbindingoffset{0mm}     % Extra offset on the inner side

\def\OPThidelinks{false}

The very small bottom margin cause the page numbers to be pushed off page. Making that 10mm brings them back, but only just, and in an odd looking position. I couldn't see how to control page number positioning independently.

tannerntannern commented 1 year ago

in case it's useful to anyone else

Useful to me 3 years later! I have a kobo e-reader of similar size so these settings worked great. Thanks @Glidos 🙂