\section{Gallery}
\subsection{Tables of signs}
The following example comes from the documentation of the excellent \tkzname{tablor.sty}.


\medskip


\begin{tkzexample}[vbox,small]
  \begin{tikzpicture}
    \tkzTabInit[lgt=3]
       {$x$                                  /1,
        Sign of\\ $-2x+3$                    /1.5,
        Sign of\\ $-x+5$                    /1.5,
        Sign of\\ $(-2x+3)(-x+5)$           /1.5 }%
       {$-\infty$,$\dfrac{3}{2}$,$5$,$+\infty$}%
    \tkzTabLine { ,+,z,-,t,-, }
    \tkzTabLine { ,+,t,+,z,-, }
    \tkzTabLine { ,+,z,-,z,+, }
  \end{tikzpicture}
\end{tkzexample}


\subsection{Variations of functions}
 \subsubsection{Variations of a rational function}

 This example is given in the documentation of the package \tkzname{tabvar}.

 Study of the function $f~:~ x \longmapsto \frac{x^3+2}{2x}$ on $(-\infty, 0) \cup (0, +\infty)$

\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
  \tkzTabInit[]
  {$x$  /1, $f'(x)$ /1,$f$  /3}
  {$-\infty$ , $0$ , $1$ , $+\infty$}
\tkzTabLine{,-,d,-,z,+,}
\tkzTabVar{+/$+\infty$ ,-D+/$-\infty$ / $+\infty$ ,-/$\frac{3}{2}$, +/$+\infty$}
\tkzTabVal{1}{2}{0.4}{$ -\sqrt[3]{2}$}{$0$}
\end{tikzpicture}
\end{tkzexample}


\subsubsection{Variations of an irrational function}

Another example from the documentation of the package \tkzname{tabvar}.

Study of the function $f~:~ x \longmapsto \sqrt{\frac{x-1}{x+1}}$ on $(-\infty, -1) \cup [1, +\infty)$

\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
  \tkzTabInit[]
  {$x$  /1, $f'(x)$ /1,$f$  /3}
  {$-\infty$ , $-1$ , $1$ , $+\infty$}
\tkzTabLine{,+,d,h,d,+, }
\tkzTabSlope{ 3/ /+\infty}
\tkzTabVar{-/$1$ ,+DH/$+\infty$  ,-/$0$, +/$1$}
\end{tikzpicture}
\end{tkzexample}

With a continuous extension, for example $f(x)=0$ on $[-1, 1]$, the table would become

\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
  \tkzTabInit[]
  {$x$  /1, $f'(x)$ /1,$f$  /3}
  {$-\infty$ , $-1$ , $1$ , $+\infty$}
\tkzTabLine{,+,d,0,d,+, }
\tkzTabSlope{ 3/ /+\infty}
\tkzTabVar{-/$1$ ,+D-/$+\infty$/$0$  ,-/$0$, +/$1$}
\end{tikzpicture}
\end{tkzexample}


\subsection{Trigonometric functions}
\NameFonct{Trigonometric functions}
 \subsubsection{Variations of the tangent function}
  \NameFonct{Tangent function}
 Study of the function $f~:~ x \longmapsto \tan{x}$ on $[0, \pi]$

 \begin{tkzexample}[vbox]
\begin{tikzpicture}
\tkzTabInit[espcl=6]{$x$ / 1,Sign of\\$f'(x)$/1, Variations of\\ $f$ / 3}%
     {$0$ ,$\frac{\pi}{2}$ , $\pi$}%
\tkzTabLine{ ,+,d,+, }
\tkzTabVar{-/$0$ ,  +D-/$+\infty$/$-\infty$  , +/$0$ }
\tkzTabVal{1}{2}{0.5}{$\frac{\pi}{4}$}{$1$}
\tkzTabVal{2}{3}{0.5}{$\frac{3\pi}{4}$}{$1$}
\end{tikzpicture}
\end{tkzexample}

\subsubsection{Variations of the cosine function}
 \NameFonct{Cosine function}
  Study of the function $f~:~ x \longmapsto \cos{x}$ on $[0, \pi]$

 \begin{tkzexample}[vbox]
\begin{tikzpicture}
\tkzTabInit[espcl=6]{$x$ / 1,Sign of\\$f'(x)$/1, Variations of\\ $f$ / 3}%
     {$0$ , $\pi$}%
\tkzTabLine{ , - , }
\tkzTabVar{+/$1$ ,   -/$-1$ }
\tkzTabVal{1}{2}{0.5}{$\frac{\pi}{2}$}{$0$}
\end{tikzpicture}
\end{tkzexample}

\subsection{Parametric and trigonometric functions}
\NameFonct{Parametric functions} \NameFonct{Trigonometric functions}

Study on $\left[0, \frac{\pi}{2}\right]$
 \begin{equation*}
\left\{%
\begin{array}{l}
 x(t) = \cos(3t)\\
 y(t) = \sin(4t)
\end{array}\right.
\end{equation*}

\begin{tkzexample}[vbox,small]
  \begin{tikzpicture}
  \tkzTabInit[ lgt=3 , espcl=3]%
    {$t$                               /1,
    Sign of\\        $x'(t)$          /1.5,
    Variations of\\   $x$              /3,
     Variations of\\  $y$              /3,
    Sign of\\        $y'(t)$          /1.5}
              {$0$   , $\frac{\pi}{8}$             , $\frac{\pi}{3}$ ,
               $\frac{3\pi}{8}$ , $\frac{\pi}{2}$ }%
  \tkzTabLine {z , - ,-3\sin\left(\frac{3\pi}{8}\right) , - , z , +  ,%
   3\sin\left(\frac{\pi}{8}\right),+,3}
   \tkzTabVar  { +/$1$ , R/    , -/$-1$/ , R/     , +/$0$ }
    \tkzTabIma{1}{3}{2}{$\cos\left(\frac{3\pi}{8}\right)$}
   \tkzTabIma{3}{5}{4}{$-\cos\left(\frac{\pi}{8}\right)$}
     \tkzTabVar  { -/$0$ , +/$1$ , R/      , -/$-1$ , +/$0$ }
   \tkzTabIma{2}{4}{3}{$\frac{-\sqrt{3}}{2}$}
   \tkzTabLine {4 , + , z , - , -2 , - ,  z ,+,4}
 \end{tikzpicture}
\end{tkzexample}


\subsection{French Baccalauréat, Asia, ES 1998}
\index{Baccalauréat}
The \emph{Baccalauréat} is the French high-school final exam; the following exercises are translated from it. A small trick: normally \tkzname{z} is the symbol that gives a zero centered on a dotted rule. For a zero without the rule, replace \tkzname{z} by \tkzname{0}: it is not a recognized symbol, so it is treated as an ordinary string.

  Let $f$ be the function of the real variable $x$ defined on $\mathbf{R}$ by:
  \[
      f(x)=\E^x(\E^x+a)+b
  \]
  where $a$ and $b$ are two real constants.

  What is known about $f$ is given in the table of variations below.

  \medskip
  \begin{center}
    \begin{tikzpicture}
    \tkzTab[lgt=3,espcl=4]{$x$/1,Sign of $f'(x)$ /1,Variations of $f$ /2}%
    {$-\infty$,$0$,$+\infty$}%
    {,, z ,,}%
     {+/    $-3$  ,
      -/          ,
      +/          }
    \end{tikzpicture}
  \end{center}

  \medskip
  \begin{enumerate}
      \item Compute $f'(x)$ in terms of $a$ ($f'$ is the derivative of $f$).
      \item \begin{enumerate}
             \item Find $a$ and $b$ using the information given in the
              table above.
             \item Compute $f(0)$ and the limit of $f$ at $+\infty$.
             \item Copy and complete the table of variations of $f$.
             \end{enumerate}
      \item Solve in $\mathbf{R}$ the equation
      \[
          \E^x(\E^x-2)-3=0
      \]
      (you may set $X=\E^x$).
      \item Solve in $\mathbf{R}$ the inequalities:
      \[
          \E^x(\E^x-2)-3\geq -4
      \]
      \[
          \E^x(\E^x-2)-3 \leq 0
      \]
       (Use the table of variations given above, in particular the
        results of 2.b.)
  \end{enumerate}

\begin{tkzexample}[code only,small]
  Let $f$ be the function of the real variable $x$ defined on $\mathbf{R}$ by:
  \[
      f(x)=\E^x(\E^x+a)+b
  \]
  where $a$ and $b$ are two real constants.

  What is known about $f$ is given in the table of variations below.

  \medskip
  \begin{center}
    \begin{tikzpicture}
    \tkzTab[lgt=3,espcl=4]{$x$/1,Sign of $f'(x)$ /1,Variations of $f$ /2}%
    {$-\infty$,$0$,$+\infty$}%
    {,, z ,,}%
     {+/    $-3$  ,
      -/          ,
      +/          }
    \end{tikzpicture}
  \end{center}

  \medskip
  \begin{enumerate}
      \item Compute $f'(x)$ in terms of $a$ ($f'$ is the derivative of $f$).
      \item \begin{enumerate}
             \item Find $a$ and $b$ using the information given in the
              table above.
             \item Compute $f(0)$ and the limit of $f$ at $+\infty$.
             \item Copy and complete the table of variations of $f$.
             \end{enumerate}
      \item Solve in $\mathbf{R}$ the equation
      \[
          \E^x(\E^x-2)-3=0
      \]
      (you may set $X=\E^x$).
      \item Solve in $\mathbf{R}$ the inequalities:
      \[
          \E^x(\E^x-2)-3\geq -4
      \]
      \[
          \E^x(\E^x-2)-3 \leq 0
      \]
       (Use the table of variations given above, in particular the
        results of 2.b.)
  \end{enumerate}
\end{tkzexample}


\subsection{French Baccalauréat}
\index{Baccalauréat}
	Consider the function $f$ defined on $(-\infty, 0)$ by:

	\[
	  f(x)=ax+b+\ln(-2x)
	\]
	where $a$ and $b$ are two given real numbers.

	\begin{enumerate}
	\item Compute $f'(x)$ in terms of $a$ and $b$.
	\item The table below gives the variations of a particular function $f$.

	\medskip
	\begin{center}
	  \begin{tikzpicture}
	  \tkzTab[]%
	  {$x$/1.25,Sign of\\ $f'(x)$/1.5, Variations\\ of $f$/1.5}%
	  {$-\infty$,$\dfrac{-1}{2}$,$0$}%
	  {,+,$0$,-,}%
	  {-//,
	  +/$2$/,
	  -//}
	  \end{tikzpicture}
	\end{center}

	\medskip
	\begin{enumerate}
	\item Using the table, find the values of $a$ and $b$ for
	 this function.
	\item For this particular function $f$, find
	        $\displaystyle \lim_{x \xrightarrow[x<0]{} 0} f(x)$.
	\item Show that, on the interval $\Big[\dfrac{-1}{2}, -0.01\Big]$, the equation $f(x)=0$
	 has exactly one solution. Give an approximation of it to within $10^{-3}$.
	\end{enumerate}
	\end{enumerate}

\begin{tkzexample}[small,code only]
	Consider the function $f$ defined on $(-\infty, 0)$ by:

	\[
	  f(x)=ax+b+\ln(-2x)
	\]
	where $a$ and $b$ are two given real numbers.

	\begin{enumerate}
	\item Compute $f'(x)$ in terms of $a$ and $b$.
	\item The table below gives the variations of a particular function $f$.

	\medskip
	\begin{center}
	  \begin{tikzpicture}
	  \tkzTab[]%
	  {$x$/1.25,Sign of\\ $f'(x)$/1.5, Variations\\ of $f$/1.5}%
	  {$-\infty$,$\dfrac{-1}{2}$,$0$}%
	  {,+,$0$,-,}%
	  {-//,
	  +/$2$/,
	  -//}
	  \end{tikzpicture}
	\end{center}

	\medskip
	\begin{enumerate}
	\item Using the table, find the values of $a$ and $b$ for
	 this function.
	\item For this particular function $f$, find
	        $\displaystyle \lim_{x \xrightarrow[x<0]{} 0} f(x)$.
	\item Show that, on the interval $\Big[\dfrac{-1}{2}, -0.01\Big]$, the equation $f(x)=0$
	 has exactly one solution. Give an approximation of it to within $10^{-3}$.
	\end{enumerate}
	\end{enumerate}
\end{tkzexample}



\subsection{French Baccalauréat, French Guiana, ES 1998}
\index{Baccalauréat}
This example led me to create symbols such as $+V+$. The authors probably did not want to influence the students with a double bar (too often associated with an asymptote).

\textbf{The exercise:}

{\parindent=0pt
Consider a function $f$ of the variable $x$, whose table of variations is:

\begin{center}
\begin{tikzpicture}
\tkzTab[lgt=3]%
{$x$/1.25,Sign of\\ $f'(x)$/1.5, Variations\\ of $f$/2.5}
{$-\infty$,$\dfrac{-1}{2}$,$1$,$+\infty$}
{,-,$0$,+, ,-,}
{+/ $1$ , -/$\dfrac{-1}{3}$ , +V+/ $+\infty$ /$+\infty$ , -/$1$}
\end{tikzpicture}
\end{center}

(C) is the graph of $f$ in an orthonormal coordinate system $(O;\vec{\imath};\vec{\jmath})$ (unit: 2 cm on each axis).

\vspace{6pt}
\textbf{Part one}

Using the table above:%

 \begin{enumerate}
 \item  Give the domain of $f$.
 \item  Draw in the coordinate system $(O;\vec{\imath};\vec{\jmath})$:
 \begin{enumerate}
 \item  the horizontal asymptote (D);
 \item  the vertical asymptote (D');
 \item  the point $A$ where the tangent to (C) is horizontal.
 \end{enumerate}
 \end{enumerate}

\textbf{Part two}

Now $f$ is given by:
\[
f(x)=1 + \dfrac{4}{(x-1)}    + \dfrac{3}{(x-1)^2}
\]
\begin{enumerate}
 \item Solve the equations $f(x)=0$ and $f(x)=1$.
 \item  With your calculator, fill in the following table
  (copy it onto your answer sheet).
\end{enumerate}
\begin{tikzpicture}
   \tkzTabInit[deltacl=1,espcl=1]{ $x$/1 , $f(x)$ /1}%
              {-1,,{-0.75},,{0.5},,2,,3,,4}%
   \tkzTabLine{,,,,,,,,,,,,,,,,,,,,}%
   \makeatletter
   \foreach \x in {1,...,5}
    \setcounter{tkz@cnt@pred}{\x}\addtocounter{tkz@cnt@pred}{\x}
    \draw (N\thetkz@cnt@pred 0.center) to (N\thetkz@cnt@pred 2.center);
\end{tikzpicture}
}


\begin{tkzexample}[code only,small]
Consider a function $f$ of the variable $x$, whose table of variations is:

\begin{center}
\begin{tikzpicture}
\tkzTab[]%
{$x$/1.25,Sign of\\ $f'(x)$/1.5, Variations\\ of $f$/2.5}
{$-\infty$,$\dfrac{-1}{2}$,$1$,$+\infty$}
{,-,$0$,+, ,-,}
{+/ $1$ , -/$\dfrac{-1}{3}$ , +V+/ $+\infty$ /$+\infty$ , -/$1$}
\end{tikzpicture}
\end{center}

 \vspace{6pt}
(C) is the graph of $f$ in an orthonormal coordinate system%
 $(O;\vec{\imath};\vec{\jmath})$ (unit: 2 cm on each axis).%

\textbf{Part one}

Using the table above:%

 \begin{enumerate}
 \item  Give the domain of $f$.
 \item  Draw in the coordinate system $(O;\vec{\imath};\vec{\jmath})$:
 \begin{enumerate}
 \item  the horizontal asymptote (D);
 \item  the vertical asymptote (D');
 \item  the point $A$ where the tangent to (C) is horizontal.
 \end{enumerate}
 \end{enumerate}

\textbf{Part two}

Now $f$ is given by:
\[
f(x)=1 + \dfrac{4}{(x-1)}    + \dfrac{3}{(x-1)^2}
\]
\begin{enumerate}
 \item Solve the equations $f(x)=0$ and $f(x)=1$.
 \item  With your calculator, fill in the following table
  (copy it onto your answer sheet).
   \begin{tikzpicture}
   \tkzTabInit[deltacl=1,espcl=1]{ $x$/1,$f(x)$ /1}%
   {-1,,{-0.75},,{0.5},,2,,3,,4}%
   \tkzTabLine{,,,,,,,,,,,,,,,,,,,,}%
   \makeatletter
   \foreach \x in {1,...,5}
    \setcounter{tkz@cnt@pred}{\x}\addtocounter{tkz@cnt@pred}{\x}
    \draw (N\thetkz@cnt@pred 0.center) to (N\thetkz@cnt@pred 2.center);
    \end{tikzpicture}
\end{enumerate}

\vfill
\end{tkzexample}

\subsection{A question from a user: decimal commas}

In French, the decimal separator is a comma, which is also the list separator of the macros. The package numprint solves this kind of problem: the macro |\np| prints a decimal number correctly, with the separator of the current language.
\begin{tkzexample}[code only, small]
\usepackage[french]{babel}
\usepackage[np]{numprint}
\end{tkzexample}

\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=1]
\tkzTabInit[lgt=6,espcl=7]
{$x$/0.75,
$x\np{-1.5}$/0.75}
{$-\infty$,$+\infty$}
\end{tikzpicture}
\end{tkzexample}

\subsection{Some classic tables}

Table 1 (ln):

\begin{tkzexample}[vbox,small]
  \begin{tikzpicture}
  \tkzTabInit[espcl=6]{$x$/1,$\ln'(x)$/1,$\ln(x)$/2}{$0$,$+\infty$}
  \tkzTabLine{d,+,}
  \tkzTabVar{D-/$-\infty$,+/$+\infty$,}
  \tkzTabVal{1}{2}{0.4}{1}{0}
  \tkzTabVal{1}{2}{0.67}{$\E$}{1}
  \end{tikzpicture}
\end{tkzexample}


\bigskip

Table 2 (square root):

\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
\tkzTabInit[lgt=3,espcl=6]{$x$/1,$f'(x)$/1,$f(x)=\sqrt{x}$/2}{$0$,$+\infty$}
\tkzTabLine{d,+,}
\tkzTabVar{-/0,+/$+\infty$,}
\end{tikzpicture}
\end{tkzexample}

\bigskip

Table 3 (reciprocal):

\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
\tkzTabInit[lgt=3,espcl=6]{$x$/1,$f'(x)=-\dfrac{1}{\ x^2}$/1,$f(x)=\dfrac{1}{x}$/2}{$-\infty$,$0$,$+\infty$}
\tkzTabLine{,-,d,-,}
\tkzTabVar{+/0,-D+/$-\infty$/$+\infty$,-/0}
\end{tikzpicture}
\end{tkzexample}

\bigskip

Table 4 (\(f(x)=\dfrac{x^2+4}{x}\)):
\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
\tkzTabInit[]{\(x$/1,$f'(x)\)/1,\(f(x)\)/2}{\(-\infty\),\(-2\),\(0\),2,\(+\infty\)}
\tkzTabLine{,+,z,-,d,-,z,+,}
\tkzTabVar{-/\(-\infty\),+/-4,-D+/$-\infty$/$+\infty$,-/4,+/\(+\infty\)}
\end{tikzpicture}
\end{tkzexample}

\bigskip


Table 5 (cos):
\begin{tkzexample}[vbox,small]
\begin{tikzpicture}
\tkzTabInit{$x$/1,$-\sin(x)$/1,$\cos(x)$/2}{$0$,$\pi$,$2\pi$}
\tkzTabLine{z,-,z,+,z}
\tkzTabVar{+/$1$,-/$-1$,+/$1$}
\tkzTabVal{1}{2}{0.5}{$\dfrac{\pi}{2}$}{0}
\tkzTabVal{2}{3}{0.5}{$\dfrac{3\pi}{2}$}{0}
\end{tikzpicture}
\end{tkzexample}

\subsection{Using the macro \tkzcname{par}}

Well, it is not possible. The best solution is the macro |\parbox|; otherwise |\endgraf|, defined by |\let\endgraf=\par|, can do the job.

\begin{tkzexample}[width=7cm,small]
  \begin{tikzpicture}
  \tkzTabInit {$x$ / 1 ,$f(x)$ /1}%
  {$0$,$1$}
  \tkzTabLine{,\parbox{3cm}{$u(x)$\\ $v(x)$},}
  \end{tikzpicture}
\end{tkzexample}

\subsection{An example with the option help}

\begin{tkzexample}[vbox,small]
  \begin{tikzpicture}
  \tkzTabInit[color, colorT = red!20, colorC = yellow!20,
   colorL = cyan!40,  colorV = lightgray!20, espcl=3,help]
        {$x$ /1, $f''$ /1,$f'$ /2,  $f$ /2}
        {$-\infty$ , $0$ ,$+\infty$}
  \tkzTabLine{, - , z , + ,}
  \tkzTabVar{+/$+\infty$ , -/$-2$ , +/$+\infty$}
  \tkzTabVal[draw]{1}{2}{.6}{$x_1$}{$0$}
  \tkzTabVal[draw]{2}{3}{.4}{$x_2$}{$0$}
  \end{tikzpicture}
\end{tkzexample}


\begin{tkzexample}[vbox,small]
  \begin{tikzpicture}
  \tikzset{arrow style/.style   = {black,
  >->           = latex’,thick ,
  shorten >   =  5pt,
  shorten <   =  5pt}}
  \tkzTabInit[color, colorT = red!20, colorC = yellow!20,
   colorL = cyan!40,  colorV = lightgray!20, espcl=3]
        {$x$ /1, $f''$ /1,$f'$ /2,  $f$ /2}
        {$-\infty$ , $0$ ,$+\infty$}
  \tkzTabLine{, - , z , + ,}
  \tkzTabVar{+/$+\infty$ , -/$-2$ , +/$+\infty$}
  \tkzTabVal[draw]{1}{2}{.6}{$x_1$}{$0$}
  \tkzTabVal[draw]{2}{3}{.4}{$x_2$}{$0$}
  \begin{scope}[>->,line width=1pt,>=stealth]
  \path (N13) -- (N23) node[midway,below=6pt](N){};
  \draw ([above=6pt]N14) to [bend left=45] ([left=1pt]N);
  \draw ([right=3pt]N) to [bend left=45] ([above=6pt]N24)  ;
  \draw ([above right=6pt]N24)to [bend right=40] ([below left=6pt]N33);
  \end{scope}
  \end{tikzpicture}
\end{tkzexample}

\subsection{Changing the width of a column}
This is not provided by the package. A trick is to add empty columns.

\begin{tkzexample}[vbox,small]
  \begin{tikzpicture}
      \tikzset{t style/.style = {style = densely dashed}}
      \tkzTabInit[lgt=4, espcl = 1.2, lw = 0.5pt, deltacl=0]
      { / 0.7 , $x(x^2-5x+4)$ / 1}{ ,$0$, $1$, , $4$,}
      \tkzTabLine{,-,t,+,t,,-,,t, +,}
      \draw[fill=black] (N21) circle(2pt);
      \draw[fill=black] (N31) circle(2pt);
      \draw[fill=black] (N51) circle(2pt);
      \draw[->=stealth, line width=1.5pt] (N11) -> (N61.east) node[right=2pt] {$x$};
  \end{tikzpicture}
\end{tkzexample}

\endinput