3

Output with \raggedright looks good when greater indentation is specified for \parshape, but \raggedright eats up smaller indentation.

If a word doesn't fit on a line, is there a way to prevent hyphenation and move the entire word to the next line without touching paragraph indentation (what I thought \raggedright would do) specified with \parshape?

\documentclass[varwidth]{standalone}
\begin{document}
  \parbox{40mm}
    { \parshape 3 0pt 113.81102pt 14.44pt 99.37102pt 17.77pt 96.04102pt
      \raggedright % comment this line to see the difference
      % \tolerance 0 % uncomment this line when \raggedright is commented
      \textbullet\ This is sentence 1.\\This is sentence 2.
      This is sentence 3.
    }
\end{document}

No \raggedright (indentation is preserved but inter-word spacing is excessive):

With \raggedright (no excessive inter-word spacing but indentation is ruined):

No \raggedright but with \tolerance 0 (too narrow inter-word spacing this time, and overflowed letter s; I need the word This to be moved to the next line automatically):

4

\raggedright redefines \\: it internally inserts a \par and so actually ends your \parshape. You can use \newline instead of \\:

\documentclass[varwidth]{standalone}

\begin{document}
 \parbox{40mm}
    { \parshape 3 0pt 113.81102pt 14.44pt 99.37102pt 17.77pt 96.04102pt
      \raggedright 
      \textbullet\ This is sentence 1 \newline This is sentence 2
      This is sentence 3
    }

\end{document}

enter image description here

Or set \rightskip:

\documentclass[varwidth]{standalone}

\begin{document}
 \parbox{40mm}
    { \parshape 3 0pt 113.81102pt 14.44pt 99.37102pt 17.77pt 96.04102pt
      \rightskip 0pt plus 1fil
      \textbullet\ This is sentence 1 \\ This is sentence 2
      This is sentence 3
    }

\end{document}

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.