修改环境

修改环境

我一直在使用这里找到的环境在我的工作表中编写示例:

\usepackage{geometry}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{booktabs}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{calc}
\usepackage{lipsum}

\newcounter{exa}[section]
\renewcommand\theexa{\thesection.\arabic{exa}}

\newlength\mylen% to hols the width of the title

\newmdenv[
  settings={\global\refstepcounter{exa}
            \settowidth\mylen{\bfseries\color{cyan}Example~\theexa}},
  leftline=false,
  linecolor=cyan,
  middlelinewidth=1pt,
  innertopmargin=30pt,
  innerbottommargin=10pt,
  innerleftmargin=0pt,
  skipbelow=1.3\topsep,
  singleextra={
    \path node[font=\bfseries\color{cyan},anchor=west,yshift=-12pt,inner sep=0pt] at (O|-P) {Example~\theexa};
    \draw[ultra thick,cyan] ([yshift=.5\pgflinewidth]O|-P) -- ++(\mylen,0pt);
    \draw[line width=2pt,white] (O) -- ($(P|-O)+(-2cm,0pt)$) node (A){};
    \node[anchor=south west,fill=cyan,inner sep=3pt,outer sep=0pt] at (A) {};
  },
  firstextra={
    \path node[font=\bfseries\color{cyan},anchor=west,yshift=-12pt,inner sep=0pt] at (O|-P) {Example~\theexa};
    \draw[ultra thick,cyan] ([yshift=.5\pgflinewidth]O|-P) -- ++(\mylen,0pt);
  },
  secondextra={
    \draw[line width=2pt,white] (O) -- ($(P|-O)+(-2cm,0pt)$) node (A){};
    \node[anchor=south west,fill=cyan,inner sep=3pt,outer sep=0pt] at (A) {};
  }
]{example}

我不记得是从谁那里得到的,但如果有人知道,请告诉我,这样我就可以归功于我。我只是想知道如何修改此代码以使其成为通过 y=axis 的反射。谢谢。

编辑:代码来自特殊示例环境

相关内容