Skip to content

Commit

Permalink
Add preliminary support for titlecaps
Browse files Browse the repository at this point in the history
This monkey-patches at least `\title`, `\subtitle`, `\chapter`,
`\section`, `\subsection`, and `\subsubsection` (the latter three at
least in the table of contents, since they are upper-case anyway).
However, patching the `\headmark` in the footer of the page is missing,
and it does not seem to be trivial.
  • Loading branch information
stephanlukasczyk committed Apr 4, 2024
1 parent 88f992c commit 3fe98ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Binary file modified examples/se2thesis-master-thesis-example.pdf
Binary file not shown.
16 changes: 11 additions & 5 deletions se2thesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,8 @@
% Load required packages early.
% \begin{macrocode}
\RequirePackage{graphicx}
\RequirePackage{titlecaps}
\Addlcwords{a an the that to this is are and with on}
\RequirePackage{translations}
\LoadDictionary{se2translations}
\DeclareTranslationFallback{version-of-date}{%
Expand Down Expand Up @@ -1211,10 +1213,10 @@
\cs_new:Nn \__@@_print_title:
{
\group_begin:
\usekomafont{title}\centering\@title\par
\usekomafont{title}\centering\titlecap{\@title}\par
\group_end:
\ifx\@subtitle\@empty\else{%
\medskip\usekomafont{subtitle}\centering\@subtitle\par%
\medskip\usekomafont{subtitle}\centering\titlecap{\@subtitle}\par%
}\fi
\bigskip
\group_begin:
Expand Down Expand Up @@ -1331,7 +1333,7 @@
\renewcommand*{\@lowertitleback}{%
\group_begin:
\noindent\textbf{\@author}:\\
\emph{\@title}\\
\emph{\titlecap{\@title}}\\
\tl_if_eq:NnT \l_@@_thesis_type_tl { bachelor }
{ \GetTranslation{Bachelor-thesis},~ }
\tl_if_eq:NnT \l_@@_thesis_type_tl { master }
Expand Down Expand Up @@ -1359,9 +1361,13 @@
}
\renewcommand{\chapterlinesformat}[3]{%
\parbox[b]{\textwidth}{\hrulefill#2}\par%
#3\par\bigskip%
\titlecap{#3}\par\bigskip%
\hrule%
}
\let\orig@addtocentrydefault\addtocentrydefault
\renewcommand*{\addtocentrydefault}[3]{%
\orig@addtocentrydefault{#1}{#2}{\titlecap{#3}}%
}
\RedeclareSectionCommand[afterskip=1.5\baselineskip]{chapter}
\renewcommand*{\chapterlineswithprefixformat}[3]{%
\Ifstr{#1}{chapter}
Expand All @@ -1373,7 +1379,7 @@
}
% \end{macrocode}
%
% Change the loop of a \cmd{\paragraph} to be italic and end with a full stop.
% Change the look of a \cmd{\paragraph} to be italic and end with a full stop.
% \begin{macrocode}
\setkomafont{paragraph}{\normalsize\normalfont\itshape}
\AddtoDoHook{heading/endgroup/paragraph}{\headingdot}
Expand Down

0 comments on commit 3fe98ab

Please sign in to comment.