summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/answers/ansexam1.tex34
-rw-r--r--Master/texmf-dist/doc/latex/answers/ansexam2.tex62
-rw-r--r--Master/texmf-dist/doc/latex/answers/ansexam3.tex40
-rw-r--r--Master/texmf-dist/doc/latex/answers/answers.pdfbin227626 -> 211493 bytes
-rw-r--r--Master/texmf-dist/source/latex/answers/answers.dtx29
-rw-r--r--Master/texmf-dist/tex/latex/answers/answers.sty18
6 files changed, 41 insertions, 142 deletions
diff --git a/Master/texmf-dist/doc/latex/answers/ansexam1.tex b/Master/texmf-dist/doc/latex/answers/ansexam1.tex
deleted file mode 100644
index 7c66156daad..00000000000
--- a/Master/texmf-dist/doc/latex/answers/ansexam1.tex
+++ /dev/null
@@ -1,34 +0,0 @@
-%%
-%% This is file `ansexam1.tex',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% answers.dtx (with options: `ex1')
-%%
-\documentclass[12pt,a4paper]{article}
-\usepackage{answers}
-\Newassociation{sol}{Solution}{ans}
-\newtheorem{ex}{Exercise}
-\begin{document}
-\Opensolutionfile{ans}[ans1]
-\section{Problems}
-\begin{ex}
- First exercise
- \begin{sol}
- First solution.
- \end{sol}
-\end{ex}
-\begin{ex}
- Second exercise
- \begin{sol}
- Second solution.
- \end{sol}
-\end{ex}
-\Closesolutionfile{ans}
-\section{Solutions}
-\input{ans1}
-\end{document}
-\endinput
-%%
-%% End of file `ansexam1.tex'.
diff --git a/Master/texmf-dist/doc/latex/answers/ansexam2.tex b/Master/texmf-dist/doc/latex/answers/ansexam2.tex
deleted file mode 100644
index 098efde98f5..00000000000
--- a/Master/texmf-dist/doc/latex/answers/ansexam2.tex
+++ /dev/null
@@ -1,62 +0,0 @@
-%%
-%% This is file `ansexam2.tex',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% answers.dtx (with options: `ex2')
-%%
-\documentclass[12pt,a4paper]{article}
-\usepackage{answers}%\usepackage[nosolutionfiles]{answers}
-\newtheorem{Exc}{Exercise}
-\newenvironment{Ex}{\begin{Exc}\normalfont}{\end{Exc}}
-\Newassociation{solution}{Soln}{test}
-\Newassociation{hint}{Hint}{test}
-\Newassociation{Solution}{sSol}{testtwo}
-\newcommand{\prehint}{~[Hint]}
-\newcommand{\presolution}{~[Solution]}
-\newcommand{\preSolution}{~[Homework]}
-\newcommand{\Opentesthook}[2]%
- {\Writetofile{#1}{\protect\section{#1: #2}}}
-\renewcommand{\Solnlabel}[1]{\emph{Solution #1}}
-\renewcommand{\Hintlabel}[1]{\emph{Hint #1}}
-\renewcommand{\sSollabel}[1]{\emph{Solution to #1}}
-
-\begin{document}
- \Opensolutionfile{test}[ans2]{Solutions}
- \Writetofile{test}{\protect\subsection{Some Solutions}}
- \Opensolutionfile{testtwo}[ans2x]
- \Writetofile{testtwo}{%
- \protect\subsection{Extra Solutions}}
- \section{Exercises}
- \begin{Ex}
- An exercise with a solution.
- \begin{solution}
- This is a solution.
- \relax{}
- \end{solution}
- \end{Ex}
- \begin{Ex}
- An exercise with a hint and a secret solution.
- \begin{hint}
- This is a hint.
- \end{hint}
- \begin{Solution}
- This is a secret solution.
- \end{Solution}
- \end{Ex}
- \begin{Ex}
- An exercise with a hint.
- \begin{hint}
- This is a hint.
- \end{hint}
- \end{Ex}
- \Closesolutionfile{test}
- \Readsolutionfile{test}
- \clearpage
- \Closesolutionfile{testtwo}
- \Readsolutionfile{testtwo}
-\end{document}
-\endinput
-%%
-%% End of file `ansexam2.tex'.
diff --git a/Master/texmf-dist/doc/latex/answers/ansexam3.tex b/Master/texmf-dist/doc/latex/answers/ansexam3.tex
deleted file mode 100644
index 8eb84299f33..00000000000
--- a/Master/texmf-dist/doc/latex/answers/ansexam3.tex
+++ /dev/null
@@ -1,40 +0,0 @@
-%%
-%% This is file `ansexam3.tex',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% answers.dtx (with options: `ex3')
-%%
-\documentclass[12pt,a4paper]{article}
-\usepackage{answers}
-\newenvironment{Ex}[1]{\begin{trivlist}\item \emph{#1} %
- \renewcommand{\Currentlabel}{#1}}{\end{trivlist}}
-\Newassociation{solution}{Soln}{solutions}
-
-\renewenvironment{Soln}[1]{\begin{trivlist}\item
- Solution to \emph{#1} }{\end{trivlist}}
-
-\begin{document}
-\section*{Problems}
- \Opensolutionfile{solutions}[ans3]
- \begin{Ex}{First exercise}
- An exercise with a solution.
- \begin{solution}
- This is a solution.
- \relax{}
- \end{solution}
- \end{Ex}
- \begin{Ex}{Second exercise}
- A second exercise with a solution.
- \begin{solution}
- This is another solution.
- \end{solution}
- \end{Ex}
- \Closesolutionfile{solutions}
-\section*{Solutions}
- \Readsolutionfile{solutions}
-\end{document}
-\endinput
-%%
-%% End of file `ansexam3.tex'.
diff --git a/Master/texmf-dist/doc/latex/answers/answers.pdf b/Master/texmf-dist/doc/latex/answers/answers.pdf
index d5f09f4e858..a3a0a99b00b 100644
--- a/Master/texmf-dist/doc/latex/answers/answers.pdf
+++ b/Master/texmf-dist/doc/latex/answers/answers.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/answers/answers.dtx b/Master/texmf-dist/source/latex/answers/answers.dtx
index a9563da67ad..a3a3e27fb00 100644
--- a/Master/texmf-dist/source/latex/answers/answers.dtx
+++ b/Master/texmf-dist/source/latex/answers/answers.dtx
@@ -9,7 +9,7 @@
%
% Originally developed by Mike Piff
% Copyright (C) 1990,1994-1996 by Mike Piff
-% Copyright (C) 2009-2010 by
+% Copyright (C) 2009-2010,2014 by
% Joseph Wright <joseph.wright@morningstar2.co.uk>
%
% This file may be distributed and/or modified under the conditions of
@@ -24,7 +24,7 @@
%
% \fi
%
-% \CheckSum{247}
+% \CheckSum{267}
%
% \changes{2.0}{1994/03/25}{First version for LaTeX2e}
% \changes{2.01}{1994/03/30}{Whoops! |ProvidesPackage{answers}|,
@@ -47,6 +47,7 @@
% \changes{2.12}{2009/09/16}{License change to LPPL}
% \changes{2.12}{2009/09/16}{New maintainer}
% \changes{2.13}{2010/10/11}{Make hyperlinks to solutions work correctly}
+% \changes{2.14}{2014/08/08}{Use a protected write for creating output files}
%
%
% \title{Production of solution sheets in \LaTeXe}
@@ -378,7 +379,7 @@
% Announce the package name and its version:
% \begin{macrocode}
\ProvidesPackage{answers}
- [2010/10/11 v2.13 Production of solution sheets in LaTeX2e]
+ [2014/08/08 v2.14 Production of solution sheets in LaTeX2e]
% \end{macrocode}
%
% \section{Options}
@@ -402,6 +403,26 @@
\RequirePackage{verbatim}
% \end{macrocode}
%
+% \begin{macro}{\protected@iwrite}
+% An immediate version of \cs{protected@write}: not available in the
+% kernel but needed for safety.
+% \begin{macrocode}
+\long\def\protected@iwrite#1#2#3{%
+ \begingroup
+ \let\thepage\relax
+ #2%
+ \let\protect\@unexpandable@protect
+ \edef \reserved@a{\immediate\write#1{#3}}%
+ \reserved@a
+ \endgroup
+ \if@nobreak
+ \ifvmode
+ \nobreak
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
%
% \section{File handling}
%
@@ -451,7 +472,7 @@
{%
\let\protect\string
\Ifanswerfiles{%
- \immediate\write\@nameuse{#1@file}{#2}%
+ \protected@iwrite\@nameuse{#1@file}{#2}%
}{}%
}%
}{}%
diff --git a/Master/texmf-dist/tex/latex/answers/answers.sty b/Master/texmf-dist/tex/latex/answers/answers.sty
index cb7311822d6..ab9ed30d53a 100644
--- a/Master/texmf-dist/tex/latex/answers/answers.sty
+++ b/Master/texmf-dist/tex/latex/answers/answers.sty
@@ -26,13 +26,27 @@
\def\filename{answers.dtx}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{answers}
- [2010/10/11 v2.13 Production of solution sheets in LaTeX2e]
+ [2014/08/08 v2.14 Production of solution sheets in LaTeX2e]
\newif\ifanswerfiles \answerfilestrue
\DeclareOption{nosolutionfiles}{\answerfilesfalse
\typeout{No answer files being produced}}%
\ProcessOptions
\RequirePackage{verbatim}
+\long\def\protected@iwrite#1#2#3{%
+ \begingroup
+ \let\thepage\relax
+ #2%
+ \let\protect\@unexpandable@protect
+ \edef \reserved@a{\immediate\write#1{#3}}%
+ \reserved@a
+ \endgroup
+ \if@nobreak
+ \ifvmode
+ \nobreak
+ \fi
+ \fi
+}
\newcommand{\solutionpoint}{.}
\newcommand{\solutionextension}{tex}
\newenvironment{Filesave}[1]{%
@@ -59,7 +73,7 @@
{%
\let\protect\string
\Ifanswerfiles{%
- \immediate\write\@nameuse{#1@file}{#2}%
+ \protected@iwrite\@nameuse{#1@file}{#2}%
}{}%
}%
}{}%