I would like to create an exercise environment for which I can specify two optional arguments, one appearing before the "Exercise" mention and the other one appearing in brackets after the theorem number.
I'm using the amsthm
package.
Using a basic theorem style such as
\newtheoremstyle{mystyle}{}{}{}{}{\sffamily\bfseries}{.}{ }{}
\theoremstyle{mystyle}{
\newtheorem{exo}{\bfseries Exercice}}
the following code
\begin{exo}[Nom de l'exo]
Montrer par récurrence sur $n$ que
\end{exo}
gives me this output:
In another course, I used a different environment that helped me add something before the "Exercise":
\newtheoremstyle{exerci}{}{}{}{}{\bfseries}{.}{.5em}{\thmnote{#3}~\thmname{#1}~\thmnumber{#2}}
\theoremstyle{exerci}
\newtheorem{exo}[]{Exercice}
so
\begin{exo}[\faBatteryThreeQuarters]
Montrer par récurrence sur $n$ que
\end{exo}
gives me the following output:
Now I can't figure how to allow for both optional arguments to appear. Does anyone know how to achieve that?
Thanks in advance!
Best Answer
Here you can let a battery name (
bata
tobatd
) or nothing, and let an exercise name or not.