# Right margin exceeds

Here is my code

\documentclass[12pt,oneside,letterpaper,chapterprefix=on,numbers=noenddot,
]{scrbook}

%%%page set-up
\usepackage[none]{hyphenat} %to get rid of hyphenation
\usepackage[margin=1in,includefoot,heightrounded]{geometry}
\usepackage{mathptmx}%times new roman
\usepackage[doublespacing]{setspace}% <- changed
\usepackage{indentfirst} %indent first paragraph
\usepackage[document]{ragged2e} %ragged right
\setlength{\RaggedRightParindent}{\parindent}
\pagestyle{plain}

\begin{document}
standard LaTeX commands to change the text alignment. Alternativaly you can use therrrrrrrrrrrrrrrttttttttttttttt

\end{document}


I need the latex to start the long word from the new line and do not exceed the right margin of 1 inch. Could you give me some help. thank you

• Why are you loading package ragged2e? It allows hyphenated ragged documents, but you disallowed hyphenation completely. – Johannes_B Jun 11 '17 at 6:16
• Just put \raggedright in your preamble and don't listen to the sharelatex stuff. en.wikibooks.org/wiki/LaTeX/… – Johannes_B Jun 11 '17 at 6:19

Since you suppressing all hyphenation, there's not much of a point in loading the ragged2e package and using its \RaggedRight mode (which is enabled via the option document).

Instead, I'd like to suggest you use the instruction \raggedright and run \setlength{\parindent}{2em} after executing \raggedright.

\documentclass[12pt,oneside,letterpaper,chapterprefix=on,numbers=noenddot]{scrbook}

%%% document setup
\usepackage[none]{hyphenat} % no hyphenation
\raggedright
\setlength{\parindent}{2em} % *after* "\raggedright"

\usepackage[margin=1in,includefoot,heightrounded]{geometry}
\usepackage{mathptmx}%times new roman
\usepackage[doublespacing]{setspace}% <- changed
\usepackage{indentfirst} %indent first line after a sectioning header

\begin{document}

standard LaTeX commands to change the text alignment.
Alternativaly you can use therrrrrrrrrrrrrrrttttttttttttttt

\end{document}