%% Custom macros for IEEE TAC / CSS submissions.
%% Author: Mohamad H. Kazma. See root.tex for usage.
%%Created by Mohamad H. Kazma
%%Date: January 10, 2024.
%%This preamble contains packages and defined commands 
%%that are usefull for writing journal papers in the field of control systems. 

%%To overide ieee template commands
%\IEEEoverridecommandlockouts
%\overrideIEEEmargins
% Use this code to change number of appendices from roman to letter
%\useRomanappendicesfalse

%%To change the index terms to keywords 
%\renewcommand\IEEEkeywordsname{Keywords}
%\renewcommand\IEEEkeywordsname{Index terms}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%use this to decrease paper length; works only with subtle mode for IEEEtran
%\usepackage[moderate]{savetrees}
%\usepackage[subtle]{savetrees}
%\usepackage{titlesec} % Adjust section spacing
%\titlespacing*{\section}{0pt}{*0.9}{*0.9}
%\titlespacing*{\subsection}{0pt}{*0.7}{*0.7}
%\setlength{\abovedisplayskip}{3pt} % Space above equations
%\setlength{\belowdisplayskip}{3pt} % Space below equations


%%Adjusted fonts to reduce paragraph size    
%\fontdimen2\font=0.60ex% inter word space or 59ex
%\fontdimen3\font=0.62ex% inter word stretch
%\fontdimen4\font=0.62ex% inter word stretch

%%Adjusted for Subtle savetrees mode to reduce paragraph size    
%\fontdimen2\font=0.45ex% inter word space or 59ex
%\fontdimen3\font=0.5ex% inter word stretch
%\fontdimen4\font=0.2ex% inter word stretch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{xcolor} % When using IEEEclc.els  and for TAC JOURNAL
%\definecolor{subsectioncolor}{RGB}{39,94,77} % Define the subsectioncolor 

% #275e4d color RGB value is (39,94,77) used for Automatic Control 
% RGB value (0,0,0) for color black
%  RGB value (0, 177, 231) for color L-CSS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%Use below to mark paper headings realted to CSS Journals
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For IEEE Transactions of Control Systems Technology
%	\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
		%				T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
%\markboth{Preparation of Paper for IEEE Transactions of Control Systems Technology (November 2023)}{Preparation of Paper for IEEE Transactions of Control Systems Technology (November 2023)}

% For IEEE Transactions of Automatic Control 
%\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
		%		T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
%\markboth{\hskip25pc IEEE TRANSACTIONS AND JOURNALS TEMPLATE}
%{Author \MakeLowercase{\textit{et al.}}: Title}

% For L-CSS letters
%\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
		%		T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
%\markboth{\journalname, VOL. XX, NO. XX, XXXX 2017}
%{Author \MakeLowercase{\textit{et al.}}: Preparation of Papers for textsc{IEEE Control Systems
		%		Letters} (November 2021)}
