答案1
和tcolorbox
:
\documentclass{article}
\usepackage{mwe}%<--- for testing purpose only
\usepackage{geometry}
\usepackage{setspace}
\usepackage{anyfontsize}
\usepackage[most]{tcolorbox}
\usetikzlibrary{positioning,calc}
% Title page layout
\title{My wonderful article}
\date{March 21, 2021}
\makeatletter
\renewcommand{\maketitle}{%
\begin{titlepage}
\topskip0pt
\vspace*{\fill}
\begin{tcolorbox}[
sharp corners,enhanced,
fontupper=\Huge\bfseries,
halign=center,
colframe=red,
colback=white,
colupper=red,
shadow={2mm}{-2mm}{0mm}{red}]
\@title
\end{tcolorbox}\vspace{2cm}
\begin{center}
\Large\@date
\end{center}\vspace*{\fill}
\end{titlepage}%
}
\makeatother
% Box layouts
\tcbset{
mybox/.style={
enhanced jigsaw,
breakable,
attach boxed title to top left={yshift=-3mm,yshifttext=-1mm, xshift=-5pt},
colframe=white,
boxed title style={size=small,colframe=white, drop lifted shadow=gray}
},
thtitle/.style={adjusted title={Theorem~\thetcbcounter\ifstrempty{#1}{\ignorespaces}{~#1}}},
prtitle/.style={adjusted title={Problem~\thetcbcounter\ifstrempty{#1}{\ignorespaces}{~#1}}},
}
\newtcolorbox[auto counter]{theorem}[1][]{%
mybox,
colback=pink!30!white,
colbacktitle=red,
thtitle={},
#1}
\newtcolorbox[auto counter]{problem}[1][]{%
mybox,
colback=cyan!10!white,
colbacktitle=cyan,
prtitle={},
#1}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{blindtext}
% circled page number
\newcommand*\circlenum[1]{\tikz{\node[shape=circle,fill=cyan,inner sep=2.5pt, text=white] {#1};}}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[R]{\circlenum{\thepage}}
\begin{document}
\maketitle\doublespacing
\section{First section}
\begin{theorem}
\blindtext%<--- for testing purpose only
\end{theorem}
\blindtext%<--- for testing purpose only
\begin{problem}
\blindtext%<--- for testing purpose only
\end{problem}
\blindtext%<--- for testing purpose only
\section{Second section}
\begin{theorem}[thtitle={My theorem}]
\blindtext%<--- for testing purpose only
\end{theorem}
\blindtext%<--- for testing purpose only
\begin{problem}[prtitle={My problem}]
\blindtext%<--- for testing purpose only
\end{problem}
\end{document}