Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add title fontsize option and remove hyphenation #1

Merged
merged 1 commit into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions cover.sty
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
% image yshift (length): Shifts the image up. Defaults to 0 pt.
% image file (string): Filepath to the image file. Defaults to \relax (None)
% which makes the macro use the cover image defined by the theme.
% title fontsize (lenght): Sets the main title font size. Defaults to 72 pt.
%
% -----------------------------------------------------------------------------

Expand Down Expand Up @@ -93,7 +94,6 @@
text width={\paperwidth - 2\@cover@margin},
minimum width=\paperwidth,
anchor=north west,
font=\tudtitlefamily\fontsize{72}{65}\selectfont,
outer sep=0pt,
inner sep=0pt,
yshift=-1.2\@cover@margin,
Expand Down Expand Up @@ -154,6 +154,7 @@
\define@key{cover}{image xshift}{\setlength{\@coverimage@xshift}{#1}}
\define@key{cover}{image yshift}{\setlength{\@coverimage@yshift}{#1}}
\define@key{cover}{image file}{\def\@coverimage@file{#1}}
\define@key{cover}{title fontsize}{\def\@cover@fontsize{#1}}

% Setting the default arguments so the user does not have to pass any
\setkeys{cover}{
Expand All @@ -164,6 +165,7 @@
image xshift=0pt,
image yshift=0pt,
image file=\relax, % \relax = None, Default image is specified by theme
title fontsize=72pt,
}

\newcommand*{\makecover}[1][]{
Expand All @@ -177,17 +179,20 @@
\pgfsetlayers{background, assets, main}

\begin{tikzpicture}[remember picture,overlay]

% Main layer contains all text
\begin{pgfonlayer}{main}
\node (title) [
title,
text=\@cover@textcolor,
font=\tudtitlefamily\fontsize{
\@cover@fontsize
}{0.9\@cover@fontsize}\selectfont,
] at (current page.north west) {
\ifx\@cover@title\undefined
\@title
\nohyphens{\@title}
\else
\@cover@title
\nohyphens{\@cover@title}
\fi
};
\node (subtitle) [
Expand Down
1 change: 1 addition & 0 deletions packages.sty
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
\RequirePackage{subcaption}
\RequirePackage{pdfpages}
\RequirePackage[hyphens]{url}
\RequirePackage{hyphenat}
\RequirePackage{array}
\RequirePackage{fancyhdr} % Inserts a fancy smancy header into sub-pages
\RequirePackage[fit, breakall]{truncate} % Used w/ fancyhdr to fix overlap
Expand Down