% \iffalse meta-comment
%
% Copyright (C) 2026 by Professor Naam Mohamed (الأستاذ ناعم محمد)
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the conditions of the 
% LaTeX Project Public License, either version 1.3c of this license.
% حقوق الملكية الفكرية محفوظة للأستاذ ناعم محمد - الجزائر.
% ---------------------------------------------------------------------------
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{na-cover.dtx}
\documentclass{ltxdoc}
\usepackage{na-cover}
\usepackage[explicit]{titlesec}
\usepackage{xcolor,tikz,geometry,eso-pic,polyglossia}
\usetikzlibrary{calc,backgrounds,positioning,decorations.markings,shapes.geometric}
\geometry{left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm}
\setmainlanguage[numerals=maghrib,locale=algeria]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.2]{Arial} 
\newfontfamily\na[Script=Arabic,Scale=1.2]{Arial} 
\newfontfamily\arabicfontsf[Script=Arabic,Scale=1.2]{Arial}
\renewcommand{\thesection}{\arabic{section}}
\titleformat{\section}
{\bf\Large\sffamily}
{\begin{tikzpicture}[baseline=(a.base)]
\node[text=white,scale=1,anchor=east,draw=blue!50!black,
fill=red!50!black,rounded corners=1pt] (a) {\thesection};
\node [text=black,anchor=east] at (a.west) (2){\large\textarabic{\bf\sffamily #1}};
\end{tikzpicture}}
{0pt}{}
\titleformat{\subsection}
{\bf}
{\begin{tikzpicture}[baseline=(a.base)]
\node[text=white,scale=1,anchor=east,draw=blue!50!black,
fill=blue!50!black,rounded corners=1pt] (a) {\thesubsection};
\node [text=black,anchor=east] at (a.west) (2){\large\textarabic{\bf\sffamily #1}};
\end{tikzpicture}}
{0pt}{}
\setnonlatin
\definecolor{Navy}{RGB}{0,0,128}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\AddToShipoutPictureBG{
\begin{tikzpicture}[remember picture,overlay]
\ifodd\value{page}
\fill[Navy!40] (current page.north east) rectangle ([xshift=-1.5cm]current page.south east);
\draw[Navy!40, line width=1pt] ([xshift=-1.5cm]current page.north east) -- ([xshift=-1.5cm]current page.south east);
\node[rotate=-90, text=white, font=\sffamily\bfseries\Large] 
at ([xshift=-0.75cm]current page.east) {na-cover package \quad --- \quad v1.0};
\else
\fill[Navy!40] (current page.north west) rectangle ([xshift=1.5cm]current page.south west);
\draw[Navy!40, line width=1pt] ([xshift=1.5cm]current page.north west) -- ([xshift=1.5cm]current page.south west);
\node[rotate=90, text=white, font=\sffamily\bfseries\Large] 
at ([xshift=0.75cm]current page.west) {na-cover package \quad --- \quad v1.0};
\fi
\end{tikzpicture}}
\tikzstyle{a}=[text width=\textwidth-1cm, rectangle,draw,line width=1pt,fill=white,minimum width=\textwidth, align=center,inner ysep=1cm,rounded corners=2pt] 
\newcommand\boxtitle[1]{%
\begin{center}
\begin{tikzpicture}
\scoped[on background layer]{\node[a](1){#1};}
\node[inner xsep=4mm,anchor=south east,text=black] (2) at ([shift={(-0.7cm,0mm)}]1.south east) {\small\textarabic{الأستاذ ناعم محمد}};
\scoped[on background layer]{%
\path[draw=black,fill=gray] ([yshift=0mm,xshift=-3mm]2.south west) arc(180:360:1mm) ([yshift=0mm,xshift=1mm]2.south east) arc(180:360:1mm);
\path[draw=black,fill=white] ([xshift=-2mm,yshift=-1mm]2.south west) -- ([xshift=2mm,yshift=-1mm]2.south east) [rounded corners=1.5mm]-- ([xshift=1mm,yshift=-1mm]2.south east) -- (2.north east) -- (2.north west) -- ([xshift=-1mm,yshift=-1mm]2.south west) [sharp corners]-- cycle;}
\node[inner xsep=4mm,anchor=south west,text=black] (3) at ([shift={(0.7cm,0mm)}]1.south west) 
{\small\textarabic{ حزمة لصناعة واجهات مذكرات تخرج}};
\scoped[on background layer]{%
\path[draw=black,fill=gray] ([yshift=0mm,xshift=-3mm]3.south west) arc(180:360:1mm) ([yshift=0mm,xshift=1mm]3.south east) arc(180:360:1mm);
\path[draw=black,fill=white] ([xshift=-2mm,yshift=-1mm]3.south west) -- ([xshift=2mm,yshift=-1mm]3.south east) [rounded corners=1.5mm]-- ([xshift=1mm,yshift=-1mm]3.south east) -- (3.north east) -- (3.north west) -- ([xshift=-1mm,yshift=-1mm]3.south west) [sharp corners]-- cycle;}
\end{tikzpicture}
\end{center}}
\newcommand{\previewcover}[2]{%
\noindent
\begin{tikzpicture}[baseline=(char.base)]
\node(char) [draw=#2, line width=1pt, inner sep=15pt, text width=8.5cm, align=center, rounded corners=2pt] 
{\Large \texttt{\textbackslash nacover\{#1\}\{#2\}}};
\begin{scope}[color=#2, scale=0.22]
\csname na\ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\fi\endcsname{([shift={(0.8,0.8)}]char.south west)}{1}
\csname na\ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\fi\endcsname{([shift={(-0.8,0.8)}]char.south east)}{1}
\csname na\ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\fi\endcsname{([shift={(0.8,-0.8)}]char.north west)}{1}
\csname na\ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\fi\endcsname{([shift={(-0.8,-0.8)}]char.north east)}{1}
\end{scope}
\end{tikzpicture}\\[0.6cm]}
\begin{document}
\OnlyDescription  % <--- هذا السطر هو التعديل الوحيد: يمنع ظهور صفحة الأكواد الأخيرة
\DocInput{na-cover.dtx}
\end{document}
%</driver>
% \fi
%
%\title{\boxtitle{\Huge\bfseries na-cover\\[0.4cm]\large\textarabic{ حزمة لتنسيق المجلات التربوية}}}
%\author{} \date{}
%\maketitle
%
%\section{مقدمة وتوافقية المعالجة}
%\selectlanguage{arabic}
%بسم الله الرحمن الرحيم. نضع بين أيدي الأساتذة الكرام هذه الحزمة لتسهيل تصميم المجلات.\\
%\textbf{ملاحظة هامة:}\\
%هذه الحزمة متوافقة تماماً مع جميع المعالجات: \texttt{pdfLaTeX}, \texttt{XeLaTeX}, و \texttt{LuaLaTeX}.
%
%\section{كيفية الاستخدام وتغيير الواجهة}
%\noindent\textbf{ملاحظة هامة:} \\
%للحصول على واجهة مختلفة في كل صفحة، يجب استخدام الأمر التالي لمسح الواجهة السابقة:
%
%\texttt{\textbackslash ClearShipoutPictureBG}
%
%\section{تعليمات الواجهات المتاحة}
%\selectlanguage{english}
%
%\previewcover{1}{red}
%\previewcover{2}{blue}
%\previewcover{3}{OliveGreen}
%\previewcover{4}{Orange}
%\previewcover{5}{Purple}
%\previewcover{6}{Cyan}
%\previewcover{7}{Magenta}
%\previewcover{8}{Brown}
%\previewcover{9}{Teal}
%\previewcover{10}{NavyBlue}
%\previewcover{11}{Violet}
%\previewcover{12}{ForestGreen}
%
% \StopEventually{\PrintIndex \PrintChanges}
%
% \iffalse
%<*package>
% \fi
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{na-cover}[2026/05/11 Custom Artistic Page]
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage{tikz}
\RequirePackage{eso-pic}
\usetikzlibrary{calc,shapes.geometric,backgrounds}
\newcommand{\naA}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \r in {0, 22.5, 45, 67.5} {\draw[line width=0.8pt, rotate=\r] (-1.1,-1.1) rectangle (1.1,1.1);} \draw[line width=1.2pt, fill=white] (0,0) circle (0.55); \fill (0,0) circle (0.2); \end{scope}}
\newcommand{\naB}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 45, ..., 315} { \begin{scope}[rotate=\a] \draw[line width=1.1pt] (0.2,0) to[out=45, in=135] (1.5,0) to[out=-135, in=-45] (0.2,0); \fill (1.5,0) circle (1.8pt); \end{scope} } \draw[line width=1.3pt] (0,0) circle (0.5); \end{scope}}
\newcommand{\naC}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 60, ..., 300} { \begin{scope}[rotate=\a] \draw[line width=1.1pt] (0.2,0) -- (0.8,0.35) -- (1.5,0) -- (0.8,-0.35) -- cycle; \fill (1.5,0) circle (2pt); \end{scope} } \draw[line width=1.2pt] (0,0) circle (0.5); \end{scope}}
\newcommand{\naD}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 30, ..., 330} {\draw[line width=1pt] (\a:1.2) -- (\a+30:1.2); \fill (\a:1.2) circle (1.5pt);} \foreach \a in {0, 45, ..., 315} {\draw[line width=0.8pt, opacity=0.7, rotate=\a] (0.6,0) circle (0.6);} \fill (0,0) circle (0.3); \end{scope}}
\newcommand{\naE}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 10, ..., 350} {\draw[line width=0.2pt, opacity=0.2] (0,0) -- (\a:1.6);} \foreach \a in {0, 60, ..., 300} { \begin{scope}[rotate=\a] \draw[line width=1.1pt] (0.2,0) -- (0.8,0.35) -- (1.5,0) -- (0.8,-0.35) -- cycle; \draw[line width=0.5pt, opacity=0.7] (0.3,0) -- (0.8,0.2) -- (1.3,0) -- (0.8,-0.2) -- cycle; \fill (1.5,0) circle (2pt); \end{scope} } \draw[line width=1.2pt] (0,0) circle (0.5); \fill (0,0) circle (0.3); \end{scope}}
\newcommand{\naF}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \r in {0, 45, ..., 135} {\draw[line width=1pt, rotate=\r, opacity=0.7] (0,0) ellipse (1.5 and 0.4);} \foreach \s in {0.3, 0.6} {\draw[line width=1.2pt] (0,0) circle (\s);} \foreach \a in {0, 60, ..., 300} {\fill (\a:1) circle (2pt); \draw[white, line width=0.5pt] (\a:1) circle (2pt);} \fill (0,0) circle (0.15); \end{scope}}
\newcommand{\naG}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 15, ..., 345} { \draw[line width=0.2pt, opacity=0.3] (0,0) -- (\a:1.8); \fill (\a:1.8) circle (0.7pt); } \foreach \r in {0, 45} { \draw[line width=1.2pt, rotate=\r, rounded corners=2pt] (-1.2,-1.2) rectangle (1.2,1.2); } \foreach \a in {22.5, 67.5, ..., 337.5} { \begin{scope}[rotate=\a] \draw[line width=1pt] (0.4,0) -- (1,0.4) -- (1.6,0) -- (1,-0.4) -- cycle; \fill (1.6,0) circle (2.2pt); \fill[white] (1.6,0) circle (1pt); \end{scope} } \draw[line width=1.5pt, fill=white] (0,0) circle (0.7); \node[regular polygon, regular polygon sides=6, draw, line width=1pt, minimum size=0.8cm] at (0,0) {}; \fill (0,0) circle (0.15); \end{scope}}
\newcommand{\naH}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \r in {0, 45} { \draw[line width=1.3pt, rotate=\r] (-1,-1) rectangle (1,1); \draw[line width=0.5pt, opacity=0.5, rotate=\r] (-0.7,-0.7) rectangle (0.7,0.7); } \draw[line width=1pt] (0,0) circle (0.4); \foreach \a in {0, 90, 180, 270} { \draw[line width=1.5pt] (\a:0.4) -- (\a:0.6); } \foreach \x in {-1, 1} { \foreach \y in {-1, 1} { \fill (\x,\y) circle (2.5pt); \draw[white, line width=0.6pt] (\x,\y) circle (2.5pt); } } \end{scope}}
\newcommand{\naI}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 15, ..., 345} { \draw[line width=0.4pt, opacity=0.4] (0,0) -- (\a:1.4); } \foreach \r in {0, 45} { \draw[line width=1.2pt, rotate=\r] (-1,-1) rectangle (1,1); \draw[line width=0.5pt, opacity=0.6, rotate=\r] (-1.1,-1.1) rectangle (1.1,1.1); } \foreach \a in {0, 90, 180, 270} { \draw[line width=0.8pt, rotate=\a] (1,1) arc (0:180:0.3); \draw[line width=0.8pt, rotate=\a] (1,-1) arc (0:-180:0.3); } \draw[line width=1.5pt, fill=white] (0,0) circle (0.6); \fill (0,0) circle (0.15); \end{scope}}
\newcommand{\naJ}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 30, ..., 330} { \draw[line width=0.2pt, opacity=0.3] (0,0) -- (\a:1.8); } \foreach \a in {0, 45, ..., 315} { \begin{scope}[rotate=\a] \draw[line width=1.1pt] (0.2,0) to[out=45, in=135] (1.5,0) to[out=-135, in=-45] (0.2,0); \draw[line width=0.5pt, opacity=0.6] (0.4,0) to[out=30, in=150] (1.2,0); \fill (1.5,0) circle (2pt); \fill[white] (1.5,0) circle (0.8pt); \end{scope} } \foreach \a in {22.5, 67.5, ..., 337.5} { \draw[line width=0.8pt, opacity=0.7] (\a:0.6) -- (\a:1.1) -- (\a+22.5:0.8) -- cycle; } \draw[line width=1.3pt] (0,0) circle (0.5); \fill[white] (0,0) circle (0.05); \end{scope}}
\newcommand{\naK}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \a in {0, 10, ..., 350} { \draw[line width=0.3pt, opacity=0.3] (0,0) -- (\a:1.6); \fill (\a:1.6) circle (0.6pt); } \foreach \r in {0, 22.5, 45, 67.5} { \draw[line width=1pt, rotate=\r] (-1.2,-1.2) rectangle (1.2,1.2); \draw[line width=0.4pt, opacity=0.5, rotate=\r] (-1.3,-1.3) rectangle (1.3,1.3); } \foreach \a in {0, 45, ..., 315} { \draw[line width=0.7pt, opacity=0.8, rotate=\a] (0.7,0) circle (0.5); \fill (\a:1.2) circle (2pt); \fill[white] (\a:1.2) circle (1pt); } \draw[line width=1.5pt, fill=white] (0,0) circle (0.65); \foreach \a in {0, 30, ..., 330} { \draw[line width=0.6pt] (0,0) -- (\a:0.65); \node[regular polygon, regular polygon sides=6, draw, scale=0.4, rotate=\a] at (\a:0.45) {}; } \fill (0,0) circle (0.25); \draw[white, line width=0.8pt] (0,0) circle (0.12); \end{scope}}
\newcommand{\naL}[2]{\begin{scope}[shift={#1}, scale=#2] \foreach \r in {0.5, 1.0, 1.5} { \draw[line width=0.2pt, opacity=0.3] (0,0) circle (\r); } \foreach \r in {0, 22.5} { \draw[line width=1.3pt, rotate=\r] (0:1.6) -- (45:1.6) -- (90:1.6) -- (135:1.6) -- (180:1.6) -- (225:1.6) -- (270:1.6) -- (315:1.6) -- cycle; } \foreach \a in {0, 45, ..., 315} { \begin{scope}[rotate=\a] \draw[line width=0.8pt] (0.3,0) -- (1.1,0.2) -- (1.5,0) -- (1.1,-0.2) -- cycle; \foreach \x in {0.5, 0.7, 0.9} { \draw[line width=0.2pt, opacity=0.5] (\x, 0.1) -- (\x+0.2, -0.1); } \fill (1.5,0) circle (1.8pt); \fill[white] (1.5,0) circle (0.8pt); \end{scope} } \draw[line width=1.5pt, fill=white] (0,0) circle (0.55); \foreach \a in {0, 15, ..., 345} { \draw[line width=0.5pt] (\a:0.45) -- (\a:0.55); } \node[star, star points=6, star point ratio=0.5, draw, fill=., scale=0.6] at (0,0) {}; \fill[white] (0,0) circle (0.08); \end{scope}}
\newcommand{\naname}[1]{\ifcase#1\or naA\or naB\or naC\or naD\or naE\or naF\or naG\or naH\or naI\or naJ\or naK\or naL\fi}
\newcommand{\nacover}[2]{%
\AddToShipoutPictureBG*{%
\begin{tikzpicture}[remember picture,overlay]
\draw[line width=2.5pt, #2] ([shift={(0.75cm,-0.75cm)}]current page.north west) rectangle ([shift={(-0.75cm,0.75cm)}]current page.south east);
\expandafter\let\expandafter\tempna\csname\naname{#1}\endcsname
\begin{scope}[color=#2]
 \tempna{([shift={(1.25cm,-1.65cm)}]current page.north west)}{0.28}
\tempna{([shift={(-1.25cm,-1.65cm)}]current page.north east)}{0.28}
\tempna{([shift={(1.25cm,1.45cm)}]current page.south west)}{0.28}
\tempna{([shift={(-1.25cm,1.45cm)}]current page.south east)}{0.28}
\end{scope}
\foreach \i in {0, 0.28cm} {
\draw[line width=1pt, #2] ([shift={(1.55cm+\i, -1.45cm-\i)}]current page.north west) -- ([shift={(-1.55cm-\i, -1.45cm-\i)}]current page.north east);
\draw[line width=1pt, #2] ([shift={(1.55cm+\i, 1.25cm+\i)}]current page.south west) -- ([shift={(-1.55cm-\i, 1.25cm+\i)}]current page.south east);
\draw[line width=1pt, #2] ([shift={(1.05cm+\i, -1.95cm-\i)}]current page.north west) -- ([shift={(1.05cm+\i, 1.75cm+\i)}]current page.south west);
 \draw[line width=1pt, #2] ([shift={(-1.05cm-\i, -1.95cm-\i)}]current page.north east) -- ([shift={(-1.05cm-\i, 1.75cm+\i)}]current page.south east);}
 \foreach \x in {0.2, 0.4, 0.6, 0.8} {
\fill[#2, opacity=0.6] ($(current page.north west)!\x!(current page.north east) + (0,-1.05cm)$) circle (1.5pt);
\fill[#2, opacity=0.6] ($(current page.south west)!\x!(current page.south east) + (0,0.95cm)$) circle (1.5pt);}     
\end{tikzpicture}}}
%    \end{macrocode}
% \iffalse
%</package>
% \fi
% \Finale
\endinput