Skip to content
Snippets Groups Projects
Commit 66e479be authored by Jan Wille's avatar Jan Wille
Browse files

add `todos` class-option

parent e2e83f16
Branches
Tags
No related merge requests found
......@@ -9,6 +9,8 @@ All notable changes to this project will be documented in this file.
- autobobble option for `listings`, which automaticly determins the indentation width and gooble it up, removing the need to put `gobble=n` manually
every time. (#8)
- `todos` class-option. Loads the `todos` package if present but also redefines its commands to have no effect when this option is omitted. Also
changes the margins to make space for the todo-notes.
### Changed
......
......@@ -29,6 +29,7 @@
\newcommand{\HsHlogoPage}{1}
\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
\newif\if@german%
%<article|report>\newif\if@todos\@todosfalse%
%% document options -------------------------------------------------------------------------------
\DeclareOption{german}{
......@@ -61,6 +62,11 @@
\DeclareOption{roman}{
\renewcommand{\familydefault}{\rmdefault}
}
%<*article|report>
\DeclareOption{todos}{
\@todostrue
}
%</article|report>
%<article>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}}
%<report>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}}
%<standalone>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{standalone}}
......@@ -98,7 +104,11 @@
%
%<*article|report>
% required for changing layout
\if@todos
\PassOptionsToPackage{left=1cm,right=5cm,top=3cm,bottom=3cm}{geometry}
\else
\PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry}
\fi
\RequirePackage{geometry}
%
% language specific localisation
......@@ -129,6 +139,23 @@
% this makes quotationmarks usable in text:
\MakeOuterQuote{"}
%
% Todonote package
% already changed the margins with geometry
\if@todos
\PassOptionsToPackage{svgnames}{xcolor}
\PassOptionsToPackage{
textwidth=4.5cm,
textsize=small,
figwidth=.6\textwidth
}{todonotes}
\RequirePackage{todonotes}
\setlength{\marginparwidth}{5.2cm}
\else
\newcommand{\listoftodos}[1][]{}
\newcommand{\todo}[2][]{}
\newcommand{\missingfigure}[2][]{}
\fi
%
% foreach loops
\RequirePackage{pgffor}
%
......@@ -642,6 +669,13 @@
isbn=false,
}
}{}
\@ifpackageloaded{todonotes}{
\setuptodonotes{
backgroundcolor=orange!60!white,
linecolor=orange,
bordercolor=white
}
}{}
\@ifpackageloaded{siunitx}{
\if@german
\sisetup{output-decimal-marker={,}} % use comma as dezimal
......
......@@ -104,6 +104,9 @@ If you don't define something different, the classes set your project up to use
keep the page numbering consistent with the original.
- `sans` This option sets the font family to Sans Serif.
- `roman` The opposite of `sans`, sets a roman/serif font.
- `todos` This enables the [`todonotes`](http://tug.ctan.org/macros/latex/contrib/todonotes/todonotes.pdf) package and allows you to use the `\todo{}`
command. It is set up in a way that removing this option allows you to still leave `\todos`'s in your code without breaking. DO NOT combine this
with the `twoside` option!
All remaining options are passed along to the respective subclasses and processed there. This means, that you can use all the options described in
their respec­tive documentations.
......
......@@ -30,6 +30,7 @@
\newcommand{\HsHlogoPage}{1}
\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
\newif\if@german%
\newif\if@todos\@todosfalse%
%% document options -------------------------------------------------------------------------------
\DeclareOption{german}{
......@@ -62,6 +63,9 @@
\DeclareOption{roman}{
\renewcommand{\familydefault}{\rmdefault}
}
\DeclareOption{todos}{
\@todostrue
}
\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}}
\ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options
\ProcessOptions\relax
......@@ -78,7 +82,11 @@
\RequirePackage{graphicx}
\RequirePackage{amsmath}
\if@german\RequirePackage{ziffer}\fi
\if@todos
\PassOptionsToPackage{left=1cm,right=5cm,top=3cm,bottom=3cm}{geometry}
\else
\PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry}
\fi
\RequirePackage{geometry}
\if@german\PassOptionsToPackage{ngerman}{babel}\else\PassOptionsToPackage{english}{babel}\fi
\RequirePackage{babel}
......@@ -94,6 +102,20 @@
\if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi
\RequirePackage{csquotes}
\MakeOuterQuote{"}
\if@todos
\PassOptionsToPackage{svgnames}{xcolor}
\PassOptionsToPackage{
textwidth=4.5cm,
textsize=small,
figwidth=.6\textwidth
}{todonotes}
\RequirePackage{todonotes}
\setlength{\marginparwidth}{5.2cm}
\else
\newcommand{\listoftodos}[1][]{}
\newcommand{\todo}[2][]{}
\newcommand{\missingfigure}[2][]{}
\fi
\RequirePackage{pgffor}
%% options for not loaded packages ----------------------------------------------------------------
\PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex}
......
......@@ -30,6 +30,7 @@
\newcommand{\HsHlogoPage}{1}
\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
\newif\if@german%
\newif\if@todos\@todosfalse%
%% document options -------------------------------------------------------------------------------
\DeclareOption{german}{
......@@ -62,6 +63,9 @@
\DeclareOption{roman}{
\renewcommand{\familydefault}{\rmdefault}
}
\DeclareOption{todos}{
\@todostrue
}
\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}}
\ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options
\ProcessOptions\relax
......@@ -78,7 +82,11 @@
\RequirePackage{graphicx}
\RequirePackage{amsmath}
\if@german\RequirePackage{ziffer}\fi
\if@todos
\PassOptionsToPackage{left=1cm,right=5cm,top=3cm,bottom=3cm}{geometry}
\else
\PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry}
\fi
\RequirePackage{geometry}
\if@german\PassOptionsToPackage{ngerman}{babel}\else\PassOptionsToPackage{english}{babel}\fi
\RequirePackage{babel}
......@@ -94,6 +102,20 @@
\if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi
\RequirePackage{csquotes}
\MakeOuterQuote{"}
\if@todos
\PassOptionsToPackage{svgnames}{xcolor}
\PassOptionsToPackage{
textwidth=4.5cm,
textsize=small,
figwidth=.6\textwidth
}{todonotes}
\RequirePackage{todonotes}
\setlength{\marginparwidth}{5.2cm}
\else
\newcommand{\listoftodos}[1][]{}
\newcommand{\todo}[2][]{}
\newcommand{\missingfigure}[2][]{}
\fi
\RequirePackage{pgffor}
%% options for not loaded packages ----------------------------------------------------------------
\PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex}
......
......@@ -17,6 +17,13 @@
isbn=false,
}
}{}
\@ifpackageloaded{todonotes}{
\setuptodonotes{
backgroundcolor=orange!60!white,
linecolor=orange,
bordercolor=white
}
}{}
\@ifpackageloaded{siunitx}{
\if@german
\sisetup{output-decimal-marker={,}} % use comma as dezimal
......
No preview for this file type
\documentclass[twoside,f1]{HsH-report}
\documentclass[todos,f1]{HsH-report}
\usepackage{color}
\usepackage{lipsum}
......@@ -58,7 +58,7 @@
\vspace{2cm}\\
eine zahl: $3,5+3.5$\footnote[1]{hello}\\
Tiny: {\tiny hello} Small: {\small hello}
Tiny: {\tiny hello} \todo{test} Small: {\small hello}
\makeatletter
\newcommand{\test}[1][l]{
......@@ -70,7 +70,7 @@
\fi
}
}
\test; \test[right]
\test; \test[right] \todo{super long todo that mus be going over multiple lines}
\lipsum[5-6]
......@@ -81,6 +81,8 @@
\caption{a nice plot }
\end{figure}
test text\todo{why this?}
\begin{figure}
\centering
\includegraphics{crc/exampleCircuit.pdf}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment