%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%          nigde-fbe.cls  (FINAL SÜRÜM)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{nigde-fbe}[2025/11/23 Niğde ÖHÜ FBE Tez Şablonu]

\LoadClass[fleqn, 12pt, a4paper]{report}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  GEREKLİ PAKETLER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{ifxetex}
\RequirePackage{geometry}
\RequirePackage{setspace}
\RequirePackage[fleqn]{amsmath}
\RequirePackage{amssymb}
\RequirePackage{graphicx}
\RequirePackage{caption}
\RequirePackage{float}
\RequirePackage{titlesec}
\RequirePackage{tocloft}
\RequirePackage{fancyhdr}
\RequirePackage{chngcntr}
\RequirePackage{ragged2e}
\RequirePackage{tikz}
\usetikzlibrary{calc}
\RequirePackage{hyperref}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{microtype}
\setlength{\emergencystretch}{3em}
\setlength{\mathindent}{0pt}
\RequirePackage{bm}
\RequirePackage{booktabs}
\RequirePackage{longtable}
\RequirePackage{adjustbox}
\usepackage{float}
\usepackage{caption}
\usepackage{lastpage}
\usepackage{refcount}
\setlength{\intextsep}{10pt}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  FONT AYARLARI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifxetex
\RequirePackage{fontspec}
\setmainfont{Times New Roman}
\else
\RequirePackage{newtxtext,newtxmath}
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  SAYFA AYARLARI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\geometry{
	left=3.5cm,
	right=2.5cm,
	top=2.5cm,
	bottom=2.5cm,
	headheight=14pt
}

\onehalfspacing
\setlength{\parindent}{0pt}
\justifying
\hyphenpenalty=10000

%\fancypagestyle{plain}{
%	\fancyhf{}
%	\fancyfoot[C]{\thepage}
%}

\pagestyle{plain}

%\numberwithin{equation}{section}

\linespread{1.5}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  BÖLÜM BAŞLIKLARI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\titleformat{\chapter}
{\normalfont\bfseries\centering\MakeUppercase}
{BÖLÜM~\thechapter}{1em}{}

\titleformat{\section}
{\normalfont\bfseries}
{\thesection}{1.5em}{}
\titlespacing*{\section}
{0pt}{1.5em}{1.5em}

\titleformat{\subsection}
{\normalfont\bfseries}
{\thesubsection}{1.5em}{}
\titlespacing*{\subsection}
{0pt}{1.5em}{1.5em}

\titleformat{\subsubsection}
{\normalfont\bfseries}
{\thesubsubsection}{1.5em}{}
\titlespacing*{\subsubsection}
{0pt}{1.5em}{1.5em}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  TEZ TÜRÜ: YL / DR
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\thesistype}{}
\newcommand{\mastersthesis}{\renewcommand{\thesistype}{YÜKSEK LİSANS TEZİ}}
\newcommand{\phdthesis}{\renewcommand{\thesistype}{DOKTORA TEZİ}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  YAZAR BİLGİLERİ
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\thesistitle}{}
\newcommand{\authorname}{}
\newcommand{\supervisor}{}
\newcommand{\submissionyear}{}
\newcommand{\submissionmonth}{}
\newcommand{\department}{}
\newcommand{\ozetbaslik}{}
\newcommand{\summarycontent}{}
\newcommand{\keywordcontent}{}
\newcommand{\randomtext}{}
\newcommand{\lastpagenumber}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  KONUMLANDIRICI ve BAŞLIKLANDIRICI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setlength{\TPVertModule}{1cm}
\setlength{\TPHorizModule}{1cm}

