From 987336e6340e870414aea3ce425cdc39825abea8 Mon Sep 17 00:00:00 2001 From: Sebastian Kuhnert Date: Thu, 13 Nov 2008 09:09:04 +0000 Subject: add name= option for exercises --- exercisesheets.sty | 35 +++++++++++++++++++---------------- exercisesheets.tex | 8 +++++--- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/exercisesheets.sty b/exercisesheets.sty index c616277..3cbdce2 100644 --- a/exercisesheets.sty +++ b/exercisesheets.sty @@ -1,5 +1,5 @@ -\def\fileversion{0.5c} -\def\filedate{2008/11/03} +\def\fileversion{0.5d} +\def\filedate{2008/11/13} % TODO: allow \and in author and solutionsby @@ -77,6 +77,7 @@ note/.initial={}, % % additional exercise info + name/.initial={}, firstline/.initial={}, points/.initial={}, oral/.style={/exsh/points=oral},oral/.value forbidden, @@ -440,23 +441,25 @@ \pgfkeysvalueof{/exsh/points font}}% \appto\exsh@points{\egroup}% }% - \refstepcounter{section}% \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/firstline}}}{% - \@startsection{section}{1}{\z@}% - {\pgfkeysvalueof{/exsh/above exercise skip}}% - {1em}% - {\pgfkeysvalueof{/exsh/exercise title font}}% - [\pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\exsh@shortpoints]{\noindent% - \pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\exsh@points}% + \def\exsh@firstline{}% + }{% + \edef\exsh@firstline{\pgfkeysvalueof{/exsh/firstline}}% + \preto\exsh@firstline{\quad\bgroup\normalfont\normalsize}% + \appto\exsh@firstline{\egroup}% + }% + \ifthenelse{\equal{}{\pgfkeysvalueof{/exsh/name}}}{% + \def\exsh@exname{}% }{% - \@startsection{section}{1}{\z@}% - {\pgfkeysvalueof{/exsh/above exercise skip}}% - {1em}% - {\pgfkeysvalueof{/exsh/exercise title font}}% - [\pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\exsh@shortpoints]{\noindent% - \pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\quad% - {\normalfont\normalsize\pgfkeysvalueof{/exsh/firstline}}\exsh@points}% + \edef\exsh@exname{\space(\pgfkeysvalueof{/exsh/name})}% }% + \refstepcounter{section}% + \@startsection{section}{1}{\z@}% + {\pgfkeysvalueof{/exsh/above exercise skip}}% + {1em}% afterskip corrected below + {\pgfkeysvalueof{/exsh/exercise title font}}% + [\pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\exsh@exname\exsh@shortpoints]{\noindent% + \pgfkeysvalueof{/exsh/strings/exercise}~\arabic{section}\exsh@exname\exsh@firstline\exsh@points}% \unskip\vskip\pgfkeysvalueof{/exsh/below exercise title skip}\relax \@afterindentfalse \ignorespaces diff --git a/exercisesheets.tex b/exercisesheets.tex index f81e47b..c421e35 100644 --- a/exercisesheets.tex +++ b/exercisesheets.tex @@ -35,7 +35,7 @@ \title{The \exsh Package} \author{Sebastian Kuhnert} -\date{October 28th, 2008} +\date{November 13th, 2008} \begin{document} \maketitle @@ -201,8 +201,10 @@ supported: points. By default, exercises are unlabelled. \item[\option{oral}] Label this exercise as \emph{oral}. This supersedes and is superseded by the option \option{points}. - \item[\option{firstline=\param{text}}] Save some space by putting \param{text} - behind the exercise number. + \item[\option{name=\param{text}}] Use \param{text} as the name of the exercise. + Useful for exercises that prove a famous theorem. + \item[\option{firstline=\param{text}}] Save some space by text \param{text} + behind the exercise title. \item[\option{solutions\opt{=\param{true/false}}}] Use this to override the document (or sheet) default. \end{description} -- cgit v1.2.3