I am back for more... =) I am actually trying to fix my own problems, and i feel i learn so much here. Thank you so much for helpin someone as clueless as me ^^
I am attempting to make a text, with a list of tasks. Oppgave in norwegian is the same as task. Each task should have a mandatory argument saying how much points the task is worth. The task, should also have an optional argument alt which will input the task as Alternative 1. Below is a minimal example of what I am looking for
\Oppgave{5}
\Oppgave{3}
\Oppgave{2}
\Oppgave{4}{Alt}
\Oppgave{4}{Alt}
\Oppgave{3}
\Oppgave{7}{Alt}
\Oppgave{7}{Alt}
\Oppgave{7}{Alt}
\Oppgave{9}
The output should look like this
Oppgave 1 (5 poeng)
Oppgave 2 (3 poeng)
Oppgave 3 (2 poeng)
Oppgave 4 Alternative I (4 poeng)
Oppgave 4 Alternative II (4 poeng)
Oppgave 5 (3 poeng)
Oppgave 6 Alternative I (7 poeng)
Oppgave 6 Alternative II (7 poeng)
Oppgave 6 Alternative III (7 poeng)
Oppgave 7 (9 poeng)
Here is a minimal example of my work so far.
\documentclass[10pt,a4paper]{article}
\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[norsk]{babel}
\usepackage{amsmath}
\newcounter{problem}
\setcounter{problem}{1}
\newcommand{\oppgave}[1]{\section*{Oppgave \arabic{problem} {\normalfont \normalsize (#1 poeng)}
\addcontentsline{toc}{section}{Oppgave \arabic{problem} }} \stepcounter{problem} }
\begin{document}
\tableofcontents
\oppgave{3}
\oppgave{4}
\oppgave{2}
\end{document}
