Tableau et valeur interdite

Bonjour,

Je voudrais faire deux traits verticaux dans un tableau pour indiquer une valeur interdite. Comment puis-je faire?

Merci.

Réponses

  • Bonjour,

    Avec quel outil crées-tu ton tableau ?
  • Voici un copié-collé de Tkz-Tab (\usepackage{tikz} (obligé ?) et \usepackage{tkz-tab.sty} en préambule) :
    \begin{tikzpicture}
    \tkzTabInit[lgt=1.5,espcl=6.5]{$x$ /1,$i’(x)$ /1,$i$ /3}
    {$-\infty$,$0$,$+\infty$}%
    \tkzTabLine{,-,d,-,}
    \tkzTabVar{+/
    $0$ / ,-D+/ $-\infty$ / $+\infty$ , -/ $0$ /}
    \end{tikzpicture}
    
  • Bonjour,
    J'avais essayé avec tabular, comme je n'y arrivais pas j'ai utilisé tikzpicture.
  • Bonjour,
    Avec le préambule ci-dessous et le code ci-dessous, la valeur b de mon tableau de variation sort de mon tableau.
    J'ai un bug et je n'arrive pas à le résoudre.
    \documentclass[11pt]{article} 
    \usepackage{hyperref}
    \usepackage[latin1]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    \usepackage[top=1.5cm,bottom=1cm,left=1cm,%
    right=1cm]{geometry}
    \usepackage{graphicx}
    \usepackage{pstricks,pst-plot,pst-eucl} 
    \usepackage{framed}
    \usepackage{amsmath}
    \usepackage{amssymb}
    \usepackage{ulem}
    \usepackage{mathrsfs}
    \usepackage{fancybox}
    \usepackage{multicol}
    \usepackage{xcolor}
    \usepackage{epsfig}
    \usepackage{pifont}
    \usepackage[framed]{ntheorem}
    \usepackage[frenchb]{babel}
    \usepackage{tabularx}
    \usepackage{fancyhdr}
    \usepackage{fp}
    
    \usepackage{pstricks-add}
    
    \def\R{{\mathbb R}}
    %\def\Q{{\mathbb Q}}
    \def\Z{{\mathbb Z}}
    %\def\D{{\mathbb D}}
    \def\N{{\mathbb N}}
    %\def\C{{\mathbb C}}
    
    \newcommand{\encad}[1]{%
    	\fbox{\begin{minipage}[t]{1\linewidth}%
    			#1\end{minipage}}}
    \setlength{\theorempreskipamount}{0pt}
    \setlength{\theorempostskipamount}{0pt}
    \theoremstyle{break}
    \theorembodyfont{\upshape}
    \newframedtheorem{Th}{Th\'eor\`eme}
    \newframedtheorem{Prop}{Propri\'et\'e}
    \newframedtheorem{Cor}{Corollaire}
    \newtheorem{Rem}{Remarque}
    \newtheorem{Not}{Notation}
    \newtheorem*{Dem}{D\'emonstration}
    %\theorembodyfont{\rmfamily}
    %\newtheorem{Exo}{EXERCICE \no{}}
    %\theorembodyfont{\small \sffamily}
    \newtheorem{Ex}{Exemple}
    \theorembodyfont{\slshape}
    \newframedtheorem{Def}{D\'efinition}
    
    \renewcommand\thesection{\Roman{section}}
    \renewcommand\FrenchLabelItem{\textbullet}
    \newcommand{\V}{\overrightarrow}
    
    \renewcommand\thesection{\Roman{section}}
    \renewcommand{\thesubsection}{\quad \arabic{subsection})}
    \renewcommand{\thesubsubsection}{\qquad \alph{subsubsection})}
    \renewcommand\FrenchLabelItem{\textbullet}
    
    \setlength\parindent{0pt}      % Pour éviter l'indentation en début de paragraphe
    
    \newcommand{\cRM}[1]{\MakeUppercase{\romannumeral #1}} % chiffre romain
    
    \usepackage{algorithm} 
    \usepackage{algorithmic}
    \usepackage{eurosym}
    \usepackage{tikz,tkz-tab}
    
    \begin{document}
    
    	\begin{tabular}{p{8cm}|p{8cm}}
    		$\bullet$ Cas où $f$ est strictement croissante.
    		
    						\begin{center}
    							\begin{tikzpicture}
    							\begin{scope}[yscale=0.2,xscale=0.75]
    							\draw[thick,->](-1,0)--(6,0) ;
    						\draw[black] (6,0)--(6,0) node[below]{$x$};
    							\draw[thick,->](0,-5)--(0,20) node[left]{$y$};
    							\draw[blue,thick] plot[domain=1:5,samples=200] (\x,{0.25*(\x+3)^2});
    							\draw[red,thick] plot[domain=-1:6,samples=200] (\x, 12.25);
    							\draw[thin,dashed] (0,11)--(0,11) node[red,left] {$k$};
    							\draw[thin,dashed] (4,12.25)--(4,0) node[red,below] {$c$};
    							\draw[thin,dashed] (1,4)--(1,0)  node[black,below]{$a$};
    							\draw[thin,dashed] (1,4)--(0,4)  node[black,left]{$f(a)$};
    							\draw[thin,dashed] (5,16)--(5,0) node[black,below]{$b$};
    							\draw[thin,dashed] (5,16)--(0,16) node[black,left]{$f(b)$};
    							\draw[thin,dashed] (0,-1)--(0,-1) node[black,left]{$O$};
    							\draw (6,12)--(6,12) node[red,above] {$\Delta$};
    							\end{scope}
    							\end{tikzpicture}
    						\end{center}
    		\begin{tikzpicture}
    		\tkzTabInit[espcl=1]{$x$ / 1 , $f(x)$ / 2}{$a$, $c$, $b$}
    		\end{tikzpicture}
    	&
    	  $\bullet$ Cas où $f$ est strictement décroissante.	
    	\end{tabular}
    \end{document}
    
    Merci pour votre aide.

    [Restons dans la discussion que tu as ouverte sur les tableaux de variation. AD]
  • Je ne sais pas, je n'ai pas de problème majeur (juste le $b$ qui est un peu trop bas). Voici une variante consistant à mettre $c$ dans une colonne tkzTabVal de valeurs intermédiaires plutôt que dans la ligne tkzTabInit.
      \begin{tikzpicture}
      \tkzTabInit[lgt=1.2,espcl=4.5]{$x$ / 1 , $f(x)$ / 2}{$a$, $b$}
      \tkzTabVar{-/$f(a)$,+/$f(b)$}
      \tkzTabVal{1}{2}{.5}{$c$}{$k$}
      \end{tikzpicture}
    
    71196
  • Quand je compile votre code dans mon document, la b n'est pas dans le tableau il est à l'extérieur du rectangle définissant le tableau.
  • C'est mystérieux. Et dans un document plus dépouillé ?
    \documentclass{article}
    
    \usepackage[margin=2cm]{geometry}
    \usepackage{tikz}
    \usepackage{tkz-tab}
    \usetikzlibrary{calc}
    \usepackage[utf8]{inputenc}
    \usepackage[francais]{babel}
    
    \begin{document}
    
    \begin{tikzpicture}
      \tkzTabInit[lgt=1.2,espcl=4.5]{$x$ / 1 , $f(x)$ / 2}{$a$, $b$}
      \tkzTabVar{-/$f(a)$,+/$f(b)$}
      \tkzTabVal{1}{2}{.5}{$c$}{$k$}
      \end{tikzpicture}
    
    \end{document}
    
  • Avec un document plus dépouillé comme celui que vous proposez, je n'ai aucun problème, le tableau est correctement tracé.
  • Ah ! C'est donc dû à une mauvaise interaction entre paquets. Eh bien, cela promet un travail patient de remplumage. Je commencerais par supprimer pstricks et affidés (pst*). Le paquet framed provoque peut-être des comportements compliqués.
  • Effectivement en supprimant pstricks de mon préambule je n'ai plus de problème. pstrick et tikz ne font pas bon ménage.
Connectez-vous ou Inscrivez-vous pour répondre.