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?

  • 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
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

  • 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
  • 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 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.