0

I am trying to use R Markdown documents for report writing in a way I used Word before for a couple of months. While RStudio/Markdown is generally great, there is one thing that keeps embarrassing me: the need to input two spaces to force a line break. My whole life related to writing on the computer screen is a life when pressing Enter means breaking the line. Moreover, I see in the editor that line is broken and new paragraph starts, but after the compilation of Rmd-file I see a wall of text, without line breaks, and have to go back and check whether all line endings have two spaces on their end. It is awful. I understand that maybe I need to develop a habit to input two spaces (which does not seem intuitive), but it is hard.

Is there a way to enforce Markdown parser in RStudio count end of the line in Rmd document as a line break, so I can avoid entering two spaces to force a line break? Maybe, there are workarounds, like RStudio addins or something else? I have searched these on the Internet but has not found any.

Alex Knorre
  • 620
  • 4
  • 15
  • 1
    if your output file is a .docx file you can maybe use a double Enter as if you wanted to start a new paragraph. You can then provide a Word template file for your R markdown script (as in https://vimeo.com/110804387) in which you set no spaces between paragraphs. – Davide Passaretti May 22 '18 at 14:46
  • 1
    Which R Markdown output format are you using? – Jonathan May 22 '18 at 16:06
  • @Jonathan PDF and Word. Currently Word. Any ideas, aside from using double Enter? – Alex Knorre May 23 '18 at 11:57
  • You might try setting `pandoc_args` to `--wrap=preserve`. https://stackoverflow.com/questions/26066621/preserve-line-breaks-in-pandoc-markdown-latex-conversion – Jonathan May 23 '18 at 18:18
  • So I ended with double Enter, as @DavidePassaretti suggested. Not very clean, but that will do. – Alex Knorre May 24 '18 at 09:43

0 Answers0