diff options
author | Karl Berry <karl@freefriends.org> | 2014-08-30 21:39:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-08-30 21:39:23 +0000 |
commit | 576d771fa1ee205c48a93cdeeff84ae6eec69f58 (patch) | |
tree | 1514af48ae02e293b6841570c32806c70e2051cf | |
parent | 30819b8aa56e702e34aaaa8d288e4a246b1b5c0c (diff) |
exsol (30aug14)
git-svn-id: svn://tug.org/texlive/trunk@35071 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/exsol/exsol.pdf | bin | 250637 -> 256889 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/exsol/exsol.dtx | 154 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/exsol/exsol.sty | 56 |
3 files changed, 166 insertions, 44 deletions
diff --git a/Master/texmf-dist/doc/latex/exsol/exsol.pdf b/Master/texmf-dist/doc/latex/exsol/exsol.pdf Binary files differindex 95da401bdba..2dbb52814f3 100644 --- a/Master/texmf-dist/doc/latex/exsol/exsol.pdf +++ b/Master/texmf-dist/doc/latex/exsol/exsol.pdf diff --git a/Master/texmf-dist/source/latex/exsol/exsol.dtx b/Master/texmf-dist/source/latex/exsol/exsol.dtx index a0c1538c422..236f934340c 100644 --- a/Master/texmf-dist/source/latex/exsol/exsol.dtx +++ b/Master/texmf-dist/source/latex/exsol/exsol.dtx @@ -29,7 +29,7 @@ %<package|driver>\NeedsTeXFormat{LaTeX2e} %<driver>\ProvidesFile{exsol.dtx} %<package>\ProvidesPackage{exsol} -%<package|driver> [2013/05/12 v0.6 ExSol - Exercises and Solutions package (DMW)] +%<package|driver> [2014/08/31 v0.91 ExSol - Exercises and Solutions package (DMW)] %<*driver> \documentclass[11pt]{ltxdoc} \usepackage[english]{babel} @@ -47,8 +47,8 @@ \RecordChanges \newcommand{\exsol}{\textsf{ExSol}} \StopEventually{\PrintChanges\PrintIndex} -\def\fileversion{0.8} -\def\filedate{2014/07/15} +\def\fileversion{0.91} +\def\filedate{2014/08/31} \begin{document} \DocInput{exsol.dtx} \end{document} @@ -89,6 +89,7 @@ % of write hanles} % \changes{v0.9}{2014/07/28}{. Changed default behavior % w.r.t. minipage-wraping of exercises} +% \changes{v0.91}{2014/08/31}{. Corrected minipage dependence, made } % % \DoNotIndex{\newcommand,\newenvironment} % \setlength{\parindent}{0em} @@ -186,7 +187,6 @@ % 5 x^2 -3 x = 5 % \end{equation} % \end{exercise} -% % \begin{solution} % Let's start by rearranging the equation, a bit: % \begin{eqnarray} @@ -217,7 +217,6 @@ % \end{eqnarray} % The proposed values $x = x_1, x_2$ are solutions to the given equation. % \end{solution} -% % \begin{exercise} % Consider a 2-dimensional vector space equipped with a Euclidean % distance function. Given a right-angled triangle, with the sides @@ -255,7 +254,7 @@ % \texttt{exsol.sol.tex}), containing all solutions in sequence. % % Generating a solution book is a simple as including the file into a -% simple harness, that allows you giving it a proper title page and to +% simple \LaTeX{} harness, that allows you giving it a proper title page and to % add other bells and whistles. % % E.g., @@ -336,15 +335,84 @@ % % \rule{\linewidth}{.7pt} % +% \subsection{Fiddling with the spacing} +% +% The default spacing provided by the \textsf{ExSol} package should be +% fine for most users. However, if you like to tweak, below you can +% find the controls. +% \subsubsection{Spacing before and after the \texttt{exercises} environment} +% +% The lengths below control the spacing of the |exercises| environment: +% \begin{itemize} +% \item |exsolexerciseaboveskip|: rubber length controlling the +% vertical space after the top marker line of the environment +% \item |exsolexercisebelowskip|: rubber length controlling the +% vertical space before the bottom marker line of the environment +% \end{itemize} +% +% You can simply specify them like: +% \begin{verbatim} +% \setlength{\exsolexercisesaboveskip}{1ex plus 1pt minus 1pt} +% \setlength{\exsolexercisesbelowskip}{1ex plus 1pt minus 1pt} +% \end{verbatim} +% The spacings specified here are the package defaults. +% +% \subsubsection{Spacing of the individual exercises} +% Caution: the spacing can only be tuned, when one invokes the +% |exerciseaslist| package option! +% +% Then lengths below control the spacing of the |exercise| environment: +% \begin{itemize} +% \item |exercisetopbottomsep|: rubber length controlling the vertical +% space before and after individual exercises +% \item |exerciseleftmargin|: length controlling the horizontal +% space between the surrounding environment's left margin (most +% often the page margin) and the left edge of the exercise +% environment +% \item |exerciseleftmargin|: length controlling the horizontal +% space between the surrounding environment's right margin (most +% often the page margin) and the right edge of the exercise +% environment +% \item |exerciseitemindent|: length controlling the first-line +% indentation of the first paragraph in the exercise environment +% (actually, the label is set w.r.t. this position, that we will +% conveniently call position 'x') +% \item |exerciseparindent|: length controlling the first-line +% indentation of the other paragraphs in the exercise environment. +% \item |exerciselabelsep|: length controlling the distance between +% the label and position 'x' +% \item |exerciselabelwidth|: minimal width of the (internally +% right-alligned) box to use for the exercises label; if the box is +% not sufficiently big, position 'x' is shifted to the right +% \item |exerciseparsep|: internal paragraph separation (vertically) +% \end{itemize} +% +% You can simply specify them like: +% \begin{verbatim} +% \setlength{\exsolexercisetopbottomsep}{0pt plus 0pt minus 1pt} +% \setlength{\exsolexerciseleftmargin}{1em} +% \setlength{\exsolexerciserightmargin}{1em} +% \setlength{\exsolexerciseparindent}{0em} +% \setlength{\exsolexerciselabelsep}{0.5em} +% \setlength{\exsolexerciselabelwidth}{0pt} +% \setlength{\exsolexerciseitemindent}{0pt} +% \setlength{\exsolexerciseparsep}{\parskip} +% \end{verbatim} +% The spacings specified here are the package defaults. +% % \subsection{Tips and tricks} % -% Just one for now: if you want to include the solutions all at the +% If you want to include the solutions all at the % end of the current document, you need to explicitly close the % solution stream before including it: % \begin{verbatim} % \closeout\solutionstream\input{\jobname.sol.tex} % \end{verbatim} % +% If you want to avoid exercises being split by a page boundary, then +% provide the package option 'minipage'. This causes the exercises to +% be wrapped in a minipage environment. +% % \clearpage % % \section{Implementation} @@ -423,6 +491,44 @@ \newcommand{\exercisesfontsize}{\csname \exsol@exercisesfontsize\endcsname} % \end{macrocode} % +% +% \subsection{Customization of lengths} +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The commands below allow customizing many lengths that control the +% typesetting of the exercises. +% +% \changes{v0.91}{2014/08/31}{added user-accessible lengths} +% First some lengths to control the spacing before and after |exercises|. +% \begin{macrocode} +\newlength{\exsolexercisesaboveskip} +\setlength{\exsolexercisesaboveskip}{1ex plus 1pt minus 1pt} +\newlength{\exsolexercisesbelowskip} +\setlength{\exsolexercisesbelowskip}{1ex plus 1pt minus 1pt} +% \end{macrocode} +% +% Then some lengths to control the spacing for a single +% exercise. These lengths only work when the |exerciseaslist| package +% option has been specified. Sensible defaults have been set. +% \begin{macrocode} +\newlength{\exsolexercisetopbottomsep} +\setlength{\exsolexercisetopbottomsep}{0pt plus 0pt minus 1pt} +\newlength{\exsolexerciseleftmargin} +\setlength{\exsolexerciseleftmargin}{1em} +\newlength{\exsolexerciserightmargin} +\setlength{\exsolexerciserightmargin}{1em} +\newlength{\exsolexerciseparindent} +\setlength{\exsolexerciseparindent}{0em} +\newlength{\exsolexerciselabelsep} +\setlength{\exsolexerciselabelsep}{0.5em} +\newlength{\exsolexerciselabelwidth} +\setlength{\exsolexerciselabelwidth}{0pt} +\newlength{\exsolexerciseitemindent} +\setlength{\exsolexerciseitemindent}{0pt} +\newlength{\exsolexerciseparsep} +\setlength{\exsolexerciseparsep}{\parskip} +% \end{macrocode} +% +% % \subsection{Con- and destruction of the auxiliary streams} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % At the beginning of your document, we start by opening a stream to a @@ -558,24 +664,22 @@ {% }% {% - \setlength{\topsep}{0pt}% - \setlength{\leftmargin}{1em}% - \setlength{\rightmargin}{1em}% - \setlength{\listparindent}{0em}% - \setlength{\itemindent}{0em}% - \setlength{\parsep}{\parskip}}% - \item[\hspace*{\leftmargin}\textit{\exercisename{} - \theexercise:}] + \setlength{\topsep}{\exsolexercisetopbottomsep}% + \setlength{\leftmargin}{\exsolexerciseleftmargin}% + \setlength{\rightmargin}{\exsolexerciserightmargin}% + \setlength{\listparindent}{\exsolexerciseparindent}% + \setlength{\itemindent}{\exsolexerciseitemindent}% + \setlength{\parsep}{\exsolexerciseparsep} + \setlength{\labelsep}{\exsolexerciselabelsep} + \setlength{\labelwidth}{\exsolexerciselabelwidth}} + \item[\textit{~\exercisename{} \theexercise:~}] }% - { - \textit{\exercisename{} \theexercise:}~ - } + {\textit{\exercisename{} \theexercise:}} } {% - \ifthenelse{\boolean{exsol@exerciseaslist}} - {\end{list}}{} - \ifthenelse{\boolean{exsol@minipage}}{\end{minipage}}{} - \vspace{1ex}\par + \ifthenelse{\boolean{exsol@exerciseaslist}}% + {\end{list}}{}% + \ifthenelse{\boolean{exsol@minipage}}{\end{minipage}}{\par}% } % \end{macrocode} % \end{macro} @@ -624,9 +728,9 @@ % \changes{v0.3}{2012/01/07}{Added some extra whitespace below exercisesname} % \begin{macrocode} \newenvironment{exercises} -{\par\exercisesfontsize\rule{.25\linewidth}{0.15mm}\\*~\\*% - \textbf{\normalsize \exercisesname}\vspace*{1ex}\\} -{~\\*\rule{.25\linewidth}{0.15mm}\par} +{\par\exercisesfontsize\rule{.25\linewidth}{0.15mm}\vspace*{\exsolexercisesaboveskip}\\*% + \textbf{\normalsize \exercisesname}} +{\vspace*{-\baselineskip}\vspace*{\exsolexercisesbelowskip}\rule{.25\linewidth}{0.15mm}\par} % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/tex/latex/exsol/exsol.sty b/Master/texmf-dist/tex/latex/exsol/exsol.sty index 94f5fc2fc12..4afcf4b74b8 100644 --- a/Master/texmf-dist/tex/latex/exsol/exsol.sty +++ b/Master/texmf-dist/tex/latex/exsol/exsol.sty @@ -22,7 +22,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{exsol} - [2013/05/12 v0.6 ExSol - Exercises and Solutions package (DMW)] + [2014/08/31 v0.91 ExSol - Exercises and Solutions package (DMW)] \RequirePackage{fancyvrb} \RequirePackage{ifthen} \RequirePackage{kvoptions} @@ -32,6 +32,26 @@ \DeclareBoolOption[false]{minipage} \ProcessKeyvalOptions* \newcommand{\exercisesfontsize}{\csname \exsol@exercisesfontsize\endcsname} +\newlength{\exsolexercisesaboveskip} +\setlength{\exsolexercisesaboveskip}{1ex plus 1pt minus 1pt} +\newlength{\exsolexercisesbelowskip} +\setlength{\exsolexercisesbelowskip}{1ex plus 1pt minus 1pt} +\newlength{\exsolexercisetopbottomsep} +\setlength{\exsolexercisetopbottomsep}{0pt plus 0pt minus 1pt} +\newlength{\exsolexerciseleftmargin} +\setlength{\exsolexerciseleftmargin}{1em} +\newlength{\exsolexerciserightmargin} +\setlength{\exsolexerciserightmargin}{1em} +\newlength{\exsolexerciseparindent} +\setlength{\exsolexerciseparindent}{0em} +\newlength{\exsolexerciselabelsep} +\setlength{\exsolexerciselabelsep}{0.5em} +\newlength{\exsolexerciselabelwidth} +\setlength{\exsolexerciselabelwidth}{0pt} +\newlength{\exsolexerciseitemindent} +\setlength{\exsolexerciseitemindent}{0pt} +\newlength{\exsolexerciseparsep} +\setlength{\exsolexerciseparsep}{\parskip} \AtBeginDocument{ \newwrite\solutionstream \immediate\openout\solutionstream=\jobname.sol.tex @@ -107,24 +127,22 @@ {% }% {% - \setlength{\topsep}{0pt}% - \setlength{\leftmargin}{1em}% - \setlength{\rightmargin}{1em}% - \setlength{\listparindent}{0em}% - \setlength{\itemindent}{0em}% - \setlength{\parsep}{\parskip}}% - \item[\hspace*{\leftmargin}\textit{\exercisename{} - \theexercise:}] + \setlength{\topsep}{\exsolexercisetopbottomsep}% + \setlength{\leftmargin}{\exsolexerciseleftmargin}% + \setlength{\rightmargin}{\exsolexerciserightmargin}% + \setlength{\listparindent}{\exsolexerciseparindent}% + \setlength{\itemindent}{\exsolexerciseitemindent}% + \setlength{\parsep}{\exsolexerciseparsep} + \setlength{\labelsep}{\exsolexerciselabelsep} + \setlength{\labelwidth}{\exsolexerciselabelwidth}} + \item[\textit{~\exercisename{} \theexercise:~}] }% - { - \textit{\exercisename{} \theexercise:}~ - } + {\textit{\exercisename{} \theexercise:}} } {% - \ifthenelse{\boolean{exsol@exerciseaslist}} - {\end{list}}{} - \ifthenelse{\boolean{exsol@minipage}}{\end{minipage}}{} - \vspace{1ex}\par + \ifthenelse{\boolean{exsol@exerciseaslist}}% + {\end{list}}{}% + \ifthenelse{\boolean{exsol@minipage}}{\end{minipage}}{\par}% } \def\solution{\FV@Environment{}{solution}} \def\FVB@solution{% @@ -151,9 +169,9 @@ \def\FVE@solution{\endgroup\@esphack} \DefineVerbatimEnvironment{solution}{solution}{} \newenvironment{exercises} -{\par\exercisesfontsize\rule{.25\linewidth}{0.15mm}\\*~\\*% - \textbf{\normalsize \exercisesname}\vspace*{1ex}\\} -{~\\*\rule{.25\linewidth}{0.15mm}\par} +{\par\exercisesfontsize\rule{.25\linewidth}{0.15mm}\vspace*{\exsolexercisesaboveskip}\\*% + \textbf{\normalsize \exercisesname}} +{\vspace*{-\baselineskip}\vspace*{\exsolexercisesbelowskip}\rule{.25\linewidth}{0.15mm}\par} \newcommand{\exercisename}{Exercise} \newcommand{\exercisesname}{Exercises} \newcommand{\solutionname}{Solution} |