Skip to content
Snippets Groups Projects
Commit a35c153f authored by Marc Weber's avatar Marc Weber
Browse files

rewrite of ic-exercise

should also port the changes to the other classes for consistency
parent 9a4a8d01
Branches
Tags
No related merge requests found
Showing
with 196 additions and 183 deletions
......@@ -17,23 +17,23 @@ buildname = "ic-templates"
-- for each module, the build process is carried out according to config/modulename/build.lua
-- make sure, that dependencies are met by respecting the order of modules here:
modules = {
"config/ic-book",
"config/ic-thesis",
"config/ic-slides",
-- "config/ic-book",
-- "config/ic-thesis",
-- "config/ic-slides",
"config/ic-exercise",
"config/ic-thesisnotice",
"config/ic-book-template",
"config/ic-book-demo1",
"config/ic-book-demo2",
"config/ic-thesis-template",
"config/ic-thesis-demo1",
"config/ic-slides-template",
"config/ic-slides-demo1",
"config/ic-slides-demo2",
-- "config/ic-thesisnotice",
-- "config/ic-book-template",
-- "config/ic-book-demo1",
-- "config/ic-book-demo2",
-- "config/ic-thesis-template",
-- "config/ic-thesis-demo1",
-- "config/ic-slides-template",
-- "config/ic-slides-demo1",
-- "config/ic-slides-demo2",
"config/ic-exercise-template",
"config/ic-exercise-demo1",
"config/ic-thesisnotice-template",
"config/ic-thesisnotice-demo1"
-- "config/ic-thesisnotice-template",
-- "config/ic-thesisnotice-demo1"
}
......
......@@ -15,6 +15,11 @@
%% TODO: setup your document printing setup, e.g. oneside for digital copies or twopage for prints in a book format
%% INFO: for works that are being designed for use on screen, it is advised to stick with the oneside layout
oneside,
logo = blue,
% logo = black
% TODO: chose which color logo you want
% DIV=20,
% TODO: if you need more horizontal space, use the DIV option from KOMAScript
]{ic-exercise}
%% INFO: put all your customizations into a package of your own, so you can move them to other documents, and so they don't clutter up your main document. A default implementation of package customization will be shipped with the bundle.
......@@ -45,7 +50,7 @@
%% INFO: fill in your custom date or ensure the auto-updating date is intended.
%% INFO: it is common, to also include a version identifier into the \date command, e.g. v0.1, to signify changes
\date{24.12.2023}
\date{v2024.0.1}
% TODO: manually override the footer with your custom content, if desired
% \makeatletter
......@@ -63,10 +68,6 @@
% \makeatother
% create the title on first page
% you can customize the logo color by choosing one of white, black, and blue(default)
% \maketitle[%
% logo = black,%
% ]%
\maketitle
......
......@@ -16,9 +16,7 @@
% TODO: if you want to use the official RWTH fonts:
% * first change your latex engine to 'lualatex', e.g. in latexmkrc set $pdf_mode = 4
% * then uncomment the following two lines
% \RequirePackage{fontspec}
% \setsansfont{HelveticaNeueLTCom}
\ExplSyntaxOff
\usetikzlibrary{math}
......
\relax
\gdef \@abspage@last{1}
# Fdb version 4
["latex"] 0 "demo0.tex" "demo0.dvi" "demo0" 0 -1
"demo0.aux" 0 -1 0 "latex"
"demo0.tex" 0 -1 0 ""
(generated)
"demo0.aux"
"demo0.dvi"
"demo0.log"
(rewritten before read)
PWD /ws/src/ic-exercise-template
INPUT /usr/local/texlive/2024/texmf.cnf
INPUT /usr/local/texlive/2024/texmf-dist/web2c/texmf.cnf
INPUT /usr/local/texlive/2024/texmf-var/web2c/pdftex/latex.fmt
INPUT demo0.tex
OUTPUT demo0.log
......@@ -15,6 +15,11 @@
%% TODO: setup your document printing setup, e.g. oneside for digital copies or twopage for prints in a book format
%% INFO: for works that are being designed for use on screen, it is advised to stick with the oneside layout
oneside,
logo = blue,
% logo = black
% TODO: chose which color logo you want
% DIV=20,
% TODO: if you need more horizontal space, use the DIV option from KOMAScript
]{ic-exercise}
%% INFO: put all your customizations into a package of your own, so you can move them to other documents, and so they don't clutter up your main document. A default implementation of package customization will be shipped with the bundle.
......@@ -44,7 +49,7 @@
%% TODO: fill in your custom date or ensure the auto-updating date is intended.
%% INFO: it is common, to also include a version identifier into the \date command, e.g. v0.1, to signify changes
\date{24.12.2023}
\date{v2024.0.1}
% TODO: manually override the footer with your custom content, if desired
% \makeatletter
......@@ -62,10 +67,6 @@
% \makeatother
% create the title on first page
% you can customize the logo color by choosing one of white, black, and blue(default)
% \maketitle[%
% logo = black,%
% ]%
\maketitle
......
......@@ -16,9 +16,6 @@
% TODO: if you want to use the official RWTH fonts:
% * first change your latex engine to 'lualatex', e.g. in latexmkrc set $pdf_mode = 4
% * then uncomment the following two lines
% \RequirePackage{fontspec}
% \setsansfont{HelveticaNeueLTCom}
......
......@@ -2,75 +2,6 @@
\RenewDocumentCommand{\@maketitle}{ }{%
\global\@topnum=\z@
\setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
% \ifx\@titlehead\@empty \else
% \begin{minipage}[t]{\textwidth}
% \usekomafont{titlehead}{\@titlehead\par}%
% \end{minipage}\par
% \fi
\coffin_new:N \title_coffin
\vcoffin_set:Nnn {\title_coffin} {10cm} {
% \begin{center}
\ifx\@subject
\@empty
\else
{\usekomafont{subject}{\@subject \par} }%
% \vskip 0.5em
\fi
{\usekomafont{title}{ \@title \par}}%
% \vskip .5em
% {\ifx\@subtitle\@empty\else\usekomafont{subtitle}\@subtitle\par\fi}%
% \vskip 1em
% \end{center}%
}
% TODO: replace the titlehead with the logo display
\begin{tikzpicture}[
remember~picture,
overlay,
% background~rectangle /.style= {
% fill = blue,
% },
% show~background~rectangle,
inner ~ sep = 0pt,
]
\node[
inner~sep = 0,
anchor = north~east,
% draw,
] at ($(current~page.north~east) + (-6.2mm , 0mm)$) {
% DEBUG:
%\includegraphics[height=16.2mm]{example-image}
% this is the RWTH-styleguide-recommended height for documents in A4
% TODO: make logo size depend on paper size
% \includegraphics[ height=24.3mm]{\l_logoname_str}
\includegraphics[ height=24mm]{\l_logoname_str}
% INFO: the logo file already contains the Schutzraum around it
% \hspace*{4.5mm}
};
% \node [
% % draw,
% anchor = north ~ west,
% ] at ($(current~page.north ~ west) + (3.75mm, -6.075mm)$) {
% \coffin_typeset:Nnnnn \title_coffin {t} {l} { 0pt} {0pt}
% };
\end{tikzpicture}
% \null
% \vskip 4em%
% \begin{minipage}{\textwidth}
% \begin{adjustwidth}{}{\dimexpr-\marginparwidth-\marginparsep\relax}
% \box_clear_new:N \title_box
% \leavevmode\vspace{0pt}
% \par
% \vskip 2em
% \centering
{\Huge \bfseries \@title} \par
% \@subject\par
\vskip 2em
}%
\ No newline at end of file
......@@ -2,12 +2,10 @@
logo .str_set:N = \l_ic_maketitle__logo
}
\RenewDocumentCommand \maketitle { O{} } {
\group_begin:
% merge the given key-value arguments with the default values
\keys_set:nn { maketitle } {
logo = blue,
#1
}
\maketitle:
\group_end:
}
\ No newline at end of file
% define the custom maketitle typesetting
\cs_set:Nn \maketitle: {
% handle logo color with switch command:
\str_case:VnF \l_ic_maketitle__logo
{
{white}{
\str_set:Nx \l_logoname_str {rwth_ic_ \g_language_str _rgb_w}
}
{black}{
\str_set:Nx \l_logoname_str {rwth_ic_ \g_language_str _rgb_b}
}
}
{
% otherwise use the default blue version
\str_set:Nx \l_logoname_str {rwth_ic_ \g_language_str _rgb}
}
\cs_new_nopar:Nn \maketitle: {
\oldmaketitle
......
......@@ -54,28 +54,41 @@
paper .code:n = {\PassOptionsToClass{paper = #1}{scrartcl}},
paper .initial:n = a4,
paper .value_required:n = true,
% pass default value for usage of geometry
usegeometry .code:n = {\PassOptionsToClass{usegeometry = #1}{scrartcl}},
usegeometry .initial:n = {true},
usegeometry .value_required:n = true,
% handle the logo color
% this sets the default color for logos on this document, it can be overwritten at any time locally
% possible supported values are white, black and blue (any other value from white/black defauklts to blue)
logo .str_set:N = \l_ic_logo_color_str,
logo .initial:n = blue,
logo .value_required:n = true,
% handle remaining options given
unknown .code:n = {
\iow_term:x {
Passing~option~\CurrentOption \c_space_tl to~
scrartcl
}
\PassOptionsToClass { \CurrentOption } { scrartcl }
}
}
% All unkown options get passed on to the base class. This allows all options of the base KOMAScript classes to be used.
% \DeclareUnknownKeyHandler {
% \tl_if_blank:oTF {#2} {
% \ClassWarning{ic-book}{ Passing~unknown~option~'#1'~to~base~class~'\str_use:N \g_icbook__base_class_str' }
% \PassOptionsToClass { #1 } { \str_use:N \g_icbook__base_class_str }
% }
% {
% \ClassWarning{ic-book}{ Passing~unknown~key~'#1'~with~value~'#2'~to~base~class~'\str_use:N \g_icbook__base_class_str' }
% \PassOptionsToClass { #1 = #2 } { \str_use:N \g_icbook__base_class_str }
% }
% }
% \ProcessKeysOptions also handles global "class" options. This is the intended way, as we want to react to global changes e.g. language selections
% see: https://tex.stackexchange.com/a/371754/53868
% process options for this class
\ProcessKeysOptions{l3icexercise}
% \ProcessKeysOptions{l3icexercise}
% process remaining options
% \ProcessKeyOptions
% process options
\@ifundefined{ProcessKeyOptions}
{%
\RequirePackage{l3keys2e}%
\ProcessKeysOptions{l3icexercise}
}
{\ProcessKeyOptions[l3icexercise]} % use LaTeX's new interface if available
%% Pre-Package-Loading:
......@@ -134,12 +147,15 @@
% load fontspec for using custom RWTH font HelveticNeueLTCom
% NOTE: this packages mandates the use of the lualatex engine
% \RequirePackage{fontspec}
% use regular Heveltica for \sffamily, unless a way to use TTF is allowed
% \RequirePackage[scaled]{helvet}
\sys_if_engine_luatex:TF
{
\RequirePackage{fontspec}
\setsansfont{HelveticaNeueLTCom}
}
{
\RequirePackage{ClearSans}
\def\sfdefault{\clearfamily}
}
% load the typographic enhancements needed for precice optical alignment. No commands from this package are used directly, it is just optimizing kerning.
......@@ -265,7 +281,6 @@
% INFO: the subtracted lengths have been set up in order to atch the logo Schutzraum on the outside
\KOMAoption{footwidth}{\paperwidth-20mm}
\KOMAoption{footheight}{3mm}
\KOMAoption{headwidth}{\paperwidth-20mm}
......@@ -277,53 +292,44 @@
\setkomafont{pagehead}{\normalfont\footnotesize\sffamily}
\addtokomafont{pagehead}{\color{black50}}
% shift lines up:
\ModifyLayer[addvoffset=-1ex]{scrheadings.foot.above.line}
\ModifyLayer[addvoffset=-1ex]{plain.scrheadings.foot.above.line}
% create the space needed for title and header with logo by moving the typearea down a bit
\AfterCalculatingTypearea{
% % \addtolength{\evensidemargin}{0.1\textwidth}
% % \setlength{\textwidth}{0.9\textwidth}
% % \setlength{\marginparwidth}{%
% % \dimexpr 1.5\evensidemargin+0.5\marginparsep\relax}
% % \setlength{\marginparsep}{0.5\marginparsep}
\setlength{\topmargin}{-1in+24mm}
\setlength{\textheight}{\paperheight-\topmargin-1in-\headheight-\headsep-\footskip}
% \addtolength{\textheight}{0pt}
\addtolength{\footskip}{1cm}
% \addtolength{\topmargin}{-1in+2em}
% \addtolength{\headheight}{99pt}
% \setlength{\topmargin}{-1in+32mm}
% \setlength{\voffset}{-1in}
\newlength{\oldtopmargin}
\setlength{\oldtopmargin}{\topmargin}
\setlength{\topmargin}{\dimexpr -1in-\voffset +24mm\relax}
\addtolength{\textheight}{\dimexpr \oldtopmargin-\topmargin \relax}
}
\KOMAoptions{DIV=last}
% \recalctypearea
\pagestyle{plain.scrheadings}
% TODO: more space between bar and text
% TODO: better alignment of elements
% TODO: lighter color
\ExplSyntaxOff
% additional translation
\DeclareTranslation{English}{of}{of}
\DeclareTranslation{German}{of}{von}
% automatically change the siunitx locale to the currently selected language
\addto\extrasenglish{\sisetup{locale= UK}}
\addto\extrasgerman{\sisetup{locale = DE}}
% setup header and footer content
\cfoot[
\@subject {} \vertbar{}
\@title {} \vertbar{}
\@date {} \vertbar{}
\thepage~\GetTranslation{of}~\pageref{LastPage}\
\thepage~\GetTranslation{of}~\pageref*{LastPage}\
]{
\@subject {} \vertbar{}
\@title {} \vertbar{}
\@date {} \vertbar{}
\thepage~\GetTranslation{of}~\pageref{LastPage}\
\thepage~\GetTranslation{of}~\pageref*{LastPage}\
}
% \ihead{Teast}
% \chead{Test\\some\\lines}
\ExplSyntaxOn
% \setheadsepline{0.5mm}[\color{1blue}]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Setup fonts
......@@ -387,7 +393,7 @@
\setkomafont{paragraph}{\normalfont\normalcolor\normalsize\scshape}
\setkomafont{subparagraph}{\normalfont\normalcolor\normalsize\scshape}
% \setkomafont{pageheadfoot}{\normalfont\normalcolor\small\scshape}
\setkomafont{title}{\rmfamily\HUGE\bfseries}
\setkomafont{title}{\rmfamily\Huge\bfseries}
\setkomafont{subtitle}{\rmfamily\large}
\setkomafont{subject}{\rmfamily\large}
\setkomafont{author}{\rmfamily\large}
......@@ -400,6 +406,9 @@
\setkomafont{pagehead}{\normalfont\footnotesize\sffamily\lseries}
\addtokomafont{pagehead}{\color{black50}}
% process the current language option to make the locale available as string
\str_case_e:nnF { \languagename }
{
{german} {\str_gset:Nn \g_language_str {de}}
......@@ -410,11 +419,24 @@
\str_gset:Nn \g_language_str {en}
}
% process locale and color information for the correct logo choice
\cs_new_nopar:Nn \ic_logocolor_to_str:N {
\str_case:VnF #1
{
{white}{
% \str_set:Nx \l_ic_logo_str {rwth_ic_ \g_language_str _rgb_w}
_rgb_w
}
{black}{
_rgb_b
}
}
{
% otherwise use the default blue version
% TODO: implement logo color choice as option of maketitle
% \str_set:Nx \l_logoname_str {rwth_ic_ \l_logoname_language_str _rgb_b}
_rgb
}
% \str_use:N \l_ic_logo_color_str
}
\let\oldmaketitle = \maketitle
......@@ -430,10 +452,69 @@
% set pagestyle for the whole document to playin, i.e. remove page numbers
% \pagestyle{empty}
% declare a new layer to hold the logo
\DeclareNewLayer[
background,
% head,
% align=tr,
% TODO: ensure proper size of area
area={0pt}{0pt}{\paperwidth}{3cm},
contents={
% take up all horizontal space to shift the logo right
\hfill
\includegraphics[ height=24mm]{rwth_ic_ \str_use:N \g_language_str \ic_logocolor_to_str:N \l_ic_logo_color_str}
% INFO: the additional spacing of 6.2mm has been made to match the width of the footsepline and headsepline.
\hspace*{6.2mm}
}
]{ic.logohead}
% modify layer for footer to align at the bottom of the page
\ModifyLayer[
foot,
hoffset = 1cm,
align = t,
voffset=\paperheight-\dim_max:nn {\footheight} {\onelineskip},
]{plain.scrheadings.foot.oneside}
% modify the layer containing the footsepline to be just above the footer text
\ModifyLayer[
foot,
hoffset = 1cm,
align=b,
voffset=\paperheight-\dim_max:nn {\footheight} {0.7\onelineskip},
]{plain.scrheadings.foot.above.line}
% define custom pagestyles
\DeclarePageStyleByLayers[]{plain.icheadings}{
plain.scrheadings.head.odd,
plain.scrheadings.head.even,
plain.scrheadings.head.oneside,
plain.scrheadings.head.above.line,
plain.scrheadings.head.below.line,
plain.scrheadings.foot.odd,
plain.scrheadings.foot.even,
plain.scrheadings.foot.oneside,
plain.scrheadings.foot.above.line
}
\DeclarePageStyleByLayers[]{plain.icheadings.logo}{
ic.logohead,
plain.scrheadings.head.odd,
plain.scrheadings.head.even,
plain.scrheadings.head.oneside,
plain.scrheadings.head.above.line,
plain.scrheadings.head.below.line,
plain.scrheadings.foot.odd,
plain.scrheadings.foot.even,
plain.scrheadings.foot.oneside,
plain.scrheadings.foot.above.line
}
% set pagestyle for the whole document to plain, i.e. remove page numbers
\pagestyle{plain.icheadings}
% override titlepage style for scrartcl
\renewcommand*{\titlepagestyle}{scrheadings}
\RenewDocumentCommand{\titlepagestyle}{}{plain.icheadings.logo}
% \setlength{\parindent}{0pt}
......@@ -590,6 +671,8 @@
delims-eval=.|,
]
% configure mathtools to properly display ':=' as the definition operator.
\mathtoolsset{centercolon}
\input{ic.operators.document-layer.clo}
......
......@@ -111,3 +111,7 @@
\DeclareDocumentCommand \N {} {\ensuremath{\mathbb{N}}}
\DeclareDocumentCommand \Z {} {\ensuremath{\mathbb{Z}}}
\DeclareDocumentCommand \Q {} {\ensuremath{\mathbb{Q}}}
% declare a command for imaginary unit times frequency
\NewDocumentCommand \jw {} {\mathrm{j}\omega}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment