From 26185a9edd4fa917ddf42dceabdb5d7a10ab253d Mon Sep 17 00:00:00 2001 From: Kosyrev Serge <_deepfire@feelingofgreen.ru> Date: Sat, 25 Jun 2016 04:09:00 +0300 Subject: [PATCH] Drop problematic usage of the `environ` package, fixes #8 --- grid-system.sty | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/grid-system.sty b/grid-system.sty index 5cb8b19..eb56546 100644 --- a/grid-system.sty +++ b/grid-system.sty @@ -4,7 +4,7 @@ \RequirePackage{calc} \RequirePackage{xkeyval} \RequirePackage{ifthen} -\RequirePackage{environ,forloop} +\RequirePackage{forloop} \newlength{\gridsystem@rowwidth} \setlength{\gridsystem@rowwidth}{\linewidth} @@ -49,14 +49,19 @@ \gridsystem@finishrow% } -\NewEnviron{Cell}[1]{% - %\global\@namedef{gridsystem@cellcontent\arabic{gridsystem@cellcount}}{\BODY}% - %\edef\@celltemp{\BODY}% - %\global\@namedef{gridsystem@cellcontent\arabic{gridsystem@cellcount}}{\@celltemp}% - \expandafter\global\expandafter\let\csname gridsystem@cellcontent\arabic{gridsystem@cellcount}\endcsname\BODY% - \global\@namedef{gridsystem@cellwidth\arabic{gridsystem@cellcount}}{#1}% - \stepcounter{gridsystem@cellcount}% - \addtocounter{gridsystem@stripecount}{#1}% +\newenvironment{Cell}[1]{% + %\global\@namedef{gridsystem@cellcontent\arabic{gridsystem@cellcount}}{\BODY}% + %\edef\@celltemp{\BODY}% + %\global\@namedef{gridsystem@cellcontent\arabic{gridsystem@cellcount}}{\@celltemp}% + \xdef\gridsystem@cellstripes{#1}% + \expandafter\global\expandafter\let\csname gridsystem@cellcontent\arabic{gridsystem@cellcount}\endcsname% + \ignorespaces% +} +{% + \global\@namedef{gridsystem@cellwidth\arabic{gridsystem@cellcount}}{\gridsystem@cellstripes}% + \stepcounter{gridsystem@cellcount}% + \addtocounter{gridsystem@stripecount}{\gridsystem@cellstripes}% + \ignorespacesafterend% } %%%% @@ -71,6 +76,7 @@ \setcounter{gridsystem@cellinrow}{0}% \setcounter{gridsystem@stripecount}{0}% \noindent% +\ignorespaces% }{% \setlength{\gridsystem@one@cellwidth}{(\gridsystem@rowwidth-\gridsystem@cellsep*(\value{gridsystem@cellcount}-1))/\value{gridsystem@stripecount}}% % For each 1..gridsystem@cellcount @@ -88,4 +94,5 @@ \setcounter{gridsystem@cellcount}{0}% \setcounter{gridsystem@stripecount}{0}% %\gridsystem@finishrow% +\ignorespacesafterend% }