\documentclass[a4paper,8pt]{extarticle} % 10pt - 30% = 7pt
% Packages
\usepackage[utf8]{inputenc} % Unicode support (Umlauts etc.)
\usepackage{amsmath,mathtools} % Advanced math typesetting
\usepackage{physics} % Physics notation
\usepackage{hyperref} % Add a link to your document
\usepackage{geometry} % Margins
\usepackage{multicol} % for multicolumn layout
\usepackage{xcolor} % For color
\usepackage{tcolorbox} % For colored boxes
\usepackage{fancyhdr} % Headers and footers
\geometry{top=1in, headheight=0.5in, headsep=0.1in, margin=0.5in}
% Compact itemize
\usepackage{enumitem}
\setlist{nosep}
% Compact sections
\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{*0}{*0}
\titlespacing{\subsection}{0pt}{*0}{*0}
\titlespacing{\subsubsection}{0pt}{*0}{*0}
% Reduce line spacing
\renewcommand{\baselinestretch}{0.8}
% Color scheme
\definecolor{lightblue}{rgb}{0.75,0.85,1}
% Headers
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\renewcommand{\headrulewidth}{0pt} % no line in header area
\fancyhead[C]{Formelsammlung MMP II} % Center
% New command for creating boxes with black text
\newcommand{\mybox}[2]{
\begin{tcolorbox}[colback=lightblue!5!white,colframe=lightblue!75!black,boxsep=1pt,arc=0pt,outer arc=0pt,title={\textcolor{black}{#1}}]
\textcolor{black}{#2}
\end{tcolorbox}
}
% Start the document
\begin{document}
\fontsize{7pt}{8pt}\selectfont
\begin{multicols}{2}
\mybox{Title}{
Text inside of the box.
With equations:
\begin{subequations}
\begin{align}
v &= u + at \\
s &= ut + \frac{1}{2}at^2 \\
v^2 &= u^2 + 2as
\end{align}
\end{subequations}
}
\mybox{Dynamics}{
\begin{equation}
F = ma
\end{equation}
}
\mybox{Energy}{
\begin{equation}
E = mc^2
\end{equation}
}
\mybox{Quantum Mechanics}{
\begin{equation}
i\hbar\frac{\partial}{\partial t}\Psi = \hat{H}\Psi
\end{equation}
}
\end{multicols}
% End the document
\end{document}