ich hätte da eine sehr ausgefallene Idee:
Ich würde mir gern eine neue Umgebung bauen, mit der ich im Fließtext einer Section eine Aufgabe einbauen kann, deren Lösung allerdings erst am Ende der Section eingeblendet wird.
Mit zwei getrennten Umgebungen (exercise, solution) funktioniert das auch schon ganz gut.
Gibt es eine Möglichkeit das direkt in eine Umgebung zu packen?
Danke schonmal
\documentclass[18pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{lmodern} \usepackage{kpfonts} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{makeidx} \usepackage[german]{babel} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} \usepackage{color} \usepackage{scrpage2} \automark[section]{subsection} \renewcommand*{\subsectionmark}[1]{\markleft{\subsectionmarkformat #1}} \newcounter{exercisesc} \makeatletter \@addtoreset{exercisesc}{section} \makeatother \newenvironment{exercise}{\noindent\hrulefill \\ \refstepcounter{exercisesc} \begin{flushright} \textbf{Aufgabe \thesection.\theexercisesc} \end{flushright} \begin{flushleft}} {\end{flushleft} \noindent\hrulefill} \newcounter{solutionsc} \makeatletter \@addtoreset{solutionsc}{section} \makeatother \newenvironment{solution}{\noindent\hrulefill \\ \refstepcounter{solutionsc} \begin{flushright} \textbf{Lösung \thesection.\thesolutionsc} \end{flushright} \begin{flushleft}} {\end{flushleft} \noindent\hrulefill} \begin{document} \section{Wellenausbreitung im Vakuum und in Materie} \subsection{Maxwellsche Gleichungen} \begin{align*} \nabla \cdot \vec{E}\left(\vec{r}, t \right)=\frac{\varrho\left(\vec{r}, t \right)}{\varepsilon_0} \end{align*} \begin{exercise} Something stupid \end{exercise} \subsection{Empirischer Zugang zu Wellengleichungen} \begin{exercise} Eine weitere Aufgabe \end{exercise} \subsection*{Lösungen} \begin{solution} Here is a nonstupid solution for your problem \end{solution} \begin{solution} Solution Number 2 \end{solution} \end{document}