5

Bellow is some developed example solution I asked here tikz and mdframed + shadow drop and shading

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian]{babel}
\usepackage[a5paper]{geometry}
\usepackage{amsthm,thmtools}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{amsmath,amssymb}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{shadows,shapes}
\usetikzlibrary{calc}
\usepackage{lipsum}
\newcounter{exercise}
\newtheorem{myexercise}{Exercise}[section]
\tikzset{myshadow/.style={                             % custom shadow with tikz
         opacity=.85,
         shadow xshift=0.15,
         shadow yshift=-0.15,
         shade,
         shading=axis,
         shading angle=230}
         } 
\tikzstyle{titregris} =
[draw=gray, line width=1.0pt,% 
        text=white, rectangle,  
        right,minimum height=.7cm,
       double,
       shade,
              top color=blue!40,
              bottom color=blue!5,
              rounded corners=8pt,
               opacity=1,
                                     shadow xshift=0.15,
                                     shadow yshift=-0.15,
                                     shade,
                                     shading=axis,
                                     shading angle=30,
              drop shadow,
        ]
\tikzstyle{pointstyle} =
[draw=red, thick, fill=red,% 
        text=white, rectangle,  
        right,minimum height=.7cm,
       double,
       shade,
              top color=red,
              bottom color=blue!5,
              rounded corners=3pt,
              drop shadow
        ]        

