%! TeX program = lualatex
% (for vimtex)
\documentclass[11pt, a4paper]{article}
% SET LANGUAGE HERE
\usepackage[english]{babel}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
% ENVIRONMENTS etc
\usepackage{adjustbox}
\usepackage{colortbl}   % color table
\usepackage{tabularx}   % bravais table
\usepackage{multirow}   % for superconducting qubit table
\usepackage{hhline}     % for superconducting qubit table
% TOOLING
\usepackage{graphicx}
\usepackage{etoolbox}
% \usepackage{luacode}
\usepackage{expl3}      % switch case and other stuff
\usepackage{substr}
\usepackage{xcolor}
% FORMATING
\usepackage{float}                  % float barrier
\usepackage{subcaption}             % subfigures
\usepackage[hidelinks]{hyperref}    % hyperrefs for \fqEqRef, \qtyRef, etc
\usepackage[shortlabels]{enumitem}  % easily change enum symbols to i), a. etc
\setlist{noitemsep}                 % no vertical space between items
\setlist[1]{labelindent=\parindent} % < Usually a good idea
\setlist[itemize]{leftmargin=*}
% \setlist[enumerate]{labelsep=*, leftmargin=1.5pc}  % horizontal indent of items

\usepackage{titlesec}   % colored titles
\usepackage{array}      % more array options
\newcolumntype{C}{>{$}c<{$}} % math-mode version of "c" column type
% \usepackage{sectsty}
% GRAPHICS
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepackage{tikz}       % drawings
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.pathreplacing} % braces
\usetikzlibrary{calc}
\usetikzlibrary{patterns}
\usetikzlibrary{patterns}
\input{util/tikz_macros}
% speed up compilation by externalizing figures
% \usetikzlibrary{external}
% \tikzexternalize[prefix=tikz_figures]
% \tikzexternalize
\usepackage{circuitikz} % electrical circuits with tikz
% SCIENCE PACKAGES
\usepackage{mathtools}
% set display math skips
\AtBeginDocument{
    \abovedisplayskip=0pt
    \abovedisplayshortskip=0pt
    \belowdisplayskip=0pt   
    \belowdisplayshortskip=0pt
}
\usepackage{MnSymbol}   % for >>> \ggg sign
\usepackage[version=4,arrows=pgf-filled]{mhchem}
\usepackage{upgreek}    % upright greek letters for chemmacros
\usepackage{chemmacros} % for orbitals images
% \usepackage{esdiff} % derivatives
% esdiff breaks when taking \dot{q} has argument
\usepackage{derivative} % \odv, \pdv
\usepackage{bbold}      % \mathbb font
\usepackage{braket}     % <bra|ket>
\usepackage{siunitx}    % \si \SI units
\sisetup{output-decimal-marker = {,}}
\sisetup{separate-uncertainty}
\sisetup{per-mode = power}
\sisetup{exponent-product=\ensuremath{\cdot}}

% DEBUG
% \usepackage{lua-visual-debug}
% DUMB STUFF
% \usepackage{emoji}
% \newcommand\temoji[1]{\text{\emoji{#1}}}
% \def\sigma{\temoji{shark}}
% \def\lambda{\temoji{sheep}}
% \def\psi{\temoji{pickup-truck}}
% \def\pi{\temoji{birthday-cake}}
% \def\Pi{\temoji{hospital}}
% \def\rho{\temoji{rhino}}
% \def\nu{\temoji{unicorn}}
% \def\mu{\temoji{mouse}}

\newcommand{\TODO}[1]{{\color{fg-red}TODO:#1}}
\newcommand{\ts}{\textsuperscript}

% Create a text file with relevant labels for vim-completion
\newwrite\labelsFile
\immediate\openout\labelsFile=\jobname.labels.txt
\newcommand\storeLabel[1]{
    \immediate\write\labelsFile{#1}%
}
\AtEndDocument{\immediate\closeout\labelsFile}

\input{circuit.tex}
\input{util/macros.tex}
\input{util/math-macros.tex}
\input{util/environments.tex}   % requires util/translation.tex to be loaded first
\usepackage{pkg/mqlua}
\usepackage{pkg/mqfqname}
% TRANSLATION
% \usepackage{translations}
\usepackage{pkg/mqtranslation}
\input{util/colorscheme.tex}
\input{util/colors.tex} % after colorscheme

\usepackage{pkg/mqconstant}
\usepackage{pkg/mqquantity}
\usepackage{pkg/mqformula}
\usepackage{pkg/mqperiodictable}


\title{Formelsammlung}
\author{Matthias Quintern}
\date{\today}
\begin{document}

\makeatletter\let\percentchar\@percentchar\makeatother

\maketitle
\tableofcontents
\newpage
\setcounter{page}{1}

\input{util/translations.tex}

% \InputOnly{comp}

\Input{math/math}
\Input{math/linalg}
\Input{math/geometry}
\Input{math/calculus}
\Input{math/probability_theory}

\Input{mechanics}
\Input{statistical_mechanics}

\Input{ed/ed}
\Input{ed/el}
\Input{ed/mag}
\Input{ed/em}
\Input{ed/optics}
\Input{ed/misc}

\Input{qm/qm}
\Input{qm/atom}

\Input{cm/cm}
\Input{cm/crystal}
\Input{cm/egas}
\Input{cm/charge_transport}
\Input{cm/low_temp}
\Input{cm/semiconductors}
\Input{cm/misc}
\Input{cm/techniques}
\Input{cm/topo}
\Input{cm/mat}

\Input{particle}

\Input{quantum_computing}

\Input{comp/comp}
\Input{comp/qmb}
\Input{comp/est}
\Input{comp/ad}
\Input{comp/ml}

\Input{ch/periodic_table}  % only definitions
\Input{ch/ch}
\Input{ch/el}
\Input{ch/misc}

\newpage
\Part[
    \eng{Appendix}
    \ger{Anhang}
]{appendix}
\begin{formula}{world}
    \desc{World formula}{}{}
    \desc[german]{Weltformel}{}{}
    \eq{E = mc^2 +\text{AI}}
\end{formula}
\Input{quantities}
\Input{constants}

% \listofquantities
\listoffigures
\listoftables
\Section[
    \eng{List of elements}
    \ger{Liste der Elemente}
]{elements}
    \printAllElements
\newpage
% \Input{test}

% \bibliographystyle{plain}
% \bibliography{ref}

\end{document}
