\ProvidesPackage{myformat}[2026/07/28 SrcBook styled]
% This file change the behaviour of some commands such as:
% \underline -> \uline
%
%
\RequirePackage{fontspec}
\RequirePackage[svgnames, dvipsnames, table, rgb]{xcolor}
\RequirePackage{fontawesome5}

\KOMAoptions{
    paper=a4, 
    fontsize=12pt, 
    chapterprefix=true, 
    twoside=semi, 
    DIV=classic, 
    parskip=half
}

% JP Font
% \RequirePackage{xeCJK}
% \setCJKmainfont{HaranoAji_GothicMedium.otf}[Path=./fonts/]

% other package
\RequirePackage{lmodern}
\RequirePackage{microtype}
\RequirePackage{tcolorbox}
\RequirePackage{graphics}
\RequirePackage{booktabs}
\RequirePackage[normalem]{ulem}
\renewcommand{\underline}[1]{\uline{#1}}

\RequirePackage{tabularx}
\tcbuselibrary{minted,skins,breakable}


\sffamily
\linespread{1.25}
\setfootnoterule{0.8\textwidth}

\RequirePackage{scrlayer-scrpage}
\pagestyle{scrheadings}
\automark[section]{chapter}
\ofoot*{}
\cfoot*{\pagemark}

\RequirePackage{imakeidx}
\begin{filecontents}[overwrite]{myindexstyle.ist}
headings_flag 1
heading_prefix
 "\\bigskip\\par\\penalty-50\\textbf{"
heading_suffix
 "}\\\\[\\medskipamount]"
symhead_positive "Symbols"
symhead_negative "symbols"
numhead_positive "Numbers"
numhead_negative "numbers"
delim_0 ",\~"
\end{filecontents}
\makeindex[intoc, options=-s myindexstyle]


\usepackage{hyperref}
\hypersetup{
    colorlinks,
    linkcolor = black,
    urlcolor = blue!70!Red,
    citecolor = blue!70!Red,
    pdfauthor = Domipoke,
    pdftitle = LearnLATEX
}

\RequirePackage[open,openlevel=1,atend,numbered]{bookmark}
\RequirePackage{pdfpages}
% Chapter Heading (and related)
\renewcommand*{\chaptermarkformat}{\chapapp~\thechapter~--~}
\addtokomafont{chapterprefix}{\itshape\color{white}}
\renewcommand*{\chapterformat}{\raggedleft\colorbox{RoyalBlue}{\parbox[b][2.8em]{2.8em}{\vfill\centering{\large\chapapp}\\[-0.4em]\thechapter\vfill}}}
\renewcommand*{\chapterheadstartvskip}{\addvspace{2em}}
\RequirePackage{pgfornament}
\renewcommand*{\chapterheadendvskip}{\pgfornament[width=\textwidth]{88}\par}
% Section Heading
\renewcommand*{\sectionformat}{\colorbox{black}{\textcolor{white}{\thesection\autodot}}\enskip}
\renewcommand*{\sectionlinesformat}[4]{\makebox[0pt][l]{\rule[-\fboxsep-\fboxrule]{\textwidth}{\fboxrule}}#3\parbox[b]{0.85\textwidth}{\linespread{1}\selectfont#4}}

% minted
\RequirePackage{minted}
\setmonofont{JetBrains Mono}
% \usemintedstyle{monokai}
\definecolor{codeBg}{HTML}{282822} % Monokai's dark background color
\colorlet{trcl}{white!0}
\setmintedinline{style=emacs, fontsize=\scriptsize, frame=single, framesep=2mm, bgcolor=trcl, formatcom={\color{black}}}
\setminted{style=monokai, fontsize=\scriptsize, framesep=2mm, linenos, bgcolor=codeBg, formatcom={\color{white}}}


% Define purple colors
\definecolor{notaDark}{RGB}{106, 27, 154}    % Dark purple for header
\definecolor{notaLight}{RGB}{243, 229, 245}  % Light purple for content
\definecolor{notaFrame}{RGB}{106, 27, 154}   % Frame color matching header
% Create the Nota environment
\newtcolorbox{nota}{
    enhanced,
    breakable,
    colback = notaLight,
    colframe = notaFrame,
    colbacktitle = notaDark,
    coltitle = white,
    title = \textbf{Nota},
    fonttitle = \large\bfseries,
    attach boxed title to top left = {xshift=5mm, yshift=-2mm},
    boxed title style = {
        size = small,
        colback = notaDark,
        sharp corners,
        boxrule = 0pt,
    },
    sharp corners,
    boxrule = 1pt,
    left = 5mm,
    right = 5mm,
    top = 3mm,
    bottom = 3mm,
}


\RequirePackage{wrapfig}