\newcommand{\placeabs}[2]{%
	% #1 = üstten uzaklık
	% #2 = metin
	\begin{textblock*}{\textwidth}(\dimexpr 1in+\oddsidemargin, #1)
		#2
	\end{textblock*}
}

\RequirePackage{textpos}
\RequirePackage{hyperref}
\RequirePackage{environ}

\newcommand{\abssectionformat}[1]{%
	\ifx#1\section
	\Large\bfseries
	\else\ifx#1\subsection
	\large\bfseries
	\else
	\normalsize\bfseries
	\fi\fi
}

% abssection environment
% #1 = dikey konum
% #2 = section level
% #3 = numaralı / numarasız: "numbered" / "unnumbered"
\NewEnviron{abssection}[3]{%
	% --- 1) Numara ---
	\ifthenelse{\equal{#3}{numbered}}{%
		\refstepcounter{#2}%
		\edef\abs@number{\csname the#2\endcsname\space}%
	}{%
		\edef\abs@number{}%
	}%
	
	% --- 2) TOC ---
	\phantomsection
	\addcontentsline{toc}{#2}{\abs@number \BODY}%
	
	% --- 3) Sayfaya bas ---
	\placeabs{#1}{%
		{\abssectionformat{#2} \abs@number \BODY}%
	}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  ÜST METİN BLOĞU ve LOGOLAR
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\tcuniversite}{
\vspace*{2.5cm}

% Logolar
	\begin{tabular}{p{3cm} p{9cm} p{3cm}}
     \centering\includegraphics[width=2.8cm]{/home/hasan/bulutNOHU/Nükleer Fizik/LaTex/kapak/left-logo.png} &
     \centering\vspace{-3.2cm}{{T.C. \par}
	 {NİĞDE ÖMER HALİSDEMİR ÜNİVERSİTESİ \par}
	 {FEN BİLİMLERİ ENSTİTÜSÜ \par}
	 {\department \par}} & 
	 \centering\includegraphics[width=2.8cm]{/home/hasan/bulutNOHU/Nükleer Fizik/LaTex/kapak/right-logo.png}  \\
	\end{tabular}
    %\vspace{0.6cm}

}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  SOL ŞERİT (ÇİZGİ + DÖNDÜRÜLMÜŞ METİN)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\makesidebar}{
	\vspace{6.6cm}
	\begin{tikzpicture}[remember picture,overlay]
		\coordinate (leftedge) at ($(current page.north west)+(3.2cm,-0cm)$);
		%Dikey çizgi
		\draw[line width=1pt] ($(leftedge)+(0,-0.5cm)$) -- ($(leftedge)+(0,-\paperheight+0.5cm)$);
		
		% Döndürülmüş yazı
		\node[anchor=east, rotate=90] at (-9cm, \paperheight/2-13cm){
			\begin{minipage}{\paperheight}
				\begin{tabular}{p{14cm} p{10cm} p{4cm}}
					\centering{{NİĞDE ÖMER HALİSDEMİR ÜNİVERSİTESİ} 
					\par \vspace{-0.1cm}
					{FEN BİLİMLERİ ENSTİTÜSÜ}} &
					\centering{YÜKSEK LİSANS TEZİ} \par\vspace{2cm} &
					{\authorname, \submissionyear} \par\vspace{2cm} \\
				\end{tabular}
			\end{minipage}
		};
			
	\end{tikzpicture}
	}
	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  EK-A Başlık
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\newcommand{\placerighttop}[3]{%
%	\begin{tikzpicture}[remember picture,overlay]
%		\node[
%		anchor=north east,
%		inner sep=0pt,
%		outer sep=0pt
%		]
%		at ($(current page.north east)+(-#1,-#2)$)
%		{#3};
%	\end{tikzpicture}%
%}

\RequirePackage{eso-pic}
\RequirePackage{calc}
\newcommand{\placerighttop}[3]{%
	\AddToShipoutPictureFG*{%
		\put(
		\LenToUnit{\dimexpr\paperwidth-#1\relax},
		\LenToUnit{\dimexpr\paperheight-#2\relax}
		){#3}
	}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  KAPAK SAYFASI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\makecover}{
	\thispagestyle{empty}
	\begin{titlepage}
		\centering
		\vspace{4cm}
		\makesidebar
		\tcuniversite
		\placerighttop{1.5cm}{1cm}{EK-A}
		\centering
		\vspace{3.9cm}
		{\thesistitle\par}
		\vspace{7cm}
		\renewcommand{\authorname}{Hasan SANSAR}
		{\authorname\par}
		\vspace{5cm}
    	{\normalsize \submissionmonth{ }\submissionyear\par}
		
	\end{titlepage}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  FRONT / MAIN MATTER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\startfrontmatter}{
	\pagenumbering{roman}
	\setcounter{page}{1}
}

\newcommand{\startmainmatter}{
	\cleardoublepage
	\pagenumbering{arabic}
	\setcounter{page}{1}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  İKİNCİ KAPAK SAYFASI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\covertwo}{
	\thispagestyle{empty}
	\centering
	\placerighttop{1.5cm}{1cm}{EK-B}
	\placeabs{4.1cm}{
		{T.C. \\[-0.25cm]}
		{NİĞDE ÖMER HALİSDEMİR ÜNİVERSİTESİ \\[-0.25cm]}
		{FEN BİLİMLERİ ENSTİTÜSÜ \\[-0.25cm]}
		{\department \par}}
	\placeabs{10cm}{
		{\MakeUppercase{\thesistitle}\par}}
	\placeabs{16cm}{{\authorname}}
	\placeabs{18cm}{Yüksek Lisans Tezi}
	\placeabs{20cm}{{Danışman}}
	\placeabs{21cm}{\supervisor}
	\placeabs{26cm}{\submissionmonth{ }\submissionyear\par}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   JÜRI SAYFASI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
% boş liste oluştur
\newcommand{\jurymembers}{}

% jüri ekleme komutu: listeye makro ekler
\newcommand{\addjurymember}[2]{%
	\g@addto@macro\jurymembers{\jurymember{#1}{#2}}%
}

% her jüri satırının nasıl görüneceğini belirler
\newcount\jurycount
\newcommand{\processmember}[2]{%
	\advance\jurycount by 1\relax
	\ifnum\jurycount=1
		\noindent\textbf{Başkan:}\hspace{0.9cm} #1\\
		\hspace*{2.45cm} #2
		\hfill \rule{4cm}{0.4pt}\par\vspace{2cm}
	\else
		\noindent\textbf{Üye:}\hspace{1.6cm} #1\\
		\hspace*{2.47cm} #2
		\hfill \rule{4cm}{0.4pt}\par\vspace{2cm}
	\fi
}

% jurymember nesnesi → doğrudan processmember'a yönlendirir
\newcommand{\jurymember}[2]{%
	\processmember{#1}{#2}%
}

% jürileri sayfaya basar
\newcommand{\printjury}{%
	\begingroup
	\jurycount=0\relax
	\setlength{\parskip}{0pt}%
	\jurymembers
	\endgroup
}

\makeatother

% Jüri Kabul
\newcommand{\makejuriapproval}{
	\clearpage
	\thispagestyle{empty}
	\justifying
	{\noindent
	\authorname{ } tarafından \supervisor{ } danışmanlığında hazırlanan ``\thesistitle'' adlı bu çalışma jürimiz tarafından
	Niğde Ömer Halisdemir Üniversitesi Fen Bilimleri Enstitüsü
	\department’nda \textbf{Yüksek Lisans Tezi} olarak kabul edilmiştir. \par}
	
	\vspace{1.5cm}
	\placerighttop{1.5cm}{1cm}{EK-C}
	% --- Jüri Tablosu ---
	\printjury
	
	\vspace{0.8cm}
	
	{
	{\noindent\textbf{ONAY:}}
	
	\noindent Bu tez, Fen Bilimleri Enstitüsü Yönetim Kurulunca belirlenmiş olan yukarıdaki jüri üyeleri tarafından 
	.../.../20.. tarihinde uygun görülmüş ve Enstitü Yönetim Kurulu’nun .../.../20.. tarih ve 
	............................. sayılı kararıyla kabul edilmiştir.}
	
	\vspace{1cm}
	\hfill \textbf{.../.../20..}
	
	\vspace{3.5cm}
	
	\makebox[\textwidth][r]{%
	\begin{minipage}{6cm} % mini page genişliği
		\centering
		\textbf{Prof. Dr. Mustafa KARATEPE} \\
		\textbf{MÜDÜR}
	\end{minipage}%
	}
	
	\clearpage
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   TEZ BİLDİRİMİ
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\tezbildirimsayfasi}{
	\clearpage
	\thispagestyle{empty}

	\placeabs{2.5cm}{\centering \textbf{TEZ BİLDİRİMİ}}

	\vspace*{0.5cm}
	\justifying
	{\noindent Tez içindeki bütün bilgilerin bilimsel ve akademik kurallar çerçevesinde elde edilerek sunulduğunu, ayrıca tez yazım kurallarına uygun olarak hazırlanan bu çalışmada bana ait olmayan her türlü ifade ve bilginin kaynağına eksiksiz atıf yapıldığını bildiririm.\par}
	
	\vspace*{2.5cm}
	\makebox[\textwidth][r]{%
	\begin{minipage}{4cm} % mini page genişliği
		\centering
		{\authorname}
	\end{minipage}%
	}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   ÖZET SAYFASI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\ozetsayfasi}{
	%\clearpage
	%\thispagestyle{empty}
	
	%\placeabs{2.5cm}{\centering \textbf{\ozetbaslik}}
	
	\begin{center}
		\begin{abssection}{2.5cm}{section}{unnumbered}\ozetbaslik\end{abssection}
	\end{center}
	
	\vspace*{0.5cm}
	{\centering \MakeUppercase{\thesistitle} \\}
	
	\vspace{0.7cm}
	{\centering \randomtext \\}
	
	\vspace{1.5cm}
	{\centering \submissionmonth{ }\submissionyear, \lastpagenumber \\}
	
	\vspace*{1cm}
	{\noindent \summarycontent \\} 
	
	\vspace*{-5pt}
	{\noindent \fontsize{10}{8}\selectfont \keywordcontent}
	
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% İÇİNDEKİLER (Word formatı)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{tocloft}

% --- Başlık biçimi ---
\renewcommand{\cfttoctitlefont}{\hfill\bfseries\large}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand{\contentsname}{}

% --- Noktalı çizgiler ---
\renewcommand{\cftdot}{.}
\renewcommand{\cftdotsep}{1}   % nokta aralığı

% --- Girişten önceki dikey boşluk ---
\setlength{\cftbeforetoctitleskip}{-1.0cm}
\setlength{\cftaftertoctitleskip}{1cm}

% --- Giriş maddesinin sol girintisi ---
\setlength{\cftchapindent}{0pt}

% Bölümler (chapter)
\setlength{\cftchapindent}{0pt}
\setlength{\cftchapnumwidth}{1.4cm}

% Alt bölüm (section)
\setlength{\cftsecindent}{0.7cm}
\setlength{\cftsecnumwidth}{1.4cm}

% Alt-alt bölüm (subsection)
\setlength{\cftsubsecindent}{1.4cm}
\setlength{\cftsubsecnumwidth}{1.6cm}

% Alt-alt-alt bölüm (subsubsection)
\setlength{\cftsubsubsecindent}{2.1cm}
\setlength{\cftsubsubsecnumwidth}{1.8cm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ŞEKİLLER DİZİNİ
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{etoolbox}
\usepackage{babel}

\renewcommand{\figurename}{Şekil}
%\numberwithin{figure}{section}

\renewcommand{\listfigurename}{}
\setlength{\cftbeforeloftitleskip}{0.0cm}
\setlength{\cftafterloftitleskip}{0.7cm}
\setlength{\cftfignumwidth}{5em}
\renewcommand{\cftloftitlefont}{}
\renewcommand{\cftafterloftitle}{}

\renewcommand\cftfigpresnum{\bfseries Şekil }
\renewcommand\cftfigaftersnum{\normalfont}
% --- Caption ---
\usepackage[labelfont=bf,labelsep=space,justification=centering]{caption}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ÇİZELGELER DİZİNİ
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand{\tablename}{Çizelge}

\renewcommand{\listtablename}{}
\setlength{\cftbeforelottitleskip}{0.0cm}
\setlength{\cftafterlottitleskip}{0.7cm}
\setlength{\cfttabnumwidth}{5.7em}
\renewcommand{\cftlottitlefont}{}
\renewcommand{\cftafterlottitle}{}

\renewcommand\cfttabpresnum{\bfseries Çizelge }
\renewcommand\cfttabaftersnum{\normalfont}
\captionsetup[table]{skip=15pt}
\renewcommand{\arraystretch}{1.0}

\usepackage{array}
\newcolumntype{H}{>{\setbox0=\hbox\bgroup}c<{\egroup}@{}}




