Verified Commit 69dffa5b authored by Adrian C. Hinrichs's avatar Adrian C. Hinrichs
Browse files

Change Option-Procession



There is a warning, which says all Options are unused, IMHO they are used
Signed-off-by: Adrian C. Hinrichs's avatarACHinrichs <adrian-corin.hinrichs@gmx.de>
parent db9e4366
......@@ -39,7 +39,9 @@
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesClass{HomeworkAssignment}
[2017/04/29 v1.4 HomeworkAssignment]
[2017/04/29 v1.4 HomeworkAssignment]
\LoadClassWithOptions{article}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=hwa,
......@@ -49,7 +51,6 @@
\DeclareStringOption[alph]{subproblemsty}
\DeclareStringOption[roman]{subsubproblemsty}
\ProcessKeyvalOptions*
\relax \LoadClass{article}
\RequirePackage{suffix} \RequirePackage{fancyhdr}
\RequirePackage{ifthen}
......@@ -83,38 +84,22 @@
\ifthenelse{\equal{#1}{alph}}{
\renewcommand{#2}{\alph{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value #1 for option Counter-Styling}{Possible Values are alph, arabic, Arabic, roman or Roman.}
\ifthenelse{\equal{#1}{Alph}}{
\renewcommand{#2}{\Alph{#3}}
}{
\ifthenelse{\equal{#1}{Roman}}{
\renewcommand{#2}{\Roman{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value #1 for option Counter-Styling}{Possible Values are alph, arabic, Arabic, roman or Roman.}
}
}
}
}
}
}
\hwa@parseCounterStyle{\hwa@problemsty}{\hwa@problemno}{problem}
\ifthenelse{\equal{\hwa@subproblemsty}{arabic}}{
\renewcommand{\hwa@subproblemno}{\arabic{subproblem}}
}{
\ifthenelse{\equal{\hwa@subproblemsty}{roman}}{
\renewcommand{\hwa@subproblemno}{\roman{subproblem}}
}{
\ifthenelse{\equal{\hwa@subproblemsty}{alph}}{
\renewcommand{\hwa@subproblemno}{\alph{subproblem}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@subproblemsty for option subproblemsty}{Possible Values are alph, arabic, or roman. Standard is alph}
}
}
}
\ifthenelse{\equal{\hwa@subsubproblemsty}{arabic}}{
\renewcommand{\hwa@subsubproblemno}{\arabic{subsubproblem}}
}{
\ifthenelse{\equal{\hwa@subsubproblemsty}{roman}}{
\renewcommand{\hwa@subsubproblemno}{\roman{subsubproblem}}
}{
\ifthenelse{\equal{\hwa@subsubproblemsty}{alph}}{
\renewcommand{\hwa@subsubproblemno}{\alph{subsubproblem}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@subsubproblemsty for option subsubproblemsty}{Possible Values are alph, arabic, or roman. Standard is roman}
}
}
}
\hwa@parseCounterStyle{\hwa@subproblemsty}{\hwa@subproblemno}{problem}
\hwa@parseCounterStyle{\hwa@subsubproblemsty}{\hwa@subsubproblemno}{subsubproblem}
\newcommand{\hwa@kurs}{Kein Kurs}
\newcommand{\subject}[1]{\renewcommand{\hwa@kurs}{#1}}
\newcommand{\kurs}[1]{\subject{#1}}
......
......@@ -40,7 +40,8 @@
%<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<class>\ProvidesClass{HomeworkAssignment}
%<*class>
[2017/04/29 v1.4 HomeworkAssignment]
[2017/04/29 v1.4 HomeworkAssignment]
\LoadClassWithOptions{article}
%</class>
%
%<*driver>
......@@ -105,6 +106,7 @@
% \subsection{Sectioning\label{SECTIONING_CMDS}}
% \subsubsection{\enquote*{plain}
% Sectioning\label{PLAIN_SECTIONING_CMDS}}
% \subsubsection{\enquote*{better}
% Sectioning\label{BETTER_SECTIONING_CMDS}}
% \section{Pagestyle}
......@@ -129,7 +131,7 @@
% \end{description}
% \pagebreak
% \section{Implementation}
% The following part is verry boring, but i have not found a solution
% The following part is verry boring, but I have not found a solution
% to create a \texttt{.cls}--file without including the implemetation
% into the document. \StopEventually{\PrintIndex} Loads \LaTeX{}2e
% and sets the Version
......@@ -143,9 +145,7 @@
\DeclareStringOption[arabic]{problemsty}
\DeclareStringOption[alph]{subproblemsty}
\DeclareStringOption[roman]{subsubproblemsty}
%\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessKeyvalOptions*
\relax \LoadClass{article}
% \end{macrocode}
%
% Loads required Packages
......@@ -178,10 +178,15 @@
\setlength{\headheight}{25pt} }
% \end{macrocode}
% \subsection{Internal commands}
% \subsubsection{Counter--Commands}
% These are used to output the Exercise numbers in the desired style
\newcommand{\hwa@problemno}{\arabic{problem}}
\newcommand{\hwa@subproblemno}{\alph{subproblem}}
\newcommand{\hwa@subsubproblemno}{\roman{subsubproblem}}
%
% \subsubsection{Counter--Style Parser}
% This takes a style-input (#1), one of the three previous defined commands (#2) and the coresponding counter (#3) to redefine #1, so that it corresponds to #2. See \ref{RE-DEF-COUNTER-CMDS-IMPLM} for example usement
%
\newcommand{\hwa@parseCounterStyle}[3]{
\ifthenelse{\equal{#1}{arabic}}{
\renewcommand{#2}{\arabic{#3}}
......@@ -192,38 +197,26 @@
\ifthenelse{\equal{#1}{alph}}{
\renewcommand{#2}{\alph{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value #1 for option Counter-Styling}{Possible Values are alph, arabic, Arabic, roman or Roman.}
\ifthenelse{\equal{#1}{Alph}}{
\renewcommand{#2}{\Alph{#3}}
}{
\ifthenelse{\equal{#1}{Roman}}{
\renewcommand{#2}{\Roman{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value #1 for option Counter-Styling}{Possible Values are alph, arabic, Arabic, roman or Roman.}
}
}
}
}
}
}
%
% \subsubsection{Counter--Commands II\label{RE-DEF-COUNTER-CMDS-IMPLM}}
% Redefines the three counter-commands
%
\hwa@parseCounterStyle{\hwa@problemsty}{\hwa@problemno}{problem}
\ifthenelse{\equal{\hwa@subproblemsty}{arabic}}{
\renewcommand{\hwa@subproblemno}{\arabic{subproblem}}
}{
\ifthenelse{\equal{\hwa@subproblemsty}{roman}}{
\renewcommand{\hwa@subproblemno}{\roman{subproblem}}
}{
\ifthenelse{\equal{\hwa@subproblemsty}{alph}}{
\renewcommand{\hwa@subproblemno}{\alph{subproblem}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@subproblemsty for option subproblemsty}{Possible Values are alph, arabic, or roman. Standard is alph}
}
}
}
\ifthenelse{\equal{\hwa@subsubproblemsty}{arabic}}{
\renewcommand{\hwa@subsubproblemno}{\arabic{subsubproblem}}
}{
\ifthenelse{\equal{\hwa@subsubproblemsty}{roman}}{
\renewcommand{\hwa@subsubproblemno}{\roman{subsubproblem}}
}{
\ifthenelse{\equal{\hwa@subsubproblemsty}{alph}}{
\renewcommand{\hwa@subsubproblemno}{\alph{subsubproblem}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@subsubproblemsty for option subsubproblemsty}{Possible Values are alph, arabic, or roman. Standard is roman}
}
}
}
\hwa@parseCounterStyle{\hwa@subproblemsty}{\hwa@subproblemno}{problem}
\hwa@parseCounterStyle{\hwa@subsubproblemsty}{\hwa@subsubproblemno}{subsubproblem}
% \subsection{Commands}
% \begin{macro}{\subject}
% Defines |\kurs|. |\subject| equals |\kurs|
......
......@@ -39,7 +39,9 @@
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesClass{HomeworkAssignment}
[2017/04/29 v1.4 HomeworkAssignment]
[2017/04/29 v1.4 HomeworkAssignment]
\LoadClassWithOptions{article}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=hwa,
......@@ -49,7 +51,6 @@
\DeclareStringOption[alph]{subproblemsty}
\DeclareStringOption[roman]{subsubproblemsty}
\ProcessKeyvalOptions*
\relax \LoadClass{article}
\RequirePackage{suffix} \RequirePackage{fancyhdr}
\RequirePackage{ifthen}
......@@ -83,38 +84,22 @@
\ifthenelse{\equal{#1}{alph}}{
\renewcommand{#2}{\alph{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value #1 for option Counter-Styling}{Possible Values are alph, arabic, Arabic, roman or Roman.}
\ifthenelse{\equal{#1}{Alph}}{
\renewcommand{#2}{\Alph{#3}}
}{
\ifthenelse{\equal{#1}{Roman}}{
\renewcommand{#2}{\Roman{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value #1 for option Counter-Styling}{Possible Values are alph, arabic, Arabic, roman or Roman.}
}
}
}
}
}
}
\hwa@parseCounterStyle{\hwa@problemsty}{\hwa@problemno}{problem}
\ifthenelse{\equal{\hwa@subproblemsty}{arabic}}{
\renewcommand{\hwa@subproblemno}{\arabic{subproblem}}
}{
\ifthenelse{\equal{\hwa@subproblemsty}{roman}}{
\renewcommand{\hwa@subproblemno}{\roman{subproblem}}
}{
\ifthenelse{\equal{\hwa@subproblemsty}{alph}}{
\renewcommand{\hwa@subproblemno}{\alph{subproblem}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@subproblemsty for option subproblemsty}{Possible Values are alph, arabic, or roman. Standard is alph}
}
}
}
\ifthenelse{\equal{\hwa@subsubproblemsty}{arabic}}{
\renewcommand{\hwa@subsubproblemno}{\arabic{subsubproblem}}
}{
\ifthenelse{\equal{\hwa@subsubproblemsty}{roman}}{
\renewcommand{\hwa@subsubproblemno}{\roman{subsubproblem}}
}{
\ifthenelse{\equal{\hwa@subsubproblemsty}{alph}}{
\renewcommand{\hwa@subsubproblemno}{\alph{subsubproblem}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@subsubproblemsty for option subsubproblemsty}{Possible Values are alph, arabic, or roman. Standard is roman}
}
}
}
\hwa@parseCounterStyle{\hwa@subproblemsty}{\hwa@subproblemno}{problem}
\hwa@parseCounterStyle{\hwa@subsubproblemsty}{\hwa@subsubproblemno}{subsubproblem}
\newcommand{\hwa@kurs}{Kein Kurs}
\newcommand{\subject}[1]{\renewcommand{\hwa@kurs}{#1}}
\newcommand{\kurs}[1]{\subject{#1}}
......
\documentclass[a4paper,twoside,subsubproblemsty=arabic,problemsty=roman,subproblemsty=roman]{HomeworkAssignment}
\documentclass[a4paper,twoside,subsubproblemsty=Alph,problemsty=Roman,subproblemsty=arabic]{HomeworkAssignment}
\usepackage[ngerman]{babel}
\usepackage{tikz}
\usetikzlibrary{%
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment