summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/vcell/vcell.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-16 21:27:48 +0000
committerKarl Berry <karl@freefriends.org>2020-05-16 21:27:48 +0000
commit1996b5ad272493d43c08372eda3609b1d3271c2c (patch)
tree90c3ebe316ceb2c0ffcb0ca01783d0d8b7e7d61a /Master/texmf-dist/tex/latex/vcell/vcell.sty
parentaafdfd77994347e1396e12ef19e2cb245c6eeff6 (diff)
vcell (16may20)
git-svn-id: svn://tug.org/texlive/trunk@55164 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/vcell/vcell.sty')
-rw-r--r--Master/texmf-dist/tex/latex/vcell/vcell.sty76
1 files changed, 76 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/vcell/vcell.sty b/Master/texmf-dist/tex/latex/vcell/vcell.sty
new file mode 100644
index 00000000000..4c8957a0abf
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/vcell/vcell.sty
@@ -0,0 +1,76 @@
+%
+% vcell.sty V1.0 version (15-May-2020)
+%
+% Author: Xavier Dionne <info@latex-tables.com>
+%
+% Licence :
+%
+% The contents of this package are distributed under the LaTeX Project
+% Public License, version 1.3c or later.
+% https://www.latex-project.org/lppl/lppl-1-3c/
+
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+\ProvidesPackage{vcell}[2020/05/15 v1.0]
+\newdimen\rowheight
+\newdimen\rowht
+\newdimen\rowdp
+\newcount\@cellcount
+\newcount\@cellusecount
+\newbox\@celltemp
+
+\def\resetcellcount{%
+ \global\@cellusecount 1\relax\global\@cellcount 1\relax%
+ \global\setlength\rowht{\arraystretch\ht\strutbox}%
+ \global\setlength\rowdp{\arraystretch\dp\strutbox}%
+ \global\setlength\rowheight{\dimexpr\rowht+\rowdp}%
+}
+
+\resetcellcount
+
+\def\savecellheight{%
+ \ifdim\ht\@celltemp>\rowht\global\setlength{\rowht}{\ht\@celltemp}\fi%
+ \ifdim\dp\@celltemp>\rowdp\global\setlength{\rowdp}{\ht\@celltemp}\fi%
+ \ifdim\dimexpr\dp\@celltemp+\ht\@celltemp>\rowheight{\global\setlength{\rowheight}{\dimexpr\dp\@celltemp+\ht\@celltemp}}\fi
+}
+\long\def\savecellbox#1{%
+ \global\sbox\@celltemp{\hbox{\ifdim\hsize=\textwidth #1\else \vbox{#1}\fi}}%
+ \savecellheight%
+ \parbox{0pt}{\vrule height \ht\@celltemp depth \dp\@celltemp width 0pt}%
+ \global\expandafter\newbox\csname @cellbox\the\@cellcount\endcsname%
+ \global\expandafter\sbox\csname @cellbox\the\@cellcount\endcsname{\hbox{\usebox\@celltemp}}%
+ \global\advance\@cellcount 1\relax%
+}
+\let\vcell\savecellbox
+\def\printcelltop{%
+ \leavevmode\vbox to \dimexpr\rowht{%
+ \hbox to \expandafter\wd\csname @cellbox\the\@cellusecount\endcsname{%
+ \vrule height \arraystretch\ht\strutbox depth \arraystretch\dp\strutbox width 0pt%
+ \expandafter\usebox\csname @cellbox\the\@cellusecount\endcsname%
+ }%
+ \vss%
+ }%
+ \global\advance\@cellusecount 1\relax%
+ \ifnum\@cellusecount=\@cellcount\resetcellcount\fi%
+}
+\def\printcellmiddle{%
+ \leavevmode\vbox to \dimexpr\rowht{%
+ \vfill\hbox to \expandafter\wd\csname @cellbox\the\@cellusecount\endcsname{%
+ \vrule height \arraystretch\ht\strutbox depth 0pt width 0pt%
+ \expandafter\usebox\csname @cellbox\the\@cellusecount\endcsname%
+ }%
+ \vfill%
+ }%
+ \global\advance\@cellusecount 1\relax%
+ \ifnum\@cellusecount=\@cellcount\resetcellcount\fi
+}
+\def\printcellbottom{%
+ \leavevmode\vbox to \dimexpr\rowht{%
+ \vss\hbox to \expandafter\wd\csname @cellbox\the\@cellusecount\endcsname{%
+ \vrule height \rowht depth \rowdp width 0pt%
+ \expandafter\usebox\csname @cellbox\the\@cellusecount\endcsname
+ }%
+ }%
+ \global\advance\@cellusecount 1\relax%
+ \ifnum\@cellusecount=\@cellcount\resetcellcount\fi
+}
+\endinput \ No newline at end of file