右边距超出

右边距超出

这是我的代码

\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 
\setlength{\parindent}{2em} %adjust indentation
\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}

我需要 latex 从新行开始长单词,并且不超过 1 英寸的右边距。你能帮我一下吗?谢谢

答案1

ragged2e由于您抑制了所有连字符,因此加载包并使用其\RaggedRight模式(通过选项启用)没有多大意义 document

相反,我建议你使用指令\raggedright并运行\setlength{\parindent}{2em} 正在执行\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}

相关内容