Trying to execute @DavidCarlisle code I still having errors
! Missing number, treated as zero. \ l.21 ...{5cm}{4}{10pt}{2cm}{1}{5cm}{8cm}\ \lipsum[ 1] A number should have been here; I inserted '0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.)
! Missing = inserted for \ifnum. \ l.21 ...{5cm}{4}{10pt}{2cm}{1}{5cm}{8cm}\ \lipsum[ 1] I was expecting to see '<', '=', or '>'. Didn't.
\documentclass{article}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\parindent0pt
\parskip\bigskipamount
\makeatletter
\def\newparshape{\parshape\@npshape0{}}
\def\@npshape#1#2#3{\ifx\\#3\expandafter\@@@npshape\else\expandafter\@@npshape\fi
{#1}{#2}{#3}}
\def\@@npshape#1#2#3#4#5{%
\ifnum#3>\z@\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
{\expandafter\@@npshape\expandafter{\the\numexpr#1+1\relax}{#2 #4 #5}{\numexpr#3-1\relax}{#4}{#5}}%
{\@npshape{#1}{#2}}}
\def\@@@npshape#1#2#3{#1 #2 }
\makeatother
\begin{document}
\newparshape{3}{5pt}{5cm}{4}{10pt}{2cm}{1}{5cm}{8cm}\\\lipsum[1]
\newparshape{2}{5cm}{5cm}{2}{4cm}{5cm}{2}{3cm}{5cm}{1}{0pt}{\textwidth}\\\lipsum[1]
\end{document}
Note that I have texlive 2016, any suggestions.
\ \lipsum[1]had to be\\\lipsum[1]. Meaning the\newparshapeends with\\\and then the text follows. I have made that correction in the original code by @DavidCarlisle and in your code above. – Pieter van Oostrum Dec 21 '16 at 11:33:(. A tip: for getting a double backslash in comments, use “double backquote, double backslash, double backquote”:\\– egreg Dec 21 '16 at 11:45