1

Please could someone help me build this variation table enter image description here

Here is my code :

\documentclass[11pt,a4paper]{article}
\usepackage[left=2.5cm,right=2cm,top=3.8cm,bottom=0.1cm]{geometry}
\usepackage{tkz-tab}
\begin{document}
\begin{tikzpicture}[scale = 0.8]
\newcommand*{ \E}{ \ensuremath{ \mathrm{e}}}.
\tkzTabInit{$x$ /1,$f'(x)$ /1,$f(x)$ /2}
{$-\infty$,$-3$,$0$,$1$,$2$,$3$,$+\infty$}
\tkzTabLine{,-,z,+,d, ,-, ,z, , -, ,}
\tkzTabVar{+/$+\infty$, -/$2$, +D+/$+\infty$/$+\infty$, R/, -/$-2$, R/, +/$+\infty$}
\tkzTabIma{3}{5}{4}{$0$}
\tkzTabIma{3}{3}{6}{$0$}
\end{tikzpicture}
\end{document}

enter image description here

I still don't understand how the \tkzTabIma{}{}{}{$0$} works !!

I tried [scale = 0.8] to make it small but it turns small and ugly.

Thanks in advance.

1
  • 3
    Please tell us what you've tried so far.
    – Mico
    Commented Feb 5, 2023 at 11:13

2 Answers 2

3

You can reduce the space between values (default =2 cm) using espcl= number (in cm)

Instead of using \tkzTabIma, place a node between the top and bottom nodes (N62 and N63).

Using \tkzTabInit[espcl=1.7, help] will display the name of the nodes.

a

\documentclass[11pt,a4paper]{article}
\usepackage[left=2.5cm,right=2cm,top=3.8cm,bottom=0.1cm,showframe]{geometry} % show the margins <<<
\usepackage{tkz-tab}

\begin{document}

    \begin{tikzpicture}
    \tkzTabInit[espcl=1.8]{$x$ /1,$f'(x)$ /1,$f(x)$ /2} {$-\infty$,$-3$, $0$,$1$,$2$,$3$,$+\infty$}
    \tkzTabLine{,-,z,+,d, ,-, ,z, , -, ,}
    \tkzTabVar{+/$+\infty$,  -/$2$,  +D+/$+\infty$,  R/,  -/$-2$,   R/,  +/$+\infty$ }
    \tkzTabIma{3}{5}{4}{$0$}
    \path (N62)--node[midway,fill=white]{$0$}(N63);
    \end{tikzpicture}

\end{document}
1
  • 1
    Tikz is so huge that every question/answer make you discover something. I wasn't aware of espcl (or didn't notice it when I read the manual.) Thanks for that.
    – gildux
    Commented Feb 5, 2023 at 21:18
4

I'll just answer one part:

I still don't understand how the \tkzTabIma{}{}{}{$0$} works !!

\tkzTabIma{}{}{}{} takes as arguments:

  1. the index of arrow starting.
  2. the index of arrow ending.
  3. the index of the value itself.
  4. the associated image to the value.

I guess you are confused by indexes. In your case they're four so:

1 2 3 4 5 6 7
\tkzTabInit{}{…} $-\infty$ $-3$ $0$ $1$ $2$ $3$ $+\infty$
\tkzTabVar{…} +/$+\infty$ -/$2$ +D+/$+\infty$/$+\infty$ R/ -/$-2$ R/ +/$+\infty$

So, \tkzTabIma{3}{5}{4}{$0$} says that your function's image for the 4th value (denoted by R/ then) is zero, which should be placed between the 3rd (i.e. $+\infty$) and the 5th (i.e. -/$-2$). So far so good.

But, \tkzTabIma{3}{3}{6}{$0$} says that your function's image for the 6th value (also denoted by R/) is zero, and should be between the 3rd and the 3rd …hence exactly at the 3rd position?
Looking at the image, I think you wanted \tkzTabIma{5}{7}{6}{$0$} or similar.

First index/argument should be an integer lesser than key/third index, and last index (second argument) should be an integer greater than image corresponding index.
Why not just use the before last argument to position the last argument? In my understanding, you give an interval where to place the last argument. You could have use \tkzTabIma{4}{7}{6}{$0$} that I interpret as “hey, try to put zero somewhere between position 4 and 7, but closer to position 6 which is my reference”

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .