reddit / emacs
Help for a writer
eburkhead · 2022-06-23 22:21
Hello r/emacs. I am in dire need of your assistance. My main hobbies are writing and playing around with programming. I am not particularly good at either, but I was drawn to emacs after seeing people post about how great it is as both an IDE and a word processor.
Over the last two weeks, I have scoured the internet trying to learn more about emacs. I configured spacemacs, and then switched to doom emacs. I have learned the basics of org mode and org-roam. And even though it's been a much steeper learning curve than I expected, I have really loved it so far.
However, I am stuck on one particular issue that is maddening and crippling my ability to use emacs the way I want. And that issue is almost enough to make me want to give up.
The problem is formatting. Eventually, I need to be able to output this to a word or a PDF doc in double spaced times new Roman font. And while I know that there are a myriad of ways to do that, I am struggling to find a way that works while making my words in emacs not completely unreadable.
As it stands now, if I tab or add spaces to indent my paragraphs, emacs will behave more like a programming text editor and indent the whole block of text. It looks fine if I copy it into libre word, but makes for tough writing in emacs itself
If I add a space to break up paragraphs in emacs (a new line character), then I am stuck with an undesired extra space when I put it in libre word, and I can't figure out an easy way to search and delete those extra lines in word itself.
I am not very good at configuring emacs, but I am trying to learn. Unfortunately, this one issue has made me almost want to give up completely even though I definitely see the advantages this software could offer. I feel like I am fighting with the system more than actually producing creative work.
If anyone has any good advice on how to solve this, I would appreciate it. I know the solution is there, but I have yet to find it in my searches of YouTube and Google.
GuardianDownOhNo · 2022-06-23 23:25
Using pandoc can be your friend here. Alternatively, exporting to LaTeX and then using a visual LaTeX editor for final formatting and export may help.
I’m sure there is a more direct way that another guru can offer, but this may serve your purpose.
eburkhead · 2022-06-23 23:39
Good to know! I haven't done much with pandoc or LaTeX, but I will look into those!
deerpig · 2022-06-23 23:59
You are making the mistake of thinking of Emacs as an IDE or a Word Processor. Go back to basics and use Emacs as a text editor. You don't use text editors to format text, you use them to write and edit text.
Then, when you are happy with something you have written, export it to PDF, or directly to Libre Office and do the formatting there. Org has a powerful built in export backend. If the org exporter doesn't do what you want, as mentioned in another comment look into pandoc. If you really want to go down the rabbit hole explore exporting to LaTeX which converts to PDF.
I have used org-mode to write books, with notes in org-roam which I then export using several steps to epub as well as to LaTeX which converts to camera ready copy that was sent to the printer.
Finally I suggest slowing down. As Treebeard said, "don't be hasty." Emacs is a tool that grows with you over time if you give it the time to reveal it's power. Invest in yourself and your tools and you will be repaid many times over.
GuardianDownOhNo · 2022-06-24 00:15
Pandoc should be easy to get working with doom - just add +pandoc to your org module form in .doom.d/init.el and M-x doom/reload (or sync). After that, your org files will have a pretty rich export (C-c C-e) selection out of the gate.
eburkhead · 2022-06-24 00:41
That is solid advice. I completely understand what you are saying about just focusing on writing text. That's actually what appeals to me about emacs.
It has been a little frustrating, because getting that text into any other software has not gone so well, but the ideas you and others have suggested are great!
It's wonderful to hear about how other people have made it work!
copperbranch · 2022-06-24 00:43
Try putting this in the top of your org file to make it double space
`#+LATEX_HEADER: \usepackage{setspace}`
`#+LATEX_HEADER: \doublespacing`
And this to make it Times New Roman
`#+LATEX_HEADER: \usepackage{times}`
You can use manual indentation, but depending on what Latex class (article, report, book, letter) you are using, they will come by default. I suggest you trying some and seeing which one better fits what you're trying to do.
To pick one, add this to top of the document:
`#+LaTeX_CLASS: book`
Let me know if it worked
​
This tutorial will likely be useful to you: [https://orgmode.org/worg/org-tutorials/org-latex-export.html](https://orgmode.org/worg/org-tutorials/org-latex-export.html)
GuardianDownOhNo · 2022-06-24 02:00
Would love to hear more about how you're using org-mode and org-roam together, if you're willing to share.
pxoq · 2022-06-24 03:17
see [this](https://www.reddit.com/r/emacs/comments/mxnrak/full_document_writing_in_emacs/gvrr31o/?context=3) (a old comment I made on easy document creation), exporting it as a ODT is the easiest by far. You can use the fully GUI abilities of libreoffice to make your document and you get the fully consistency and power of Emacs.
**EDIT**: See [this post](https://emacsnotes.wordpress.com/2020/06/21/create-a-stylesheet-for-your-opendocument-files-and-inline-the-xml-definitions-right-in-your-org-file-think-html_head-or-html_head_extra-but-for-odt-docx-files/) for a visual guide on how to get manuscript format using the org-export ODT solution.
rbslco · 2022-06-24 03:19
The most important concept to grasp here is separating your work into steps or phases. In Emacs phase, you give your document a proper *structure*. WYSIWYM (what you see is what you *mean*) is the key word here. Thus, you separate paragraphs with empty lines, you don't worry about spacing, fonts, indentations etc. The only thing that matters is that you use proper structure. In an ORG document that means your chapters are denoted by one star, sections with two stars, you put longer quotations inside `#+begin_quote ... #+end_quote` environments, italicized text between forward slashes, etc.
Visual work starts only *after* you've completed writing and structuring stuff, and it is done outside of Emacs, technically. It can still be automated for the most part. Others already pointed out the pandoc + LaTeX route, so you know where to look. I'll answer your question about exporting to Writer/Word document.
Org-mode is capable of exporting directly to ODT format (LibreOffice Writer's OpenDocument Text format). Also, it enables you to use predefined templates when exporting your document. Templates determine how exported text will look. Once you define text styles in a template (in this particular case: set text to Times New Roman, double spacing, indented paragraphs, with red headings set in Arial bold etc.), every time you use that template when exporting your ORG document, you'll get properly formatted text as a result.
If you wish to learn more about exporting to ODT, check out [Org-mode manual](https://orgmode.org/manual/OpenDocument-Text-Export.html). Here's a quick rundown:
(1) Export an ORG document you already finished, or are close to finish, to ODT. You'll use this exported document as a template. Classic Emacs keybinding would be `C-c C-e o o`, but I'm not sure what is equivalent in Doom. You'll have to check that out.
(2) Open exported ODT document in LibreOffice Writer. Press F11 to show "Styles" sidebar. You'll do the formatting over there. Click anywhere inside a normal paragraph in your text. You'll notice that "Text Body" style is automatically selected in "Styles" palette. Right click on Text Body > Modify. In "Font" tab set the font to "Times New Roman". In "Indents and Spacing" set first line to something like 0,5 cm, spacing above and below paragraphs to 0, and line spacing to "Double". Press "OK". Do the same for other relevant text styles: chapters, quotations, footnotes, etc.
(3) After you've finished tweaking paragraph styles, select all text in your document and delete it. Since this document is going to serve as a template, it doesn't need to contain any actual text. The whole point here is only to (re)define paragraph styles. Go to File > Save As > choose **.ott** format, not the default .odt, and name the document something like *my-org-to-odt-template*. Save it somewhere convenient like in `~/Documents/Templates` directory.
(4) Finally, the only thing left to do is to go back to your ORG document and add the following line at the beginning:
`#+ODT_STYLES_FILE: "~/Documents/Templates/my-org-to-odt-template.ott"`
Try exporting the document to ODT again and watch it formatted exactly as you wish.
Templates are very useful when you need the same document exported for different purposes. You'll have to play with styles a little bit initially, but once set, you can export in a matter of seconds a version for your university, a different version for your editor, another one for your publisher, etc.
cazzipropri · 2022-06-24 04:09
I write a lot of markdown in emacs and I find that the basic formatting features of markdown is well rendered by emacs.
TiMueller · 2022-06-24 08:30
Hello, another writer over here.
Everything the others have said about exporting and text editor versus word processor is right. If you still wish to have the text look more like a novel in emacs, look at this reddit thread: [paragraph indent for novel writing with emacs](https://www.reddit.com/r/emacs/comments/sgaxf7/paragraph_indent_for_novel_writing_with_emacs/).
Deep-Fox6860 · 2022-06-24 09:04
I think you're bothered by the paragraph indent mode; disable it by running `m-x paragraph-indent-minor-mode`.
AuroraDraco · 2022-06-24 09:04
This is the correct answer OP. What I was going to suggest too
eburkhead · 2022-06-24 12:15
Absolutely! I tend to gravitate towards writing very long, very complicated high fantasy novels. Think Game of Thrones, but less dark.
For the last few years, I've pretty much written exclusively using Google Docs, since it serves the obvious purpose of offering cloud storage and word processing. Due to the length of my books, I write each chapter as a separate file, which I then send out to my friends and beta readers for feedback. Whenever I am ready to start querying publishers, the plan will be to compile all of those chapters together into a single giant document.
That actually is not a bad work flow by itself, but there are some serious negatives for my specific needs. I tend to work with a pretty iterative process and a lot of outlines, and I like to take copious notes about characters, settings, and timelines. In the process of writing a book, or even a short story, I often generate a pretty significant amount of background text that I use just for reference.
Doing all of that in Google Docs is pretty clunky. With org-roam, it appears to be really easy to build up that library of notes and quickly pull them up for reference. In org-mode itself, I'm really loving the ability to quickly create split screens and fold in bullets. That allows me to write and rewrite scenes and chapters in a way that manages the mess and prevents a huge amount of clutter.
As it now stands, I have a few Google Docs that are dozens of pages long and include as many as three different drafts of a particular chapter, and I regularly find myself scrolling up and down as I rework different things.
I'm extremely grateful for all of the suggestions I've seen here, and I'm going to be working on testing all of them today. I definitely want to learn more about LaTeX, as I know that in the long run it probably offers the best options for my needs.
After sleeping on it last night, I actually was able to figure out a solution of my own to my problem. I tried writing out a few paragraphs in emacs with no indentations, and hit return twice to break up the paragraphs. Initially, I thought that was a problem since it would require me to go back and delete all of those breaks manually in libre office or Google Docs. For whatever reason, it didn't occur to me until this morning that I could search for that double newline paragraph break using regular expressions. In libre office, $\^ will allow you to find and replace those breaks, and then it's pretty simple to indent the first line of every paragaph using formatting.
eburkhead · 2022-06-24 12:16
This is very helpful! Thank you!
eburkhead · 2022-06-24 12:16
I will take a look at this. I have very little experience with LaTeX, but I think that's probably my end-game solution. Thanks for providing the link and the advice!
eburkhead · 2022-06-24 12:25
Yes, that's exactly what I'm talking about! I will try the suggestions in your thread as well.