1

After some trial and error efforts I am having a difficult time getting to show a particular point at a particular position.

The MWE is

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage{tkz-tab}
\usetikzlibrary{shapes,snakes,arrows,backgrounds}
\usetikzlibrary{scopes,svg.path,shapes.geometric,shadows}

\begin{document}
\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=1.5]
{$x$   /1, $f''$ /1,$f'$ /2,  $f$ /2}
%
{$-\infty$  , $x_1$ , $0$, $x_2$ ,$+\infty$   }
%
\tkzTabLine{,-,t,-, z,+, t, +  }
%
\tkzTabVar {+/$+\infty$ ,R/, -/$-2$  ,R/ , +/$+\infty$   }
\tkzTabVal{1}{2}{1}{$x_1$}{$0$}
\tkzTabVal{2}{3}{2}{}{$0$}
\begin{scope}[>->,line width=1pt,>=stealth]
\draw (2.7,-5.5) to [bend left=45] (3.7,-4.5);
\draw (4.3,-4.5) to [bend left=45] (5.3, -5.5)  ;
\draw (6.1, -5.5) to [bend right=45] (8.1 , -4.5);
\end{scope}
\makeatother
\end{tikzpicture}
\end{document}

The output is

enter image description here

which is almost what I desire expect for one little detail. That zero that is generated by the code

\tkzTabVal{2}{3}{2}{}{$0$}

should not be in that position. It should be in the position where the other zero is. I played around with that changing the values but I cannot position it right. As a matter of fact I am working blind here since I cannot understand how \tkzTabVal actually works.

I think the manual should also be translated in English. That would be a future request of mine.

2 Answers 2

2

Rather then {$-\infty$ , $x_1$ , $0$, $x_2$ ,$+\infty$} just use {$-\infty$ , $0$ ,$+\infty$} inputs x_1 and x_2 are added with \tkzTabVal command like this

\tkzTabVal[draw]{1}{2}{.6}{$x_1$}{$0$}
\tkzTabVal[draw]{2}{3}{.4}{$x_2$}{$0$}

Here option draw for dotted line joining x_i with 0, note that you need to increase width of table with espcl

Complete Code

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xcolor}
\usepackage{tkz-tab}
\usetikzlibrary{shapes,snakes,arrows,backgrounds}
\usetikzlibrary{scopes,svg.path,shapes.geometric,shadows}

\begin{document}
\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]
\draw (2.7,-5.5) to [bend left=45] (3.7,-4.5);
\draw (4.3,-4.5) to [bend left=45] (5.3, -5.5)  ;
\draw (6.1, -5.5)to [bend right=45] (8.1 , -4.5);
\end{scope}
\makeatother
\end{tikzpicture}
\end{document}
3
  • Hmm .. increase width ? I am using a two column document .. I don't know if I can do that . Thanks for the help .
    – Tolaso
    Jan 9, 2017 at 0:00
  • If you leave espcl=1.5 the second arrow will be outside of table
    – Salim Bou
    Jan 9, 2017 at 0:05
  • Yes, I realize that. I'll just test it out. Compiles perfectly. ..
    – Tolaso
    Jan 9, 2017 at 0:08
1

A few clarifications. If you use the "help" option you will have the nodes necessary for the constructions without looking for coordinates.

\documentclass[10pt]{article}
\usepackage{xcolor}
\usepackage{tkz-tab}

\begin{document}
\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{document}

enter image description here

You must log in to answer this question.

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