Skip to content

Commit

Permalink
Fix namespace conflict caused by report.cls
Browse files Browse the repository at this point in the history
This commit addresses Issue [#34] by prepending `tud-` to all template
packages and class files. As a result, the namespace conflict which
led to failing compilations on TeXLive 2020 is fixed.

[#34]: skilkis/tudelft-light#34
  • Loading branch information
skilkis committed Feb 18, 2021
1 parent 9628f4e commit 87c1708
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 45 deletions.
18 changes: 9 additions & 9 deletions cover.sty → tud-cover.sty
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
% -----------------------------------------------------------------------------
%
% Copyright (c) 2020. San Kilkis. All rights reserved.
%
%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/
%
% --- Package Documentation: --------------------------------------------------
%
%
% This package provides the \makecover macro for creating the outer coverpage.
%
%
% The basic usage is to define the title and subtitle using the \title and
% \subtitle macros followed by a call to the \makecover macro:
%
%
% \title{An Important Topic Worth Writing About}
% \subtitle{A Very Important Report}
% \makecover
Expand All @@ -25,22 +25,22 @@
% \subtitle[Different Cover Subtitle]{A Very Important Report}
% \makecover
% \maketitle
%
%
% The cover page can be changed from the default dark theme by passing the
% theme=light keyword argument. The light theme is meant for light background
% images and will change the white logo and text to black:
%
% \title{An Important Topic Worth Writing About}
% \subtitle{A Very Important Report}
% \makecover[theme=light]
%
%
% Optional Keyword Arguments:
% theme (string): Sets the theme of the cover page. Defaults to dark.
% fill opacity (number): Sets the opacity of the header fill which can help
% to increase the contrast of the title text against certain backgrounds.
% Defaults to 0.3.
% image scale (number): Scales the background image. Defaults to 1.
% image angle (number): Sets the counter-clockwise rotation in degrees
% image angle (number): Sets the counter-clockwise rotation in degrees
% of the image. Defaults to 0 (deg).
% image xshift (length): Shifts the image toward the right. Defaults to 0 pt.
% image yshift (length): Shifts the image up. Defaults to 0 pt.
Expand All @@ -51,15 +51,15 @@
% -----------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tudelft-light/cover}[2018/02/08 TU Delft Light Report Class]
\ProvidesPackage{tudelft-light/tud-cover}

\RequirePackage{tikz}
\RequirePackage{calc}
\RequirePackage{xkeyval} % Needed for options to the \makecover macro
\RequirePackage{graphicx}
\RequirePackage{fontspec}
\RequirePackage[us]{datetime}
\RequirePackage{tudelft-light/style} % Requires house style fonts and colors
\RequirePackage{tudelft-light/tud-style} % Requires house style fonts & colors

\usetikzlibrary{calc, positioning, fit}

Expand Down
4 changes: 2 additions & 2 deletions macros.sty → tud-macros.sty
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
% Refer to: https://www.overleaf.com/learn/latex/Writing_your_own_package

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tudelft-light/macros}
\ProvidesPackage{tudelft-light/tud-macros}

%\\\\\\\\\\\ Command for XDSM Files \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\newcommand{\zero}[1]{{#1}^{\left(0\right)}}

%\\\\\\\\\\\ Simplification for Bibliography Creation \\\\\\\\\\\\\\\\\\\\\\\\\

% \renewcommand{\printbibliography}{}
% \renewcommand{\printbibliography}{}
8 changes: 4 additions & 4 deletions packages.sty → tud-packages.sty
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
% -----------------------------------------------------------------------------
%
% Copyright (c) 2020. San Kilkis. All rights reserved.
%
%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/
%
% --- Package Documentation: --------------------------------------------------
%
%
% Defines all packages required by the tudelft-light/report document class.
%
% -----------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tudelft-light/packages}
\ProvidesPackage{tudelft-light/tud-packages}

\RequirePackage[margin=6pc, headheight=14pt]{geometry}
\RequirePackage{import}
Expand Down Expand Up @@ -66,4 +66,4 @@
style=numeric,
citestyle=numeric,
sorting=none
]{biblatex}
]{biblatex}
25 changes: 12 additions & 13 deletions report.cls → tud-report.cls
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
% -----------------------------------------------------------------------------
%
% Copyright (c) 2020. San Kilkis. All rights reserved.
%
%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/
%
% --- Class Documentation: ----------------------------------------------------
%
%
% This package provides the tudelft-light/report class for use with XeLaTeX.
%
%
% The document class is based on the report class from the LaTeX Std. Lib.
% For a full list of available document options refer to:
% For a full list of available document options refer to:
% https://en.wikibooks.org/wiki/LaTeX/Document_Structure
%
% Optional Keyword Arguments:
Expand All @@ -31,11 +31,11 @@
% -----------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{tudelft-light/report}[2018/02/08 TU Delft Light Report Class]
\ProvidesClass{tudelft-light/tud-report}

