5

I'm a newby with both tkz-tab and tikz. I'd like to use tkz-tab to present the analysis of a function.

Is there a way to draw symbols for convex and concave that span over the whole diagram's cell, in the way the arrow are drawn ?

Up to now I've tried to use cup and cap symbols, but the result is not suitable. I would like to have something like a portion of a parabola.

Here is a mwe :

\documentclass{article}
\usepackage{tkz-tab}
\usepackage{amsmath,fullpage}
\begin{document}
\begin{tikzpicture}
\tkzTabInit[lgt=2,espcl=1]{
    $x$         /1,
    $\sin(x)$   /1
}% 
{
    $-\pi$, $0$ , $\pi$ 
}%
\tkzTabLine{  , {\Huge \smile} , t , \frown , }
\end{tikzpicture} 
\end{document}
3
  • Could you edit your question and add a link to a page showing the symbols you're looking for?
    – jub0bs
    Jan 20, 2014 at 10:58
  • Sorry I cannot provide a link right now, but the symbols may look like \smile and \frown but span across the cell.
    – svannay
    Jan 20, 2014 at 11:11
  • 2
    I don't know what you mean by diagram's cell; I've never used tkz-tab myself. Could you post a minimal working example (MWE)? That usually helps in getting a quick and satisfactory answer.
    – jub0bs
    Jan 20, 2014 at 11:13

1 Answer 1

4

One simple possibility, using \draw and some of the predefined nodes:

\documentclass{article}
\usepackage{tkz-tab}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}
\tkzTabInit[lgt=2,espcl=1]{
    $x$         /1,
    $\sin(x)$   /1
}% 
{
    $-\pi$, $0$ , $\pi$ 
}%
\tkzTabLine{  , , t , , }
\draw[cyan,shorten >= 7pt,shorten <= 7pt] 
  ( $(T11)!0.2!(T12)$ ) to[out=-50,in=230,looseness=1.4] ( $(N21)!0.2!(N22)$ );
\draw[cyan,yscale=-1,shorten >= 7pt,shorten <= 7pt] 
  ( $(N22)!0.1!(N21)$ ) to[out=-50,in=230,looseness=1.4] ( $(T22)!0.1!(T21)$ );
\end{tikzpicture} 

\end{document}

enter image description here

2
  • I've tried it with slightly wider columns (espcl=2): the curve are crossing the table's borders. Is there a way to adjust automatically the looseness ? Further idea: is there a way to create commands, for instance \convexe and \concave that do the drawings automatically where it is typed ? In that case, the nodes used for the drawing should be choosen relatively to the place the command is typed.
    – svannay
    Jan 20, 2014 at 20:21
  • @svannay Since TikZ is being used, surely there's a way, but that would imply going into the code of the package, and I don't have time to do so. Perhaps the package author (who is one of the regulars here) will read your question and provide a more automatic solution. Jan 20, 2014 at 22:35

You must log in to answer this question.

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