reddit / emacs

Assistance with Writing fiction with Emacs

Frequent-Video-251 · 2022-02-01 01:45
Hello all, I am a new user of Emacs (Following system crafters stuff no less). I am trying to use Emacs for writing fantasy books / Novels. However all the information ive seen has been so disparate that I cant find anything good on how to actually do it. ​ I know ORG-mode is the go to mode for this but I haven't seen much on how to actually convert said mode into epub or mobi or etc. So far Ive only really read ramblings on what you "could" do and not how to do it. ​ Does anyone have any specific website I may be able to look at? Am honestly unsure which subreddit this is supposed to be under ​ Tl:dr Assistance on how to use emacs to actually write with. My eyes are going blind from googlefu. ​ Post post - Compiled list of stuff: One can use Pandoc to convert from Org to Markdown and then fix that towards a good pandoc for E-books (no information on how to do that well on this thread nor is it emacs specific) [https://github.com/kawabata/ox-pandoc](https://github.com/kawabata/ox-pandoc) can be useful for going org to other associated Using Org and Latex is another way (most likely the best for conversion)
ieure · 2022-02-01 01:54
I don't know if there's really a mode for creating ebooks in Emacs. If you want to start from Org Mode, you'd need to set up [org-epub](https://github.com/syohex/org-epub) to export to ePub. I'm not sure how (or how well) it works.
Least_Isopod_4061 · 2022-02-01 01:55
Don't have a specific tutorial except to suggest setting org-mode to use [olivetti](https://github.com/rnkn/olivetti) and a nice variable pitch font for writing prose. You might also like the [poet theme](https://github.com/kunalb/poet). To export an org file to epub use [ox-epub](https://github.com/ofosos/ox-epub), and you'll get an option for epub in the normal org-mode export with `C-c C-e`.
Frequent-Video-251 · 2022-02-01 02:08
Thanks ill look into it
Frequent-Video-251 · 2022-02-01 02:10
Thanks for the input, I started looking at just pure markdown and then read people did it through Org, But there was not many tutorials or they just did "Look heres magic". Ill read up more on the org-epub method.
shidan · 2022-02-01 03:53
I think your ideal pipeline would be org > latex > pandoc. You will probably want to leave the last 20% of the latex typesetting and template modifications to a professional as the details matter.
quiteasmallperson · 2022-02-01 04:48
The `ox-pandoc` [package](https://github.com/kawabata/ox-pandoc) is really useful (you need to have pandoc itself installed) and can export to epub using just the export function of org-mode itself. (That, in turn, is [described thoroughly](https://orgmode.org/manual/Exporting.html) in the org manual.) If your target is ebook formats, [Calibre](https://calibre-ebook.com/) is another very useful program to have on board. Among many other powerful features you can use it to create ebooks, including covers and metadata, from a variety of file formats. So basically once you export from org to something Calibre likes better, such as epub or html, you're home free to make mobi or a variety of other things. Good luck!
chandaliergalaxy · 2022-02-01 08:22
Can't you also just write in markdown and use pandoc to export it to various formats? I'm a huge proponent of org-mode, but it's doesn't have to be for everyone.
chandaliergalaxy · 2022-02-01 08:26
My understanding is that many people who write nontechnical material (like fiction / creative writing) use Scrivener. If you google for Scrivener and Emacs, you'll find a lot of people who share their experience configuring Emacs for this sort of writing and you might find one that speaks to you.
tomheon · 2022-02-01 13:53
Hey there, I've written & self-published a number of novels using org mode to compose and then creating epubs, mobi, and print-ready pdfs from that source material. It (unfortunately) still requires a fair amount of technical experience, as a bunch of the process is driven through pandoc, a command-line driven program, and getting the format the way you want it in a repeatable, automated way means doing some light programming (for example, I had to write a python script to get rid of the indent after section breaks, and an awk script to do drop caps). Below is the Makefile that drove the process for my last book. I don't know anything about your technical experience level, so if this all feels familiar and workable to you, I'm delighted to answer any questions as you adapt this to your own workflow. If this feels overwhelming, you might want to take a look at scrivener, instead, as others have suggested, because this is about what it takes to get the process to work (in my experience). Cheers! (Edit: reddit's code formatting doesn't work well for makefiles. If you'd like to get this as a template, let me know and I'm happy to share the file and associated scripts. In the meantime, this should at least give you a flavor.) SRC=src PANDOC=/usr/bin/env pandoc --filter $(SRC)/filter-ignore.py TITLE=world-enough-and-time MS=world-enough-and-time.txt EDEDICATION=$(SRC)/dedication-ehead.md $(SRC)/dedication.md BACKMATTER=$(SRC)/about-reviews.md $(SRC)/acknowledgements.md $(SRC)/books-by.md $(SRC)/about-the-author.md $(SRC)/about-this-book.md $(SRC)/copyright-ehead.md $(SRC)/copyright.md $(SRC)/e-isbn.md BOOK_MATERIALS=$(EDEDICATION) $(MS) $(BACKMATTER) EXTENSIONS=+native_divs+fenced_code_blocks+raw_tex+old_dashes+smart FORMAT=org$(EXTENSIONS) TOC_OPTS=--toc --toc-depth 1 COMMON_OPTS=$(TOC_OPTS) --from $(FORMAT) EPUB_OPTS=$(COMMON_OPTS) --epub-metadata=$(SRC)/epub-md.xml --number-sections --epub-cover-image=$(SRC)/cover.jpg --to epub3 EPUB_META_FILES=$(SRC)/epub-md.xml $(SRC)/cover.jpg PANDOC_EPUB=$(PANDOC) $(EPUB_OPTS) EPUB2_OPTS=$(COMMON_OPTS) --epub-metadata=$(SRC)/epub-md.xml --number-sections --epub-cover-image=$(SRC)/cover.jpg --to epub2 EPUB2_META_FILES=$(SRC)/epub-md.xml $(SRC)/cover.jpg PANDOC_EPUB2=$(PANDOC) $(EPUB2_OPTS) PDF_OPTS=$(COMMON_OPTS) --filter $(SRC)/deindent-post-hr.py PANDOC_PDF=$(PANDOC) $(PDF_OPTS) PDFLATEX=xelatex OUTPUT_DIR=out EPUB=$(OUTPUT_DIR)/$(TITLE).epub EPUB2=$(OUTPUT_DIR)/$(TITLE).2.epub EPUB_FOR_KINDLE=$(OUTPUT_DIR)/$(TITLE).forkindle.epub MOBI=$(OUTPUT_DIR)/$(TITLE).mobi PDF=$(OUTPUT_DIR)/$(TITLE).pdf PDF2=$(OUTPUT_DIR)/$(TITLE)-double-spaced.pdf LATEX_BASE=$(TITLE).nodc.tex LATEX=$(OUTPUT_DIR)/$(LATEX_BASE) DROP_CAPPED_LATEX_BASE=$(TITLE).tex DROP_CAPPED_LATEX=$(OUTPUT_DIR)/$(DROP_CAPPED_LATEX_BASE) BOOK_CSS=$(SRC)/book.css NOOK_CSS=$(SRC)/epub-for-nook.css KINDLE_CSS=$(SRC)/epub-for-kindle.css NOOK_EDITION_CSS=$(OUTPUT_DIR)/nook-edition.css KINDLE_EDITION_CSS=$(OUTPUT_DIR)/kindle-edition.css AWK=gawk ifeq (, $(shell which gawk)) AWK=awk endif all: epub epub2 mobi pdf epub: $(EPUB) epub2: $(EPUB2) $(NOOK_EDITION_CSS): $(NOOK_CSS) $(BOOK_CSS) cat $(NOOK_CSS) $(BOOK_CSS) > $(NOOK_EDITION_CSS) $(KINDLE_EDITION_CSS): $(KINDLE_CSS) $(BOOK_CSS) cat $(KINDLE_CSS) $(BOOK_CSS) > $(KINDLE_EDITION_CSS) $(EPUB): $(BOOK_MATERIALS) $(EPUB_META_FILES) $(NOOK_EDITION_CSS) $(SRC)/filter-ignore.py $(PANDOC_EPUB) --css=$(NOOK_EDITION_CSS) -o $(EPUB) $(BOOK_MATERIALS) $(EPUB2): $(BOOK_MATERIALS) $(EPUB_META_FILES) $(NOOK_EDITION_CSS) $(SRC)/filter-ignore.py $(PANDOC_EPUB2) --css=$(NOOK_EDITION_CSS) -o $(EPUB2) $(BOOK_MATERIALS) separate epub => mobi process for kindle to support a separate css $(EPUB_FOR_KINDLE): $(BOOK_MATERIALS) $(EPUB_META_FILES) $(KINDLE_EDITION_CSS) $(SRC)/filter-ignore.py $(PANDOC_EPUB) --css=$(KINDLE_EDITION_CSS) -o $(EPUB_FOR_KINDLE) $(BOOK_MATERIALS) mobi: $(MOBI) $(MOBI): $(EPUB_FOR_KINDLE) # kindlegen doesn't allow dirs in output name and creates in same dir as source kindlegen -o tmp.mobi $(EPUB_FOR_KINDLE) mv out/tmp.mobi $(MOBI) $(OUTPUT_DIR)/%.tex: $(SRC)/%.md $(PANDOC) $(COMMON_OPTS) -t latex --top-level-division=chapter -o $@ $< $(OUTPUT_DIR)/dedication.tex: $(SRC)/dedication.md $(OUTPUT_DIR)/copyright.tex: $(SRC)/copyright.md $(OUTPUT_DIR)/acknowledgements.tex: $(SRC)/acknowledgements.md $(OUTPUT_DIR)/about-the-author.tex: $(SRC)/about-the-author.md $(OUTPUT_DIR)/about-reviews.tex: $(SRC)/about-reviews.md $(OUTPUT_DIR)/about-this-book.tex: $(SRC)/about-this-book.md GENERATED_TEX_FILES=$(OUTPUT_DIR)/dedication.tex $(OUTPUT_DIR)/copyright.tex $(OUTPUT_DIR)/acknowledgements.tex $(OUTPUT_DIR)/about-the-author.tex $(OUTPUT_DIR)/about-reviews.tex $(OUTPUT_DIR)/about-this-book.tex $(OUTPUT_DIR)/%.otf: $(SRC)/%.otf cp $< $@ $(OUTPUT_DIR)/%.ttf: $(SRC)/%.ttf cp $< $@ $(OUTPUT_DIR)/Valkyrie.otf: $(SRC)/Valkyrie.otf $(OUTPUT_DIR)/Valkyrie-BoldItalic.otf: $(SRC)/Valkyrie-BoldItalic.otf $(OUTPUT_DIR)/Valkyrie-Bold.otf: $(SRC)/Valkyrie-Bold.otf $(OUTPUT_DIR)/Valkyrie-Italic.otf: $(SRC)/Valkyrie-Italic.otf $(OUTPUT_DIR)/Valkyrie.otf: $(SRC)/Valkyrie.otf $(OUTPUT_DIR)/Valkyrie-SC.otf: $(SRC)/Valkyrie-SC.otf $(OUTPUT_DIR)/Audiowide-Regular.ttf: $(SRC)/Audiowide-Regular.ttf FONTS=$(OUTPUT_DIR)/Valkyrie.otf $(OUTPUT_DIR)/Valkyrie-BoldItalic.otf $(OUTPUT_DIR)/Valkyrie-Bold.otf $(OUTPUT_DIR)/Valkyrie-Italic.otf $(OUTPUT_DIR)/Valkyrie.otf $(OUTPUT_DIR)/Valkyrie-SC.otf $(OUTPUT_DIR)/Audiowide-Regular.ttf pdf: $(PDF) $(DROP_CAPPED_LATEX): $(LATEX) $(SRC)/lettrine.awk $(AWK) -f $(SRC)/lettrine.awk $(LATEX) > $(DROP_CAPPED_LATEX) $(PDF): $(DROP_CAPPED_LATEX) $(FONTS) cd $(OUTPUT_DIR); $(PDFLATEX) $(DROP_CAPPED_LATEX_BASE) cd $(OUTPUT_DIR); $(PDFLATEX) $(DROP_CAPPED_LATEX_BASE) pdf2: $(PDF2) $(PDF2): $(MS) $(SRC)/double-spaced.latex $(PANDOC_PDF) --template=$(SRC)/double-spaced.latex -o $(PDF2) $(MS) latex: $(LATEX) $(LATEX): $(MS) $(GENERATED_TEX_FILES) $(SRC)/template.latex $(SRC)/filter-ignore.py $(SRC)/deindent-post-hr.py $(PANDOC_PDF) --template=$(SRC)/template.latex --to latex -o $(LATEX) $(MS) clean: rm -rf $(PDF) $(PDF2) $(EPUB) $(EPUB_FOR_KINDLE) $(MOBI) tmp/* out/* $(GENERATED_TEX_FILES) .PHONY: clean
accoil · 2022-02-01 19:06
Doesn't help your export problem, but you may be interested in https://github.com/rnkn/binder. It's a mode inspired by Scrivener.
its_never_lupus · 2022-02-01 20:24
If you want a basic easy start: 1. Create a new file called my_book.org, copy this into it and save the buffer: #+TITLE: This is the title of my book * The first chapter Loren ipsum whatever. * The second chapter More writings. 2. Open a terminal, cd to the same directory as the file above, and run: pandoc my_book.org -o my_book.epub Assuming you have pandoc installed this will create my_book.epub which should work in an ebook reader. Congratulations on making your first ebook! From here you can look into: - pandoc documentation, to find ways of customising the look of the book, or even how to add pictures or more advanced text formatting - org-mode and emacs documentation, to find tips and tricks for editing the source files - Makefile and make tool documentation, for an easy way to run the command above or to combine multiple source files together to make editing them more manageable - elisp documentation, to find ways to compile and view the ebook from inside emacs without ever having to leave the editor Have fun and best of luck with the book! *Edit: reddit insists on applying formatting to the source file above so see https://pastebin.com/h781KGgA for the raw version
oantolin · 2022-02-02 00:47
If you select the Markdown editor on reddit you can keep your source blocks intact by indenting each line in them by four spaces: #+TITLE: This is the title of my book * The first chapter Loren ipsum whatever. * The second chapter More writings.
Frequent-Video-251 · 2022-02-17 13:38
Thanks for the inpuit, Will def be taking a look
tomheon · 2022-02-17 15:28
Cool, here's a pastebin with the indentation maintained: &#x200B; https://pastebin.com/iRRnC7MU