\RequirePackage{iftex}
\RequireXeTeX % Raises error if not compiling with XeLaTeX

% --- Class Options: ----------------------------------------------------------
\RequirePackage{kvoptions}

Expand All @@ -50,16 +50,15 @@
% Passing all unspecified options to the report class of the LaTeX Std. Lib.
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOptionKey}{report}}
\ProcessKeyvalOptions*

\LoadClass{report}

% --- Importing TU Delft Light Packages: --------------------------------------
\RequirePackage{tudelft-light/packages}
\RequirePackage{tudelft-light/style}
\RequirePackage{tudelft-light/setup}
\RequirePackage{tudelft-light/cover}
\RequirePackage{tudelft-light/title}
\RequirePackage{tudelft-light/macros}
\RequirePackage{tudelft-light/tud-packages}
\RequirePackage{tudelft-light/tud-style}
\RequirePackage{tudelft-light/tud-setup}
\RequirePackage{tudelft-light/tud-cover}
\RequirePackage{tudelft-light/tud-title}
\RequirePackage{tudelft-light/tud-macros}

% --- Document Layout & Title Margins: ----------------------------------------
\titlespacing*{\chapter}{0pt}{-25pt}{10pt}
Expand Down
8 changes: 4 additions & 4 deletions setup.sty → tud-setup.sty
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
% -----------------------------------------------------------------------------
%
% Copyright (c) 2020. San Kilkis. All rights reserved.
%
%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/
%
% --- Package Documentation: --------------------------------------------------
%
%
% This package performs a setup of document metadata.
%
% Several macros are provided that can be called either inside or outside of
Expand All @@ -23,9 +23,9 @@
% -----------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tudelft-light/setup}
\ProvidesPackage{tudelft-light/tud-setup}

\RequirePackage{tudelft-light/style} % Needed for setup of PDF colorlinks
\RequirePackage{tudelft-light/tud-style} % Needed for setup of PDF colorlinks

% --- Document Meta-Data and Properties ---------------------------------------
\hypersetup{
Expand Down
6 changes: 3 additions & 3 deletions style.sty → tud-style.sty
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
% -----------------------------------------------------------------------------
%
% Copyright (c) 2020. San Kilkis. All rights reserved.
%
%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/
%
% --- Package Documentation: --------------------------------------------------
%
%
% This package defines colors and fonts as per the TU Delft House Style.
%
% -----------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tudelft-light/style}
\ProvidesPackage{tudelft-light/tud-style}

\RequirePackage{xcolor}
\RequirePackage{fontspec}
Expand Down
20 changes: 10 additions & 10 deletions title.sty → tud-title.sty
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
% -----------------------------------------------------------------------------
%
% Copyright (c) 2020. San Kilkis. All rights reserved.
%
%
% This Source Code Form is subject to the terms of the Mozilla Public
% License, v. 2.0. If a copy of the MPL was not distributed with this
% file, You can obtain one at http://mozilla.org/MPL/2.0/
%
% --- Package Documentation: --------------------------------------------------
%
%
% This package redefines the \maketitle macro for creating the inner titlepage.
%
%
% The basic usage is to define the title and subtitle using the \title and
% \subtitle macros followed by a call to the \maketitle macro:
%
%
% \title{An Important Topic Worth Writing About}
% \subtitle{A Very Important Report}
% \author{John Doe | 0000001, Jane Doe | 0000002}
Expand All @@ -29,10 +29,10 @@
% -----------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tudelft-light/title}
\ProvidesPackage{tudelft-light/tud-title}

\RequirePackage{tudelft-light/cover}
\RequirePackage{tudelft-light/style}
\RequirePackage{tudelft-light/tud-cover}
\RequirePackage{tudelft-light/tud-style}

\newcommand*{\@title@makeplural}[2][\relax]{%
% Makes the supplied word plural by adding an "s" suffix to it
Expand All @@ -44,7 +44,7 @@
% is given below
%
% \makeplural[\@author@itemslen]{Author}
%
%
% Optional Arguments:
% 1 (number): Number of items used to conditionally make the word plural
%
Expand All @@ -53,7 +53,7 @@
%
% Returns:
% (string): The provided string with the suffix "s" applied
%
%
\if #1\relax
% If no optional argument is provided make it plural
#2s%
Expand Down Expand Up @@ -136,4 +136,4 @@
\end{center}
\end{titlepage}
\restoregeometry
}
}

0 comments on commit 87c1708

Please sign in to comment.