## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Convexity table with TiKz Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm

### Convexity table with TiKz

Hello there,

I would need your help to build a convexity table with the package TiKz...
I already know how to make a variation table or a sign chart, but I have no idea to make a convexity one...

I joined a picture on which you'll be able to see how kind of table I want to create (sorry, it's in french)

convex.png (8.9 KiB) Viewed 5827 times

Thanks to everyone who will help me!

PS : Sorry for my bad English, I'm french

Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm
I feel... alone :p

Johannes_B
Site Moderator
Posts: 4186
Joined: Thu Nov 01, 2012 4:08 pm
Your information are sparse. I myself don't know, what convexity tables are.
What have you tried so far? Meaning, can you post a compilable but minimal working example? That gives helpers a good starting point, and all are on the same base of important knowledge.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm
Hmm... For the moment, I only have my phone, si I will send a piece of code when I'll have my computer...
Otherwise, to me, a convexity table is just a just like a sign chart, but instead of studying the sign of the function, it studies the convexity of the function, or in other words, the sign of the second derivative of the function.
If the function is convex, the word "convex" appears in the table just as the symbol "-" if the function was negative.
You car see in the picture the design that I'm looking for for the inflexion points.

Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm
Finally, I carefully read the documentation of tkz-tab, and I found almost all what I wnated...

Here's a code that you can test :

\documentclass[a4paper, 12pt, fleqn]{article}\usepackage{tkz-tab}\usepackage[utf8]{inputenc}\usepackage{amsmath}\usepackage[frenchb]{babel}\usepackage{makeidx} \begin{document}     \begin{tikzpicture}[double distance=0.04cm]     \tkzTabInit[color,espcl=3.5, lgt=2.3]{$x$ /1,Convexité\\ de $\left(\mathcal{C}_f\right)$ /3}{$- \infty$, $a$, $+\infty$}\tkzTabLine{,\text{Convexe},\genfrac{}{}{0pt}{0}{\text{Point}}{\text{d'inflexion}},\text{Concave},}     \draw (N21) to (M12);     \draw (N21) to (M22);     \end{tikzpicture}\end{document}

However, as you can see, there still is a problem of proportions...

Could you help me to make it prettier?

Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm
Here's what I get with the code that I sent in my last post :

temp.png (18.96 KiB) Viewed 5770 times

Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm
Hm... Above all, do not rush... :p

hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm
The lack of replies might be caused by other people being busy with their own problems and maybe also by you using a package with french documentation which reduces the number of people able to read it (I think I kind of understand it, but it takes me much longer than a plain english manual would, especially since I have to read everything because I don't know what to search for )

That being said, I have a few tips to get the alignment at least a little better:

\documentclass[a4paper, 12pt, fleqn]{article}\usepackage{tkz-tab}\usepackage[utf8]{inputenc}\usepackage{amsmath}\usepackage[frenchb]{babel}\usepackage{makeidx} \begin{document}     \begin{tikzpicture}[double distance=0.04cm]     \tkzTabInit[color,espcl=3.5, lgt=2.3,deltacl=1]{$x$ /1,Convexité\\ de $\left(\mathcal{C}_f\right)$ /2}%         {$- \infty$, $a$, $+\infty$}%     \tkzTabLine{\text{Convexe},,\genfrac{}{}{0pt}{0}{\text{Point}}{\text{d'inflexion}},,\text{Concave}}     \draw (N21) to (M12);     \draw (N21) to (M22);     \end{tikzpicture}\end{document}

Edits:
• Changed /3 to /2 after "Convexité de C_f", this is simply the height of the row in cm
• moved the comma's before convexe and after concave between the words and the point d'inflexion, this moves these words to the left and right side of the box instead of cramped up in the middle
• added the deltacl option, which sets the margin before the first and after the last item

So all in all, as you're writing a french text I'd expect you to be able to at least understand the french manual, and the best summary of this post is RTFM on page 10 it clearly displays graphically which option sets which length, you don't even have to understand a single word in the rest of the manual to understand that
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit

Pierrotdu18
Posts: 22
Joined: Sun Dec 01, 2013 11:24 pm
Oh, thank you so much...
Indeed, I should have read the whole documentation, since, in addition, it's written in French

Otherwise, I love what you have done, but I still have a last question : could I "center" the words "convexe" and "concave" so that they don't stick to the edges?

hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm
Actually, this is all just a little hacking about at the code, trying to add some more columns to have a little more fine grained placement options, maybe there is a more elegant solution in the manual
I reduced the column spacing a little, added some commas to move the text away from the borders, and changed the coordinates of the triangle.

\documentclass[a4paper, 12pt, fleqn]{article}\usepackage{tkz-tab}\usepackage[utf8]{inputenc}\usepackage{amsmath}\usepackage[frenchb]{babel}\usepackage{makeidx} \begin{document}     \begin{tikzpicture}[double distance=0.04cm]     \tkzTabInit[color,espcl=2.5, lgt=2.3,deltacl=1]{$x$ /1,Convexité\\ de $\left(\mathcal{C}_f\right)$ /2}%         {$- \infty$,, $a$,, $+\infty$}%     \tkzTabLine{,\text{Convexe},,,\genfrac{}{}{0pt}{0}{\text{Point}}{\text{d'inflexion}},,,\text{Concave},}     \draw (N31) to (M12);     \draw (N31) to (M42);     \end{tikzpicture}\end{document}
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit