summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/exercises/exercises.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/exercises/exercises.dtx')
-rw-r--r--macros/latex/contrib/exercises/exercises.dtx68
1 files changed, 63 insertions, 5 deletions
diff --git a/macros/latex/contrib/exercises/exercises.dtx b/macros/latex/contrib/exercises/exercises.dtx
index d818e495e6..4ec2313f34 100644
--- a/macros/latex/contrib/exercises/exercises.dtx
+++ b/macros/latex/contrib/exercises/exercises.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015 by Roger Jud <rogerjud@outlook.com>
+% Copyright (C) 2000 by Roger Jud <rogerjud@outlook.com>
% -------------------------------------------------------
%
% This file may be distributed and/or modified under the
@@ -17,7 +17,7 @@
%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<package>\ProvidesPackage{exercises}[2015/09/19 v1.0 .dtx exercises file]
+%<package>\ProvidesPackage{exercises}[2000/05/17 v1.1 .dtx exercises file]
%
%<*driver>
\documentclass[a4paper]{ltxdoc}
@@ -29,7 +29,7 @@ filecolor=black,%
linkcolor=black,%
urlcolor=black,%
}
-\usepackage[printsolution=true]{exercises}[2015/09/19]
+\usepackage[printsolution=true]{exercises}[2000/05/17]
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
@@ -71,6 +71,7 @@ urlcolor=black,%
%
%
% \changes{v1.0}{2015/09/19}{Initial version}
+% \changes{v1.1}{2000/05/17}{Add the command ifsolutionthenelse}
%
% \GetFileInfo{exercises.sty}
%
@@ -312,11 +313,55 @@ Sum of points: \totalpoints
%
%
%
+% \subsection{Print text depending on wether the solution is printed or not}
+% With the command |\ifsolutionthenelse{}{}| you can print text depending on wether the solution is printed or not.
%
-%
+% \iffalse
+%<*example>
+% \fi
+\begin{latexcode}
+\usepackage[printsolution=true]{exercises}
+\ifsolutionthenelse{%
+ \subsection*{This is the header for the solutions}%
+ }%
+ {%
+ \subsection*{This is the header for the exercises}%
+ }
+\end{latexcode}
+% \iffalse
+%</example>
+% \fi
+%
+% \emph{produces}
+%
+% \subsection*{This is the header for the solutions}
+%
+%
+% \emph{while}
%
%
%
+%
+% \iffalse
+%<*example>
+% \fi
+\begin{latexcode}
+\usepackage[printsolution=false]{exercises}
+\ifsolutionthenelse{%
+ \subsection*{This is the header for the solutions}%
+ }%
+ {%
+ \subsection*{This is the header for the exercises}%
+ }
+\end{latexcode}
+% \iffalse
+%</example>
+% \fi
+%
+% \emph{produces}
+%
+% \subsection*{This is the header for the exercises}
+%
% \StopEventually{\PrintChanges}
%
% \section[Implementation]{Implementation -- how I've done it (only in German)}
@@ -923,7 +968,7 @@ Sum of points: \totalpoints
%
% \begin{macro}{\exercisenewpage}
% \begin{macro}{\solutionnewpage}
-% Die Befehle |exercisenewpage| und |solutionnewpage| erlauben es, einen Seitenumbruch in abhängigkeit der Lösungsausgabe einzufügen.
+% Die Befehle |exercisenewpage| und |solutionnewpage| erlauben es, einen Seitenumbruch in Abhängigkeit der Lösungsausgabe einzufügen.
% \begin{macrocode}
\newcommand{\exercisenewpage}{\ifthenelse{\boolean{exercises@printsolution}}{}{\newpage}}
% \end{macrocode}
@@ -934,5 +979,18 @@ Sum of points: \totalpoints
% \end{macro}
% \end{macro}
%
+%
+%
+% \subsection{Befehl für die bedingte Textausgabe}
+%
+% \begin{macro}{\ifsolutionthenelse}
+% Der Befehl |ifsolutionthenelse{}{}| erlaubt es, Text in Abhängigkeit der Lösungsausgabe auszugeben.
+% \begin{macrocode}
+\newcommand{\ifsolutionthenelse}[2]{\ifthenelse{\boolean{exercises@printsolution}}{#1}{#2}}
+% \end{macrocode}
+%
+% \end{macro}
+
+%
% \Finale
\endinput