% !TEX TS-program = LuaLaTeX
% From mitthesis package
% Documentation: https://ctan.org/pkg/mitthesis

\ProvidesFile{mydesign_redsansheadings.tex}[2026/01/31 v1.01]

% ==> you can change this however you want. The content below is just for illustration. <==

% In this illustration, chapter and section headings are set in bold face, sans-serif and the color Red4 (from xcolor package)
%	Caption labels are also set this way.
%	This arrangement looks good with fontsets that load helvetica or heros fonts as sans-serif, 
%		e.g. fontset=termes-stix2 (lualatex), fontset=newtx (pdftex), etc.


%%%%%%%%%%  Color support  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Color package: xcolor. 
%% Change this if you prefer something else

\usepackage[dvipsnames,svgnames,x11names]{xcolor}
	\definecolor{MITRed}{rgb}{0.457, 0, 0.0781}   % 117/0/20 red  

%% can add option [table] to xcolor to use color in tables (see xcolor documentation)


%%%%%%%%%%  Hyperlink and line number colors  %%%%%%%%%%%%%%

\AtBeginDocument{
    % Using color names from xcolor package
    \hypersetup{
    	linkcolor=Blue3,
    	citecolor=Blue3,
    	urlcolor=violet,
    	filecolor=red, 
    	}
    %
    \ifmit@lineno
	    \renewcommand{\linenumberfont}{\sffamily\mdseries\tiny\color{violet}}% line numbers will be sans-serif, medium weight, tiny, and violet
	\fi
}

%%%%%%%%%  Caption support  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
\IfFormatAtLeastTF{2025/11/01}
{
    %% If your latex format is at least 2025/06/01, you should use this approach:
    \NewSocketPlug{caption/label}{plug-A}{{\textcolor{Red4}{\textbf{ #1}}\quad}} % This strictly addresses the caption label, not caption text.
    \AssignSocketPlug{caption/label}{plug-A}
    %
    %% If your latex format is at least 2025/11/01, this command is also available:
    \AddToHook{cmd/@makecaption/before}{\sffamily} % This styles the entire caption, but label socket above is able to override it.
    %
    % These commands make caption label bold and red, with a \quad space separating label from text;
    %    \sffamily affects both label and text (unless you put a font selection command in the plug).
}{
    %% For older formats, use the following. See documentation of caption package for details.
    %
     \RequirePackage{caption}
    %% This sets caption labels in red, sans-serif, bold face type. 
    	\DeclareCaptionLabelFormat{redlabel}{\textbf{\textcolor{MITRed}{#1\ #2}}}
    	\captionsetup[figure]{labelformat=redlabel,labelfont={sf},labelsep=quad}  % change to red, boldface, sans label with separation of one \quad
    	\captionsetup[table]{labelformat=redlabel,labelfont={bf,sf},labelsep=quad}% change to red, boldface, sans label with separation of one \quad
}

%%%%%%%%%  Customize titles and section headings  %%%%%%%%%%

% To directly modify section headings as follows, see https://latexref.xyz/dev/latex2e.html#g_t_005c_0040startsection
%
% This makes section headings sans-serif, MITRed, and ragged-right (compare to report.cls)
% NB: for fonts with a predefined bold \mathversion, the fontset file inserts \mathversion{bold} into these commands.
%
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\color{MITRed}\sffamily\Large\bfseries\raggedright}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                   {-3.25ex\@plus -1ex \@minus -.2ex}%
                                   {1.5ex \@plus .2ex}%
                                   {\color{MITRed}\sffamily\large\bfseries\raggedright}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                   {-3.25ex\@plus -1ex \@minus -.2ex}%
                                   {1.5ex \@plus .2ex}%
                                   {\color{MITRed}\sffamily\normalsize\bfseries\raggedright}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                   {3.25ex \@plus1ex \@minus.2ex}%
                                   {-1em}%
                                   {\color{MITRed}\sffamily\normalsize\bfseries\raggedright}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
                                   {3.25ex \@plus1ex \@minus .2ex}%
                                   {-1em}%
                                   {\color{MITRed}\sffamily\normalsize\bfseries\raggedright}}

%% This makes numbered chapter headings MITRed and san-serif
\patchcmd{\@makechapterhead}{\Huge}{\color{MITRed}\Huge\sffamily}{}{}
\patchcmd{\@makechapterhead}{\huge}{\huge\color{MITRed}\sffamily}{}{}

%% This makes UNnumbered chapter headings Red4 san-serif
\patchcmd{\@makeschapterhead}{\Huge}{\Huge\color{MITRed}\sffamily}{}{}


%%%%%%%%%  Change page margins  %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% The default thesis margin is 1 inch all around. You may want different margins (e.g., to add a gutter for binding),
% in which case you can use the \newgeometry command from the geometry package.  Refer to the package documentation
% for details.
%
% mitthesis defaults: [top=1in,bottom=1in,left=1in,right=1in,marginparwidth=50pt,headsep=12pt,footskip=0.5in]
%
% The following tells the geometry package to use a two-sided layout with a 1 cm binding offset on the inside 
% 	and 1 inch margins all around, reducing textwidth slightly (by 0.7 cm). See geometry documentation, Section 8.2.
%
%\newgeometry{twoside, bindingoffset=1cm,margin=1in,marginparwidth=50pt,headsep=12pt,footskip=0.5in}
