I would like to add a random white space at the begining of each line in a flushleft typeset paragraph. The idea is to simulate a hand-written manuscript.
I thought I could do trick lineno package to do this but that's not the logic. Any idea would be welcome.
Follow-up question
Sašo Živanović's solution works, but in a similar context, it conflicts with a previously defined macro: the paragraph shape remains normal.
% Based on some ideas from http://tex.stackexchange.com/a/29458
\documentclass{article}
% thanks to Bruno Le Floch
\usepackage{rotating}
\usepackage[first=-3,last=5]{lcg}% you can play around with these values
\makeatletter
\newcommand{\globalrand}{\rand\global\cr@nd\cr@nd}
\makeatother
\newcommand{\randomrotation}[1]{\globalrand\turnbox{\value{rand}}{#1}\phantom{#1}}
% thanks...
\makeatletter
\def\handmove#1{%
\@handmove#1 \@empty }
\def\@handmove#1 #2{%
\randomrotation{#1}\space
\ifx #2\@empty
\else
\expandafter\@handmove
\fi
#2%
}
\makeatother
%la macro de Saso Zivanovic
\usepackage{pgf,pgffor}
\usepackage{etoolbox}
\def\randomflushleftpercent{0.3}
\def\randomflushleftn{42}
\newenvironment{randomflushleft}{%
\raggedright
\everypar={\computerandomparshape}
}{}
\def\computerandomparshape{%
\gdef\myparshape{\parshape\randomflushleftn\space}%
\foreach \n in {1,2,...,\randomflushleftn} {%
\pgfmathparse{rnd*\randomflushleftpercent*\textwidth}%
\xappto\myparshape{\pgfmathresult pt }%
\pgfmathparse{\textwidth-\pgfmathresult}%
\xappto\myparshape{\pgfmathresult pt }%
}%
\myparshape
}
\begin{document}
\pagestyle{empty}
\begin{randomflushleft}
\handmove{Solacia dua, nequaquam paria tanto dolori, solacia
tamen. Solacia dua, nequaquam paria tanto dolori, solacia
tamen. Solacia dua, nequaquam paria tanto dolori, solacia
tamen.}
\end{randomflushleft}
\end{document}


