Text FormattingBoxed theorem tex

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
latex program
Posts: 3
Joined: Thu Jan 07, 2021 11:26 am

Boxed theorem tex

Post by latex program »

Good morning
I want boxed-theorem such that theorems must be enumerated by sections, I found this code,I and I tried to do changes in order to enumerate theorems by sections but it didn't work!
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{boiboites}
\newboxedtheorem [ boxcolor=pink, background=white!5, titlebackground=pink!20,
titleboxcolor= black]{Theorem}{Theorem}
\begin{document}
\section{title}
\begin{Theorem}[Loi des grands nombres]
Soit $(X_n)_{n\in \mathbb{N}}$ une suite de variables aléatoires réelles
indépendantes identiquement distribuées telles que $X_1 \in L^1$. Alors :
\[\frac{1}{n} \sum_{i=1}^n X_i \overset{\textnormal{p.s.}}{\longrightarrow}
\mathbb{E} (X_1) .\]
\end{Theorem}
\end{document

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Boxed theorem tex

Post by Ijon Tichy »

If this is the package by Alexis Flesch and you want to reset the counter at every section, see his documentation page. There you can find
As for the options, there are a few. For example, thcounter=section will have your environment's counter go back to 0 whenever you enter a new section in your document: …
Disclaimer: I've never used this package, because it is not part of TeX Live and AFAIK not at CTAN and it even does not have a license statement. I would use tcolorbox instead. BTW: The author of boiboites himself recommend to use xeboiboites instead of boiboites:
Please consider trying xeboiboites.sty (still under development but with a lot more features !).
BTW: Please try to mark your code as code. This can be done easily by selecting it and clicking to the Code-Button in the toolbar.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
latex program
Posts: 3
Joined: Thu Jan 07, 2021 11:26 am

Boxed theorem tex

Post by latex program »

Thank you so much for your answer! I have already used the tcolorbox package but I always get errors because of this package!!!!!!
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

Boxed theorem tex

Post by Ijon Tichy »

I think we would be able to fix most of such errors, if you'd ask a proper question … :roll:

BTW: If you use boiboites in a question you should always add a link to the package. The cost to find a package, that cannot be found on CTAN and is not part of TeX Live and MiKTeX, could deter helpers.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
latex program
Posts: 3
Joined: Thu Jan 07, 2021 11:26 am

Boxed theorem tex

Post by latex program »

okey! the package boiboites found as a file attachement in https://www.alexisfles.ch/en/latex/boites1.html
Post Reply