From 53fd1db4e92c7f40124c92de9c43b455aa7f29bb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 13 May 2013 23:45:45 +0000 Subject: exsol (13may13) git-svn-id: svn://tug.org/texlive/trunk@30451 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/exsol/exsol.sty | 202 ++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/exsol/exsol.sty (limited to 'Master/texmf-dist/tex/latex/exsol') 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 +%% +%% 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'. -- cgit v1.2.3