summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-09-14 19:25:12 +0000
committerKarl Berry <karl@freefriends.org>2024-09-14 19:25:12 +0000
commit7d6647d88a7d9b0011e6e2710e98f4560109ae44 (patch)
tree8d3574accbcaf03001937032ee4b136395e7707a /Master/texmf-dist/tex/latex
parent382b5e26c7ebc05d90dedda8357b6a4095c1e04e (diff)
pas-tableur (14sep24)
git-svn-id: svn://tug.org/texlive/trunk@72283 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/pas-tableur/pas-tableur.sty91
1 files changed, 85 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/pas-tableur/pas-tableur.sty b/Master/texmf-dist/tex/latex/pas-tableur/pas-tableur.sty
index a2de8687f22..84928cd92d6 100644
--- a/Master/texmf-dist/tex/latex/pas-tableur/pas-tableur.sty
+++ b/Master/texmf-dist/tex/latex/pas-tableur/pas-tableur.sty
@@ -1,6 +1,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
-% pas-tableur.sty v2.05 encodage : UTF8 %
+% pas-tableur.sty v2.06 encodage : UTF8 %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
@@ -8,8 +8,8 @@
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-\def\fileversion{2.04}
-\def\filedate{2023/04/16}
+\def\fileversion{2.06}
+\def\filedate{2024/09/14}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{pas-tableur}[%
\filedate\space v\fileversion\space
@@ -102,7 +102,14 @@
%
%==> Macro etoilee : \tableur*{A/<l1>,B/<l2>,...}. Tableur avec colonnes de largeurs differentes
%
-\newcommand{\tableur@star}[2][1]
+% Modifiée dans la version 2.06 sur la suggestion de Emiel van Miltenburg
+
+\newcommand{\tableur@star}[2][1]
+ {
+ \IfSubStr{#2}{,}{\tableur@star@columns[#1]{#2}}{\tableur@star@onecolumn[#1]{#2}}
+ }
+
+\newcommand{\tableur@star@columns}[2][1]
{%
\xdef\list@of@col{#2}%
% Placement de la premiere cellule en-tête
@@ -139,7 +146,39 @@
}%
}%
\fi%
- } % --> Fin de \tableur*
+ }
+
+\newcommand{\tableur@star@onecolumn}[2][1]
+ {%
+ % Placement de la premiere cellule en-tête
+ \StrBefore{#2}{/}[\first@name] % Récupère la partie avant "/"
+ \StrBehind{#2}{/}[\first@width] % Récupère la partie après "/"
+ \pastab@draw@cell{\first@width}{\first@name}{0}{}{\first@name}
+ % Placement des en-têtes de lignes
+ \pastab@draw@cell{\numline@width}{numline1}{2}{\first@name.south west}{1}
+ \ifnum#1>1%
+ \foreach \num@line [remember=\num@line as \lastnum (initially 1)] in {2,...,#1}
+ {%
+ \pastab@draw@cell{\numline@width}{numline\num@line}{3}{numline\lastnum.south east}{\num@line}%
+ }%
+ \fi%
+ % Trace de la grille
+ \foreach \name/\w in {#2}
+ {%
+ \pastableur@grid{\w}{\name}{1}{\name.south}%
+ }%
+ \ifnum#1>1%
+ \foreach\numline [remember=\numline as \lastnumline (initially 1)] in {2,...,#1}
+ {%
+ \foreach \name/\w in {#2}
+ {%
+ \pastableur@grid{\w}{\name}{\numline}{cell\name-\lastnumline.south}%
+ }%
+ }%
+ \fi%
+ }
+
+% --> Fin de \tableur*
%
%==> Macro non etoilee : \tableur{A,B,C,...} ou \tableur{A-C}
%
@@ -302,7 +341,6 @@
\newcommand*\multiSelec[2]
{%
\fill[blueSelec,opacity=0.5] ($(cell#1.north west)+(0.25pt,-0.25pt)$) rectangle ($(cell#2.south east)+(-0.25pt,0.25pt)$);%
- \draw[very thick] (cell#1.south west) rectangle (cell#1.north east);%
\fill[black] ($(cell#2.south east)+(-0.5pt,0.5pt)$) rectangle +(3pt,-3pt);%
%
%==> On colorie les en-têtes "colonnes"
@@ -328,10 +366,51 @@
\pastableur@colorcell{numline\i}{0}
\node[celhead,minimum width=\numline@width,minimum height=\line@height] at (numline\i) {\helvbx\i};%
}%
+ \draw[very thick] (cell#1.south west) rectangle (cell#1.north east);%
}% fin de \multiSelec
%
%
%
+
+%
+% Selection de plusieurs cellules : \multimultiSelec{A-1}{A-2}{A-3}
+% Proposition de Emiel van Miltenburg pour la version 2.06 le 2024/09/14
+%
+\newcommand*\multimultiSelec[3]
+{%
+ \fill[blueSelec,opacity=0.5] ($(cell#1.north west)+(0.25pt,-0.25pt)$) rectangle ($(cell#3.south east)+(-0.25pt,0.25pt)$);%
+
+ \fill[black] ($(cell#3.south east)+(-0.5pt,0.5pt)$) rectangle +(3pt,-3pt);%
+ %
+ %==> On colorie les en-têtes "colonnes"
+ %
+ \StrChar{#1}{1}[\str@start] % par exemple, "G"
+ \StrChar{#2}{1}[\str@end] % par exemple, "L"
+ \StrBetween{\col@names}{\str@start}{\str@end}[\str@col] % retourne par exemple "HIJK"
+ \edef\str@col{\str@start\str@col\str@end} % retourne alors "GHIJKL"
+ \StrLen{\str@col}[\nb@columns] % nombre d'en-têtes "colonnes" \`a colorier
+ \foreach \i in {1,...,\nb@columns}
+ {%
+ \StrChar{\str@col}{\i}[\name]%
+ \pastableur@colorcell{\name}{1}
+ \node at (\name) {\helvbx\name};%
+ }%
+ %
+ %==> On colorie les en-têtes "lignes"
+ %
+ \StrGobbleLeft{#1}{2}[\first@num]%
+ \StrGobbleLeft{#2}{2}[\second@num]%
+ \foreach \i in {\first@num,...,\second@num}
+ {%
+ \pastableur@colorcell{numline\i}{0}
+ \node[celhead,minimum width=\numline@width,minimum height=\line@height] at (numline\i) {\helvbx\i};%
+ }%
+ \draw[very thick] (cell#2.south west) rectangle (cell#1.north east);%
+}% fin de \multimultiSelec
+%
+%
+%
+
\newlength\pastableur@decal
\newcommand{\pastableur@colorcell}[2] % #1 : name, #2 : 0=en-tetes "lignes" / 1=en-tetes "colonnes"
{%