* Checklist This is a checklist for preparing an existing manuscript in .doc (.docx, .odt, etc.) so it can be used with the Nepo Press web-based automated formatting system to turn it into Mobi, EPUB, and "camera-ready" PDF files. This is primarily for my own use when formatting a manuscript for a customer, therefore it leaves out lots of details that you *must* read the user manuals *and* watch the videos to learn. In most cases, it is best if you STOP RIGHT HERE and do not read any further. If you are starting a *new* manuscript, then your task is much simpler. Please see the user manuals mentioned above. This checklist is provided as a UTF-8 plain text file (checklist.txt) to make it easy to copy and paste from it for people (such as the author of this checklist) to use with a text editor. To see it correctly in a web browser (or text editor or word processor), you may need to set the character encoding to UTF-8 or to Unicode (in Firefox, View / Character Encoding / Unicode). Much more information is available in the free user manuals and other documentation at http://nepotism.net, including the videos at http://nepotism.net/videos. If you are new to this, I highly recommend you read at least one of the beginning user manuals *first*. Last updated December 19, 2014 ** Opening and closing curly single quotation marks - opening curly single quote :: โ€˜ - closing curly single quote :: โ€™ - section mark U+00A7 or C-x 8 S :: ยง List of character codes: - https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references - https://en.wikipedia.org/wiki/List_of_Unicode_characters ** Overview Some of the work must be done within a word processor. The free LibreOffice word processor is the best one to use even if you created your manuscript with another word processor such as Microsoft Word, and even if you plan to do further editing using another word processor. Some of the work may be done in either a word processor or in a text editor. This author prefers the Emacs text editor, so this checklist shows certain steps in Emacs. If you use a different text editor, or if you use LibreOffice for all of the conversion work, you will need to adjust those steps accordingly. The main things to accomplish are: - turn off headers and footers - determine substitute character for asterisk (prefer $) - insert template and regular expression (RE) strings - replace actual asterisks with dollar signs (and mark breaks if appropriate) - mark chapters (checking first for bold in case that helps find them) with "$ " - mark scene breaks if not done yet - mark italics and bold with asterisks Throughout this checklist, I assume the manuscript is for the novel *Stormy Night* and the manuscript file is named stormy.txt or stormy.doc or stormy.odt or plain-text-stormy.txt. Adjust for your manuscript's name, of course. ** LibreOffice Detail - bring up .doc file in LibreOffice - uncheck Format / AutoCorrect / While Typing (in LibreOffice 5, it is under the Tools menu, i.e., Tools / AutoCorrect / While Typing - turn off headers/footers under Format / Page - find substitute characters for asterisk (*) and percent sign (%) that are not present in the manuscript. I prefer to use $ for asterisks. See if the manuscript contains any dollar sign, asterisk, or percent sign characters ($, *, %) --- if none, great. - make a note of the manuscript's word count. - insert the curly.odt boilerplate at the top of the document. It includes the search and replace strings for marking italics. (Insert / File) - look for any FIXME notes from the author (about smallquotes or setting a section with wider margins, etc.) - examine for asterisks (such as scene breaks or whatever). If so, isolate them by changing them to something else such as $ - check for bold in case that helps find chapters easily (checking for centering might also help to find chapters) - mark chapters with leading "$ " (NOTE, if searching for uppercase "CHAPTER", etc., be sure to check the "Match case" box) - mark italics (the RE strings are already in the manuscript .doc file because curly.odt was inserted at the top) Edit / Search & Replace / : search ([\s,]*)(.+?)([\s,]*)$ : replace $1*$2*$3 - similarly mark bold, if any - scene breaks (if not done already) (or do them in Emacs) - save as text - upload to the Nepo Press book account and format once as a Mobi file to create plain-text-stormy.txt - download plain-text-stormy.txt, rename to stormy.txt and continue editing it (not the original .doc file). If you do not wish to move to a text editor (such as Emacs, as shown below), then rename plain-text-stormy.txt to stormy.doc and continue editing it in LibreOffice. ** Move to Emacs | keyboard shortcut | command | | M-% | M-x query-replace | | C-M-% | M-x query-replace-regexp | | C-M-s | M-x search-forward-regexp | | | M-x occur | | C-x 5 C-o | M-x display-buffer-other-frame | | M-Tab | switch "frames" | | C-x 5 0 | M-x delete-frame | | C-x 5 1 | M-x delete-other-frames | Also consider Emacs batch mode for some of the conversion steps (http://www.emacswiki.org/emacs/BatchMode). Make sure % is not used in manuscript - open plain-text-stormy.txt and save as stormy.txt - M-x unwrap-paragraphs (See http://www.emacswiki.org/emacs/MultilineRegexp as I might not need to unwrap-paragraphs if I add |\n?| at the appropriate places (to allow zero or one newlines) to allow the match to cross line boundaries.) - Selectively remove italics from white space: C-M-% search: \*\([ ]+\)\* replace: \1 - Selectively remove italics from italicized single characters: C-M-% search: \*\(\S \)\* replace: \1 - M-x fix-apostrophes - Selectively undo some of above such as where 'husbands' was incorrectly changed to 'husbands% C-M-% search for: \(['\|`].*s\)% selectively replace with: \1' - M-x fix-single-quotes - replace all % with apostrophe M-% - M-x fix-hyphens (Should we afterwards check for any single hyphens that were missed? Or maybe check for a hyphen preceded by or followed by a space? Or by any number of spaces between the dots, to catch things like | . . . | or even just two or four dots like | . . | and | . . . . | - M-x fix-ellipses - fill in boiler plate - replace all $ with asterisk M-% - upload stormy.txt to the Nepo Press book account and format it as a Mobi file, for the purpose of creating stormy.html - search HTML (stormy.htm) for any asterisks (should be few if any) or any other problems ** Regexp M-x re-builder (to change syntax C-c C-i reb-change-syntax) (for single backslashes use 'string', for doubled backslashes use 'read') C-h S regexp for doco (doesn't work?) Here is a sample function (defun expand-next () "interactive" (goto-char (point-min)) (while (re-search-forward "\\next"))) search: \*\([\s ,]*\)\(.+?\)\([\s ,]*\)\* replace: \1*\2*\3 ** Emacs Functions ; I might want to narrow to region first with C-x n n ; (and widen again with C-x n w) (defun unwrap-paragraphs () "turn each paragraph into a very long line" (interactive) (set-fill-column 5000) (fill-region (point-min) (point-max))) (defun fix-apostrophes1 () "fix up single quotes in contractions and possessives, such as changing |don't| to |don%t| and |Alfred's| to |Alfred%s|" (interactive) (goto-char (point-min)) (while (re-search-forward "\\(\\w\\)['\\|โ€™]\\(\\w\\)" nil t) (replace-match "\\1%\\2"))) (defun fix-apostrophes2 () "Fix up single quotes in possessives that end with |s'|. Must do some manual checking afterwards." (interactive) (goto-char (point-min)) (while (re-search-forward "s'\\([\\s ,\\.]\\)" nil t) ; next change "the Smiths' dog" to "the Smiths% dog" (replace-match "s%\\1"))) (defun fix-apostrophes () "Fix up possessives and contractions. Must do some manual checking afterwards." (interactive) (fix-apostrophes1) (fix-apostrophes2)) Then, go back and manually search for "\\(['\\|`].*s\\)%" and selectively restore to "\1'" i.e., Instead, search/replace with C-M-% search for: \\(['\\|`].*s\\)% selectively replace with: \1' (defun fix-single-quotes () "change left single quote of each pair into a backtick" (interactive) (goto-char (point-min)) (while (re-search-forward "\\('\\|`\\)\\(.*?\\)\\('\\)" nil t) ; change |'hello'| or |`hello'| to |`hello'| (replace-match "`\\2'"))) (defun fix-hyphens () "Change | - | to |---|" (interactive) (goto-char (point-min)) (while (search-forward " - " nil t) (replace-match "---"))) (defun fix-ellipses () "Change |. . .| to |...|" (interactive) (goto-char (point-min)) ;(while (re-search-forward ". . ." nil t) (while (search-forward ". . ." nil t) (replace-match "...")))