\renewcommand*\theexercise{Exercise \textnumero\arabic{exercise}}
\makeatletter
\def\mdf@@exercisepoints{}%new mdframed key:
\define@key{mdf}{exercisepoints}{%
\def\mdf@@exercisepoints{#1}
}
\def\mdf@@fig{}%new mdframed key:
\define@key{mdf}{fig}{%
\def\mdf@@fig{#1}
}
\def\mdf@@title{}%new mdframed key:
\define@key{mdf}{title}{%
\def\mdf@@title{#1}
}


\mdfdefinestyle{exercisestyle}{%
middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray,
%apptotikzsetting={\tikzset{mdfbackground/.append style ={%
%shading = exersicebackground}}},
 apptotikzsetting={\tikzset{mdfbackground/.append style={top color=blue!40, bottom color=white}}},
innertopmargin=1.2\baselineskip,
skipabove={\dimexpr0.5\baselineskip+\topskip\relax},
skipbelow={-1em},
 shadow=true,
 shadowcolor=blue!35,
needspace=3\baselineskip,
frametitlefont=\sffamily\bfseries,
settings={\global\refstepcounter{exercise}},
singleextra={%
\node[titregris,xshift=1cm] at (P-|O) %
{~\mdf@frametitlefont{\theexercise}~\mdf@@title};
\ifdefempty{\mdf@@exercisepoints}%
{}%\node[fill=blue!40,font=\color{black},yshift=-51,circle,inner sep=1pt]
{\node[pointstyle,left,xshift=-1cm] at (P)%
{~\mdf@frametitlefont{\mdf@@exercisepoints pt.}~};},%
\ifdefempty{\mdf@@fig}%
{}%
{\path let \p1=(P), \p2=(O) in node[fill=blue!40,circle,inner sep=1pt,font=\color{white}] at (P|-0,0.5*\y2+0.5*\y1)  {\mdf@@fig};}% 
},
firstextra={%
\node[titregris,xshift=1cm] at (P-|O) %
{~\mdf@frametitlefont{\theexercise}~};
\ifdefempty{\mdf@@exercisepoints }%
{}%
{\node[pointstyle,left,xshift=-1cm] at (P)%
{~\mdf@frametitlefont{\mdf@@exercisepoints points}~};},%
{\node[pointstyle, left,xshift=1cm]  {$\clubsuit$};}
},
}
\makeatother
\begin{document}
\begin{mdframed}[style=exercisestyle,exercisepoints=10,fig=$\spadesuit$,title= example $E=mc^2$]
%\begin{myexercise}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
%\end{myexercise}        
\end{mdframed}
\listoftheorems{myexercise}
\end{document}

almost everything can be passed, Now question is can there be "List of Exercise" and "add to toc" commands? Yes thee is a tocloft, but it needs command. With TiKZ this is discussed here Adding TikZ code to TOC . Do i need to wrap mdframed environment with another command? or there can be a another way? p.s. I tryied to use ntheorem to create new theorem , but when i do printing of list theorems it is not pronted in utf-8..It seems conflict with fontencoding..there are broken LIRC commands and i gave up with ntheorem

From here New Qestion starts: Sorry...I edited and rolled back original code...here is an code developed during discussion. Since that fancy 'suit' node gives problem, when frame splits on tho pages, in coe below i removed it being default. So user can pass 'right side suit fig', when he knows that environment is not splitting. Before if there was no use of this frame splitting was ok...in code below there appeared ne problem: environmet title is lost and only counter value is displayed.

here is a code:

    \documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian]{babel}
\usepackage[a5paper]{geometry}
\usepackage{amsthm,thmtools}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{amsmath,amssymb}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{shadows,shapes}
\usetikzlibrary{calc}
\usepackage{lipsum}

\newcounter{exercise}

\newtheorem{myexercise}{Exercise}[section]
\tikzset{myshadow/.style={                             % custom shadow with tikz
         opacity=.85,
         shadow xshift=0.15,
         shadow yshift=-0.15,
         shade,
         shading=axis,
         shading angle=230}
         } 
\tikzstyle{titregris} =
[draw=gray, line width=1.0pt,% 
        text=white, rectangle,  
        right,minimum height=.7cm,
       double,
       shade,
              top color=blue!40,
              bottom color=blue!5,
              rounded corners=8pt,
               opacity=1,
                                     shadow xshift=0.15,
                                     shadow yshift=-0.15,
                                     shade,
                                     shading=axis,
                                     shading angle=30,
              drop shadow,
        ]
\tikzstyle{pointstyle} =
[draw=red, thick, fill=red,% 
        text=white, rectangle,  
        right,minimum height=.7cm,
       double,
       shade,
              top color=red,
              bottom color=blue!5,
              rounded corners=3pt,
              drop shadow
        ]        

%\renewcommand*\theexercise{Exercise \textnumero\arabic{exercise}}
\makeatletter
\def\mdf@@exercisepoints{}%new mdframed key:
\define@key{mdf}{exercisepoints}{%
\def\mdf@@exercisepoints{#1}
}
\def\mdf@@fig{}%new mdframed key:
\define@key{mdf}{fig}{%
\def\mdf@@fig{#1}
}
\def\mdf@@title{}%new mdframed key:
\define@key{mdf}{title}{%
\def\mdf@@title{#1}
}


\mdfdefinestyle{exercisestyle}{%
middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray,
 apptotikzsetting={\tikzset{mdfbackground/.append style={top color=blue!40, bottom color=white}}},
innertopmargin=1.2\baselineskip,
skipabove={\dimexpr0.5\baselineskip+\topskip\relax},
skipbelow={-1em},
 shadow=true,
 shadowcolor=blue!35,
needspace=3\baselineskip,
frametitlefont=\sffamily\bfseries,
singleextra={%
\node[titregris,xshift=1cm] at (P-|O) %
{~\mdf@frametitlefont{Exercise~\textnumero\theexercise}~\mdf@@title};
\ifdefempty{\mdf@@exercisepoints}%
{}%\node[fill=blue!40,font=\color{black},yshift=-51,circle,inner sep=1pt]
{\node[pointstyle,left,xshift=-1cm] at (P)%
{~\mdf@frametitlefont{\mdf@@exercisepoints pt.}~};},%
\ifdefempty{\mdf@@fig}%
{}%
{\path let \p1=(P), \p2=(O) in node[fill=blue!40,circle,inner sep=1pt,font=\color{white}] at (P|-0,0.5*\y2+0.5*\y1)  {\mdf@@fig};}% 
},
firstextra={%
\node[titregris,xshift=1cm] at (P-|O) %
{~\mdf@frametitlefont{\theexercise}~};
\ifdefempty{\mdf@@exercisepoints }%
{}%
{\node[pointstyle,left,xshift=-1cm] at (P)%
{~\mdf@frametitlefont{\mdf@@exercisepoints points}~};},%
%{\node[pointstyle, left,xshift=1cm]  {$\clubsuit$};}
},
}
\newcommand\listmdfname{List of Exercises}
\newcommand\listofmdframed{\section*{\listmdfname}%
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
\@starttoc{mdf}}
\newenvironment{mythm}[2][]
  {\refstepcounter{exercise}\addcontentsline{mdf}{figure}{Exercise~\theexercise~#2}\begin{mdframed}[style=exercisestyle,#1,title=#2]}
  {\end{mdframed}}
\makeatother

\begin{document}
\listofmdframed

\begin{mythm}[exercisepoints=10,fig=$\spadesuit$]{Example $E=mc^2$}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}

\begin{mythm}[exercisepoints=5,fig=$\spadesuit$]{Example $a=b$}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}

\vspace{0.1cm}

Here is problematic example:
\begin{mythm}[exercisepoints=10,]{Example Problematic}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}

\begin{mythm}[exercisepoints=5,fig=$\spadesuit$]{Example $a=b$}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}
\end{document}

i think passing 'MyTheoremEnv1' as Key instead of having just hardwired text Exercise might solve this?

Moriambar
  • 11,466
  • I will be great feature to have native mdframed listof command, since this environmet can have a title and counter. p.s. I i put naive theorem in mdframed its title and number are printed. How can I supress this printings? I actually depends on theorem class i use right? and i need to redefine output in makeat/makeatother – Levan Shoshiashvili Jun 15 '13 at 20:19
  • sorry for misspelling – Levan Shoshiashvili Jun 15 '13 at 20:51
  • 1
    A listof something depends on single environments like theorem. mdframed is just a shell for such environments. If you want to have a new listof you have to declare it. – Marco Daniel Jun 15 '13 at 20:52
  • So it will be just command which accepts my declared mdframed variables? like this '\newlistof[section]{exercise}{idf}{\listexercise}'? + another commands – Levan Shoshiashvili Jun 15 '13 at 21:02
  • So just after environmet \addcontentsline{idf}{exercise_ounter}{Some Name.} and '\listofexercise' will work? – Levan Shoshiashvili Jun 15 '13 at 21:11
  • @LevanShoshiashvili there's no need to manually use \addcontentsline; this can be done automatically; please see my answer below. – Gonzalo Medina Jun 15 '13 at 21:21

1 Answers1

8

One possibility:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian]{babel}
\usepackage[a5paper]{geometry}
\usepackage{amsthm,thmtools}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{amsmath,amssymb}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{shadows,shapes}
\usetikzlibrary{calc}
\usepackage{lipsum}

\newcounter{exercise}

\newtheorem{myexercise}{Exercise}[section]
\tikzset{myshadow/.style={                             % custom shadow with tikz
         opacity=.85,
         shadow xshift=0.15,
         shadow yshift=-0.15,
         shade,
         shading=axis,
         shading angle=230}
         } 
\tikzstyle{titregris} =
[draw=gray, line width=1.0pt,% 
        text=white, rectangle,  
        right,minimum height=.7cm,
       double,
       shade,
              top color=blue!40,
              bottom color=blue!5,
              rounded corners=8pt,
               opacity=1,
                                     shadow xshift=0.15,
                                     shadow yshift=-0.15,
                                     shade,
                                     shading=axis,
                                     shading angle=30,
              drop shadow,
        ]
\tikzstyle{pointstyle} =
[draw=red, thick, fill=red,% 
        text=white, rectangle,  
        right,minimum height=.7cm,
       double,
       shade,
              top color=red,
              bottom color=blue!5,
              rounded corners=3pt,
              drop shadow
        ]        

%\renewcommand*\theexercise{Exercise \textnumero\arabic{exercise}}
\makeatletter
\def\mdf@@exercisepoints{}%new mdframed key:
\define@key{mdf}{exercisepoints}{%
\def\mdf@@exercisepoints{#1}
}
\def\mdf@@fig{}%new mdframed key:
\define@key{mdf}{fig}{%
\def\mdf@@fig{#1}
}
\def\mdf@@title{}%new mdframed key:
\define@key{mdf}{title}{%
\def\mdf@@title{#1}
}


\mdfdefinestyle{exercisestyle}{%
middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray,
 apptotikzsetting={\tikzset{mdfbackground/.append style={top color=blue!40, bottom color=white}}},
innertopmargin=1.2\baselineskip,
skipabove={\dimexpr0.5\baselineskip+\topskip\relax},
skipbelow={-1em},
 shadow=true,
 shadowcolor=blue!35,
needspace=3\baselineskip,
frametitlefont=\sffamily\bfseries,
singleextra={%
\node[titregris,xshift=1cm] at (P-|O) %
{~\mdf@frametitlefont{Exercise~\textnumero\theexercise}~\mdf@@title};
\ifdefempty{\mdf@@exercisepoints}%
{}
{\node[pointstyle,left,xshift=-1cm] at (P)%
{~\mdf@frametitlefont{\mdf@@exercisepoints pt.}~};},%
\ifdefempty{\mdf@@fig}%
{}%
{\path let \p1=(P), \p2=(O) in node[fill=blue!40,circle,inner sep=1pt,font=\color{white}] at (P|-0,0.5*\y2+0.5*\y1)  {\mdf@@fig};}% 
},
firstextra={%
\node[titregris,xshift=1cm] at (P-|O) %
{~\mdf@frametitlefont{Exercise~\textnumero\theexercise}~~\mdf@@title};
\ifdefempty{\mdf@@exercisepoints }%
{}%
{\node[pointstyle,left,xshift=-1cm] at (P)%
{~\mdf@frametitlefont{\mdf@@exercisepoints points}~};},%
},
}
\newcommand\listmdfname{List of Exercises}
\newcommand\listofmdframed{\section*{\listmdfname}%
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
\@starttoc{mdf}}
\newenvironment{mythm}[2][]
  {\refstepcounter{exercise}\addcontentsline{mdf}{figure}{Exercise~\theexercise~#2}\begin{mdframed}[style=exercisestyle,#1,title=#2]}
  {\end{mdframed}}
\makeatother

\begin{document}
\listofmdframed

\begin{mythm}[exercisepoints=10,fig=$\spadesuit$]{Example $E=mc^2$}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}

\begin{mythm}[exercisepoints=5,fig=$\spadesuit$]{Example $a=b$}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}

\vspace{0.1cm}

Here is problematic example:
\begin{mythm}[exercisepoints=10,fig=$\spadesuit$]{Example Problematic}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi\displaybreak\\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}

\begin{mythm}[exercisepoints=5,fig=$\spadesuit$]{Example $a=b$}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}
\end{document}

enter image description here

I used the LaTeX kernel's @starttoc to create a new list that will behave in a fashion completely analogous to the LoF, Lot; the file extension used is mdf (information for this new list will be written to the fil <name>.mdf); the name used for this list can be controlled using \listmdfname.

The mythm environment has one optional argument, to pass options to the optional argument of mdframed, and a mandatory argument that will be used as an entry in the new list and to give a title to the mdframed environment.

Some additional comments:

  1. Your code had

    \renewcommand*\theexercise{Exercise \textnumero\arabic{exercise}}
    

and this is not the best choice, \theexercise is meant to hold the representation for a counter, and adding Exercise \textnumero might produce undesired results (in cross-references, for example). I changed this in my code. The extra string is added outside the counter representation.

  1. Also, I stepped the counter in the mythm environment (avoiding the unnecessary counter gymnastics mentioned in a comment).

  2. If you want the counter to reset in a given sectional unit, the quickest way is to use (for example, for chapters)

    \usepackage{chngcntr}
    \counterwithin{exercise}{chapter}
    

(the line \counterwithin must appear after the definition of the counter).

Update:

If I understand the new requirement made in a comment, one can use the same settings for mdframed for various environments with a variable title; the idea would be to have a macro for the title and let each environment redefine the title macro appropriately (I called \mymdftitle this macro in the following example):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english,russian]{babel}
\usepackage[a5paper]{geometry}
\usepackage{amsthm,thmtools}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{amsmath,amssymb}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{shadows,shapes}
\usetikzlibrary{calc}
\usepackage{lipsum}

\newcounter{exercise}
\newcommand\mymdftitle{}

\tikzset{myshadow/.style={                             % custom shadow with tikz
         opacity=.85,
         shadow xshift=0.15,
         shadow yshift=-0.15,
         shade,
         shading=axis,
         shading angle=230}
         } 
\tikzstyle{titregris} =
[draw=gray, line width=1.0pt,% 
        text=white, rectangle,  
        right,minimum height=.7cm,
       double,
       shade,
              top color=blue!40,
              bottom color=blue!5,
              rounded corners=8pt,
               opacity=1,
                                     shadow xshift=0.15,
                                     shadow yshift=-0.15,
                                     shade,
                                     shading=axis,
                                     shading angle=30,
              drop shadow,
        ]
\tikzstyle{pointstyle} =
[draw=red, thick, fill=red,% 
        text=white, rectangle,  
        right,minimum height=.7cm,
       double,
       shade,
              top color=red,
              bottom color=blue!5,
              rounded corners=3pt,
              drop shadow
        ]        

%\renewcommand*\theexercise{Exercise \textnumero\arabic{exercise}}
\makeatletter
\def\mdf@@exercisepoints{}%new mdframed key:
\define@key{mdf}{exercisepoints}{%
\def\mdf@@exercisepoints{#1}
}
\def\mdf@@fig{}%new mdframed key:
\define@key{mdf}{fig}{%
\def\mdf@@fig{#1}
}
\def\mdf@@title{}%new mdframed key:
\define@key{mdf}{title}{%
\def\mdf@@title{#1}
}

\mdfdefinestyle{exercisestyle}{%
  middlelinewidth=1.2pt,
  roundcorner=5pt,
  linecolor=gray,
 apptotikzsetting={\tikzset{mdfbackground/.append style={
  top color=blue!40, bottom color=white}}},
  innertopmargin=1.2\baselineskip,
  skipabove={\dimexpr0.5\baselineskip+\topskip\relax},
  skipbelow={-1em},
  shadow=true,
  shadowcolor=blue!35,
  needspace=3\baselineskip,
  frametitlefont=\sffamily\bfseries,
  singleextra={%
    \node[titregris,xshift=1cm] at (P-|O) %
    {\mdf@frametitlefont{\mymdftitle}\mdf@@title~};
    \ifdefempty{\mdf@@exercisepoints}%
      {}
      {\node[pointstyle,left,xshift=-1cm] at (P)%
      {~\mdf@frametitlefont{\mdf@@exercisepoints pt.}~};},%
    \ifdefempty{\mdf@@fig}%
      {}%
      {\path let \p1=(P), \p2=(O) in node[fill=blue!40,circle,inner   sep=1pt,font=\color{white}] at (P|-0,0.5*\y2+0.5*\y1)  {\mdf@@fig};}},
  firstextra={%
    \node[titregris,xshift=1cm] at (P-|O) %
    {~\mdf@frametitlefont{\mymdftitle}~~\mdf@@title};
    \ifdefempty{\mdf@@exercisepoints }%
      {}%
      {\node[pointstyle,left,xshift=-1cm] at (P)%
      {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};},%
  },
}

\newcommand\listmdfname{List of Exercises}

\newcommand\listofmdframed{%
  \section*{\listmdfname}%
  \@mkboth{\MakeUppercase\listmdfname}{\MakeUppercase\listmdfname}%
  \@starttoc{mdf}}

\newenvironment{mythm}[2][]
  {\renewcommand\mymdftitle{~Exercise~\textnumero\theexercise~}%
    \refstepcounter{exercise}%
    \addcontentsline{mdf}{figure}{Exercise~\theexercise~#2}
    \begin{mdframed}[style=exercisestyle,#1,title=#2]%
  }
  {\end{mdframed}}

\newenvironment{myanother}[2][]
  {\renewcommand\mymdftitle{~A new title~}%
    \begin{mdframed}[style=exercisestyle,#1,title=#2]%
  }
  {\end{mdframed}}
\makeatother

\begin{document}

\listofmdframed

\begin{mythm}[exercisepoints=10,fig=$\spadesuit$]{Example $E=mc^2$}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{mythm}

\begin{myanother}{Additional Information}
 \begin{align}
            \dot{n} &= u\cos\psi -v\sin\psi \\
            \dot{e} &= u\sin\psi + v\cos\psi
        \end{align}
        For small angles the following approximation can be used:
        \begin{align}
            \dot{n} &= u -v\delta_\psi \\
            \dot{e} &= u\delta_\psi + v
        \end{align}
\end{myanother}

\end{document}

enter image description here

Moriambar
  • 11,466
Gonzalo Medina
  • 505,128
  • excellent..tanks..I dont know too much latex programming internals . I used example from link above and wrapped mdframed env with command + tocloft..but your approach is much better – Levan Shoshiashvili Jun 15 '13 at 21:58
  • this transformation formulaes getting popular :) ..just kidding :) p.s. and of course i just need renewcommand for chapter/section/ numbering during sectioning i guess – Levan Shoshiashvili Jun 15 '13 at 22:03
  • I added counter to code ' {\addcontentsline{mdf}{figure}{\theexercise~ #2}' and counters go strange in listof..The first counter starts from 0..if i step counter on the top, tnan environmet conter is +1 extra – Levan Shoshiashvili Jun 15 '13 at 22:37
  • fixed it with this one: \newenvironment{mythm}[2][] {\addtocounter{exercise}{+1} \addcontentsline{mdf}{figure}{\theexercise #2}\addtocounter{exercise}{-1} \begin{mdframed}[style=exercisestyle,#1,title=#2]} {\end{mdframed}} before entering in environmet counter is not increased yet and this -1 data is written to toc – Levan Shoshiashvili Jun 15 '13 at 23:02
  • and better is \theexercise{} just for extra space – Levan Shoshiashvili Jun 15 '13 at 23:12
  • 2
    @LevanShoshiashvili all those manipulations with the counter are not necessary; please see my updated answer, and specially the final remarks. – Gonzalo Medina Jun 16 '13 at 00:37
  • hmm strange behavior..it was not before...place 3,4 of mythm blocks (just copy/paste) and you will se very strange behavior of 3rd object when it is splited across pages. – Levan Shoshiashvili Jun 17 '13 at 17:08
  • @LevanShoshiashvili if you are referring to the clubsuit decoration when the frame splits, that part of your original code: you have {\node[pointstyle, left,xshift=1cm] {$\clubsuit$};} inside firstextra. If you don't want that, then don't use it. To prevent a page break in some undesired location, you can use the option nobreak=true. – Gonzalo Medina Jun 17 '13 at 17:36
  • Ok..but during page brake clubsuit is changed :) and title also gets lost in initial code i stared with clubsuit was just disappearing and other decorations were kept..its ok this behavior can be avoided..this is just user code not a class/style package..thanks again – Levan Shoshiashvili Jun 17 '13 at 18:02
  • changed 'fig=suit' to bydefault fig is empty works fine.So i can don't pass fig if frame splits – Levan Shoshiashvili Jun 17 '13 at 18:18
  • but in this last code title also gets lost..even i remove default suit thing – Levan Shoshiashvili Jun 17 '13 at 18:26
  • @LevanShoshiashvili it's impossible to know what you're talking about without seeing the actual code you are using. Please edit your question and add, as an edit, the code you are currently using and some text illustrating the problem. (Please don't overwrite the already existing code) – Gonzalo Medina Jun 17 '13 at 19:46
  • updated..I did not know if this was allowed. I got warning once , when i reposted question as answer to my own question :) – Levan Shoshiashvili Jun 17 '13 at 20:46
  • @LevanShoshiashvili Of course, it's allowed, but without deleting the previous code; otherwise the initial question and answer makes no sense! Please reedit, to include the old code and add the new code afterwards, with the new requirements. – Gonzalo Medina Jun 17 '13 at 20:48
  • Updated...with original code – Levan Shoshiashvili Jun 17 '13 at 21:12
  • found solution. I changed first extra like this in your code and I dont know how good is this change , but it works fine: firstextra={% \node[titregris,xshift=1cm] at (P-|O) % {~\mdf@frametitlefont{მაგალითი~\textnumero\theexercise}~\mdf@@title}; \ifdefempty{\mdf@@exercisepoints }% {}% {\node[pointstyle,left,xshift=-1cm] at (P)% {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};},% %{\node[pointstyle, left,xshift=1cm] {$\clubsuit$};} } – Levan Shoshiashvili Jun 17 '13 at 22:48
  • @LevanShoshiashvili I just wrote that in my updated answer :-) Also, notice the use of \displaybreak in the third frame; long equations at the end of a page are problematic, so \displaybreak is needed. – Gonzalo Medina Jun 17 '13 at 22:50
  • @LevanShoshiashvili And sorry to insist on this, but please consider accepting answers to your questions. – Gonzalo Medina Jun 17 '13 at 22:51
  • now one more comes...for not dublicating code for different environmets 'MyExample1' and MySolutionAnother can envoronment name be passed to mdframe somehow? and i dont like global counter can it be created behind user? – Levan Shoshiashvili Jun 17 '13 at 22:52
  • @LevanShoshiashvili I don't fully understand your questions. Do you need another environment with similar settings but with a different name? Can we continue this discussion in chat? – Gonzalo Medina Jun 17 '13 at 22:53
  • @LevanShoshiashvili I've updated my answer (See the section under "Update") showing how to reuse the same settings without code duplication. I hope this is close to waht you need. Also, I noticed you discovered how to accept answers. Thank you! :-) – Gonzalo Medina Jun 18 '13 at 00:31