12/07/2026
\documentclass[12pt,a4paper]{article}
%% ==========={ កំណត់គែមក្រដាស.
\usepackage[top=1.2cm,bottom=1.5cm,left=1.5cm,right=1.5cm]{geometry}
%% ==========={ បរិបទក្នុងគណិត.
\usepackage{euler}
\everymath{\displaystyle}
\setlength{\parindent}{0pt}
\usepackage{amsmath,amssymb,amsfonts,fontawesome,mathabx}
%% ==========={ ការកំណត់ពណ៌ឲ្យមានច្រើនក្នុងការប្រើប្រាស់.
\usepackage[dvipsnames]{xcolor}
%% ==========={ ទប់ស្កាត់ការទាញពង្រីកគម្លាតបញ្ឈរ.
\raggedbottom
%% ==========={ គូសរូប.
\usepackage{tikz,tkz-tab,pgfplots,everypage,etoolbox,multicol,colortbl,array}
\usetikzlibrary{positioning,calc,intersections,decorations.text,babel, arrows.meta,shapes,shadows.blur,shapes.multipart,shapes.geometric, decorations.pathmorphing,calc,intersections,decorations.text}
%% ==========={ លេខរៀង និងពុះចែកជួរឈរ.
\usepackage[inline]{enumitem}
\usepackage{enumitem}
%% ==========={ កំណត់ Font.
\usepackage{fontspec}
\setmainfont{Khmer OS Bokor}
\newfontfamily\kml{Khmer OS Moul Light}
\newfontfamily\kbk{Khmer OS Bokor}
\newfontfamily\kra{Kh Rayuth HD 39}
\newfontfamily\en{Times New Roman}[BoldFont=Times New Roman Bold]
%% ==========={ ការតម្រឹមអក្សរខ្មែរឆ្វេងស្ដាំទៅតាម \geometry.
\XeTeXlinebreaklocale "khm"
\XeTeXlinebreakskip=0pt plus 1pt minus 0.5pt
%% ==========={ លេខរៀងខ្មែរ និងអក្សរខ្មែរ.
\makeatletter
\def\ #1{\expandafter\@\number #1\}
\def\@ #1{\ifx #1\\else\char\numexpr #1+"17E0\relax\expandafter\@\fi}
\def\knum #1{\expandafter\\csname c@ #1\endcsname}
\AddEnumerateCounter{\knum}{\}{}
\newcommand*{\kalph}[1]{\expandafter\\csname c@ #1\endcsname}
\newcommand*{\}[1]{%----wrote code by Teacher " Ly Sarith "
\ifcase #1\or ក\or ខ\or គ\or ឃ\or ង\or ច\or ឆ\or ជ\or ឈ\or ញ\or ដ\or ឋ\or ឌ\or ឍ\or ណ\or ត\or ថ\or ទ\or ធ\or ន\or ប\or ផ\or ព\or ភ\or ម\or យ\or រ\or ល\or វ\or ស\or ហ\or ឡ\or អ\else\\fi}
\AddEnumerateCounter{\kalph}{\}{}
\makeatother
%% ==========={ ទំព័រលេខខ្មែរ.
\makeatletter
\def\ #1{\expandafter\@\number #1\}
\def\@ #1{\ifx #1\\else
\char\numexpr #1+"17E0\relax
\expandafter\@\fi}
\def\khmercounter #1{\expandafter\\csname c@ #1\endcsname}
%\renewcommand\{\}%---ទំព័រខ្មែរ
%% ==========={ លេខរៀង I, II, III,....
\SetEnumitemKey{I}{leftmargin=*,label={\protect\tikz[baseline=-0.8ex] \protect\node[text=black,inner sep=0.5pt,minimum size=4mm]{\textbf{\en \Roman*.}};},labelsep=1.2ex,itemsep=1mm,topsep=2pt}
%% ==========={ លេខរៀង i, ii, iii,....ផ្កាឈូកស្រាល.
\definecolor{inpink}{HTML}{FFF0F5} \SetEnumitemKey{i}{leftmargin=*,label={\protect\tikz[baseline=-0.8ex] \protect\node[circle,draw=none,fill=inpink,text=black,inner sep=0.5pt,minimum size=4mm,drop shadow={shadow xshift=2.5pt,shadow yshift=-2.5pt,fill=gray}]{\textbf{\en \roman*}};},labelsep=1.2ex,itemsep=1mm,topsep=2pt}
%% ==========={ លេខរៀង 1,2,3,...ផ្កាឈូកស្រាល.
\renewcommand{\theequation}{\knum{equation}}%---{ បង្ហាញលេខអារ៉ាប់.
\definecolor{inpink}{HTML}{FFF0F5} \SetEnumitemKey{1}{leftmargin=*,label={\protect\tikz[baseline=-0.8ex] \protect\node[circle,draw=none,fill=inpink,text=black,inner sep=0.5pt,minimum size=4mm,drop shadow={shadow xshift=2.5pt,shadow yshift=-2.5pt,fill=gray}]{ \arabic*};},font=\small \en \bfseries,labelsep=1.2ex,itemsep=1mm,topsep=2pt}
%% ==========={ លេខរៀង ក, ខ, គ,...ផ្កាឈូកស្រាល.
\definecolor{inpink}{HTML}{FFF0F5} \SetEnumitemKey{ក}{leftmargin=*,label={\protect\tikz[baseline=-0.8ex] \protect\node[circle,draw=none,fill=inpink,text=black,inner sep=0.5pt,minimum size=4mm,drop shadow={shadow xshift=2.5pt,shadow yshift=-2.5pt,fill=gray}]{\kbk \kalph*};},labelsep=1.2ex,itemsep=1mm,topsep=2pt}
%% ==========={ លេខរៀង ១, ២, ៣,...ផ្កាឈូកស្រាល.
\definecolor{inpink}{HTML}{FFF0F5} \SetEnumitemKey{១}{leftmargin=*,label={\protect\tikz[baseline=-0.8ex] \protect\node[circle,draw=none,fill=inpink,text=black,inner sep=0.5pt,minimum size=4mm,drop shadow={shadow xshift=2.5pt,shadow yshift=-2.5pt,fill=gray}]{\kbk \knum*};},labelsep=1.2ex,itemsep=1mm,topsep=2pt}
%% ==========={ អក្សរ A, B, C,...ផ្កាឈូកស្រាល.
\definecolor{inpink}{HTML}{FFF0F5} \SetEnumitemKey{A}{leftmargin=*,label={\protect\tikz[baseline=-0.8ex] \protect\node[circle,draw=none,fill=inpink,text=black,inner sep=0.5pt,minimum size=4mm,drop shadow={shadow xshift=2.5pt,shadow yshift=-2.5pt,fill=gray}]{\textbf{\en \Alph*}};},labelsep=1.2ex,itemsep=1mm,topsep=2pt}
%% ==========={ អក្សរ a, b, c,...ផ្កាឈូកស្រាល.
\definecolor{inpink}{HTML}{FFF0F5} \SetEnumitemKey{a}{leftmargin=*,label={\protect\tikz[baseline=-0.8ex] \protect\node[circle,draw=none,fill=inpink,text=black,inner sep=0.5pt,minimum size=4mm,drop shadow={shadow xshift=2.5pt,shadow yshift=-2.5pt,fill=gray}]{\textbf{\en \alph*}};},labelsep=1.2ex,itemsep=1mm,topsep=2pt}
%% ==========={ បាតកថា.
\usepackage{ifsym}%----{ លេខកាស្យូ.
\usepackage{fancyhdr}
\pagestyle{fancy}
%% ==========={ បាតលើ.
\lhead{\begin{tikzpicture}[overlay]%----{ ឆ្វេង.
\node at (1.9,-.3){\kra FB : Latex~~4~~You};
\end{tikzpicture}
}
\chead{\begin{tikzpicture}[overlay]%----{ កណ្ដាល.
\fill[left color=magenta,right color=magenta,middle color=black!20!green](-9,-.55)rectangle(9.2,-.65);
\end{tikzpicture}
}
\rhead{\begin{tikzpicture}[overlay]%----{ ស្ដាំ.
\node [scale=.9]at(-1.5,-.3){\color{black}\faSend~:~\textifsym{0976}~\textifsym{999}~\textifsym{555}};
\end{tikzpicture}
}
%% ==========={ បាតក្រោម.
\lfoot{\begin{tikzpicture}[overlay]%----{ ឆ្វេង.
\node at (4,.1){{\color{blue}\faStreetView}~ រៀបរៀងនិងបង្រៀនកូដដោយលោកគ្រូ~~\kml\color{blue} លី~សារិទ្ធ};
\end{tikzpicture}
}
\cfoot{\begin{tikzpicture}[overlay]%----{ កណ្ដាល.
\fill[left color=magenta,right color=magenta,middle color=black!20!green](-9,.6)rectangle(9.5,.7);
\end{tikzpicture}
}
\renewcommand{\thepage}{\knum{page}}%----{ ប្ដូរទំព័រជាលេខខ្មែរ.
\rfoot{\begin{tikzpicture}[overlay]%----{ ស្ដាំ.
\node [drop shadow={fill=black,
shadow xshift=.5mm,shadow yshift=-.5mm},draw=black!20!green,chamfered rectangle,chamfered rectangle ysep=0pt,fill=inpink,text=blue] at(-.1,.1) {\kra ~\thepage~~};
\end{tikzpicture}
}
%% ==========={ បិតបន្ទាត់ឬដាក់បន្ទាត់.
\renewcommand{\headrulewidth}{0pt}%----{ បន្ទាត់.
\renewcommand{\footrulewidth}{0pt}%----{ បិតបន្ទាត់.
%% ==========={ បន្ទាត់គូសពីក្រោមអក្សរ.
\usepackage{ulem}
\newcommand{\nate}[1]{\noindent\color{black}{\bfseries
\uline{ #1}}}%----{ ១ជាន់
\newcommand{\note}[1]{\noindent\color{blue}{\bfseries
\uuline{\color{black} #1}}}%----{ ២ជាន់
%% ==========={ section---ក្បាលវិញ្ញាសា.
\usepackage{graphics}
\usepackage{pgfornament}
\usepackage[explicit]{titlesec}
\renewcommand{\thesection}{\knum{section}}%----{ ប្ដូរលេខមេរៀនជាលេខខ្មែរ.
\usetikzlibrary{shapes.multipart}
\titleformat{\section}
{}
{
\begin{tikzpicture}[overlay]
\draw[line width=50pt,white](-.52,.5)--(19.65,.5);
\draw[fill=red!10,draw=blue] (-0.25,1)--(18,1)--(18,-2.)--(-0.25,-2)--(-0.25,1);
\draw [blue,line width=3pt](18,0)--(18,1)--(17,1);
\draw [blue,line width=3pt](-0.2,-1)--(-0.2,-2)--(1,-2);
\node[anchor=west,font=\footnotesize] at (-.2,.4) {\kml មណ្ឌលប្រឡង\string:\makebox[4.55cm]{\dotfill}};
\node [anchor=west,font=\footnotesize] at (8.3,.4){\kml វិញ្ញាសាត្រៀមប្រឡងសញ្ញាបត្រមធ្យមសិក្សាទុតិយភូមិ};
\node [anchor=west,font=\footnotesize] at (-.2,-.2){\kml លេខបន្ទប់\string:\makebox[2cm]{\dotfill}\kml លេខតុ\string:\makebox[2cm]{\dotfill}};
\node [anchor=west,font=\footnotesize] at (8.3,-.2){\kml វិញ្ញាសា~~~\quad\string:\quad គណិតវិទ្យា (ថ្នាក់វិទ្យាសាស្រ្ត)};
\node [anchor=west,font=\footnotesize] at (-.2,-.8){\kml ឈ្មោះបេក្ខជន\string:\makebox[4.59cm]{\dotfill}};
\node [anchor=west,font=\footnotesize] at (8.3,-.8){\kml រយៈពេល \quad\string:\quad ១៥០នាទី};
\node [anchor=west,font=\footnotesize] at (-.2,-1.4){\kml ហត្ថលេខាបេក្ខជន\string:\makebox[3.85cm]{\dotfill}};
\node [anchor=west,font=\footnotesize] at (8.3,-1.4){\kml ពិន្ទុ \hspace*{1.35cm}\string:\quad ១២៥};
\end{tikzpicture}
}
{0cm}
{}
\titlespacing*{\section}{2pt}{4pt}{2.5cm}
%% ==========={ ប្រអប់ដំណោះស្រាយ.
\usepackage[most]{tcolorbox}
\usepackage{bclogo}
\newtcolorbox{lysarith}[1][]{enhanced,breakable,arc=0pt,outer arc=0pt,
boxed title style={arc=0pt,outer arc=0pt,boxsep=0mm,
rightrule=0pt,toprule=0pt,leftrule=0pt,bottomrule=0pt,colframe=gray,
colback=white},title={\begin{tikzpicture}[overlay]
\draw [white,line width=10pt](-.7,.3)--(-.3,.3);
\node [black] at(2.1,.3){\bccle\hspace*{1.5cm}{\small\kml ដំណោះស្រាយ\kra ៚}};%----{ wrote code by teacher LY SARITH
\node[scale=1.3] at(2.85,-.16){\pgfornament[scale=.115,color=blue]{85}};
\end{tikzpicture}}, attach boxed title to top left={xshift=.3cm,yshift=-.5cm},
drop lifted shadow,colback=white,rightrule=0pt, toprule=0pt,leftrule=1pt,
bottomrule=0pt,colframe=black,top=.9cm}
{}
%% ==========={ កំណត់ទម្រង់លេខរៀងលំហាត់ I, II, III...
\newlist{examlist}{enumerate}{1}
\setlist[examlist]{
label=\textcolor{black}{\en\bfseries\Roman*.},align=left,
widest={\textcolor{black}{\en\bfseries VIII.} {\color{red}\kbk (៣០ពិន្ទុ)}},
leftmargin=*,labelsep=-.2cm,itemsep=.1cm,parsep=.1cm,topsep=0pt,before=\raggedright }
\newcommand{\qitem}[1]{
\refstepcounter{examlisti}%---{ លេខរៀង I, II, III... ដោយស្វ័យប្រវត្តិ.
\item[\textcolor{black}{\en\bfseries\Roman{examlisti}.} {\color{red}\kbk ( #1ពិន្ទុ)}]
}
\begin{document}
%% ==========={ វិញ្ញាសាទី១.
\section{ }%----{ ក្បាលវិញ្ញាសា.
\begin{examlist}
%% ==========={ លំហាត់ទី I
\qitem{១៥}
\begin{enumerate*}[១,itemjoin={\hspace{1.5cm}}]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate*}
%% ==========={ លំហាត់ទី II
\qitem{១០} ប្រូបាប \ldots\\
\begin{enumerate*}[ក, itemjoin={\hspace{1.5cm}}]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate*}
%% ==========={ លំហាត់ទី III.
\qitem{១៥} អាំងតេក្រាល \ldots
\begin{enumerate}[A]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate}
%% ==========={ លំហាត់ទី IV.
\qitem{១៥} គេមានចំនួនកុំផ្លិច \ldots
\begin{enumerate}[1]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate}
%% ==========={ លំហាត់ទី V.
\qitem{១៥} \begin{enumerate*}[i,itemjoin={\hspace{1.5cm}}]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate*}
%% ==========={ លំហាត់ទី VI.
\qitem{២០} \begin{enumerate}[១]
\item ក្នុងលំហប្រដាប់ដោយតម្រុយ \ldots
\item រកសមីការស្ដង់ដានៃអុីពែបូល \ldots
\end{enumerate}
%% ==========={ លំហាត់ទី VII.
\qitem{៣៥} គេមានអនុគមន៍ \ldots
\begin{enumerate}[1]
\item \ldots
\item \ldots
\item \ldots
\item \begin{enumerate}[a]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate}
\end{enumerate}
\end{examlist}
%% ==========={ ដំណោះស្រាយ.
\newpage
\boldmath%---គណិតដិត
\begin{lysarith}
\begin{enumerate}[I]
%% ==========={ លំហាត់ទី I
\item
\begin{enumerate*}[១,itemjoin={\hspace{1.5cm}}]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate*}
%% ==========={ លំហាត់ទី II
\item ប្រូបាប \ldots\\
\begin{enumerate*}[ក, itemjoin={\hspace{1.5cm}}]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate*}
%% ==========={ លំហាត់ទី III.
\item អាំងតេក្រាល \ldots
\begin{enumerate}[A]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate}
%% ==========={ លំហាត់ទី IV.
\item គេមានចំនួនកុំផ្លិច \ldots
\begin{enumerate}[1]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate}
%% ==========={ លំហាត់ទី V.
\item \begin{enumerate*}[i,itemjoin={\hspace{1.5cm}}]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate*}
%% ==========={ លំហាត់ទី VI.
\item \begin{enumerate}[១]
\item ក្នុងលំហប្រដាប់ដោយតម្រុយ \ldots
\item រកសមីការស្ដង់ដានៃអុីពែបូល \ldots
\end{enumerate}
%% ==========={ លំហាត់ទី VII.
\item គេមានអនុគមន៍ \ldots
\begin{enumerate}[1]
\item \ldots
\item \ldots
\item \ldots
\item \begin{enumerate}[a]
\item \ldots
\item \ldots
\item \ldots
\end{enumerate}
\end{enumerate}
\end{enumerate}
\begin{center}
\rput[r](-3pt,3pt){\pgfornament[scale=.25,color=blue]{72}}
\large{\color{blue}\kml សូមសំណាងល្អណាកូនៗ...}%
\rput[l](3pt,3pt){\pgfornament[scale=.25,color=blue]{73}}\\
\rput(0,0){\pgfornament[scale=.5,color=magenta!30!black]{85}}
\end{center}
\end{lysarith}
\end{document}
ការកំណត់ប្រើក្នុងឯកសារនេះរួមមាន៖
%% ==========={ លេខរៀង
\begin{enumerate}[1,A,a,i,១,ក]
%% ==========={ ពុម្ពអក្សរ
\kra : អក្សរ Kh Rayuth HD 39
\kml : អក្សរឆ្លាក់ Khmer OS Moul Light
\kbk : អក្សរ Khmer OS Bokor
\en : អក្សរអង់គ្លេស Times New Roman