Creating a nice-looking box without using minipage
With tcolorbox
and its tcbtheorems
is not too difficult.
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[margin=1cm]{geometry}
\usepackage[most]{tcolorbox}
\usepackage{lmodern}
\usepackage{bbding}
\tcbset{
methstyle/.style={
enhanced,
theorem style=plain,
sharp corners,
colframe=black,
colback=white,
coltitle=black,
fonttitle=\bfseries\upshape,
drop shadow={black,opacity=1},
separator sign dash,
before title=\SquareShadowBottomRight\ ,
}
}
\newtcbtheorem[number within=section]{Methode}{Méthode}{methstyle}{Met}
\begin{document}
Comment rechercher l'ordre d'un élément d'un groupe
\section{Methodes}
\begin{Methode}{A new méthode}{anm}
Soit $G$ un groupe, noté multiplicativement, et soit $a\in G$. Pour déterminer l'ordre de l'élément $a$, on peut:
\begin{itemize}
\item Calculer les puissances successives de l'élément $a$ jusqu'à l'obtention de l'élément neutre.
\item Trouver une propriété qui montre qu'aucune puissance de $a$ ne peut être le neutre.
\end{itemize}
\end{Methode}
\end{document}
Here's a starter with tcolorbox. I do not have your section and subsection styles, so this is with default styles. Please note that the tcolorbox manual is no quick read, it requires some patience.
In the code example the box is drawn with optional arguments, but feel free to use \newtcolorbox
instead if your original aim was to shorten the code.
\documentclass{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{tcolorbox}[enhanced, sharp corners, colback=white, colframe=black, drop shadow={black,opacity=1}]
\subsubsection{Méthode1.3}
Soit G un groupe, noté multiplicativement, et soit $a\in G$. Pour déterminer l'ordre de l'élément $a$, on peut:
\begin{itemize}
\item Calculer les puissances successives de l'élément $a$ jusqu'à l'obtention de l'élément neutre.
\item Trouver une propriété qui montre qu'aucune puissance de $a$ ne peut être le neutre.
\end{itemize}
\end{tcolorbox}
\end{document}
Quick and dirty implementation of your box without any packages:
\documentclass[]{article}
\usepackage{duckuments}
\newsavebox\customboxbox
\newlength\customboxOuterWidth
\newlength\customboxOuterHeight
\newlength\customboxOuterDepth
\newlength\customboxInnerWidth
\newlength\customboxRuleWidth
\newlength\customboxShadowHeight
\newlength\customboxShadowDepth
\newlength\customboxShadowWidth
\newlength\customboxInnerSep
\customboxInnerSep3\fboxsep
\customboxRuleWidth.6pt
\customboxShadowWidth4pt
\newenvironment{custombox}[1][\linewidth]
{%
\noindent
\customboxOuterWidth#1
\advance\customboxOuterWidth-\customboxShadowWidth
\customboxInnerWidth#1
\advance\customboxInnerWidth-2\customboxRuleWidth
\advance\customboxInnerWidth-2\customboxInnerSep
\advance\customboxInnerWidth-\customboxShadowWidth
\setbox\customboxbox\vbox\bgroup
\hsize\customboxInnerWidth
\linewidth\hsize
\noindent
\ignorespaces
}
{%
\ifhmode\unskip\fi
\egroup
\customboxOuterHeight\ht\customboxbox
\advance\customboxOuterHeight\customboxInnerSep
\customboxOuterDepth\dp\customboxbox
\advance\customboxOuterDepth\customboxInnerSep
\customboxShadowHeight\customboxOuterHeight
\advance\customboxShadowHeight-\customboxShadowWidth
\customboxShadowDepth\customboxOuterDepth
\advance\customboxShadowDepth\customboxShadowWidth
\raisebox{\customboxOuterHeight}
{\rlap{\vrule height \customboxRuleWidth width \customboxOuterWidth}}%
\vrule height \customboxOuterHeight
depth \customboxOuterDepth
width \customboxRuleWidth
\rlap
{%
\hskip\customboxInnerSep\usebox\customboxbox
\hskip\customboxInnerSep
\vrule height \customboxOuterHeight
depth \customboxOuterDepth
width \customboxRuleWidth
\vrule height \customboxShadowHeight
depth \customboxShadowDepth
width \customboxShadowWidth
}%
\raisebox{-\customboxOuterDepth}
{%
\rlap
{%
\vrule height \customboxRuleWidth
depth 0pt
width \customboxOuterWidth
}%
\hskip\customboxShadowWidth
\advance\customboxOuterWidth-\customboxRuleWidth
\vrule height \customboxRuleWidth
depth \customboxShadowWidth
width \customboxOuterWidth
}%
}
\begin{document}
\begin{custombox}
\blindduck
\end{custombox}
\end{document}
The environment takes an optional argument which specifies the used total width. Content width is calculated based on total width, \customboxInnerSep
, \customboxRuleWidth
and \customboxShadowWidth
.
It doesn't add any outer spacing.