Here a question also about my last topic. I want to create an environment that put a pretty box around my theorem and its title. Here is a code with the desired output :
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[english, arabic]{babel}
\usepackage{amsmath, amsfonts, amssymb, amsthm}
\usepackage{tikz}
\usepackage{etoolbox}
\AtBeginEnvironment{tikzpicture}{\selectlanguage{english}}
\tikzset{font=\selectlanguage{arabic}}
\begin{document}
\tikzset{
mybox/.style={
draw=red, fill=blue!20, very thick,
rectangle, rounded corners, inner sep=10pt, inner ysep=20pt
},
fancytitle/.style={
draw=red, fill=blue!20, text=black, rectangle, rounded corners
}
}
\begin{tikzpicture}
\node [mybox] (box){%
\begin{minipage}{.89\textwidth}
لتكن $f$ دالة مستمرة على المجال $[a,b]$ و قابلة للإشتقاق على $]a,b[$,
حيث $f(a)=f(b)$.
إذن, يوجد عدد حقيقي $c \in ]a,b[$ حيث
$$
f^\prime(c)=0.
$$
\end{minipage}
};
\node[fancytitle, left=10pt] at (box.north east) {\AR{نظـريـة}};
\node[fancytitle, rounded corners] at (box.east) {$\clubsuit$};
\end{tikzpicture}%
\end{document}
Now, if I create the environment tamtam to obtain a good looking box around my Arabic text, it doesn't do it
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[english, arabic]{babel}
\usepackage{amsmath, amsfonts, amssymb, amsthm}
\usepackage{tikz}
\usepackage{etoolbox}
\AtBeginEnvironment{tikzpicture}{\selectlanguage{english}}
\tikzset{font=\selectlanguage{arabic}}
\newenvironment{tamtam}[1]{%
\tikzset{
mybox/.style={
draw=red, fill=blue!20, very thick,
rectangle, rounded corners, inner sep=10pt, inner ysep=20pt
},
fancytitle/.style={
draw=red, fill=blue!20, text=black, rectangle, rounded corners
}
}
\begin{tikzpicture}
\node [mybox] (box){%
\begin{minipage}{.89\textwidth}
#1
\end{minipage}
};
\node[fancytitle, left=10pt] at (box.north east) {\AR{نظـريـة}};
\end{tikzpicture}%
}{}%
\begin{document}
\begin{tamtam}
لتكن $f$ دالة مستمرة على المجال $[a,b]$ و قابلة للإشتقاق على $]a,b[$,
حيث $f(a)=f(b)$.
إذن, يوجد عدد حقيقي $c \in ]a,b[$ حيث
$$
f^\prime(c)=0.
$$
\end{tamtam}
\end{document}
NB: you have to let 2 empty lines between \begin{tamtam} and the Arabic text to get a readable Arabic output !!??
