# 加载中...

LaTeX_Fun
• 博客等级：
• 博客积分：0
• 博客访问：6,869,583
• 关注人气：2,401
• 获赠金笔：0支
• 赠出金笔：0支
• 荣誉徽章：

## LaTeX技巧562：如何定制漂亮精美的定理环境

(2011-07-31 21:10:29)

### 环境

QQ群：91940767/145316219/141877998/80300084/194770436

Here is a little sty file for LaTeX that is inspired from this. The result :

With this file, you can create new environments with \newboxedtheorem. It works kind of like \newtheorem except that you have to give it a counter name as a third argument. To be more precise :

\newboxedtheorem[options]{theo}{Theorem}{thCounter}


If you don't put anything in the last {}, your environment won't be numbered. If you want to make another environment numbered like this one, just put the same counter name, for example :

\newboxedtheorem{defi}{Definition}{thCounter}


There are a lot of options. For example, thcounter=section will have your environment's counter go back to 0 whenever you enter a new section in your document.

Here is the full list of the options with their default value :

titlecolor = black, titlebackground = white, background = white,
titleboxcolor = black, boxcolor = black, thcounter=, size = .9\textwidth


Finally, the code used for the example :

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{boiboites}

\newboxedtheorem[boxcolor=orange, background=blue!5, titlebackground=blue!20,
titleboxcolor = black]{theo}{Theorem}{anything}

\begin{document}
\begin{theo}[Law of Large Numbers]
Let $(X_n)_{n\in \mathbb{N}}$ be an infinite sequence of i.i.d. variables with finite expected value. Then:
$$\frac{1}{n} \sum_{i=1}^n X_i \overset{\textnormal{a.s.}}{\longrightarrow} \mathbb{E} (X_1) .$$
\end{theo}
\end{document}


0

• 评论加载中，请稍候...

发评论

以上网友发言只代表其个人观点，不代表新浪网的观点或立场。

新浪BLOG意见反馈留言板　电话：4000520066 提示音后按1键（按当地市话标准计费）　欢迎批评指正

新浪公司 版权所有