之前的博文中,曾经定制了一个较为简单的定理漂亮的盒子,LaTeX技巧327,下面摘自一个博客的定制相对好看一些,希望对大家的排版有所帮助。
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}
选自:http://snouffy.free.fr/blog-en/index.php/post/2010/01/30/Nice-boxes-for-your-theorems-with-tikz
发表评论 取消回复