summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tablvar/tablvar.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tablvar/tablvar.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tablvar/tablvar.sty118
1 files changed, 78 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/latex/tablvar/tablvar.sty b/Master/texmf-dist/tex/latex/tablvar/tablvar.sty
index 07b48703858..958d49d6e97 100644
--- a/Master/texmf-dist/tex/latex/tablvar/tablvar.sty
+++ b/Master/texmf-dist/tex/latex/tablvar/tablvar.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2018-2023 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+%% Copyright (C) 2018-2024 by Antoine Missier <antoine.missier@ac-toulouse.fr>
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
@@ -22,13 +22,12 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{tablvar}
- [2023/12/23 v2.0 .dtx tablvar file]
-
+ [2024/08/09 v2.1 Tables of signs and variations]
\RequirePackage{array}
\RequirePackage{ifthen}
\RequirePackage{multido}
\RequirePackage{xkeyval}
-\RequirePackage{ifpdf}
+\RequirePackage{iftex}
\newif\iftv@tikz % false par défaut
\DeclareOption{tikz}{\tv@tikztrue}
@@ -38,23 +37,31 @@
\iftv@pstricks
\ifpdf
- \PackageError{tablvar}{Don't use the pstricks option with PDF engines}{}
+ \ifluatex
+ \PackageInfo{tablvar}{Option 'pstricks' works
+ with luapstricks}
+ \else
+ \PackageError{tablvar}{Don't use the 'pstricks' option with
+ PDF output mode}{Use 'tikz' option or change the engine}
+ \fi
\else
- \PackageInfo{tablvar}{PSTricks option is used}
+ \PackageInfo{tablvar}{Option 'pstricks' is used}
\fi
\else\iftv@tikz
- \PackageInfo{tablvar}{tikz option is used.
+ \AtEndDocument{\PackageWarningNoLine{tablvar}{Option 'tikz' is used.
\MessageBreak
- Run twice to draw the arrows correctly}
+ Maybe rerun to draw the arrows correctly}
+ }
\else\ifpdf
- \PackageWarningNoLine{tablvar}{PDF engine is used,
- I'm using the tikz option.
+ \AtEndDocument{\PackageWarningNoLine{tablvar}{Output is in PDF mode,
+ I'm using the 'tikz' option.
\MessageBreak
- Run twice to draw the arrows correctly}
+ Maybe rerun to draw the arrows correctly}
+ }
\tv@tikztrue
\else
- \PackageWarningNoLine{tablvar}{PDF engines not used,
- I'm using the pstricks option}
+ \PackageWarningNoLine{tablvar}{Output is in DVI mode,
+ I'm using the 'pstricks' option}
\tv@pstrickstrue
\fi\fi\fi
@@ -120,6 +127,12 @@
\newcounter{maxdiscont}
\setcounter{maxdiscont}{4} % nb max de discontinuités
+\newlength{\rowtopsep}
+\setlength{\rowtopsep}{2pt}
+
+\newlength{\rowbottomsep}
+\setlength{\rowbottomsep}{2pt}
+
\newcommand*{\fleche}[2]{
\iftv@tikz
\tikz[remember picture,overlay]{\draw[->,>=stealth,
@@ -182,8 +195,8 @@
\multido{\I=1+1}{\themaxdiscont}{\newcounter{discont\I}}
}
-\newlength\mil@heightshift
-\newcounter{mil@rowshift}
+\newlength\mil@shift
+\newcounter{mil@row}
\newcounter{maxZI} % nb max de ZI
\setcounter{maxZI}{4}
@@ -225,19 +238,20 @@
\setcounter{nbvarlignes}{3}
}
-\newcommand\tv@saveheight{%
- \tv@cellheight=0pt
- \tv@celldepth=0pt
- \ifdim \ht\tv@cellbox > \ht\@arstrutbox
- \global\advance\tv@cellheight by \ht\tv@cellbox
- \else
- \global\advance\tv@cellheight by \ht\@arstrutbox
+\newcommand\tv@setheight{%
+ \global\tv@cellheight=\ht\tv@cellbox
+ \ifthenelse{\value{var@ligne}=0}{
+ \global\advance\tv@cellheight by \rowtopsep}{}
+ \ifdim \tv@cellheight < \ht\@arstrutbox
+ \global\tv@cellheight = \ht\@arstrutbox
\fi
- \ifdim \dp\tv@cellbox > \dp\@arstrutbox
- \global\advance\tv@celldepth by \dp\tv@cellbox
- \else
- \global\advance\tv@celldepth by \dp\@arstrutbox
+ \global\tv@celldepth=\dp\tv@cellbox
+ \ifthenelse{\value{var@ligne}=0}{
+ \global\advance \tv@celldepth by \rowbottomsep}{}
+ \ifdim \tv@celldepth < \dp\@arstrutbox
+ \global\tv@celldepth = \dp\@arstrutbox
\fi
+ \vrule height \tv@cellheight depth \tv@celldepth width 0pt
}
\newcommand{\tvcoltypes}{
@@ -246,7 +260,7 @@
>{\setcounter{tv@icol}{0}\stepcounter{tv@row}\begin{lrbox}%
\tv@cellbox $}%
c%
- <{$\end{lrbox}\usebox{\tv@cellbox}\tv@saveheight}}
+ <{$\end{lrbox}\usebox{\tv@cellbox}\tv@setheight}}
% type de colonne i pour les intervalles
\newcolumntype{i}{>{\stepcounter{tv@icol}
\centering\arraybackslash$}p{\intervalwidth}<{$}}
@@ -262,8 +276,8 @@
\setkeys*{tablvar}{#1} % fourni par xkeyval
\if\XKV@rm\empty \else \setlength{\intervalwidth}{#1} \fi
\tvcoltypes
- \ifextleft \newcolumntype{B}{v{l}} \else \newcolumntype{B}{v{c}} \fi
- \ifextright \newcolumntype{E}{v{r}} \else \newcolumntype{E}{v{c}} \fi
+ \ifextleft\newcolumntype{B}{v{l}}\else\newcolumntype{B}{v{c}}\fi
+ \ifextright\newcolumntype{E}{v{r}}\else\newcolumntype{E}{v{c}}\fi
\tablvarinit{#2}
\ZIinit
\begin{array}{%
@@ -296,7 +310,6 @@
\newcommand*{\variations}[2][3]{% #1=nblignes (3 par défaut)
% (ré)initialisation des compteurs
\setcounter{nbvarlignes}{#1}
- \setcounter{var@ligne}{0}
\setcounter{numdiscont}{0}
\multido{\I=1+1}{\themaxdiscont}{\setcounter{discont\I}{0}}
% boucle : on exécute le code #2 un nb de fois égal à (#1)-1
@@ -323,6 +336,7 @@
}
% tracé des pointillés pour les valeurs remarquables
\multido{\Ix=1+1}{\thenumvr}{\vrconnect{X\Ix}{Y\Ix}}
+ \setcounter{var@ligne}{0}
\\ % dernier retour ligne du tableau
}
@@ -355,13 +369,17 @@
\newcommand*{\vdecal}[2]{\smash{\raisebox{#1}{$#2$}}}
\newcommand*{\mil}[1]{%
- \mil@heightshift = \ht\@arstrutbox
- \advance\mil@heightshift by \dp\@arstrutbox
- \divide\mil@heightshift by 2
- \setcounter{mil@rowshift}{3}
- \addtocounter{mil@rowshift}{-\value{nbvarlignes}}
- \multiply\mil@heightshift by \value{mil@rowshift}
- \pos*{2}{\vdecal{\mil@heightshift}{#1}}
+ \setcounter{mil@row}{\value{nbvarlignes}}
+ \ifthenelse{\isodd{\value{nbvarlignes}}}{
+ \addtocounter{mil@row}{1}
+ \divide\value{mil@row} by 2
+ \pos*{\themil@row}{\smash{#1}}
+ }{
+ \divide\value{mil@row} by 2
+ \mil@shift = \dp\@arstrutbox
+ \advance\mil@shift by 0.5ex
+ \pos*{\themil@row}{\vdecal{-\mil@shift}{#1}}
+ }
}
\newcommand*{\barre}[1][]{\makebox[0pt]{$#1$}%
@@ -372,8 +390,26 @@
\kern1.5pt\vrule width \bbrulewidth\kern1pt
\vrule width \bbrulewidth\kern1.5pt}
-\newcommand*{\limg}[3][c]{\zbox[r]{\valpos[#1]{#2}{#3\hspace{\limsep}}}}
-\newcommand*{\limd}[3][c]{\zbox[l]{\valpos[#1]{#2}{\hspace{\limsep}#3}}}
+\newcommand*{\@limg}[3][c]{%
+ \zbox[r]{\valpos[#1]{#2}{#3\hspace{\limsep}}}}
+\newcommand*{\@limd}[3][c]{%
+ \zbox[l]{\valpos[#1]{#2}{\hspace{\limsep}#3}}}
+\newcommand*{\@@limg}[1]{%
+ \ifthenelse{\equal{#1}{+}}{\@limg{1}{+\infty}}{
+ \ifthenelse{\equal{#1}{-}}{\@limg{\value{nbvarlignes}}{-\infty}}{
+ \PackageError{tablvar}{Invalid argument for \string\limg*}
+ {Only + or - are valid arguments for \string\limg*}
+ }}
+}
+\newcommand*{\@@limd}[1]{%
+ \ifthenelse{\equal{#1}{+}}{\@limd{1}{+\infty}}{
+ \ifthenelse{\equal{#1}{-}}{\@limd{\value{nbvarlignes}}{-\infty}}{
+ \PackageError{tablvar}{Invalid argument for \string\limd*}
+ {Only + or - are valid arguments for \string\limd*}
+ }}
+}
+\newcommand{\limg}{\@ifstar{\@@limg}{\@limg}}
+\newcommand{\limd}{\@ifstar{\@@limd}{\@limd}}
\newcommand*{\discont}{
\ifthenelse{\thevar@ligne=1}{
@@ -392,7 +428,9 @@
}{}
}
-\newcommand*{\bblim}[4]{\limg{#1}{#2}\bb\discont\limd{#3}{#4}}
+\newcommand*{\@bblim}[4]{\limg{#1}{#2}\bb\discont\limd{#3}{#4}}
+\newcommand*{\@@bblim}[2]{\limg*{#1}\bb\discont\limd*{#2}}
+\newcommand*{\bblim}{\@ifstar{\@@bblim}{\@bblim}}
\newcommand*{\vr}[2][2]{% ligne 2 par défaut sauf si tv@row=1
\stepcounter{numvr}