%TITRE

\documentclass{article}


%PACKAGES
\usepackage[utf8]{inputenc} % encodage du fichier source
\usepackage[T1]{fontenc} % gestion des accents (pour les pdf)
\usepackage[francais]{babel} % autres : english, greek, etc. respecte les règles typographiques (espaces : ; ! ? etc.)
\usepackage{amsmath,amssymb} % pour les maths
\usepackage[a4paper]{geometry} % taille du papier et marges voir juste dessous
\geometry{hmargin=1cm,vmargin=1cm}
\usepackage{graphicx} % pour inclure des images
\usepackage{xcolor} % pour gerer les couleurs
\usepackage{hyperref} % gestion des hyperliens

\usepackage{tikz,tkz-tab} % pour les tableaux de variations et bien plus
\usepackage{moreverb} % pour citer du code sans que TeX l'interprête
\renewcommand{\verbatimtabsize}{0}

%TITRE

\title{Les tableaux en \LaTeX{}}
\author{CultureMath}
\date{\today}

%DOCUMENT

\begin{document}
	
	\maketitle
	
	\section{Tableau de signes}
\begin{center}
		\begin{tikzpicture}
	\tkzTabInit{$x$ / 1 , $f(x)$ / 1}{$0$, $6$, $8$, $+\infty$}
	\tkzTabLine{z, -, d, h, d, +, }
	\end{tikzpicture}
\end{center}
	
	Obtenu avec le code suivant :
	
	\begin{listing}[1]{1}
\begin{tikzpicture}
\tkzTabInit{$x$ / 1 , $f(x)$ / 1}{$0$, $6$, $8$, $+\infty$}
\tkzTabLine{z, -, d, h, d, +, }
\end{tikzpicture}
	\end{listing}
	
	Première ligne : on définit la structure du tableau. \\
	\{[libellé de la première case] / [hauteur de ligne en cm], idem pour chaque ligne\}\{les valeurs de x séparées par des virgules\} \\
	Si on a besoin d'écrire des virgules on les met donc entre accolades. 
	
	Puis une ligne de commande pour chaque ligne du tableau. \\
	d place une double barre centrée;\\
	t place un trait en pointillé centré;\\
	z place un zéro centré sur un trait un pointillé;\\
	h permet de définir une zone interdite (la zone est hachurée par défaut);\\
	$+$ place un signe $+$;\\
	$-$ place un signe $-$
	
	\section{tableau des variations}
	
	\begin{center}
		\begin{tikzpicture}
	\tkzTabInit{$x$ / 1 , $f(x)$ / 2}{$-\infty$, $-5$, $-3$, 0, $+\infty$}
	\tkzTabVar{-/ $-\infty$, +CD-/ $0$/ $2$, +D+/ $0$ /$0$, -V-/ $-2$ / $3$, +/ $+\infty$}
	\end{tikzpicture}
	\end{center}

	\begin{listing}[1]{1}
\begin{tikzpicture}
\tkzTabInit{$x$ / 1 , $f(x)$ / 2}{$-\infty$, $-5$, $-3$, 0, $+\infty$}
\tkzTabVar{-/ $-\infty$, +CD-/ $0$/ $2$, +D+/ $0$ /$0$, -V-/ $-2$ / $3$, +/ $+\infty$}
\end{tikzpicture}
\end{listing}

\section{Tableau combiné}

\begin{center}
	\begin{tikzpicture}
\tkzTabInit{$x$ / 1 , $\cos(x)$ / 1, $\sin(x)$ / 1.5}{$0$, $\frac{\pi}{2}$, $\pi$}
\tkzTabLine{, +, z, -, }
\tkzTabVar{-/ 0, +/ 1, -/ 0}
\end{tikzpicture}
\end{center}

\begin{listing}[1]{1}
\begin{tikzpicture}
\tkzTabInit{$x$ / 1 , $\cos(x)$ / 1, $\sin(x)$ / 1.5}{$0$, $\frac{\pi}{2}$, $\pi$}
\tkzTabLine{, +, z, -, }
\tkzTabVar{-/ 0, +/ 1, -/ 0}
\end{tikzpicture}
\end{listing}

\section{Plus compliqué}

\begin{center}
	\begin{tikzpicture}
\tkzTabInit{$x$ /1, $-\sin(x)$ /1, $\cos(x)$ /1.5} {$0$ , $\frac{\pi}{2}$, $\pi$}
\tkzTabLine{, -, -1, -, } 
\tkzTabVar{+/ 1, R/, -/ -1}
\tkzTabIma{1}{3}{2}{$0$}
\end{tikzpicture}
\end{center}

\begin{listing}[1]{1}
\begin{tikzpicture}
\tkzTabInit{$x$ /1, $-\sin(x)$ /1, $\cos(x)$ /1.5} {$0$ , $\frac{\pi}{2}$, $\pi$}
\tkzTabLine{, -, -1, -, } 
\tkzTabVar{+/ 1, R/, -/ -1}
\tkzTabIma{1}{3}{2}{$0$}
\end{tikzpicture}}
\end{listing}

\end{document}