%{Author \MakeLowercase{\textit{et al.}}: Preparation of Paper for IEEE Control Systems Letters (September 2023)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Note remove this if you are using ieeeconf and ieeecolor
%\usepackage{amsthm} %defined already in ieeeconf
%\usepackage{amsmath}    %For theorems

%This code works for using chainging the margin in itemize
%\usepackage{enumitem} %defined already in ieeeconf
\let\labelindent\relax
\usepackage{enumitem}
\setlist[itemize]{leftmargin=*}

%%To make first letter a two line letter and bold in the introduction
\usepackage{lettrine} %To make first letter a two line letter and bold in the introduction
%%or use locally defined function in the macros below. Lettering might result in error when using \savetrees.

%%To have a balanced final page
\usepackage{balance} % To balance the references in the final page

%%To add color to tables.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Use this package to add color to table cells, rows, or columns
%% Provides commands like \rowcolor, \columncolor, \cellcolor for highlighting table elements
%% Also allows changing table line colors with \arrayrulecolor
\usepackage{colortbl}
%%This command allows you to color table cells, rows, or columns by using commands 
%\rowcolor{color}: Colors an entire row.
%\columncolor{color}: Colors an entire column.
%\cellcolor{color}: Colors an individual cell.
%\arrayrulecolor{color}: Changes the color of table lines.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Use this package to generate a list of symbols (Nomenclature) in the document
%% To define a nomenclature entry, use: \nomenclature{symbol}{description}
%% Compile using: makeindex <filename>.nlo -s nomencl.ist -o <filename>.nls
%% Add \printnomenclature where you want the nomenclature list to appear
%\usepackage{nomencl}

% The following packages can be found on http:\\www.ctan.org
%\usepackage{graphics} % for pdf, bitmapped graphics files
%\usepackage{epsfig} % for postscript graphics files
%\usepackage{mathptmx} % assumes new font selection scheme installed
%\usepackage{times} % assumes new font selection scheme installed
%\usepackage{amsmath} % assumes amsmath package installed
%\usepackage{amssymb}  % assumes amsmath package installed

%%To draw figures and illustration on latex%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows.meta, decorations.pathmorphing, decorations.markings, calc, 3d}
\usetikzlibrary{positioning, fit, backgrounds}
\usetikzlibrary{arrows.meta}  % for advanced positioning and arrow customization
\usetikzlibrary{positioning}
\usetikzlibrary{fit}		
\usetikzlibrary{decorations.pathreplacing, calc}
\usetikzlibrary{tikzmark, calc} % for equation highlighting
% Style for the arrows
\tikzset{
	tangent/.style={decoration={
			markings,mark=at position #1 with {
				\coordinate (ta) at (0,0);
				\coordinate (tb) at (0.1,0);
			}
		},postaction=decorate},
	tangent/.default=0.5
}
%%For flowcharts
% Define Node and Arrow Styles
%\tikzstyle{box} = [rectangle, draw, thick, rounded corners, 
%minimum width=2.5cm, minimum height=1.1cm, text centered, font=\footnotesize]
%\tikzstyle{colorbox1} = [rectangle, draw=black, thick, rounded corners, fill=blue!15, 
%minimum width=2.5cm, minimum height=1.1cm, text centered, font=\footnotesize]
%\tikzstyle{colorbox2} = [rectangle, draw=black, thick, rounded corners, fill=orange!15, 
%minimum width=2.5cm, minimum height=1.1cm, text centered, font=\footnotesize]
%\tikzstyle{colorbox3} = [rectangle, draw=black, thick, rounded corners, fill=green!15, 
%minimum width=2.5cm, minimum height=1.1cm, text centered, font=\footnotesize]
%\tikzstyle{arrow} = [thick,->,>=stealth]
%\tikzstyle{dashedarrow} = [thick, dashed, ->, >=stealth]

%%Colors that can be used; These colors were first used in system paritioning paper
% Subsystem (Overall grey)
\definecolor{Vgray}{RGB}{247,247,247}
\definecolor{Vedge}{RGB}{200,200,200}

% Define colors for the subsystems
\definecolor{Sub1purple}{RGB}{200,200,255}
\definecolor{Sub1edge}{RGB}{205,215,238}

\definecolor{Sub2yellow}{RGB}{251,234,206}
\definecolor{Sub2edge}{RGB}{251,234,206} % Same for fill and draw

\definecolor{Sub3green}{RGB}{215,238,210}
\definecolor{Sub3edge}{RGB}{215,232,210}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{Sub1color}{rgb}{0.85, 0.9, 1}
\definecolor{Sub2color}{rgb}{1, 0.9, 0.7}
\definecolor{Sub3color}{rgb}{0.8, 1, 0.8}
\definecolor{Sub4color}{RGB}{200,200,255}

%\colorlet{Sub1edge}{blue!10}
%\colorlet{Sub2edge}{orange!10}
%\colorlet{Sub3edge}{green!10}
\definecolor{Sub4edge}{RGB}{205,215,238}

\definecolor{Sub5color}{RGB}{255,210,210}
\definecolor{Sub5edge}{RGB}{240,180,180}

%%%New
%\definecolor{Sub1edge}{RGB}{120,120,120}
%\definecolor{Sub1color}{RGB}{230,230,255}
%
%\definecolor{Sub2edge}{RGB}{140,100,100}
%\definecolor{Sub2color}{RGB}{255,230,230}
%
%\definecolor{Sub3edge}{RGB}{100,140,100}
%\definecolor{Sub3color}{RGB}{230,255,230}
%
%\definecolor{Sub4edge}{RGB}{100,100,140}
%\definecolor{Sub4color}{RGB}{230,230,255}

\definecolor{Sub5edge}{RGB}{140,120,80}
\definecolor{Sub5color}{RGB}{255,245,225}

\definecolor{Sub6edge}{RGB}{100,130,150}
\definecolor{Sub6color}{RGB}{220,240,255}

\definecolor{Sub7edge}{RGB}{130,100,150}
\definecolor{Sub7color}{RGB}{245,230,255}

