mdframed の例でエラーが発生する

mdframed の例でエラーが発生する

mdframed私は次の例を取得しようとしていますパッケージドキュメント動作する(mdframed-example-default5ページ目)が、次のエラーが発生します

Missing number, treated as zero T
Illegal unit of measure (pt inserted) T

タイトル ボックスの位置が低すぎるため、環境の内容を印刷する前に奇妙な「pt」が表示されます。これを修正するにはどうすればよいでしょうか? タイトル ボックスは、一番上の行のちょうど中央に配置する必要があります。

\documentclass{article}

\usepackage{tikz,mdframed}

\begin{document}

\mdfsetup{skipabove=\topskip,skipbelow=\topskip}
\newcounter{theo}[section] 
\newenvironment{theo}[1][]{%
\stepcounter{theo}% 
    \ifstrempty{#1}% 
    {\mdfsetup{%
        frametitle={%
            \tikz[baseline=(current bounding box.east),outer sep=0pt]
            \node[anchor=east,rectangle,fill=blue!20]
            {\strut Theorem~\thetheo};}}%
    }%
    {\mdfsetup{% 
        frametitle={%
            \tikz[baseline=(current bounding box.east),outer sep=0pt]
            \node[anchor=east,rectangle,fill=blue!20]
            {\strut Theorem~\thetheo:~#1};}}%
    }%
    \mdfsetup{innertopmargin=10pt,linecolor=blue!20,%
            linewidth=2pt,topline=true,
            frametitleaboveskip=\dimexpr−\ht\strutbox\relax,}
    \begin{mdframed}[]\relax%
    }{\end{mdframed}}

\begin{theo}
    This is an example theorem
    %
    \begin{equation}
        a^2 + b^2 = c^2
    \end{equation}
\end{theo}

\end{document}

その結果

ここに画像の説明を入力してください

答え1

この線

frametitleaboveskip=\dimexpr−\ht\strutbox\relax

直前に奇妙な文字(おそらくコピー アンド ペーストのプロセスの結果)があるため\ht、標準のマイナス記号に置き換える必要があります。

frametitleaboveskip=\dimexpr-\ht\strutbox\relax

コード:

\documentclass{article}

\usepackage{tikz,mdframed}

\mdfsetup{skipabove=\topskip,skipbelow=\topskip}
\newcounter{theo}[section] 
\newenvironment{theo}[1][]{%
\stepcounter{theo}% 
    \ifstrempty{#1}% 
    {\mdfsetup{%
        frametitle={%
            \tikz[baseline=(current bounding box.east),outer sep=0pt]
            \node[anchor=east,rectangle,fill=blue!20]
            {\strut Theorem~\thetheo};}}%
    }%
    {\mdfsetup{% 
        frametitle={%
            \tikz[baseline=(current bounding box.east),outer sep=0pt]
            \node[anchor=east,rectangle,fill=blue!20]
            {\strut Theorem~\thetheo:~#1};}}%
    }%
    \mdfsetup{innertopmargin=10pt,linecolor=blue!20,%
            linewidth=2pt,topline=true,
            frametitleaboveskip=\dimexpr-\ht\strutbox\relax,}
    \begin{mdframed}[]\relax%
    }{\end{mdframed}}

\begin{document}

\begin{theo}
test
    \begin{equation}
        a^2 + b^2 = c^2
    \end{equation}
\end{theo}

\end{document}

ここに画像の説明を入力してください

関連情報