summaryrefslogtreecommitdiff
path: root/macros/xetex/latex/na-position/latex/na-position.sty
blob: 4dcf0bb103269951fed7569eb555dbebb316c957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
% na-position.sty    encodage : UTF8  
% Created By : Naam Mohamed & Salim Bou and distributed under the LPPL license.
% من إنشاء الأستاذين ناعم محمد و سليم بو
%edited by : Walid LAOUIDJI
%gmail: walidlaouidji28@gmail.com
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{na-position}[2020/06/14 version1.2]
%%%%%%%%%%%%%%% 
\RequirePackage{tkz-tab} 
 \def\Nplot{\left(C_f\right)}
\def\Nline{\left(\Delta\right)}
\def\plot{f}
\def\line{y}
\tikzset{pos style/.style = {
                           draw   = \tkzTabDefaultWritingColor}}
%<------------------------------------------>
  \newcommand*{\tkzTabPos}[2][]{%
 \makeatletter
 \setkeys[TAB]{TL}{#1}%   
 \setcounter{tkz@cnt@lg}{\thetkz@cnt@line}%
 \stepcounter{tkz@cnt@line}%
 \setcounter{tkz@cnt@lgnext}{\thetkz@cnt@line}%
 \setcounter{tkz@cnt@cl}{1}%
 \setcounter{tkz@cnt@pair}{1}%
 \setcounter{tkz@cnt@impair}{1}%
\foreach \x/\tl in {#2}{ 
\ifthenelse{\isodd{\value{tkz@cnt@cl}}}{
\path (N\thetkz@cnt@impair\thetkz@cnt@lg) --coordinate[midway](Z\thetkz@cnt@impair\thetkz@cnt@lg)(N\thetkz@cnt@impair\thetkz@cnt@lgnext); 
\ifthenelse{\equal{\expandafter\stripspaces\expandafter{\x}}{z}}{
\draw[line width =\cmdTAB@tbs@lw, pos style ]
([xshift=-01cm]N\thetkz@cnt@impair\thetkz@cnt@lgnext)..controls+(90:0.5)and+(230:1)..(N\thetkz@cnt@impair\thetkz@cnt@lg);
\draw[line width =\cmdTAB@tbs@lw,pos style ]([xshift=01cm]N\thetkz@cnt@impair\thetkz@cnt@lgnext)..controls+(90:0.5)and+(310:1)..
(N\thetkz@cnt@impair\thetkz@cnt@lg);  
\node[anchor=base,font=\scriptsize](pn)at([yshift=-0.2cm]Z\thetkz@cnt@impair\thetkz@cnt@lg){ 
\tabular{c}
  $\Nplot$
\\
    يقطع
    $\Nline$ 
 \\
   في النقطة
   \\  
 {  \tiny      
\ifTAB@VA@help\else\tl\fi}
\endtabular
} ;
              }{%
     \ifthenelse{\equal{\expandafter\stripspaces\expandafter{\x}}{}}{}{
%
\ifthenelse{\equal{\expandafter\stripspaces\expandafter{\x}}{t}}
{
         \draw[line width = \cmdTAB@tbs@lw,t style]
              (N\thetkz@cnt@impair\thetkz@cnt@lg) -- %
              (N\thetkz@cnt@impair\thetkz@cnt@lgnext);
}{
              %
\ifthenelse{\equal{\expandafter\stripspaces\expandafter{\x}}{d}}
{
       \draw[line width =\cmdTAB@tbs@lw,double style]%
         ([yshift = -\cmdTAB@tbs@lw/2] N\thetkz@cnt@impair\thetkz@cnt@lg)--%
         ([yshift = \cmdTAB@tbs@lw/2] N\thetkz@cnt@impair\thetkz@cnt@lgnext);
}{ 
\path (N\thetkz@cnt@impair\thetkz@cnt@lg)-- 
             (N\thetkz@cnt@impair\thetkz@cnt@lgnext); 
 \node at (Z\thetkz@cnt@impair\thetkz@cnt@lg){$\x$};
} 
       }
       }
       }
%       
       \stepcounter{tkz@cnt@impair}%
     }{%
       \path(M\thetkz@cnt@pair\thetkz@cnt@lg)--%
             coordinate[midway](S\thetkz@cnt@pair\thetkz@cnt@lg)%
            (M\thetkz@cnt@pair\thetkz@cnt@lgnext);% 
%%%%%%            
       \ifthenelse{\equal{\expandafter\stripspaces\expandafter{\x}}{h}}{
       %
          \setcounter{tkz@cnt@clnext}{\thetkz@cnt@pair}%
          \stepcounter{tkz@cnt@clnext}%
          \pgfmathparse{\cmdTAB@TTS@doubledistance/2+\cmdTAB@tbs@lw}
          \global\let\tkz@deltax\pgfmathresult 
          \fill[h style]([xshift=\tkz@deltax,yshift=-\cmdTAB@tbs@lw/2]%
                                N\thetkz@cnt@pair\thetkz@cnt@lg) 
                          rectangle%
                       ([xshift=-\tkz@deltax,yshift=\cmdTAB@tbs@lw/2]%
                                N\thetkz@cnt@clnext\thetkz@cnt@lgnext);
}{%
       \ifthenelse{\equal{\expandafter\stripspaces\expandafter{\x}}{+}}
{
 \node[inner sep=0pt,, text width=5em, minimum height = 5em, align = center,font=\scriptsize] at ([yshift=10pt]S\thetkz@cnt@pair\thetkz@cnt@lg) {
 \vbox to 3em{\vfill 
 $\Nplot$ \\
 {فوق}        
         \\
         $\Nline$}};
}
        {   \ifthenelse{\equal{\expandafter\stripspaces\expandafter{\x}}{-}}
{\node[inner sep=0pt,, text width=5em, minimum height = 5em, align = center,font=\scriptsize] at ([yshift=10pt]S\thetkz@cnt@pair\thetkz@cnt@lg) {
 \vbox to 3em{\vfill
$\Nplot$ \\
 {تحت}        
        \\ $\Nline$}};}{        
           \node at (S\thetkz@cnt@pair\thetkz@cnt@lg) {$\x$}; 
          }}}%%%%%%%%%%%%%%%%%%%%%
         \stepcounter{tkz@cnt@pair}%
        }%
   \stepcounter{tkz@cnt@cl}%
   }
   }
   %
%<-------------------------------The End ------------------------------------>
\endinput