TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to Write a Book in Emacs (2015)

145 pointsby sea6earover 5 years ago

17 comments

emmanueloga_over 5 years ago
I recently explored a bit the (seemingly never ending!) landscape of ways to create ebooks. In the process, I found a number of technologies I did not know before:<p>* <a href="https:&#x2F;&#x2F;www.dita-ot.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.dita-ot.org&#x2F;</a><p>* <a href="http:&#x2F;&#x2F;projectmallard.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;projectmallard.org&#x2F;</a><p>* <a href="https:&#x2F;&#x2F;www.xmlmind.com&#x2F;tutorials&#x2F;HTML5Books&#x2F;HTML5Books.html" rel="nofollow">https:&#x2F;&#x2F;www.xmlmind.com&#x2F;tutorials&#x2F;HTML5Books&#x2F;HTML5Books.html</a><p>I find the concept of DITA very interesting: to write reusable chunks of content (called &quot;Topics&quot;), that one can later map into chapters and sections to generate a whole manual. DITA is geared towards creating manuals, but got me thinking it would be a useful way of splitting content for books and even blog posts.<p>Mallard seems inspired by DITA but more minimalist. Looks pretty cool if I was generating documentation for a software product.<p>The last resource is what I will actually try [1]: &quot;XMLmind Ebook Compiler (ebookc for short) is a free, open source tool which can turn a set of HTML pages into a self-contained ebook. Supported output formats are: EPUB, Web Help, PDF, RTF, WML, DOCX (MS-Word) and ODT (OpenOffice&#x2F;LibreOffice).&quot;<p>Similar to the author of the OP, I also like PDF better than other formats for reading ebooks.<p>1: <a href="https:&#x2F;&#x2F;www.xmlmind.com&#x2F;ebookc&#x2F;download.shtml" rel="nofollow">https:&#x2F;&#x2F;www.xmlmind.com&#x2F;ebookc&#x2F;download.shtml</a>
redsymbolover 5 years ago
I wrote Powerful Python in Emacs.<p>In short, it worked great. Can&#x27;t imagine choosing to write a technical book like that in any other editor today.
emmanueloga_over 5 years ago
As an aside I want to say I really like this book. One of the best resources to learn emacs, it puts a lot of emphasis on teaching how the help system works and how to find the way around the editor independently of how it is configured.
评论 #21945334 未加载
datashowover 5 years ago
How does this compare to R Bookdown ( <a href="https:&#x2F;&#x2F;bookdown.org&#x2F;yihui&#x2F;bookdown&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bookdown.org&#x2F;yihui&#x2F;bookdown&#x2F;</a> ), which can do the regular markdown stuff, plus LaTeX, and also run the R code and embed results (tables, plots, etc.) into the book?
评论 #21945656 未加载
kragenover 5 years ago
I just did something similar. Maybe others will benefit from my experience.<p>For Dercuano I mostly just used Markdown (in Emacs and occasionally Vim, with Git) but then at the end I wrote a janky HTML renderer that outputs PDF in order to have a format people can read on cellphones. If I hadn&#x27;t done such a rush job on the HTML renderer, I think it would have come out pretty well.<p>A couple of aspects that <i>did</i> work well were Latin Modern Mono Condensed Light (lmtlc), a TeX font derived from Computer Modern Teletype, page-number links, and Reportlab. lmtlc made it possible to produce a PDF that can display 80 columns of fixed-pitch text on a cellphone screen at a readable size, although I had to fall back to FreeMono for characters outside lmtlc’s repertoire and for boldface. And page numbers make it possible to follow links in Google Drive’s inept PDF viewer, which otherwise lacks any such ability and is disappointingly the Android default, with about 15 seconds of focused effort. Not great, but not bad for a 3700-page book. And Reportlab, a PDF output lib for Python 2, is just a pleasure to work with, which is a phrase very rarely found near the word “PDF”.<p>The PDF renderer is at <a href="https:&#x2F;&#x2F;github.com&#x2F;kragen&#x2F;dercuano&#x2F;blob&#x2F;master&#x2F;genpdf.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kragen&#x2F;dercuano&#x2F;blob&#x2F;master&#x2F;genpdf.py</a> but probably it would have been a better use of time to figure out how to do it in pandoc, which has an actual box model, even though Petersen isn&#x27;t enthusiastic about his experience with it.<p>Readability on cellphone screens is really difficult, demanding a lot of compromise, and I&#x27;m very happy with what I was able to achieve there. With another couple of days I would have added hyphenation and justification, which would have made it considerably better still. The result is at <a href="http:&#x2F;&#x2F;canonical.org&#x2F;~kragen&#x2F;dercuano.20191230.pdf" rel="nofollow">http:&#x2F;&#x2F;canonical.org&#x2F;~kragen&#x2F;dercuano.20191230.pdf</a>.
mark_l_watsonover 5 years ago
The author doesn’t like markdown, but if you like markdown consider using leanpub.com<p>Emacs and VSCode (the two editors I use) have great support for markdown and the leanpub work flow is very nice.
dangover 5 years ago
Discussed at the time: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9714695" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9714695</a>
Ice_cream_suitover 5 years ago
Quite a number of mathematics and computer science books are written using latex + emacs.
wodenokotoover 5 years ago
things I were missing while writing my thesis were completely different from things mentioned in the article:<p>1) A left hand pane with a tree structure of everything, including chapters, headlines, figures and tables. Dragging and dropping should move sections and the tree should understand that chapters are stored in separate files.<p>2) An autocomplete for referencing the above.<p>3) An autocomplete for references in my bib file (and no, I shouldn’t have to remember which paper acl2008a is. I should be able to autocomplete on name or author or date and see exactly which paper I’m pointing to)
ggmover 5 years ago
Hugely impacted by reStructuredText. Had the author made any other choice the problem space would have been different.<p>Still a good read.
omarhaneefover 5 years ago
You can write the text in anything really, but Microsoft Word won out in books and legal work because it has group editing capabilities (comments, track changes, reverse or accept changes etc). Google Docs seems like it might be a contender.<p>That description of the editing process sort of convinced me <i>not</i> to try emacs for this.<p>I like org mode too, but giving up the editing for org mode doesn&#x27;t seem like a fair bargain.<p>edit: I know this author doesn&#x27;t use org-mode. I was just pointing out my favorite feature of emacs.
评论 #21946616 未加载
BooneJSover 5 years ago
Question on the book itself: as a 20 year vim user, is it a good book to learn Emacs?
评论 #21948018 未加载
评论 #21951543 未加载
评论 #21951429 未加载
haecceityover 5 years ago
Anyone know what window manager he&#x27;s using here?<p><a href="https:&#x2F;&#x2F;www.masteringemacs.org&#x2F;static&#x2F;uploads&#x2F;ediff.png" rel="nofollow">https:&#x2F;&#x2F;www.masteringemacs.org&#x2F;static&#x2F;uploads&#x2F;ediff.png</a>
评论 #21945023 未加载
评论 #21942286 未加载
clircleover 5 years ago
I love Emacs, but my editors will never touch anything that&#x27;s not a docx, so Word it is...
评论 #21942792 未加载
Stay_frostJebelover 5 years ago
So why not AsciiDoc instead of rst?
bhaakover 5 years ago
ePub on Kindles? When did that happen? Or is the author missing a step?<p>Or is the AZW&#x2F;KFX format similar enough to HTML that - like with ePub - a generic HTML file will get you almost everything you need (plus some metadata and a simple conversion)?
评论 #21949998 未加载
cryptoquickover 5 years ago
Easy! Just push all the buttons on your computer in the right order.
评论 #21945299 未加载