1

I am using a code editor called RStudio. It can produce a .docx output of the code that looks fairly nice for publishing. However the .docx document uses the consolas font. In Word, it splits words at the end of a line. So it may do something like this

For consistency, we should choose whe

ther to write W1 first or to write X first.

I can't figure out how to fix this in Word. Does anyone have a suggestion? I tried changing the font but that does not fix the problem. I checked for line-breaks and it does not seem to have them because when I put the insertion bar to the left of the t as suggested and press backspace the e disappears

7
  • Surely you fix this in Word by removing the line-break which is inserted (position the cursor before the t of ther and press backspace). To fix the root cause it's likely that RStudio needs to change: it may be a simple setting checkbox; it could be a software upgrade. Commented Jan 13, 2019 at 9:14
  • Thank you. Sorry I was not clear, I have about 3000 of these occurrences and so what I would like to find is some way to either search and replace or some way to use the "copy formatting" feature in Word.
    – Jen
    Commented Jan 13, 2019 at 11:38
  • 2
    Hi. Weclome to GDSE. This sounds like the lines have line breaks at the end. I don't think it has anything to do with the font as such. Perhaps the fault is with the way the software is outputing the docx? Could you perhaps try reaching out to the developers. It may be a bug.
    – Billy Kerr
    Commented Jan 13, 2019 at 12:07
  • Thanks for the welcome. I checked for line-breaks and it does not seem to have them because when I put the insertion bar to the left of the t as suggested and press backspace the e disappears.
    – Jen
    Commented Jan 13, 2019 at 12:48
  • Aha: thanks for trying that. That's important information which should really be added to the question itself. Commented Jan 13, 2019 at 13:51

1 Answer 1

0

I've encountered the same problem and it is indeed caused by the Consolas font in combination with paragraph justification, not by any manual line-breaks.

I've changed the justified style to left-aligned, and it no longer splits words at the end of the line. Try it yourself and see if it corrects the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.