Table of Contents
1 writing a book in Emacs
I am not going to preach the powerful tool, Org. In this post, I want to write something on the tools which facilitate the literature writing. Indeed, if I am going to write a book someday (when time is not a problem), the very tool I will adopt definitely is Emacs.
With high probability, I will adopt the workflow like Mickey Petersen
did. Also, Emacs has many extensions that make writing a book or an
article in large size possible. In general, I will write it in Org
mode, and export the book to other format with just a
C-c C-e, which
is a convenient shortcut memorized by my muscle.
2 Extensions that facilitate writing
2.1 Working Environment
My working Environment is listed as below:
- Windows 10 on Surface Pro 4;
- Emacs 25.0.5;
- Org 9.1.6;
- Also, I use spacemacs, a comprehensive configuration with many functions organized as layers.
The Org mode, the killer extension, makes Emacs great again. I surely did quite a few customization on Org. However, I use the org layer shipped with spacemacs.
Also, you can configure Org like a word processor. Org-bullet package make Org mode beautiful. I set Org bullets as:
(setq org-bullets-bullet-list '("✿" "❀" "♣" "♧" ))
As mentioned before, you can export your Org file using several formats such as HTML,TeX, PDF, Markdown and so on.
I use Org writing my own blog through ox-hugo. Of course, I use Hugo. Why not? Hugo is fast and disk-space-friend. Hugo also has its windows distribution. ox-hugo export the org files as markdown files which are supported by hugo.
I use Org to export PDF based on the latex class defined org-article ,which is a latex class I forked from tsdye/org-article and added the support for Chinese characters. Org-article is a flexible latex class and export beautiful PDF with the good-looking fonts and architecture.
2.3 Spell Checking
Using flyspell, spell checking is easy. There is a layer named spell-checking distributed with spacemacs.
I use aspell instead of ispell. So, I set:
(setq-default ispell-program-name "C:/Aspell/bin/aspell.exe")
Of course, you have to install aspell and the dictionaries. I use the Win32 version.
Using flyspell mode, you can also insert some word into your personal dictionary.
2.4 Moving around
Using Spacemacs, moving around is easy because it has almost all the jumping shortcuts used in Vim (if you use the Vim mode in spacemacs).
On the other hand, using Org, you can jump from headline to headline easily. Promoting and demoting a headline is also fast. You can even change the head level of a headline using just a few keystrokes.
tab key is a useful shortcut to change the face of how the Org
buffer looks like. I use the
tab key to give me a sketch view of the
post I am working on. Furthermore, you can even use the narrow
function to restrict the buffer showing only the section of subsection
part you are working if your file is getting large and you don’t want
to be distracted by other parts of your article.
Through the writing of this post, I also using the commands moving around sentences and paragraphs often.
||the basic Vim keys, need no description|
||goto the beginning of a line|
||goto the end of a line|
||goto the beginning of a sentence|
||goto the end of a sentence|
||move a paragraph up when cursor stays in a paragraph|
||move a paragraph down when cursor stays in a paragraph|
||goto the beginning of previous paragraph|
||goto the beginning of next paragraph|
In the Org mode, the following commands are also very convenient.
||org metadown when cursor stays in a headline|
||org metaup when cursor stays in a headline|
||promote a headline when cursor stays in a headline|
||demote a headline when cursor stays in a headline|
||goto the next headline of the same level|
||goto the previous headline of the same level|
||goto the next headline, not necessarily the same level|
||goto the previous headline, not necessarily the same level|
2.5 count words
count-words is a command built in Emacs. There is a github
repository “advance words count” which helps count the CJK word. If
you write in CJK language, it will be handy.
2.6 focus on current section
Three handy functions help me focus on what I am working on.
- the fullscreen
spacemacs/toggle-fullscreen-framewhich block distractions from other apps.
- the org-capture which allow me capture the ideas or aspirations hitting my head.
- the narrow function. This is extremely useful especially when your article or post have quite a lot sections. You can narrow your buffer to the very section you are working on.
- Emacs for writing ? Tell me your tricks !
- My Emacs Writing Setup . This is an old post by Tony Ballantyne, a writer, whose blog http://tonyballantyne.com/ provides a lot of information on how to write.
- On irreal.org , you can always find something unexpectedly.
- An Absolute Beginners Guide to Spacemacs for Academic Writing . This post is a comprehensive guide for beginners using spacemacs. I learn quite a lot from it.
- Pandoc, the swiss-army knife for file format conversion.