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

Start to implement macro for Counter-style

parent c190e23e
......@@ -45,6 +45,7 @@
family=hwa,
prefix=hwa@
}
\DeclareStringOption[arabic]{problemsty}
\DeclareStringOption[alph]{subproblemsty}
\DeclareStringOption[roman]{subsubproblemsty}
\ProcessKeyvalOptions*
......@@ -72,19 +73,22 @@
\newcommand{\hwa@problemno}{\arabic{problem}}
\newcommand{\hwa@subproblemno}{\alph{subproblem}}
\newcommand{\hwa@subsubproblemno}{\roman{subsubproblem}}
\ifthenelse{\equal{\hwa@problemsty}{arabic}}{
\renewcommand{\hwa@problemno}{\arabic{problem}}
}{
\ifthenelse{\equal{\hwa@problemsty}{roman}}{
\renewcommand{\hwa@problemno}{\roman{problem}}
\newcommand{\hwa@parseCounterStyle}[3]{
\ifthenelse{\equal{#1}{arabic}}{
\renewcommand{#2}{\arabic{#3}}
}{
\ifthenelse{\equal{\hwa@problemsty}{alph}}{
\renewcommand{\hwa@problemno}{\alph{problem}}
\ifthenelse{\equal{#1}{roman}}{
\renewcommand{#2}{\roman{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@problemsty for option problemSty}{Possible Values are alph, arabic, or roman. Standard is arabic}
\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.}
}
}
}
}
\hwa@parseCounterStyle{\hwa@problemsty}{\hwa@problemno}{problem}
\ifthenelse{\equal{\hwa@subproblemsty}{arabic}}{
\renewcommand{\hwa@subproblemno}{\arabic{subproblem}}
}{
......
......@@ -140,6 +140,7 @@
family=hwa,
prefix=hwa@
}
\DeclareStringOption[arabic]{problemsty}
\DeclareStringOption[alph]{subproblemsty}
\DeclareStringOption[roman]{subsubproblemsty}
%\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
......@@ -181,19 +182,22 @@
\newcommand{\hwa@problemno}{\arabic{problem}}
\newcommand{\hwa@subproblemno}{\alph{subproblem}}
\newcommand{\hwa@subsubproblemno}{\roman{subsubproblem}}
\ifthenelse{\equal{\hwa@problemsty}{arabic}}{
\renewcommand{\hwa@problemno}{\arabic{problem}}
}{
\ifthenelse{\equal{\hwa@problemsty}{roman}}{
\renewcommand{\hwa@problemno}{\roman{problem}}
\newcommand{\hwa@parseCounterStyle}[3]{
\ifthenelse{\equal{#1}{arabic}}{
\renewcommand{#2}{\arabic{#3}}
}{
\ifthenelse{\equal{\hwa@problemsty}{alph}}{
\renewcommand{\hwa@problemno}{\alph{problem}}
\ifthenelse{\equal{#1}{roman}}{
\renewcommand{#2}{\roman{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@problemsty for option problemSty}{Possible Values are alph, arabic, or roman. Standard is arabic}
\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.}
}
}
}
}
\hwa@parseCounterStyle{\hwa@problemsty}{\hwa@problemno}{problem}
\ifthenelse{\equal{\hwa@subproblemsty}{arabic}}{
\renewcommand{\hwa@subproblemno}{\arabic{subproblem}}
}{
......
......@@ -45,6 +45,7 @@
family=hwa,
prefix=hwa@
}
\DeclareStringOption[arabic]{problemsty}
\DeclareStringOption[alph]{subproblemsty}
\DeclareStringOption[roman]{subsubproblemsty}
\ProcessKeyvalOptions*
......@@ -72,19 +73,22 @@
\newcommand{\hwa@problemno}{\arabic{problem}}
\newcommand{\hwa@subproblemno}{\alph{subproblem}}
\newcommand{\hwa@subsubproblemno}{\roman{subsubproblem}}
\ifthenelse{\equal{\hwa@problemsty}{arabic}}{
\renewcommand{\hwa@problemno}{\arabic{problem}}
}{
\ifthenelse{\equal{\hwa@problemsty}{roman}}{
\renewcommand{\hwa@problemno}{\roman{problem}}
\newcommand{\hwa@parseCounterStyle}[3]{
\ifthenelse{\equal{#1}{arabic}}{
\renewcommand{#2}{\arabic{#3}}
}{
\ifthenelse{\equal{\hwa@problemsty}{alph}}{
\renewcommand{\hwa@problemno}{\alph{problem}}
\ifthenelse{\equal{#1}{roman}}{
\renewcommand{#2}{\roman{#3}}
}{
\ClassError{HomeworkAssignment}{Invalid Value \hwa@problemsty for option problemSty}{Possible Values are alph, arabic, or roman. Standard is arabic}
\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.}
}
}
}
}
\hwa@parseCounterStyle{\hwa@problemsty}{\hwa@problemno}{problem}
\ifthenelse{\equal{\hwa@subproblemsty}{arabic}}{
\renewcommand{\hwa@subproblemno}{\arabic{subproblem}}
}{
......
\documentclass[a4paper,twoside,subproblemsty=alph]{HomeworkAssignment}
\documentclass[a4paper,twoside,subsubproblemsty=arabic,problemsty=roman,subproblemsty=roman]{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