From 17d8cf93442b753a28ae1b52adc9f0471fdbcc8f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 5 Feb 2011 00:23:37 +0000 Subject: new latex package collcell (4feb11) git-svn-id: svn://tug.org/texlive/trunk@21300 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/collcell/collcell.sty | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/collcell/collcell.sty (limited to 'Master/texmf-dist/tex/latex/collcell') diff --git a/Master/texmf-dist/tex/latex/collcell/collcell.sty b/Master/texmf-dist/tex/latex/collcell/collcell.sty new file mode 100644 index 00000000000..8bfad2e0d8f --- /dev/null +++ b/Master/texmf-dist/tex/latex/collcell/collcell.sty @@ -0,0 +1,103 @@ +%% +%% This is file `collcell.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% collcell.dtx (with options: `package') +%% +%% Copyright (C) 2011 by Martin Scharrer +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008/05/04 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Martin Scharrer. +%% +%% This work consists of the files collcell.dtx, collcell.ins +%% and the derived file collcell.sty. +%% +%%^^A $Id: collcell.dtx 2129 2011-02-04 11:36:33Z martin $ +\ProvidesPackage{collcell} + [2011/02/04 v0.1 Collect the content of a tabular cell] +\newtoks\collect@cell@toks +\newenvironment{collectcell}{}{} +\def\collectcell#1#2\ignorespaces{% + \collect@cell@toks{}% + \let\collect@cell@spaces\empty + \def\collect@cell@end{% + \expandafter\scantokens\expandafter + {\expandafter#1\expandafter{\the\collect@cell@toks}}% + } + \def\collect@cell@next{\collect@cell@look}% + \collect@cell@next +} +\def\endcollectcell{\@gobble{endcollectcell}} +\def\collect@cell@look{% + \futurelet\collect@cell@lettoken\collect@cell@look@ +} +\begingroup +\def\:{\collect@cell@eatspace} +\expandafter\gdef\: {\collect@cell@look} +\endgroup +\def\collect@cell@look@{% + \ifx\collect@cell@lettoken\@sptoken + \edef\collect@cell@spaces{\collect@cell@spaces\space}% + \def\collect@cell@next{\collect@cell@eatspace}% + \else + \ifx\collect@cell@lettoken\bgroup + \def\collect@cell@next{\collect@cell@group}% + \else + \def\collect@cell@next{\collect@cell@arg}% + \fi + \fi + \collect@cell@next +} +\def\collect@cell@group#1{% + \begingroup + \def\@tempa{#1}% + \def\@tempb{\bgroup}% + \ifx\@tempa\@tempb + \endgroup + \def\collect@cell@next{\collect@cell@arg\bgroup}% + \else + \endgroup + \def\collect@cell@next{\collect@cell@arg{{#1}}}% + \fi + \collect@cell@next +} +\def\collect@cell@addarg#1{% + \expandafter\expandafter\expandafter\collect@cell@toks + \expandafter\expandafter\expandafter + {\expandafter\the\expandafter\collect@cell@toks\collect@cell@spaces#1}% + \let\collect@cell@spaces\empty +} +\def\collect@cell@arg#1{% + \ifx\collect@cell@lettoken\\ + \def\collect@cell@next{\collect@cell@end#1}% + \else + \ifx\collect@cell@lettoken\unskip + \def\collect@cell@next{% + \@ifnextchar\endcollectcell + {\collect@cell@end#1}% + {\collect@cell@addarg{#1}\collect@cell@look}% + }% + \else + \collect@cell@addarg{#1}% + \def\collect@cell@next{\collect@cell@look}% + \fi + \fi + \collect@cell@next +} + +\endinput +%% +%% End of file `collcell.sty'. -- cgit v1.2.3