8

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

13

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

  • That's awesome, by the way, thank you so much. – Frank Seifert Feb 12 '13 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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