[Tex/LaTex] Combining leftskip, rightskip and raggedright

horizontal alignmentindentation

For some text (\blindtext below), I would like to add 20pt to the left and right page margin, and I would like the text to be raggedright (no hyphenation).

The first try below does not add 20pt to the right margin. The second try below does not apply raggedright.

\documentclass{article}
\usepackage{blindtext}

\begin{document}
\setlength{\parindent}{0pt}
TEXT LEFT \hfill TEXT RIGHT

\begingroup\raggedright\leftskip=20pt \blindtext \par\endgroup
\par\vspace{20pt}

\begingroup\raggedright\leftskip=20pt\rightskip=20pt \blindtext \par\endgroup
\end{document}

enter image description here

Best Answer

You have to add 20pt to the value of \@rightskip and \rightskip set by \raggedright; with your setting you lose the flexibility of \rightskip necessary for getting a ragged right effect.

\documentclass{article}
\usepackage{blindtext}

\begin{document}
\setlength{\parindent}{0pt}
TEXT LEFT \hfill TEXT RIGHT

\begingroup\raggedright\leftskip=20pt \blindtext \par\endgroup
\par\vspace{20pt}

\begingroup\raggedright
\leftskip=20pt
\advance\csname @rightskip\endcsname 20pt \advance\rightskip 20pt
\blindtext \par\endgroup
\end{document}

enter image description here