summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/exsol
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-05-13 23:45:45 +0000
committerKarl Berry <karl@freefriends.org>2013-05-13 23:45:45 +0000
commit53fd1db4e92c7f40124c92de9c43b455aa7f29bb (patch)
tree11ccb7d70d825bbdc7041923c72034bc89cb27a8 /Master/texmf-dist/tex/latex/exsol
parenta43dfb3aaf9458a242743878b8ddb3ef995f956d (diff)
exsol (13may13)
git-svn-id: svn://tug.org/texlive/trunk@30451 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/exsol')
-rw-r--r--Master/texmf-dist/tex/latex/exsol/exsol.sty202
1 files changed, 202 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/exsol/exsol.sty b/Master/texmf-dist/tex/latex/exsol/exsol.sty
new file mode 100644
index 00000000000..129585d0ad8
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/exsol/exsol.sty
@@ -0,0 +1,202 @@
+%%
+%% This is file `exsol.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% exsol.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Copyright (C) 2012 by Walter Daems <walter.daems@ieee.org>
+%%
+%% This file may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3 of this license
+%% or (at your option) any later version. The latest version of this
+%% license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of LaTeX version
+%% 2005/12/01 or later.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{exsol}
+ [2013/05/12 v0.6 ExSol - Exercises and Solutions package (DMW)]
+\def\fileversion{0.6}
+\def\filedate{2013/05/12}
+\RequirePackage{fancyvrb}
+\RequirePackage{ifthen}
+\RequirePackage{kvoptions}
+\DeclareStringOption[normalsize]{exercisesfontsize}
+\DeclareBoolOption[false]{exerciseaslist}
+\DeclareBoolOption[false]{copyexercisesinsolutions}
+\ProcessKeyvalOptions*
+\newcommand{\exercisesfontsize}{\csname \exsol@exercisesfontsize\endcsname}
+\AtBeginDocument{
+ \newwrite\solutionstream
+ \immediate\openout\solutionstream=\jobname.sol.tex
+}
+\AtEndDocument{
+ \immediate\closeout\solutionstream
+}
+\newcounter{exercise}[subsection]
+\setcounter{exercise}{0}
+\renewcommand{\theexercise}{%
+ \@ifundefined{c@chapter}{}{\if0\arabic{chapter}\else\arabic{chapter}.\fi}%
+ \if0\arabic{section}\else\arabic{section}\fi%
+ \if0\arabic{subsection}\else.\arabic{subsection}\fi%
+ \if0\arabic{subsubsection}\else.\arabic{subsubsection}\fi%
+ \if0\arabic{exercise}\else%
+ \@ifundefined{c@chapter}%
+ {\if0\arabic{section}\else-\fi}%
+ {-}%
+ \arabic{exercise}%
+ \fi
+}
+\def\exercise{\FV@Environment{}{exercise}}
+\def\FVB@exercise{%
+ \refstepcounter{exercise}%
+ \newwrite\exercisestream
+ \immediate\openout\exercisestream=\jobname.exc.tex
+ \ifexsol@copyexercisesinsolutions
+ \typeout{Writing exercise to \jobname.sol.tex}
+ \immediate\write\solutionstream{\string\par---\string\newline
+ \string\textbf\string{\exercisename{} \theexercise \string}}
+ \else
+ \immediate\write\solutionstream{\string\par---\string\newline}
+ \fi
+ \immediate\write\exercisestream{\string\begin{exsol@exercise}}
+ \@bsphack
+ \begingroup
+ \FV@UseKeyValues
+ \FV@DefineWhiteSpace
+ \def\FV@Space{\space}%
+ \FV@DefineTabOut
+ \ifexsol@copyexercisesinsolutions
+ \def\FV@ProcessLine{\immediate\write\solutionstream{\FV@Line}%
+ \immediate\write\exercisestream}%
+ \else
+ \def\FV@ProcessLine{\immediate\write\exercisestream}%
+ \fi
+ \relax
+ \let\FV@FontScanPrep\relax
+ \let\@noligs\relax
+ \FV@Scan
+ }
+\def\FVE@exercise{
+ \endgroup\@esphack
+ \immediate\write\exercisestream{\string\end{exsol@exercise}}
+ \ifexsol@copyexercisesinsolutions
+ \immediate\write\solutionstream{\string~\string\newline}
+ \fi
+ \immediate\closeout\exercisestream
+ \input{\jobname.exc.tex}
+}
+\DefineVerbatimEnvironment{exercise}{exercise}{}
+\newenvironment{exsol@exercise}[0]
+{%
+ \begin{minipage}[t]{\textwidth}%
+ \ifthenelse{\boolean{exsol@exerciseaslist}}
+ {\begin{list}%
+ {%
+ }%
+ {%
+ \setlength{\topsep}{0pt}%
+ \setlength{\leftmargin}{1em}%
+ \setlength{\rightmargin}{1em}%
+ \setlength{\listparindent}{0em}%
+ \setlength{\itemindent}{0em}%
+ \setlength{\parsep}{\parskip}}%
+ \item[\hspace*{\leftmargin}\textit{\exercisename{}
+ \theexercise:}]
+ }%
+ {
+ \textit{\exercisename{} \theexercise:}~
+ }
+}
+{%
+ \ifthenelse{\boolean{exsol@exerciseaslist}}
+ {\end{list}}{}
+ \end{minipage}
+ \vspace{1ex}\par
+}
+\def\solution{\FV@Environment{}{solution}}
+\def\FVB@solution{%
+ \typeout{Writing solution to \jobname.sol.tex}
+ \immediate\write\solutionstream{\string\textbf\string{\solutionname{}\string}}
+ \ifexsol@copyexercisesinsolutions
+ \immediate\write\solutionstream{\string\newline}
+ \else
+ \immediate\write\solutionstream{\string\textbf\string{\theexercise\string}%
+ \string\newline}
+ \fi
+ \@bsphack
+ \begingroup
+ \FV@UseKeyValues
+ \FV@DefineWhiteSpace
+ \def\FV@Space{\space}%
+ \FV@DefineTabOut
+ \def\FV@ProcessLine{\immediate\write\solutionstream}%
+ \relax
+ \let\FV@FontScanPrep\relax
+ \let\@noligs\relax
+ \FV@Scan
+ }
+\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}
+\newcommand{\exercisename}{Exercise}
+\newcommand{\exercisesname}{Exercises}
+\newcommand{\solutionname}{Solution}
+\addto\captionsdutch{%
+ \renewcommand{\exercisename}{Oefening}%
+ \renewcommand{\exercisesname}{Oefeningen}%
+ \renewcommand{\solutionname}{Oplossing}%
+}
+\addto\captionsgerman{%
+ \renewcommand{\exercisename}{Aufgabe}%
+ \renewcommand{\exercisesname}{Aufgaben}%
+ \renewcommand{\solutionname}{L\"osung}%
+}
+\addto\captionsfrench{%
+ \renewcommand{\exercisename}{Exercice}%
+ \renewcommand{\exercisesname}{Exercices}%
+ \renewcommand{\solutionname}{Solution}%
+}
+\let\exsol@@makechapterhead\@makechapterhead
+\def\@makechapterhead#1{%
+ \immediate\write\solutionstream{\string\chapter{#1}}%
+ \exsol@@makechapterhead{#1}
+}
+\ifdefined\frontmatter
+ \let\exsol@@frontmatter\frontmatter
+ \def\frontmatter{%
+ \immediate\write\solutionstream{\string\frontmatter}%
+ \exsol@@frontmatter
+ }
+\fi
+\ifdefined\frontmatter
+ \let\exsol@@mainmatter\mainmatter
+ \def\mainmatter{%
+ \immediate\write\solutionstream{\string\mainmatter}%
+ \exsol@@mainmatter
+ }
+\fi
+\ifdefined\backmatter
+ \let\exsol@@backmatter\backmatter
+ \def\backmatter{%
+ \immediate\write\solutionstream{\string\backmatter}%
+ \exsol@@backmatter
+ }
+\fi
+\newcommand{\noexercisesinchapter}
+{
+ \immediate\write\solutionstream{No exercises in this chapter}
+}
+\endinput
+%%
+%% End of file `exsol.sty'.