5

I'm modifying this code to have an arrow as in the picture. I'm tried but unable to reach my goal. Please help me modify it! Thank you so much!

\documentclass[12pt]{extreport}
\usepackage[left = 1in, right = 1in, top = 0.7in, bottom = 0.7in]{geometry}
\usepackage{graphicx,latexsym,mathtools}
\usepackage{tikz,tkz-tab}

\begin{document}

\begin{tikzpicture}
\tkzTab
[lgt=5,espcl=3] 
{$x$/1, $f_\alpha'(x)$/1, $f_\alpha(x)$/3} 
{$0$, $\alpha-1$, $x^*(\alpha)$, $+\infty$} 
{,+,0,-,-,-,} 
{-/ $0$, +/ $f_\alpha(\alpha-1)$, -/ $0$ , -/ $-\infty$} 
\end{tikzpicture}

\end{document}

enter image description here

  • 1
    Are you sure you're going to + infinity? – AndréC Feb 21 at 22:23
  • @AndréC, It's my bad. It should be - infinity. – LAD Feb 21 at 22:24
  • ok, please, now give a fully compilable code. – AndréC Feb 21 at 22:25
  • I've edited my code @AndréC. – LAD Feb 21 at 22:28
  • 1
    @Navier_Stokes - please see if the answer below meets your requirement or if anything more is required -- a second negative/descent/derivative is provided with the help of intermediate entries – js bibra Feb 22 at 5:33
6

I think plain TikZ is not so difficult as OP complained ^^ What does plain mean? SIMPLE! Change [yscale=.8,xscale=1.4] as you wish!

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[yscale=.8,xscale=1.4]
\draw[shift={(-.5,.5)}] (0,0) rectangle +(8,-5) 
(0,-1)--+(0:8) (0,-2)--+(0:8) (1,0)--+(-90:5);
\path
(0,0)    node{$x$}          % <<< line 1
++(0:1)  node{$0$}
++(0:2)  node{$\alpha -1$}
++(0:2)  node{$x^*(\alpha)$}
++(0:2)  node{$+\infty$}
(0,-1)   node{$f'_{\alpha}(x)$}         % <<< line 2
++(0:2)  node{$+$}
++(0:1)  node{$0$}
++(0:1)  node{$-$}
++(0:2)  node{$-$}
(0,-3)   node{$f_{\alpha}(x)$}          % <<< line 3
++(0:1)  node (A) {$0$}
++(0:2)  +(90:1) node (B) {$f_{\alpha}(\alpha -1)$}
++(0:2)  node (C) {$0$}
++(0:2)  +(-90:1) node (D) {$-\infty$}
;
\foreach \p/\q in {A/B,B/C,C/D}
\draw[-stealth,magenta] (\p)--(\q);
\end{tikzpicture}
\end{document}
| improve this answer | |
  • Thank you so much! You save my day :) – LAD Feb 22 at 9:01
  • You are welcome! – Black Mild Feb 22 at 9:04
5

I used the intermediate tab value command from page 33 of the manual

\tkzTabVal{2}{3}{0.5}{$x^*(\alpha)$}{0}

the {2}{3} refers to the column precedent and antecedent and 0.5 on the sloped line -- -- a second negative/descent/derivative is provided with the help of intermediate entries-- these intermediate entries are not shown with a column heading of - since the continuous down slope shows that anyway

The manual is at -- http://ftp.cc.uoc.gr/mirrors/CTAN/macros/latex/contrib/tkz/tkz-tab/doc/tkz-tab-screen.pdf

enter image description here

\documentclass[12pt]{extreport}
\usepackage[left = 1in, right = 1in, top = 0.7in, bottom 
= 0.7in]{geometry}
\usepackage{graphicx,latexsym,mathtools}
\usepackage{tikz,tkz-tab}

\begin{document}

\begin{tikzpicture}

\newcommand*{\va}{\colorbox{red!50} {$\scriptscriptstyle 
V_a$}}
\newcommand*{\vb}{\colorbox{blue!50} {$\scriptscriptstyle 
V_b$}}
\newcommand*{\vbo}{\colorbox{blue!50} 
{$\scriptscriptstyle 
V_{b1}$}}
\newcommand*{\vbt}{\colorbox{yellow!50} 
{$\scriptscriptstyle 
V_{b2}$}}
\newcommand*{\vc}{\colorbox{gray!50} {$\scriptscriptstyle 
V_c$}}
\newcommand*{\vd}{\colorbox{magenta!50} 
{$\scriptscriptstyle 
V_d$}}
\newcommand*{\ve}{\colorbox{orange!50} 
{$\scriptscriptstyle 
V_e$}}
\tkzTabInit[color,
colorT = yellow!20,
colorC = red!20,
colorL = green!20,
colorV = lightgray!20,
lgt = 3,
espcl = 4]%
{$x$/1, $f_\alpha'(x)$/1, $f_\alpha(x)$/3}%
{$0$, $\alpha-1$,$+\infty$} 
\tkzTabLine{ ,+,0,-,-,, }
\tkzTabVar{-/ $0$, +/ $f_\alpha(\alpha-1)$,-/ $-\infty$}%
\tkzTabVal{2}{3}{0.5}{$x^*(\alpha)$}{0}
\end{tikzpicture}
\end{document}
| improve this answer | |
  • Could you please adjust your code to have both 0's on the same hight and and - infty below them? – LAD Feb 22 at 7:35
  • 1
    @Navier_Stokes -- then your table would be assymetrical/ unbalanced -- right side would be longer than left side -- the manual has no such parameter defined -- better to go for plain tikz -- see -- tex.stackexchange.com/a/447188/197451 -- and compare with plain tikz -- tex.stackexchange.com/a/528556/197451 – js bibra Feb 22 at 8:25
  • Thank you so much! It seems to me that there is no easy solution. – LAD Feb 22 at 8:36
0

I have found other solutions too. Just post here for future reference.

\usetikzlibrary{calc,angles,quotes}
\begin{document}
\begin{tikzpicture}
\tkzTabInit[lgt=1.5,espcl=3,deltacl=0.5]
{$x$/.6, $f_{\alpha}'(x)$/.6, $f_{\alpha}(x)$/2.5}
{$0$,$\alpha-1$,$x^*(\alpha)$,$+\infty$}
\tkzTabLine{,+,z,-,-,-,}
\draw
($(N12)!0.5!(N13)$) node (A){$0$}
(N22) node[below] (B) {$f_{\alpha}(\alpha-1)$}
($(N32)!0.5!(N33)$) node (C) {$0$}
(N43) node[above] (D) {$-\infty$};
\draw[-stealth] (A)--(B);
\draw[-stealth] (B)--(C);
\draw[-stealth] (C)--(D);
\end{tikzpicture}

\begin{tikzpicture}[>=stealth,line join=round,line cap=round,font=\footnotesize,scale=1]
\tkzTabInit[nocadre=false,lgt=1.5,espcl=2,deltacl=0.5]{$x$/.7 ,$f'_\alpha(x)$/.7,$f_\alpha(x)$/2}
{ $0$ , $\alpha-1$ ,$x^*(\alpha)$ , $+\infty$}
\tkzTabLine{ , + , $0$ , - ,-, - , }
\draw
($(N13)!0.5!(N12)$) node(A){$0$}
(N22) node[below] (B){$f_\alpha(\alpha-1)$ }
($(N32)!0.5!(N33)$) node (C){$0$}
(N43) node[above](D){$-\infty$};
\draw[->=stealth] (A)--(B) ;
\draw[->=stealth](B)--(C)--(D);
\end{tikzpicture}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.