I would like to add a character (e.g. $\hookleftarrow$) at the end of each line in a paragraph, in particular in a tabular cell, only if the paragraph has more than one line.
How can this be coded?
I would like to add a character (e.g. $\hookleftarrow$) at the end of each line in a paragraph, in particular in a tabular cell, only if the paragraph has more than one line.
How can this be coded?
Using the link provided by @GustavoMezzetti I've solved my question. The modified code is:
\documentclass{article}
\usepackage{blindtext}
\newcommand{\ppp}[1]{%
\parbox[t]{\dimexpr\linewidth-1em}{%
#1
\par
\count0=\prevgraf
\count2=\prevgraf
\loop
\ifnum\count0=\count2\else\mbox{}\hfill\rlap{\hspace*{0.1em}$\hookleftarrow$}\fi
\vskip-2\baselineskip
\advance\count0 -1
\ifnum\count0 > 0
\repeat
\kern\count2\baselineskip\mbox{}%
\strut}}
\begin{document}
\noindent\ppp{\blindtext}
\noindent\ppp{one line only}
\end{document}
Thank @GustavoMezzetti and @touhami. The post linked by @touhami is very interesting.