Debian Codegraph @

texmf-dist/doc/latex/mitthesis/examples/design_examples/latex_sources/mydesign_redsans_headings.tex

raw
1 % !TEX TS-program = LuaLaTeX
2 % From mitthesis package
3 % Documentation: https://ctan.org/pkg/mitthesis
4
5 \ProvidesFile{mydesign_redsansheadings.tex}[2026/01/31 v1.01]
6
7 % ==> you can change this however you want. The content below is just for illustration. <==
8
9 % In this illustration, chapter and section headings are set in bold face, sans-serif and the color Red4 (from xcolor package)
10 % Caption labels are also set this way.
11 % This arrangement looks good with fontsets that load helvetica or heros fonts as sans-serif,
12 % e.g. fontset=termes-stix2 (lualatex), fontset=newtx (pdftex), etc.
13
14
15 %%%%%%%%%% Color support %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16
17 %% Color package: xcolor.
18 %% Change this if you prefer something else
19
20 \usepackage[dvipsnames,svgnames,x11names]{xcolor}
21 \definecolor{MITRed}{rgb}{0.457, 0, 0.0781} % 117/0/20 red
22
23 %% can add option [table] to xcolor to use color in tables (see xcolor documentation)
24
25
26 %%%%%%%%%% Hyperlink and line number colors %%%%%%%%%%%%%%
27
28 \AtBeginDocument{
29 % Using color names from xcolor package
30 \hypersetup{
31 linkcolor=Blue3,
32 citecolor=Blue3,
33 urlcolor=violet,
34 filecolor=red,
35 }
36 %
37 \ifmit@lineno
38 \renewcommand{\linenumberfont}{\sffamily\mdseries\tiny\color{violet}}% line numbers will be sans-serif, medium weight, tiny, and violet
39 \fi
40 }
41
42 %%%%%%%%% Caption support %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43 %
44 \IfFormatAtLeastTF{2025/11/01}
45 {
46 %% If your latex format is at least 2025/06/01, you should use this approach:
47 \NewSocketPlug{caption/label}{plug-A}{{\textcolor{Red4}{\textbf{ #1}}\quad}} % This strictly addresses the caption label, not caption text.
48 \AssignSocketPlug{caption/label}{plug-A}
49 %
50 %% If your latex format is at least 2025/11/01, this command is also available:
51 \AddToHook{cmd/@makecaption/before}{\sffamily} % This styles the entire caption, but label socket above is able to override it.
52 %
53 % These commands make caption label bold and red, with a \quad space separating label from text;
54 % \sffamily affects both label and text (unless you put a font selection command in the plug).
55 }{
56 %% For older formats, use the following. See documentation of caption package for details.
57 %
58 \RequirePackage{caption}
59 %% This sets caption labels in red, sans-serif, bold face type.
60 \DeclareCaptionLabelFormat{redlabel}{\textbf{\textcolor{MITRed}{#1\ #2}}}
61 \captionsetup[figure]{labelformat=redlabel,labelfont={sf},labelsep=quad} % change to red, boldface, sans label with separation of one \quad
62 \captionsetup[table]{labelformat=redlabel,labelfont={bf,sf},labelsep=quad}% change to red, boldface, sans label with separation of one \quad
63 }
64
65 %%%%%%%%% Customize titles and section headings %%%%%%%%%%
66
67 % To directly modify section headings as follows, see https://latexref.xyz/dev/latex2e.html#g_t_005c_0040startsection
68 %
69 % This makes section headings sans-serif, MITRed, and ragged-right (compare to report.cls)
70 % NB: for fonts with a predefined bold \mathversion, the fontset file inserts \mathversion{bold} into these commands.
71 %
72 \renewcommand\section{\@startsection {section}{1}{\z@}%
73 {-3.5ex \@plus -1ex \@minus -.2ex}%
74 {2.3ex \@plus.2ex}%
75 {\color{MITRed}\sffamily\Large\bfseries\raggedright}}
76 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
77 {-3.25ex\@plus -1ex \@minus -.2ex}%
78 {1.5ex \@plus .2ex}%
79 {\color{MITRed}\sffamily\large\bfseries\raggedright}}
80 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
81 {-3.25ex\@plus -1ex \@minus -.2ex}%
82 {1.5ex \@plus .2ex}%
83 {\color{MITRed}\sffamily\normalsize\bfseries\raggedright}}
84 \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
85 {3.25ex \@plus1ex \@minus.2ex}%
86 {-1em}%
87 {\color{MITRed}\sffamily\normalsize\bfseries\raggedright}}
88 \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
89 {3.25ex \@plus1ex \@minus .2ex}%
90 {-1em}%
91 {\color{MITRed}\sffamily\normalsize\bfseries\raggedright}}
92
93 %% This makes numbered chapter headings MITRed and san-serif
94 \patchcmd{\@makechapterhead}{\Huge}{\color{MITRed}\Huge\sffamily}{}{}
95 \patchcmd{\@makechapterhead}{\huge}{\huge\color{MITRed}\sffamily}{}{}
96
97 %% This makes UNnumbered chapter headings Red4 san-serif
98 \patchcmd{\@makeschapterhead}{\Huge}{\Huge\color{MITRed}\sffamily}{}{}
99
100
101 %%%%%%%%% Change page margins %%%%%%%%%%%%%%%%%%%%%%%%%%%%
102 %
103 % The default thesis margin is 1 inch all around. You may want different margins (e.g., to add a gutter for binding),
104 % in which case you can use the \newgeometry command from the geometry package. Refer to the package documentation
105 % for details.
106 %
107 % mitthesis defaults: [top=1in,bottom=1in,left=1in,right=1in,marginparwidth=50pt,headsep=12pt,footskip=0.5in]
108 %
109 % The following tells the geometry package to use a two-sided layout with a 1 cm binding offset on the inside
110 % and 1 inch margins all around, reducing textwidth slightly (by 0.7 cm). See geometry documentation, Section 8.2.
111 %
112 %\newgeometry{twoside, bindingoffset=1cm,margin=1in,marginparwidth=50pt,headsep=12pt,footskip=0.5in}