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

add `todos` class-option

parent e2e83f16
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ All notable changes to this project will be documented in this file. ...@@ -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 - 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) 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 ### Changed
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
\newcommand{\HsHlogoPage}{1} \newcommand{\HsHlogoPage}{1}
\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} \newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
\newif\if@german% \newif\if@german%
%<article|report>\newif\if@todos\@todosfalse%
%% document options ------------------------------------------------------------------------------- %% document options -------------------------------------------------------------------------------
\DeclareOption{german}{ \DeclareOption{german}{
...@@ -61,6 +62,11 @@ ...@@ -61,6 +62,11 @@
\DeclareOption{roman}{ \DeclareOption{roman}{
\renewcommand{\familydefault}{\rmdefault} \renewcommand{\familydefault}{\rmdefault}
} }
%<*article|report>
\DeclareOption{todos}{
\@todostrue
}
%</article|report>
%<article>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}} %<article>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}}
%<report>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}} %<report>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}}
%<standalone>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{standalone}} %<standalone>\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{standalone}}
...@@ -98,7 +104,11 @@ ...@@ -98,7 +104,11 @@
% %
%<*article|report> %<*article|report>
% required for changing layout % 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} \PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry}
\fi
\RequirePackage{geometry} \RequirePackage{geometry}
% %
% language specific localisation % language specific localisation
...@@ -129,6 +139,23 @@ ...@@ -129,6 +139,23 @@
% this makes quotationmarks usable in text: % this makes quotationmarks usable in text:
\MakeOuterQuote{"} \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 % foreach loops
\RequirePackage{pgffor} \RequirePackage{pgffor}
% %
...@@ -642,6 +669,13 @@ ...@@ -642,6 +669,13 @@
isbn=false, isbn=false,
} }
}{} }{}
\@ifpackageloaded{todonotes}{
\setuptodonotes{
backgroundcolor=orange!60!white,
linecolor=orange,
bordercolor=white
}
}{}
\@ifpackageloaded{siunitx}{ \@ifpackageloaded{siunitx}{
\if@german \if@german
\sisetup{output-decimal-marker={,}} % use comma as dezimal \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 ...@@ -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. keep the page numbering consistent with the original.
- `sans` This option sets the font family to Sans Serif. - `sans` This option sets the font family to Sans Serif.
- `roman` The opposite of `sans`, sets a roman/serif font. - `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 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. their respec­tive documentations.
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
\newcommand{\HsHlogoPage}{1} \newcommand{\HsHlogoPage}{1}
\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} \newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
\newif\if@german% \newif\if@german%
\newif\if@todos\@todosfalse%
%% document options ------------------------------------------------------------------------------- %% document options -------------------------------------------------------------------------------
\DeclareOption{german}{ \DeclareOption{german}{
...@@ -62,6 +63,9 @@ ...@@ -62,6 +63,9 @@
\DeclareOption{roman}{ \DeclareOption{roman}{
\renewcommand{\familydefault}{\rmdefault} \renewcommand{\familydefault}{\rmdefault}
} }
\DeclareOption{todos}{
\@todostrue
}
\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}} \DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrartcl}}
\ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options \ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options
\ProcessOptions\relax \ProcessOptions\relax
...@@ -78,7 +82,11 @@ ...@@ -78,7 +82,11 @@
\RequirePackage{graphicx} \RequirePackage{graphicx}
\RequirePackage{amsmath} \RequirePackage{amsmath}
\if@german\RequirePackage{ziffer}\fi \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} \PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry}
\fi
\RequirePackage{geometry} \RequirePackage{geometry}
\if@german\PassOptionsToPackage{ngerman}{babel}\else\PassOptionsToPackage{english}{babel}\fi \if@german\PassOptionsToPackage{ngerman}{babel}\else\PassOptionsToPackage{english}{babel}\fi
\RequirePackage{babel} \RequirePackage{babel}
...@@ -94,6 +102,20 @@ ...@@ -94,6 +102,20 @@
\if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi \if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi
\RequirePackage{csquotes} \RequirePackage{csquotes}
\MakeOuterQuote{"} \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} \RequirePackage{pgffor}
%% options for not loaded packages ---------------------------------------------------------------- %% options for not loaded packages ----------------------------------------------------------------
\PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex} \PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex}
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
\newcommand{\HsHlogoPage}{1} \newcommand{\HsHlogoPage}{1}
\newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}} \newcommand{\includeHsHlogohere}[1][5cm]{\includegraphics[width=#1,page=\HsHlogoPage]{\HsHlogoPath}}
\newif\if@german% \newif\if@german%
\newif\if@todos\@todosfalse%
%% document options ------------------------------------------------------------------------------- %% document options -------------------------------------------------------------------------------
\DeclareOption{german}{ \DeclareOption{german}{
...@@ -62,6 +63,9 @@ ...@@ -62,6 +63,9 @@
\DeclareOption{roman}{ \DeclareOption{roman}{
\renewcommand{\familydefault}{\rmdefault} \renewcommand{\familydefault}{\rmdefault}
} }
\DeclareOption{todos}{
\@todostrue
}
\DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}} \DeclareOption*{\expandafter\PassOptionsToClass\expandafter{\CurrentOption}{scrreprt}}
\ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options \ExecuteOptions{fontsize=11pt,a4paper,ngerman,sans} % default options
\ProcessOptions\relax \ProcessOptions\relax
...@@ -78,7 +82,11 @@ ...@@ -78,7 +82,11 @@
\RequirePackage{graphicx} \RequirePackage{graphicx}
\RequirePackage{amsmath} \RequirePackage{amsmath}
\if@german\RequirePackage{ziffer}\fi \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} \PassOptionsToPackage{left=3cm,right=2.5cm,top=3cm,bottom=3cm}{geometry}
\fi
\RequirePackage{geometry} \RequirePackage{geometry}
\if@german\PassOptionsToPackage{ngerman}{babel}\else\PassOptionsToPackage{english}{babel}\fi \if@german\PassOptionsToPackage{ngerman}{babel}\else\PassOptionsToPackage{english}{babel}\fi
\RequirePackage{babel} \RequirePackage{babel}
...@@ -94,6 +102,20 @@ ...@@ -94,6 +102,20 @@
\if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi \if@german\PassOptionsToPackage{german=quotes}{csquotes}\fi
\RequirePackage{csquotes} \RequirePackage{csquotes}
\MakeOuterQuote{"} \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} \RequirePackage{pgffor}
%% options for not loaded packages ---------------------------------------------------------------- %% options for not loaded packages ----------------------------------------------------------------
\PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex} \PassOptionsToPackage{backend=biber,style=alphabetic,sorting=nyt}{biblatex}
......
...@@ -17,6 +17,13 @@ ...@@ -17,6 +17,13 @@
isbn=false, isbn=false,
} }
}{} }{}
\@ifpackageloaded{todonotes}{
\setuptodonotes{
backgroundcolor=orange!60!white,
linecolor=orange,
bordercolor=white
}
}{}
\@ifpackageloaded{siunitx}{ \@ifpackageloaded{siunitx}{
\if@german \if@german
\sisetup{output-decimal-marker={,}} % use comma as dezimal \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{color}
\usepackage{lipsum} \usepackage{lipsum}
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
\vspace{2cm}\\ \vspace{2cm}\\
eine zahl: $3,5+3.5$\footnote[1]{hello}\\ eine zahl: $3,5+3.5$\footnote[1]{hello}\\
Tiny: {\tiny hello} Small: {\small hello} Tiny: {\tiny hello} \todo{test} Small: {\small hello}
\makeatletter \makeatletter
\newcommand{\test}[1][l]{ \newcommand{\test}[1][l]{
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
\fi \fi
} }
} }
\test; \test[right] \test; \test[right] \todo{super long todo that mus be going over multiple lines}
\lipsum[5-6] \lipsum[5-6]
...@@ -81,6 +81,8 @@ ...@@ -81,6 +81,8 @@
\caption{a nice plot } \caption{a nice plot }
\end{figure} \end{figure}
test text\todo{why this?}
\begin{figure} \begin{figure}
\centering \centering
\includegraphics{crc/exampleCircuit.pdf} \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