\definecolor{Sub8edge}{RGB}{150,130,100}
\definecolor{Sub8color}{RGB}{255,250,230}

\definecolor{Sub9edge}{RGB}{90,140,140}
\definecolor{Sub9color}{RGB}{220,250,250}

\definecolor{Sub10edge}{RGB}{110,110,110}
\definecolor{Sub10color}{RGB}{240,240,240}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%
% Define colorbox styles for algorthm
\tikzset{
	highlightP1/.style={
		fill=Sub2yellow, rounded corners=2pt, inner sep=2pt, anchor=base},
	highlightP2/.style={
		fill=Sub3green, rounded corners=2pt, inner sep=2pt, anchor=base}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%Flow chart configuration, colors, arrows and nodes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Flow Chart colors 
\definecolor{LightBlue}{rgb}{0.7, 0.85, 1}
\definecolor{LightOrange}{rgb}{1, 0.8, 0.6}
\definecolor{LightGreen}{rgb}{0.843, 0.933, 0.824}

% Define Node and Arrow Styles
\tikzstyle{box} = [rectangle, draw, thick, rounded corners, 
text centered, font=\footnotesize, minimum height=1cm, text width=4.5cm]
\tikzstyle{colorbox1} = [rectangle, draw=black, rounded corners, fill=Sub1purple, 
text centered, font=\footnotesize, minimum height=1cm, text width=4.5cm]
\tikzstyle{colorbox2} = [rectangle, draw=black, rounded corners, fill=Sub2yellow, 
text centered, font=\footnotesize, minimum height=1cm, text width=4.5cm]
\tikzstyle{colorbox3} = [rectangle, draw=black, rounded corners, fill=Sub3green, 
text centered, font=\footnotesize, minimum height=1cm, text width=4.5cm]
\tikzstyle{colorbox4} = [rectangle, draw=black, rounded corners, fill={rgb,255:red,247; green,247; blue,247},text centered, font=\scriptsize, minimum height=0.5cm, text width=3cm]

\tikzstyle{arrow} = [thick,->,>=stealth]
\tikzstyle{dashedarrow} = [thick, dashed, ->, >=stealth]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Local Font Size Commands (from smallest to largest):
%\begin{tabular}{|l|l|}
%	\hline Command & Relative Size \\
%	\hline \tiny & Very very small \\
%	\hline Iscriptsize & Smaller than footnote \\
%	\hline \footnotesize & Footnote size \\
%	\hline \small & Slightly smaller than normal \\
%	\hline Inormalsize & Default size (depends on document class) \\
%	\hline \large & Larger than normal \\
%	\hline \Large & Even larger \\
%	\hline ILARGE & Bigger \\
%	\hline Vhuge & Very big \\
%	\hline UHuge & \\
%	\hline
%\end{tabular}

%Available arrow styles include:
%\begin{tabular}{|c|c|c|}
%	\hline Style & Syntax Example & Description \\
%	\hline Stealth & -\{Stealth\} & Sleek arrowhead \\
%	\hline Latex & - $\{$ Latex $\}$ & Classic LaTeX-style arrow \\
%	\hline Triangle & -\{Triangle & Equilateral triangle tip \\
%	\hline To & $\rightarrow$ or $-\{$ To \} & Default thin arrow \\
%	\hline Circle & - \{Circle\} & Open circle tip \\
%	\hline Diamond & -\{Diamond\} & Diamond-shaped head \\
%	\hline Bar & $\because$ & - \\
%	\hline
%\end{tabular}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%For conference papers L-CSS (CDC AND ACC) %To adjust margins of a paper
%\usepackage{geometry}
%\geometry{
	%	left=0.75in,   % Left margin
	%	right=0.75in,  % Right margin
	%	top=0.75in,    % Top margin
	%	bottom=0.75in, % Bottom margin
	%}
%\geometry{
	%	left=54pt,   % Left margin
	%	right=54pt,  % Right margin
	%	top=54pt,    % Top margin
	%	bottom=54pt, % Bottom margin
	%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%The lineno packages adds line numbers. Start line numbering with
%%\begin{linenumbers}, end it with \end{linenumbers}. Or switch it on
% %for the whole article with \linenumbers.
% \usepackage{lineno}

%%This package supports editorial comments and gives some extra support for writing papers
%\usepackage[editing]{coop-writing}
%\usepackage[submit]{coop-writing}
%\usepackage[publish]{coop-writing}

%%Allows to begin verbatim section
%\usepackage{fancyvrb}

%%Connects to links external to the document \href{URL}{text}
%\usepackage{hyperref}
%\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=black}

%%This packages allows easier representation of ODEs
%\usepackage[<options>]{diffcoeff}[=v5]

%%To write code for python and execute it.
\usepackage{listings}
\lstset{
	language=Python,
	basicstyle=\ttfamily,
	numbers=left,
	numberstyle=\tiny,
	stepnumber=1,
	numbersep=5pt,
	backgroundcolor=\color{white},
	showspaces=false,
	showstringspaces=false,
	showtabs=false,
	tabsize=2,
	captionpos=b,
	breaklines=true,
	breakatwhitespace=true,
	breakautoindent=true,
	linewidth=\textwidth
}
%\begin{lstlisting}[caption=Example Python Code, label=lst:example]
%	def greet(name):
%	print(f"Hello, {name}!")
%	greet("World")
%\end{lstlisting}

%\titleformat{\section}
%{\normalfont\fontsize{11}{13}\bfseries} % font size 11pt, line spacing 13pt
%{\thesection}{1em}{}


%\usepackage{lipsum}
%\usepackage{multicol}
%\usepackage{tcolorbox}
%\usepackage{witharrows}
%\usepackage{minted}
%\usetikzlibrary{positioning}
%\usepackage{pgfplots}
%\pgfplotsset{compat=1.18}
%\usepackage{tikz-cd}
%\usepackage{xcolor}
%\usepackage{tcolorbox}
%\usepackage{siunitx}
%\usepackage{cleveref}
%\usepackage{coordsys}
%\usepackage{fitbox}
%\usepackage{bchart}

%%%%%%%%%%%%%%%%
%For circuit drawing
\usepackage{circuitikz}
%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%
%\usepackage{subcaption} % for subcaptioning
\usepackage{makecell}
%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%
%For flowchart drawings
\usepackage{flowchart}
%%%%%%%%%%%%%%%

%%%%To change spacing in the enumerate and itemize environments
%\usepackage{enumitem}
%\setlist[itemize]{topsep=5pt, itemsep=3pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%User Defined Commands: (mkazma)
%\newcommand{cmd}[args]{def}
%\renewcommand{cmd}[args]{def}

%cmd: A command name beginning with a \. For \newcommand it must not be already defined and must not begin with \end; for \renewcommand it must already be defined.
%args: An integer from 1 to 9 denoting the number of arguments of the command being defined. The default is for the command to have no arguments.
%def: The text to be substituted for every occurrence of cmd; a parameter of the form #n in cmd is replaced by the text of the nth argument when this substitution takes place.

%For commenting and annotating use the following
\def\comment{\textcolor{blue}} 
\def\commentt{\textcolor{red}}

%Text  Intro start with Letterine \\\ requires packge letterine
\newcommand{\introstart}[2]{\noindent \lettrine[lines=2]{#1}{#2}}

%Text Bold for Notation and paper organization
\newcommand{\parstart}[1]{\noindent \textbf{#1.}\;}

% Text L-CSS color for Notation and paper organization
\definecolor{LCSS}{HTML}{004498}

\newcommand{\parstartc}[1]{\noindent \textbf{\textcolor{LCSS}{#1.}}\;}
\newcommand{\parquestc}[1]{\noindent \textbf{\textcolor{LCSS}{#1?}}\;}

%Reference a section with number
%\newcommand{\sec}[1]{Section~\ref{#1}}

%Column vector  \mathrm{col}\{\gamma_j\}_{j=1}^{n_y}
\newcommand{\col}[4]{\mathrm{col}\left\{ {#1}_{#2}\right\}_{{#2}={#3}}^{#4}}
%same as above without the word col
\newcommand{\nocol}[4]{\left\{ {#1}_{#2}\right\}_{{#2}={#3}}^{#4}}

%Real set
\newcommand{\R}{\mathbb{R}}
\newcommand{\Rn}[1]{\mathbb{R}^{#1}}

%%L2 and Linf norms
\newcommand{\linf}{\mathcal{L}_{\infty}}
\newcommand{\ltwo}{\mathcal{L}_{2}}
\newcommand{\lone}{\mathcal{L}_{1}}

%%Logdeterminant 
\newcommand{\logdet}[1]{\mr{log} \mr{det}(#1)}

%Title command
\newcommand{\titlesc}[1]{\title{\Large \vspace{0.7cm} \LARGE \centering {\textsc{{#1}}}}}
\newcommand{\titlebf}[1]{\title{\Large \vspace{0.7cm} \LARGE \centering {\textsc{\textbf{#1}}}}}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Redefine the proof environment for LCSS (colored)
%\renewenvironment{proof}{%
%	\par\vspace{0.3em}% Add space before the proof
%	\noindent\textbf{\textit{\textcolor{LCSS}{Proof.}}}\enspace% Styled "Proof" header
%}{%
%	\hfill $\blacksquare$% Black square at the end
%	\vspace{0.3em}% Add space after the proof
%}
\renewenvironment{proof}{%
	\par\vspace{0.3em}%
	\noindent\textbf{\textit{\textcolor{LCSS}{Proof.}}}\enspace%
}{%
	\hfill$\blacksquare$%
	\par\vspace{0.3em}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% New Enviroment for proofs when added to appdx
%%%Enviroment for proof in appdx
%\newenvironment{proofof}[1]{\vspace{0.3em}\textbf{Proof of Theorem~\ref{#1}.}}{\hfill\vspace{0.1em} $\blacksquare$\vspace{0.3em}}
%%with LCSS color
%%\newenvironment{proofofc}[1]{\vspace{0.3em}\textbf{\textit{\textcolor{LCSS}{Proof of Theorem}}~\textit{\ref{#1}}.}}{\hfill\vspace{0.1em} $\blacksquare$\vspace{0.3em}}
%\newenvironment{proofofc}[1]{%
%	\vspace{0.3em}%
%	\indent\textbf{\textit{\textcolor{LCSS}{Proof of Theorem}}}~\textit{\ref{#1}}\textcolor{LCSS}{.}\enspace%
%}{%
%	\hfill$\blacksquare$%
%	\vspace{0.3em}%
%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% New Enviroment for proofs when added to appdx
%%For Lemma in APDX
\newenvironment{proofoflemmac}[1]{%
	\vspace{0.3em}%
	\noindent\textbf{\textit{\textcolor{LCSS}{Proof of Lemma~\ref{#1}.}}}\enspace%
}{%
	\hfill$\blacksquare$%
	\vspace{0.3em}%
}
%%For Lemma in APDX
\newenvironment{proofoftheoc}[1]{%
	\vspace{0.3em}%
	\noindent\textbf{\textit{\textcolor{LCSS}{Proof of Theorem~\ref{#1}.}}}\enspace%
}{%
	\hfill$\blacksquare$%
	\vspace{0.3em}%
}

%%For Corollary in APDX
\newenvironment{proofofcorc}[1]{%
	\vspace{0.3em}%
	\noindent\textbf{\textit{\textcolor{LCSS}{Proof of Corollary~\ref{#1}.}}}\enspace%
}{%
	\hfill$\blacksquare$%
	\vspace{0.3em}%
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%To change figure caption options
%\usepackage{caption} 
%\captionsetup[figure]{name=Fig., font=smaller,font+=smaller,labelsep=period}
%%%Other option is
%\renewcommand{\figurename}{Fig.} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% To change the theorem style for L-CSS color use the following.
% Redefine the theorem style to use the custom format
% Custom styles for each theorem individually
%No romman letters for sections   
%\newtheorem{theorem}{\textbf{\textcolor{LCSS}{Theorem}}}[section]
%\newtheorem{mylem}{\textbf{\textcolor{LCSS}{Lemma}}}[section]
%\newtheorem{mydef}{\textbf{\textcolor{LCSS}{Definition}}}[section]
%\newtheorem{mypro}{\textbf{\textcolor{LCSS}{Property}}}[section]
%\newtheorem{myrem}{\textbf{\textcolor{LCSS}{Remark}}}[section]
%\newtheorem{asmp}{\textbf{\textcolor{LCSS}{Assumption}}}[section]
%\newtheorem{mycor}{\textbf{\textcolor{LCSS}{Corollary}}}[section]
%\newtheorem{myprs}{\textbf{\textcolor{LCSS}{Proposition}}}[section]
%\newtheorem{exmpl}{\textbf{\textcolor{LCSS}{Example}}}[section]

%% Define theorem environments with custom titles
%\newtheorem{theorem}{\textbf{\textcolor{LCSS}{Theorem}}}[section]
%\newtheorem{mylem}{\textbf{\textcolor{LCSS}{Lemma}}}[section]
%\newtheorem{mydef}{\textbf{\textcolor{LCSS}{Definition}}}[section]
%\newtheorem{mypro}{\textbf{\textcolor{LCSS}{Property}}}[section]
%\newtheorem{myrem}{\textbf{\textcolor{LCSS}{Remark}}}[section]
%\newtheorem{asmp}{\textbf{\textcolor{LCSS}{Assumption}}}[section]
%\newtheorem{mycor}{\textbf{\textcolor{LCSS}{Corollary}}}[section]
%\newtheorem{myprs}{\textbf{\textcolor{LCSS}{Proposition}}}[section]
%\newtheorem{exmpl}{\textbf{\textcolor{LCSS}{Example}}}[section]
%
%\def\@begintheorem#1#2{%
%	\par\noindent\textbf{\textit{\textcolor{LCSS}{#1 #2}}}%
%	\@ifnextchar[{\@withinfo}{\enspace\ignorespaces}}
%\def\@withinfo[#1]{% Handle optional arguments
%	\textbf{\textcolor{LCSS}{ (#1.)}}\enspace\ignorespaces}
%\makeatother
%
%% Customize theorem numbering (Roman section + Arabic theorem number)
%\makeatletter
%\renewcommand{\thetheorem}{\textcolor{LCSS}{\Roman{section}.\arabic{theorem}}}
%\renewcommand{\themylem}{\textcolor{LCSS}{\Roman{section}.\arabic{mylem}}}
%\renewcommand{\themydef}{\textcolor{LCSS}{\Roman{section}.\arabic{mydef}}}
%\renewcommand{\themypro}{\textcolor{LCSS}{\Roman{section}.\arabic{mypro}}}
%\renewcommand{\themyrem}{\textcolor{LCSS}{\Roman{section}.\arabic{myrem}}}
%\renewcommand{\theasmp}{\textcolor{LCSS}{\Roman{section}.\arabic{asmp}}}
%\renewcommand{\themycor}{\textcolor{LCSS}{\Roman{section}.\arabic{mycor}}}
%\renewcommand{\themyprs}{\textcolor{LCSS}{\Roman{section}.\arabic{myprs}}}
%\renewcommand{\theexmpl}{\textcolor{LCSS}{\Roman{section}.\arabic{exmpl}}}
%\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Theorems with color for LCSS colored with dot.
\newtheorem{theorem}{\textbf{\textcolor{LCSS}{Theorem}}}
\newtheorem{mylem}{\textbf{\textcolor{LCSS}{Lemma}}}
\newtheorem{mydef}{\textbf{\textcolor{LCSS}{Definition}}}
\newtheorem{mypro}{\textbf{\textcolor{LCSS}{Property}}}
\newtheorem{myrem}{\textbf{\textcolor{LCSS}{Remark}}}
\newtheorem{asmp}{\textbf{\textcolor{LCSS}{Assumption}}}
\newtheorem{mycor}{\textbf{\textcolor{LCSS}{Corollary}}}
\newtheorem{myprs}{\textbf{\textcolor{LCSS}{Proposition}}}
\newtheorem{exmpl}{\textbf{\textcolor{LCSS}{Example}}}
\newtheorem{problem}{\textbf{\textcolor{LCSS}{Problem}}}

\makeatletter
\def\@begintheorem#1#2{% 
	\par\noindent\textbf{\textcolor{LCSS}{\textit{#1 #2}}}%
	\@ifnextchar[{\@withinfo}{\textbf{\textcolor{LCSS}{.}}\enspace\ignorespaces}}
	
	\def\@withinfo[#1]{% Ensure optional argument stays inline and formatted correctly
\textbf{\textcolor{LCSS}{\textit{ (#1)}}}\textcolor{LCSS}{.} \ignorespaces}
\makeatother

%\makeatletter
%\def\@begintheorem#1#2{% 
%	\par\noindent\textbf{\textit{\textcolor{LCSS}{#1 #2}}}%
%	\@ifnextchar[{\@withinfo}{\textbf{\textcolor{LCSS}{.}}\enspace\ignorespaces}}
%\def\@withinfo[#1]{% Handle optional arguments
%	\textbf{\textcolor{LCSS}{ (#1).}}\enspace\ignorespaces}
%\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Theorems with no color or customization
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\newtheorem{theorem}{Theorem}
%\newtheorem{mydef}{Definition}
%\newtheorem{mylem}{Lemma}
%\newtheorem{mypro}{Property}
%\newtheorem{myrem}{Remark}
%\newtheorem{asmp}{Assumption}
%\newtheorem{mycor}{Corollary}
%\newtheorem{myprs}{Proposition}
%\newtheorem{exmpl}{Example}
%\newtheorem{problem}{Problem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%