在我们平时的论文编写过程中,通常,定理、定义、推论等这些内容需突出显示,随着我们宏包的扩展,我们在使用的过程中,可以简化很多制作工作。
下面我们看看用mdframed制作的样例:
- \documentclass[fleqn,11pt]{book}
- \usepackage{microtype}
- \usepackage[utf8]{inputenc}
- \usepackage[T1]{fontenc}
- \usepackage[narrowiints,frenchstyle,partialup,oldstylenums,oldstylenumsmath,nointlimits]{kpfonts}
- \usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=13pt,a4paper]{geometry}
- \usepackage{framed}
- \usepackage{amsmath}
- \usepackage[framed,amsmath,hyperref,thmmarks]{ntheorem}
- \usepackage[framemethod=TikZ]{mdframed}
- \usepackage[frenchb]{babel}
- \frenchbsetup{IndentFirst=false}
- \definecolor{ocre}{RGB}{191,0,0}
- \makeatletter
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \newtheoremstyle{gris}%
- {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont \color{ocre} ##1\ ##2\theorem@separator}\hbox{\strut}}}]}%
- {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont \color{ocre} ##1\ ##2\ \color{black} --- ##3\theorem@separator}\hbox{\strut}}}]}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \newtheoremstyle{rouge}%
- {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont \color{ocre} ##1\ ##2\theorem@separator}\hbox{\strut}}}]}%
- {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont \color{ocre} ##1\ ##2\ \color{black} --- ##3\theorem@separator}\hbox{\strut}\vskip0pt}}]}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \setlength\theorempreskipamount{0pt}
- \setlength\theorempostskipamount{0pt}
- \setlength\topsep{0pt}
- \theoremstyle{gris}
- \theoremheaderfont{\bfseries}
- \theorembodyfont{\normalfont}
- \def\theoremframecommand{\colorbox{gray!10}}
- \newshadedtheorem{definition}{Definition}[chapter]
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \theoremstyle{rouge}
- \theoremsymbol{}
- \theorembodyfont{%
- \setlength\abovedisplayskip{4pt}%
- \setlength\belowdisplayskip{4pt}}
- \newmdtheoremenv[outerlinewidth=1pt,leftmargin=0,rightmargin=0,backgroundcolor=ocre!5,
- outerlinecolor=ocre!5,linewidth=0pt,innerleftmargin=3pt,innerrightmargin=3pt,innertopmargin=3pt,
- splittopskip=\topskip,skipbelow=0.5\baselineskip,skipabove=.5\baselineskip,linecolor=ocre!50]
- {theoreme}{Theorem}[chapter]
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \usepackage[colorlinks=false,hidelinks]{hyperref}
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \pdfminorversion=5
- \pdfobjcompresslevel=6
- \pdfcompresslevel=9
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \begin{document}
- texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte
- \begin{definition}[Milieu isotrope]
- Un milieu est dit \emph{isotrope} si ses propriétés ne changent pas avec la direction considérée.
- \end{definition}
- texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte
- \begin{theoreme}[Propagation électromagnétique]
- La propagation d'une onde électromagnétique dans le vide est décrite par l'équation
- \begin{equation}
- \varepsilon_0\mu_0\frac{\partial^2\mathbf{E}}{\partial t^2}=\nabla^2\mathbf{E}
- \end{equation}
- où $\varepsilon_0$ est la permittivité diélectrique du vide et $\mu_0$ sa perméabilité magnétique. Cette équation peut être établie à partir des équations de Maxwell. En posant:
- \begin{equation}
- c=\sqrt{\frac{1}{\varepsilon _0\mu_0}}
- \end{equation}
- on obtient l'expression de la vitesse de phase dans le vide (célérité de la lumière) et la forme générale de l'équation d'onde à trois dimensions est obtenue.
- \end{theoreme}
- texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte
- \end{document}