How ro Write a Book

Writing a book

To write a book is a time-consuming process, and if you want to spend a year or more of your life doing it, it makes sense to choose the best tool for the job. Writing a Resource in Emacs To write a work is a time-consuming task, and if you want to spend a year or more of your entire career doing it, it makes good business to choose the best tools for the task. And if you are interested in technology - and if you use Emacs - the option is there.

Traditionally, the publication process includes a publishers, a writer (you are), an editor (a true being) and mostly Microsoft Word. If a non-technician wants to compose a word in Word, there are many good reasons: This makes it simple to share files and find a computer with any Word installation.

They' re looking for your script in Word anyway. Spell and grade check is great; the changes to the tracks and annotations are practical; it's wysiewyg, so it's simple for someone to reformat; and if you feel like it, you can even compare them. Ironically, once your script is completed, a Santa's Helpers Day cracking crew spends their time removing your text from Word so that they can put it into Adobe InDesign.

It' even more fun when you consider that many teeny guys are writing the text in Markdown, Dokbook or re-structured text just to insert it into Word. If you are writing a work about Emacs, it would be duplicitous not to use Emacs. Anyway, Emacs happens to be the right decision.

So when I chose to compose the script, I wanted it in both ePub and PDFs. However, not everyone shared my passion for PDFs, so I had to choose a tool chain that I could at least use to spend ePub with. LaTeX is the closest option.

In fact, the definitive PDF edition is set with LiteX. However, it is a rather barrier-free and Turin full size program; if you get too far off the well-trodden paths (or too smart), the LaTeX-to-ePub generations would feel it. Since I knew how complicated it can be to map one file to another, I chose not to publish the volume in DaV.

In the end, I chose re-structuredText. So, the brainchild was to create the text in re-structuredText and use Pandoc to transform it to ePub and DaTeX.

Sadly, it was hard to convert Org modes from one type to another. Could have been exporting Org as HTML, but like you can do the same with it. In addition, reStructuredText has a clearly definable specifications and the documentation tools to help you when Pandoc has down.

And I didn't want the effort of changing the format halfway, so I chose re-structuredText. I' m using Emacs, what could be called thermo-nuclear text processing. Emacs has several modification keys, each with its own character: Here is a photo of what the reStructured text looks like.

So I had to employ an editorial staff. At the same time I didn't want to get involved with Microsoft Word. Instead, I sent the script - the rough reStructured text script - to the publisher and she processed it as if it were her own one. Still wanted to use Microsoft Word, so I put the rough text in a Word doc, converted it to a fixed-width text and asked her to deactivate Word's "helpful" AutoCorrect because it would change the format of re-structuredText.

I used Emacs' M-x idiff buffer when she completed the script to differentiate the revised and pristine sourcescript. SUE: And Emacs would ignore any line beginning with that design. As a result, I was able to write the text in re-structured Text, have it edited in re-structured Text and correct it in Emacs with idiff.

That is one where I wish I had Microsoft Word. I' ve used M-x flyspell-mode to keep track of misspellings as I typed, and I've adapted asppell (the command line dictionary that Emacs uses in the background) to use American language instead of my mother tongue LOCALE: But asppell is a reasonable, not great check.

It' good for writing notes and smaller reader content, but for a script I found that it misses too many things and uses unpleasant hyphenation conventions. Being able to tap C-M-i on a wrongly spelled words and have Emacs corrected automatically was certainly useful. There' s a men's database and a few samples and a few scattered blogs that explain how to do the basics, but that's it.

Now, if you want to find out why certain formating algorithms in re-structuredText are not used in the edition of reTeX, this is important to you. Eventually I had to immerse myself in the sources to find out why some things worked and others did not. It turns out that re-structured text is not fully endorsed like his Markdown mark-up co-worker; or the redheaded poor child of Markdown, Pandoc Markdown, Pandoc's own attitude to Markdown.

It is perfectly acceptable that some formats are not similarly endorsed, but I wish they had made it clear what they could and could not. Maybe I have chosen a different file type if I knew it - or maybe I didn't, who knows? You can, for example, assign rolls to text in the text area.

I' ve found that Pandoc transforms everything into some kind of abstract syntax tree in JSON form. So, I thought: Great, I'll use Pandoc's capability to call Python with every single vector from the ASP and then create the LiteX (and HTML for ePub) I need by default. I had to fetch 900 Megabytes of Cubase to even run the fucking thing from code.

So I got fade-backs from reStructured text from bower and npm and the whole JS eco-system and finally chose to add user-defined tags to the text reStructured text sources which I then mapped with seg in either LiteX or HTML. Nevertheless, Pandoc is a great instrument, and I'm happy that it's there and I could use it.

If I did it all again, I would use document styles to spew HTML (the launchex it creates is OK, but not great) and then turn it into my destination fileds. This is very important for barrier-free access if you want a PDF file that is as similar as possible to pure text.

All in all, it works great and it' s not hard to spell it out. Adapting LateTeX is hard. Activating numbers in the old order (lower case) is simple enough until you only want to activate them in some parts of your work. The fact is that tinkering with LateTeX is timeconsuming, but very important to me, so I spend my spare minute trying to make it look as good as possible.

It is a great composition system, and I could have made the whole thing look even better if I had just concentrated on PDF. The smallest of the denominators (ePub on Kindles, but more on that in a second) withheld it. What I wanted was fancy spreadsheets and vectorised arrow numbers that show how the dot moved through the text, rather than the easier style I used in the work.

I couldn't do that in reStructuredText and Pandoc. It looks great on a high DPI display and I've only got good reviews so far. A ePub document is a zipped document containing a CSV document, an picture of the covers, a meta data document and a series of HTMLs.

The conversion to eBub is therefore not a turn-key matter, even if it seems so from the first. I' m happy I added supporting eBub, but it was a great deal of work to make it look good on old releases and good on new one. I' m using a plain Makefile to create the export format and in the case of DaTeX the temporary one. text, so I can use some transcripts on it.

Out of Emacs I used M-x compil to execute the make statement and show the result. Obviously the makefile itself was also created in Emacs. At the end I realised that I didn't have to turn the resulting data over so quickly because I'm a familiar data protector and did it much more often than I checked the results.

Or I could do it with a secure check (or even an intootifywait check) in Emacs. Emacs' PDF search capability allowed me to check the work in Emacs, next to the reStructuredText document, which was sometimes useful. During the whole process of my letter I spend all my free space working and touching phrases (M-e, M-a, M-k) and sections (M-{, M-}).

One part of what made my work less cumbersome was the removal of unnecessary material like fiddles with typefaces and style - a job that was referred to simply mark up in re-structuredText and the font itself, which I set for the type. Obviously the script was saved in the Git and Magit sources-controls.

By and large, the entire process, from the conceptual design as a note row and TODO in Org format to the edit and merge of changes made by the corrector, took place in Emacs. I only had the Kindle Previewer in Emacs that I didn't have. -Emacs is a great way to edit and write books.

I' ve used re-structuredText text, but Markdown, ASCIIDoc, Docbook or any number of file types would work just as well. Emacs' e-diff is a high performance comparison utility that allowed me to follow the changes made by the reviser and make selective use of them, but also process them before handing them over to the orginals.

This is the only thing I think was really good enough to write it in Emacs.

Auch interessant

Mehr zum Thema