texlive[49784] Master/texmf-dist: exframe (21jan19)
commits+karl at tug.org
commits+karl at tug.org
Mon Jan 21 22:40:19 CET 2019
Revision: 49784
http://tug.org/svn/texlive?view=revision&revision=49784
Author: karl
Date: 2019-01-21 22:40:19 +0100 (Mon, 21 Jan 2019)
Log Message:
-----------
exframe (21jan19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/exframe/README.txt
trunk/Master/texmf-dist/doc/latex/exframe/exframe.pdf
trunk/Master/texmf-dist/doc/latex/exframe/exfsmp1.tex
trunk/Master/texmf-dist/source/latex/exframe/exframe.dtx
trunk/Master/texmf-dist/tex/latex/exframe/exframe.sty
Modified: trunk/Master/texmf-dist/doc/latex/exframe/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exframe/README.txt 2019-01-21 21:40:06 UTC (rev 49783)
+++ trunk/Master/texmf-dist/doc/latex/exframe/README.txt 2019-01-21 21:40:19 UTC (rev 49784)
@@ -1,4 +1,4 @@
-exframe v3.0
+exframe v3.1
Copyright 2011-2019 Niklas Beisert
exframe is a LaTeX2e package which provides a general purpose
Modified: trunk/Master/texmf-dist/doc/latex/exframe/exframe.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/exframe/exfsmp1.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/exframe/exfsmp1.tex 2019-01-21 21:40:06 UTC (rev 49783)
+++ trunk/Master/texmf-dist/doc/latex/exframe/exfsmp1.tex 2019-01-21 21:40:19 UTC (rev 49784)
@@ -17,7 +17,7 @@
%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-\ProvidesFile{exfsmp1.tex}[2019/01/16 v3.0 sample 1 for exframe]
+\ProvidesFile{exfsmp1.tex}[2019/01/21 v3.1 sample 1 for exframe]
\documentclass[12pt]{article}
\usepackage{geometry}
Modified: trunk/Master/texmf-dist/source/latex/exframe/exframe.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/exframe/exframe.dtx 2019-01-21 21:40:06 UTC (rev 49783)
+++ trunk/Master/texmf-dist/source/latex/exframe/exframe.dtx 2019-01-21 21:40:19 UTC (rev 49784)
@@ -18,10 +18,10 @@
% and the derived files exframe.sty and exfsmp1.tex.
%
%<package|sample1>\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-%<package>\ProvidesPackage{exframe}[2019/01/16 v3.0 Framework for Exercise Problems]
-%<sample1>\ProvidesFile{exfsmp1.tex}[2019/01/16 v3.0 sample 1 for exframe]
+%<package>\ProvidesPackage{exframe}[2019/01/21 v3.1 Framework for Exercise Problems]
+%<sample1>\ProvidesFile{exfsmp1.tex}[2019/01/21 v3.1 sample 1 for exframe]
%<*driver>
-\def\thedate#1{2019/01/16}\def\theversion#1{v3.0}
+\def\thedate#1{2019/01/21}\def\theversion#1{v3.1}
\ProvidesFile{exframe.dtx}[\thedate{} \theversion{} exframe reference manual file]
\PassOptionsToClass{10pt,a4paper}{article}
\documentclass{ltxdoc}
@@ -323,10 +323,12 @@
or display them at a manually chosen location (|manual|).
Note that typically solutions are defined at the end of a (sub)problem
and therefore the choice |here| is similar to (|sub|)|problem|.
-The latter form, however, makes sure that a solution is positioned
-\emph{after} the (sub)problem block
-such that it does not inherit the layout (e.g.\ indentation)
-of the latter even if it is defined within this block.
+The latter form, however, makes sure that a solution
+does not inherit the margin of the parent block.
+The alternate modes |problem*| and |subproblem*|
+positions the solution \emph{after} the (sub)problem block
+such that it does not inherit any layout,
+but also the no definitions made in the parent block.
In |manual| mode, all solutions are collected (with appropriate headers)
until they are output by the directive |\insertsolutions|.
If no solutions are stored in the buffer
@@ -1043,7 +1045,7 @@
\DescribeMacro{\exerciseifempty}
\DescribeMacro{\exerciseifnotempty}
Handy conditionals command to check
-whether an expression \textit{expr} is empty (or pure whitespace) is:
+whether an expression \textit{expr} is empty are:
%
\begin{center}
\begin{tabular}{l}
@@ -1083,7 +1085,8 @@
%
\begin{itemize}
\item |solutionbelow=|\textit{pos}
-(can take values |here|, |subproblem|, |problem|, |sheet| and |manual|;
+(can take values |here|, |subproblem|, |subproblem*|, |problem|, |problem*|,
+|sheet| and |manual|;
initially set to |subproblem|) --
positions the solutions below the indicated blocks;
see \secref{sec:solutions} for details.
@@ -1114,7 +1117,10 @@
number problems by sheet.
\item |equationbysheet| --
-number equations by sheet.
+number dedicated equations for sheets, problems and solutions by sheet;
+note that the main equation counter is unaffected by this setting,
+it therefore makes sense to also activate the style |sheetequation|
+or use |\counterwithin{equation}{sheet}|.
\item |pagebysheet| --
number pages by sheet and denote pages by \textit{sheet}|.|\textit{page};
@@ -1517,6 +1523,18 @@
\subsection{Revision History}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{v3.1:} 2019/01/21
+
+\begin{itemize}
+\item
+alternate placement modes for solutions
+\item
+fixed expansion of problem title
+\item
+reset font size for problem text
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v3.0:} 2019/01/16
\begin{itemize}
@@ -2231,7 +2249,7 @@
%
% Basic style for all exercise text:
% \begin{macrocode}
-\exerciseconfig{styletext}{\normalfont}
+\exerciseconfig{styletext}{\normalsize\normalfont}
% \end{macrocode}
% Style for problems:
% \begin{macrocode}
@@ -2385,6 +2403,11 @@
% \begin{macrocode}
\exerciseconfig{insertproblemafter}{}
% \end{macrocode}
+% Code to insert between a problem and its solution
+% (if style |solutionbelow| is |problem|):
+% \begin{macrocode}
+\exerciseconfig{insertproblemsolution}{}
+% \end{macrocode}
% Code to insert text into the problem opening line
% by means of |\addprobleminfo|:
% \begin{macrocode}
@@ -2395,6 +2418,7 @@
\exerciseconfig{insertsubproblembefore}{}
\exerciseconfig{insertsubproblemafter}{}
\exerciseconfig{insertsubprobleminfo}{}
+\exerciseconfig{insertsubproblemsolution}{}
% \end{macrocode}
% Analogous definitions for solutions:
% \begin{macrocode}
@@ -2664,7 +2688,8 @@
% \begin{macrocode}
\def\exf at solutionbelow{subproblem}
\define at choicekey{exf at style}{solutionbelow}%
- {here,subproblem,problem,sheet,manual}{\def\exf at solutionbelow{#1}}
+ {here,subproblem,subproblem*,problem,problem*,sheet,manual}%
+ {\def\exf at solutionbelow{#1}}
% \end{macrocode}
% Conditionals to compare solution locations:
% \begin{macrocode}
@@ -2965,8 +2990,14 @@
% \end{macrocode}
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \paragraph{Problem Info Code.}
+% \paragraph{Problem Block Code.}
%
+% \macro{\exf at addmargin}
+% Define a length for block margin:
+% \begin{macrocode}
+\newlength\exf at addmargin
+% \end{macrocode}
+
% \macro{\exf at section}
% Write out problem opening line followed by some amount of skip
% (positive dimensions add vertical space,
@@ -2984,11 +3015,12 @@
\exf at exparg{\@startsection{}{}{0pt}{0pt}{#1}{}*}{\exf at tmp}}
% \end{macrocode}
-% \macro{\exf at init@intro}
+% \macro{\exf at init@block}
% Clean info buffer, define amount of skip between items:
% \begin{macrocode}
-\newcommand{\exf at init@intro}[1]%
- {\def\exf at intro{}\def\exf at introitem{}\def\exf at intro@skip{#1}}
+\newcommand{\exf at init@block}[1]{%
+ \def\exf at intro{}\def\exf at intro@skip{#1}%
+ \exf at addmargin0pt\def\exf at introitem{}}
% \end{macrocode}
% \macro{\exf at append@intro}
% Append to info buffer:
@@ -3002,10 +3034,13 @@
\newcommand{\exf at prepend@intro}[1]%
{\exf at prepend@def\exf at intro{#1\hspace{\exf at intro@skip}}}
% \end{macrocode}
-% \macro{\exf at write@intro}
-% Compose opening line:
+% \macro{\exf at open@block}
+% Open block, set margin, compose opening line:
% \begin{macrocode}
-\newcommand{\exf at write@intro}[1]{%
+\newcommand{\exf at open@block}[1]{%
+ \advance\leftskip\exf at addmargin%
+ \advance\linewidth-\exf at addmargin%
+ \advance\@totalleftmargin\exf at addmargin%
\ifx\exf at intro\exf at empty%
\exf at section{0pt}{\exf at introitem}%
\else%
@@ -3012,6 +3047,14 @@
\exf at section{#1}{\exf at introitem\exf at intro\unskip}%
\fi}%
% \end{macrocode}
+% \macro{\exf at close@block}
+% Close block, undo margin:
+% \begin{macrocode}
+\newcommand{\exf at close@block}{%
+ \advance\leftskip-\exf at addmargin%
+ \advance\linewidth\exf at addmargin%
+ \advance\@totalleftmargin-\exf at addmargin}%
+% \end{macrocode}
% \macro{\addprobleminfo}
% Interface to append or prepend to info buffer:
@@ -3675,12 +3718,6 @@
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \paragraph{Problems.}
%
-% \macro{\ifexf at problem@solnewsec}
-% Conditional to mark whether problem has been encountered:
-% \begin{macrocode}
-\newif\ifexf at problem@solnewsec\exf at problem@solnewsectrue
-% \end{macrocode}
-
% \macro{exf at problem}
% Define options for |problem| environment:
% \begin{macrocode}
@@ -3695,17 +3732,23 @@
% \begin{macrocode}
\newenvironment{\exf at problemname}[1][]{%
% \end{macrocode}
-% Start with new paragraph, set text style, add vspace and step counter:
+% Start with new paragraph, set text style, add vspace:
% \begin{macrocode}
- \par\exf at config@styletext%
- \addvspace{\exf at config@skipproblemabove}%
+ \par\exf at config@styletext\addvspace{\exf at config@skipproblemabove}%
+% \end{macrocode}
+% Step problem counter:
+% \begin{macrocode}
\refstepcounter{\exf at problemcounter}%
% \end{macrocode}
-% Insert hook code, remember that a new problem was encountered:
+% Insert hook code:
% \begin{macrocode}
\exf at config@insertproblembefore%
- \global\exf at problem@solnewsectrue%
% \end{macrocode}
+% Begin inner group, mark in problem:
+% \begin{macrocode}
+ \begingroup%
+ \def\exf at in@problem{}%
+% \end{macrocode}
% Use equation counter for problems:
% \begin{macrocode}
\ifexf at style@problemequation%
@@ -3715,12 +3758,9 @@
\let\theHequation\theHexf at problemequation%
\fi%
% \end{macrocode}
-% Start a block, mark in problem, initialise variables,
-% process arguments:
+% Initialise variables, process arguments:
% \begin{macrocode}
- \begingroup%
- \def\exf at in@problem{}%
- \exf at init@intro{\exf at config@skipprobleminfo}%
+ \exf at init@block{\exf at config@skipprobleminfo}%
\def\problemtag{\csname the\exf at problemcounter\endcsname}%
\let\exf at points@given\@undefined%
\let\exf at label\@undefined%
@@ -3733,8 +3773,9 @@
\ifexf at autolabelproblem\label{\exf at config@labelproblem{\problemtag}}\fi%
\ifdefined\exf at label\label{\exf at label}\fi%
% \end{macrocode}
-% Remember problem counter, title for solutions:
+% Mark for new solution section; remember problem counter, title:
% \begin{macrocode}
+ \gdef\exf at problem@solnewsec{}%
\xdef\exf at prevprob{\csname the\exf at problemcounter\endcsname}%
\ifcsname theH\exf at problemcounter\endcsname%
\xdef\exf at prevprobhref{\exf at problemcounter.%
@@ -3743,7 +3784,8 @@
\ifx\exf at data@problem at rawtitle\exf at empty%
\global\let\exf at prevprobtitle\@undefined%
\else%
- \xdef\exf at prevprobtitle{\exf at data@problem at rawtitle}\fi%
+ \protected at xdef\exf at prevprobtitle{\exf at data@problem at rawtitle}%
+ \fi%
\global\let\exf at prevsubprob\@undefined%
\global\let\exf at prevsubprobhref\@undefined%
% \end{macrocode}
@@ -3795,20 +3837,14 @@
% \begin{macrocode}
\else%
\ifdim\exf at config@skipproblemitem>0pt%
- \setlength\exf at tmpdim{\exf at config@skipproblemitem}%
+ \setlength\exf at addmargin{\exf at config@skipproblemitem}%
\else%
- \settowidth\exf at tmpdim{%
+ \settowidth\exf at addmargin{%
\exf at config@styletitle\exf at config@styletitleproblem%
\exf at config@composeitemproblem{\exf at config@counterproblemmax}%
\exf at config@composeitemproblemsep}%
\fi%
% \end{macrocode}
-% Set up indentation:
-% \begin{macrocode}
- \advance\leftskip\exf at tmpdim%
- \advance\linewidth -\exf at tmpdim%
- \advance\@totalleftmargin\exf at tmpdim%
-% \end{macrocode}
% Define item label:
% \begin{macrocode}
\def\exf at introitem{\makebox[0cm][r]{%
@@ -3837,7 +3873,7 @@
% \end{macrocode}
% Write out opening line:
% \begin{macrocode}
- \exf at write@intro{\exf at config@skipproblemtitle}%
+ \exf at open@block{\exf at config@skipproblemtitle}%
% \end{macrocode}
% Add table of contents line:
% \begin{macrocode}
@@ -3898,22 +3934,21 @@
\PackageWarning{exframe}{no points defined for \exf at problemname}%
\fi\fi%
% \end{macrocode}
-% End paragraph, insert hook code, vertical skip:
+% Solutions to subproblems must be declared within problem block:
% \begin{macrocode}
- \par\endgroup%
- \exf at config@insertproblemafter%
- \addvspace{\exf at config@skipproblembelow}%
+ \global\let\exf at prevsubprob\@undefined%
+ \global\let\exf at prevsubprobhref\@undefined%
% \end{macrocode}
+% End paragraph and block:
+% \begin{macrocode}
+ \par\exf at close@block%
+% \end{macrocode}
% Display solution if desired:
% \begin{macrocode}
\exf at solbelowis{problem}{%
+ \exf at config@insertproblemsolution%
\exf at showsolutions{\exf at config@composetitlesolutionmulti}{}}%
% \end{macrocode}
-% Solutions to subproblems should be declared within problem block:
-% \begin{macrocode}
- \global\let\exf at prevsubprob\@undefined%
- \global\let\exf at prevsubprobhref\@undefined%
-% \end{macrocode}
% Restore original equation counter:
% \begin{macrocode}
\ifexf at style@problemequation%
@@ -3921,6 +3956,20 @@
\setcounter{equation}{\exf at eqsav}%
\fi%
% \end{macrocode}
+% End inner group:
+% \begin{macrocode}
+ \endgroup%
+% \end{macrocode}
+% Insert hook code, vertical skip:
+% \begin{macrocode}
+ \exf at config@insertproblemafter%
+ \addvspace{\exf at config@skipproblembelow}%
+% \end{macrocode}
+% Display solution if desired:
+% \begin{macrocode}
+ \exf at solbelowis{problem*}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionmulti}{}}%
+% \end{macrocode}
% Done:
% \begin{macrocode}
\ignorespacesafterend}
@@ -3943,8 +3992,7 @@
% \end{macrocode}
% Start with new paragraph, set text style, add vspace and step counter:
% \begin{macrocode}
- \par%
- {\exf at config@styletext\addvspace{\exf at config@skipsubproblemabove}}%
+ \par{\exf at config@styletext\addvspace{\exf at config@skipsubproblemabove}}%
\refstepcounter{\exf at subproblemcounter}%
% \end{macrocode}
% Insert hook code:
@@ -3951,20 +3999,14 @@
% \begin{macrocode}
\exf at config@insertsubproblembefore%
% \end{macrocode}
-% Remember subproblem counter for solution:
+% Start inner group, mark in subproblem:
% \begin{macrocode}
- \xdef\exf at prevsubprob{\csname the\exf at subproblemcounter\endcsname}%
- \ifcsname theH\exf at subproblemcounter\endcsname%
- \xdef\exf at prevsubprobhref{\exf at subproblemcounter.%
- \csname theH\exf at subproblemcounter\endcsname}%
- \fi%
+ \begingroup%
+ \def\exf at in@subproblem{}%
% \end{macrocode}
-% Start a block, mark in subproblem, initialise variables,
-% process arguments:
+% Initialise variables, process arguments:
% \begin{macrocode}
- \begingroup%
- \def\exf at in@subproblem{}%
- \exf at init@intro{\exf at config@skipsubprobleminfo}%
+ \exf at init@block{\exf at config@skipsubprobleminfo}%
\let\exf at subproblem@points\@undefined%
\let\exf at label\@undefined%
\setkeys{exf at subproblem,exf at probleminfo}{#1}%
@@ -3973,6 +4015,14 @@
% \begin{macrocode}
\ifdefined\exf at label\label{\exf at label}\fi%
% \end{macrocode}
+% Remember subproblem counter for solution:
+% \begin{macrocode}
+ \xdef\exf at prevsubprob{\csname the\exf at subproblemcounter\endcsname}%
+ \ifcsname theH\exf at subproblemcounter\endcsname%
+ \xdef\exf at prevsubprobhref{\exf at subproblemcounter.%
+ \csname theH\exf at subproblemcounter\endcsname}%
+ \fi%
+% \end{macrocode}
% Add given points to problem total:
% \begin{macrocode}
\ifdefined\exf at subproblem@points%
@@ -4019,20 +4069,14 @@
% \begin{macrocode}
\else%
\ifdim\exf at config@skipsubproblemitem>0pt%
- \setlength\exf at tmpdim{\exf at config@skipsubproblemitem}%
+ \setlength\exf at addmargin{\exf at config@skipsubproblemitem}%
\else%
- \settowidth\exf at tmpdim{%
+ \settowidth\exf at addmargin{%
\exf at config@styletitle\exf at config@styletitlesubproblem%
\exf at config@composeitemsubproblem{\exf at config@countersubproblemmax}%
\exf at config@composeitemsubproblemsep}%
\fi%
% \end{macrocode}
-% Set up indentation:
-% \begin{macrocode}
- \advance\leftskip\exf at tmpdim%
- \advance\linewidth -\exf at tmpdim%
- \advance\@totalleftmargin\exf at tmpdim%
-% \end{macrocode}
% Define item label:
% \begin{macrocode}
\def\exf at introitem{\makebox[0cm][r]{%
@@ -4054,26 +4098,39 @@
% \end{macrocode}
% Write out opening line:
% \begin{macrocode}
- \exf at write@intro{\exf at config@skipsubproblemtitle}%
+ \exf at open@block{\exf at config@skipsubproblemtitle}%
% \end{macrocode}
% Done:
% \begin{macrocode}
\@afterindentfalse}%
% \end{macrocode}
-% End environment, show points if desired, end paragraph:
+% End environment, show points if desired:
% \begin{macrocode}
{\exf at subpointsatis{end}{\showpoints}%
- \par\endgroup%
% \end{macrocode}
-% Vertical skip, insert hook code:
+% End paragraph and block:
% \begin{macrocode}
+ \par\exf at close@block%
+% \end{macrocode}
+% Display solution if desired:
+% \begin{macrocode}
+ \exf at solbelowis{subproblem*}{%
+ \exf at config@insertsubproblemsolution%
+ \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}}%
+% \end{macrocode}
+% End inner group:
+% \begin{macrocode}
+ \endgroup%
+% \end{macrocode}
+% Insert hook code, vertical skip:
+% \begin{macrocode}
+ \exf at config@insertsubproblemafter%
{\exf at config@styletext\addvspace{\exf at config@skipsubproblembelow}}%
- \exf at config@insertsubproblemafter%
% \end{macrocode}
% Display solution if desired:
% \begin{macrocode}
- \exf at solbelowis{subproblem}{\exf at showsolutions%
- {\exf at config@composetitlesolutionsingle}{}}%
+ \exf at solbelowis{subproblem}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}}%
% \end{macrocode}
% Done:
% \begin{macrocode}
@@ -4103,10 +4160,12 @@
% \begin{macrocode}
\newenvironment{printsolution}[1]{%
% \end{macrocode}
-% Start new paragraph, add vertical space, insert hook code:
+% Start new paragraph, add vertical space:
% \begin{macrocode}
- \par%
- {\exf at config@styletext\addvspace{\exf at config@skipsolutionabove}}%
+ \par{\exf at config@styletext\addvspace{\exf at config@skipsolutionabove}}%
+% \end{macrocode}
+% Insert hook code:
+% \begin{macrocode}
\exf at config@insertsolutionbefore%
% \end{macrocode}
% Use equation counter for solutions:
@@ -4126,7 +4185,7 @@
\let\exf at label\@undefined%
\setlength{\exf at solution@points at dim}{0pt}%
\def\exf at solhref{}%
- \exf at init@intro{\exf at config@skipsolutioninfo}%
+ \exf at init@block{\exf at config@skipsolutioninfo}%
\setkeys{exf at solution,exf at probleminfo}{#1}%
% \end{macrocode}
% Set solution counter to reflect associated problem:
@@ -4168,9 +4227,9 @@
% \begin{macrocode}
\else%
\ifdim\exf at tmp>0pt%
- \setlength\exf at tmpdim{\exf at tmp}%
+ \setlength\exf at addmargin{\exf at tmp}%
\else%
- \settowidth\exf at tmpdim{%
+ \settowidth\exf at addmargin{%
\exf at config@styletitle\exf at config@styletitlesolution%
\ifx\exf at solsubprob\exf at empty%
\exf at config@composeitemsolution{\exf at config@counterproblemmax}%
@@ -4181,12 +4240,6 @@
\fi\exf at config@composeitemsolutionsep}%
\fi%
% \end{macrocode}
-% Set up indentation:
-% \begin{macrocode}
- \advance\leftskip\exf at tmpdim%
- \advance\linewidth -\exf at tmpdim%
- \advance\@totalleftmargin\exf at tmpdim%
-% \end{macrocode}
% Set item label up depending on problem or subproblem:
% \begin{macrocode}
\ifx\exf at solsubprob\exf at empty%
@@ -4208,7 +4261,7 @@
% \end{macrocode}
% Write out opening line:
% \begin{macrocode}
- \exf at write@intro{\exf at config@skipsolutiontitle}%
+ \exf at open@block{\exf at config@skipsolutiontitle}%
% \end{macrocode}
% Done:
% \begin{macrocode}
@@ -4223,11 +4276,9 @@
{\strip at pt\exf at solution@points at dim}{\exf at solution@points}\fi%
\fi\fi\fi%
% \end{macrocode}
-% End paragraph, vertical skip, insert hook code:
+% End paragraph and block:
% \begin{macrocode}
- \par\endgroup%
- {\exf at config@styletext\addvspace{\exf at config@skipsolutionbelow}}%
- \exf at config@insertsolutionafter%
+ \par\exf at close@block%
% \end{macrocode}
% Restore original equation counter:
% \begin{macrocode}
@@ -4236,6 +4287,15 @@
\setcounter{equation}{\exf at eqsav}%
\fi%
% \end{macrocode}
+% End inner group:
+% \begin{macrocode}
+ \endgroup%
+% \end{macrocode}
+% Vertical skip, insert hook code:
+% \begin{macrocode}
+ {\exf at config@styletext\addvspace{\exf at config@skipsolutionbelow}}%
+ \exf at config@insertsolutionafter%
+% \end{macrocode}
% Done:
% \begin{macrocode}
\ignorespacesafterend}
@@ -4263,6 +4323,8 @@
{\exf at config@composetocsolution{\exf at solprob}{\exf at solprobtitle}}}%
\exf at solbelowis{problem}{\let\exf at composetitle%
\exf at config@composetitlesolutionsproblemsingle}%
+ \exf at solbelowis{problem*}{\let\exf at composetitle%
+ \exf at config@composetitlesolutionsproblemsingle}%
% \end{macrocode}
% Write section line:
% \begin{macrocode}
@@ -4299,7 +4361,7 @@
% If this is the first solution within a new section,
% display section heading:
% \begin{macrocode}
- \ifexf at problem@solnewsec%
+ \ifdefined\exf at problem@solnewsec%
\def\exf at probarg{\ifdefined\exf at prevprob prob={\exf at prevprob}\fi%
\ifdefined\exf at prevprobtitle,probtitle={\exf at prevprobtitle}\fi%
\ifdefined\exf at prevprobhref,href={\exf at prevprobhref}\fi%
@@ -4306,12 +4368,13 @@
\ifdefined\exf at sollabel,label={\exf at sollabel}\fi}%
\exf at solbelowis{here}{\let\exf at probarg\@undefined}%
\exf at solbelowis{subproblem}{\let\exf at probarg\@undefined}%
+ \exf at solbelowis{subproblem*}{\let\exf at probarg\@undefined}%
\ifdefined\exf at probarg%
\ifexf at lineno\exf at addbufline{\exf at linesep}\exf at addbufline{\exf at lineno}\fi%
\exf at addbufline{\@backslashchar solutionssection{\exf at probarg}}%
\exf at addbufline{}%
\fi%
- \global\exf at problem@solnewsecfalse%
+ \global\let\exf at problem@solnewsec\@undefined%
\fi%
% \end{macrocode}
% Write separator to buffer:
@@ -4370,10 +4433,16 @@
% \begin{macrocode}
\exf at solbelowis{here}{\exf at showsolutions%
{\exf at config@composetitlesolutionsingle}{}}%
- \exf at solbelowis{subproblem}{\ifdefined\exf at in@subproblem\else%
- \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}\fi}%
- \exf at solbelowis{problem}{\ifdefined\exf at in@problem\else%
- \exf at showsolutions{\exf at config@composetitlesolutionmulti}{}\fi}%
+ \ifdefined\exf at in@subproblem\else%
+ \exf at solbelowis{subproblem}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}}%
+ \exf at solbelowis{subproblem*}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}}\fi%
+ \ifdefined\exf at in@problem\else%
+ \exf at solbelowis{problem}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionmulti}{}}%
+ \exf at solbelowis{problem*}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionmulti}{}}\fi%
% \end{macrocode}
% Done:
% \begin{macrocode}
Modified: trunk/Master/texmf-dist/tex/latex/exframe/exframe.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/exframe/exframe.sty 2019-01-21 21:40:06 UTC (rev 49783)
+++ trunk/Master/texmf-dist/tex/latex/exframe/exframe.sty 2019-01-21 21:40:19 UTC (rev 49784)
@@ -17,7 +17,7 @@
%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-\ProvidesPackage{exframe}[2019/01/16 v3.0 Framework for Exercise Problems]
+\ProvidesPackage{exframe}[2019/01/21 v3.1 Framework for Exercise Problems]
\RequirePackage{verbatim}
\RequirePackage{xkeyval}
@@ -111,7 +111,7 @@
\exerciseconfig{termpoint}{point}
\exerciseconfig{termpoints}{points}
-\exerciseconfig{styletext}{\normalfont}
+\exerciseconfig{styletext}{\normalsize\normalfont}
\exerciseconfig{styletextproblem}{}
\exerciseconfig{styletextsolution}{\footnotesize}
\exerciseconfig{styletitle}{\bfseries}
@@ -153,10 +153,12 @@
\exerciseconfig{insertsolutionsafter}{}
\exerciseconfig{insertproblembefore}{}
\exerciseconfig{insertproblemafter}{}
+\exerciseconfig{insertproblemsolution}{}
\exerciseconfig{insertprobleminfo}{}
\exerciseconfig{insertsubproblembefore}{}
\exerciseconfig{insertsubproblemafter}{}
\exerciseconfig{insertsubprobleminfo}{}
+\exerciseconfig{insertsubproblemsolution}{}
\exerciseconfig{insertsolutionbefore}{}
\exerciseconfig{insertsolutionafter}{}
\exerciseconfig{insertsolutioninfo}{}
@@ -249,7 +251,8 @@
\def\exf at solutionbelow{subproblem}
\define at choicekey{exf at style}{solutionbelow}%
- {here,subproblem,problem,sheet,manual}{\def\exf at solutionbelow{#1}}
+ {here,subproblem,subproblem*,problem,problem*,sheet,manual}%
+ {\def\exf at solutionbelow{#1}}
\newcommand{\exf at solbelowis}[2]%
{\def\exf at tmp{#1}\ifx\exf at solutionbelow\exf at tmp#2\fi}
\defexercisestyle{sheetequation}{}
@@ -384,6 +387,8 @@
\def\exf at data@problem at title{\exf at config@composetitleproblem{%
\csname the\exf at problemcounter\endcsname}{\exf at data@problem at rawtitle}}%
+\newlength\exf at addmargin
+
\newcommand{\exf at section}[2]{\setlength\exf at tmpdim{#1}%
\ifdim\exf at tmpdim<0pt%
\protected at edef\exf at tmp{#2}%
@@ -392,18 +397,26 @@
\fi%
\exf at exparg{\@startsection{}{}{0pt}{0pt}{#1}{}*}{\exf at tmp}}
-\newcommand{\exf at init@intro}[1]%
- {\def\exf at intro{}\def\exf at introitem{}\def\exf at intro@skip{#1}}
+\newcommand{\exf at init@block}[1]{%
+ \def\exf at intro{}\def\exf at intro@skip{#1}%
+ \exf at addmargin0pt\def\exf at introitem{}}
\newcommand{\exf at append@intro}[1]%
{\exf at append@def\exf at intro{#1\hspace{\exf at intro@skip}}}
\newcommand{\exf at prepend@intro}[1]%
{\exf at prepend@def\exf at intro{#1\hspace{\exf at intro@skip}}}
-\newcommand{\exf at write@intro}[1]{%
+\newcommand{\exf at open@block}[1]{%
+ \advance\leftskip\exf at addmargin%
+ \advance\linewidth-\exf at addmargin%
+ \advance\@totalleftmargin\exf at addmargin%
\ifx\exf at intro\exf at empty%
\exf at section{0pt}{\exf at introitem}%
\else%
\exf at section{#1}{\exf at introitem\exf at intro\unskip}%
\fi}%
+\newcommand{\exf at close@block}{%
+ \advance\leftskip-\exf at addmargin%
+ \advance\linewidth\exf at addmargin%
+ \advance\@totalleftmargin-\exf at addmargin}%
\newcommand{\addprobleminfo}{\@ifstar\exf at prepend@intro\exf at append@intro}
@@ -715,8 +728,6 @@
\clearpage\ifexf at twoside\ifodd\value{page}\else%
\thispagestyle{empty}\hbox{}\newpage\fi\fi}
-\newif\ifexf at problem@solnewsec\exf at problem@solnewsectrue
-
\define at key{exf at problem}{points}{\def\exf at points@given{#1}}
\define at key{exf at problem}{label}{\def\exf at label{#1}}
\define at key{exf at problem}{tag}{\def\problemtag{#1}}
@@ -723,11 +734,11 @@
\define at key{exf at problem}{sollabel}{\xdef\exf at sollabel{#1}}
\newenvironment{\exf at problemname}[1][]{%
- \par\exf at config@styletext%
- \addvspace{\exf at config@skipproblemabove}%
+ \par\exf at config@styletext\addvspace{\exf at config@skipproblemabove}%
\refstepcounter{\exf at problemcounter}%
\exf at config@insertproblembefore%
- \global\exf at problem@solnewsectrue%
+ \begingroup%
+ \def\exf at in@problem{}%
\ifexf at style@problemequation%
\exf at eqsav\value{equation}%
\setcounter{equation}{\value{exf at problemequation}}%
@@ -734,9 +745,7 @@
\let\theequation\theexf at problemequation%
\let\theHequation\theHexf at problemequation%
\fi%
- \begingroup%
- \def\exf at in@problem{}%
- \exf at init@intro{\exf at config@skipprobleminfo}%
+ \exf at init@block{\exf at config@skipprobleminfo}%
\def\problemtag{\csname the\exf at problemcounter\endcsname}%
\let\exf at points@given\@undefined%
\let\exf at label\@undefined%
@@ -745,6 +754,7 @@
\setkeys{exf at problem,exf at probleminfo}{#1}%
\ifexf at autolabelproblem\label{\exf at config@labelproblem{\problemtag}}\fi%
\ifdefined\exf at label\label{\exf at label}\fi%
+ \gdef\exf at problem@solnewsec{}%
\xdef\exf at prevprob{\csname the\exf at problemcounter\endcsname}%
\ifcsname theH\exf at problemcounter\endcsname%
\xdef\exf at prevprobhref{\exf at problemcounter.%
@@ -753,7 +763,8 @@
\ifx\exf at data@problem at rawtitle\exf at empty%
\global\let\exf at prevprobtitle\@undefined%
\else%
- \xdef\exf at prevprobtitle{\exf at data@problem at rawtitle}\fi%
+ \protected at xdef\exf at prevprobtitle{\exf at data@problem at rawtitle}%
+ \fi%
\global\let\exf at prevsubprob\@undefined%
\global\let\exf at prevsubprobhref\@undefined%
\let\exf at problem@points\@undefined%
@@ -786,16 +797,13 @@
{\exf at data@problem at rawtitle}}}%
\else%
\ifdim\exf at config@skipproblemitem>0pt%
- \setlength\exf at tmpdim{\exf at config@skipproblemitem}%
+ \setlength\exf at addmargin{\exf at config@skipproblemitem}%
\else%
- \settowidth\exf at tmpdim{%
+ \settowidth\exf at addmargin{%
\exf at config@styletitle\exf at config@styletitleproblem%
\exf at config@composeitemproblem{\exf at config@counterproblemmax}%
\exf at config@composeitemproblemsep}%
\fi%
- \advance\leftskip\exf at tmpdim%
- \advance\linewidth -\exf at tmpdim%
- \advance\@totalleftmargin\exf at tmpdim%
\def\exf at introitem{\makebox[0cm][r]{%
\exf at config@styletitle\exf at config@styletitleproblem%
\exf at config@composeitemproblem{\csname the\exf at problemcounter\endcsname}%
@@ -812,7 +820,7 @@
\exf at config@insertpointsmargin\expandafter{\expandafter%
\exf at config@composepointsmargin\expandafter{\exf at problem@pointsshow}}}%
\let\exf at problem@pointsshow\@undefined\fi}%
- \exf at write@intro{\exf at config@skipproblemtitle}%
+ \exf at open@block{\exf at config@skipproblemtitle}%
\exf at addcontentsline{\exf at config@toclevelproblem}%
{\exf at config@composetocproblem{\csname the\exf at problemcounter\endcsname}%
{\exf at data@problem at rawtitle}}%
@@ -848,17 +856,21 @@
\ifdefined\exf at problem@points\else\ifdim\exf at sheet@points at dim=0pt\else%
\PackageWarning{exframe}{no points defined for \exf at problemname}%
\fi\fi%
- \par\endgroup%
- \exf at config@insertproblemafter%
- \addvspace{\exf at config@skipproblembelow}%
+ \global\let\exf at prevsubprob\@undefined%
+ \global\let\exf at prevsubprobhref\@undefined%
+ \par\exf at close@block%
\exf at solbelowis{problem}{%
+ \exf at config@insertproblemsolution%
\exf at showsolutions{\exf at config@composetitlesolutionmulti}{}}%
- \global\let\exf at prevsubprob\@undefined%
- \global\let\exf at prevsubprobhref\@undefined%
\ifexf at style@problemequation%
\setcounter{exf at problemequation}{\value{equation}}%
\setcounter{equation}{\exf at eqsav}%
\fi%
+ \endgroup%
+ \exf at config@insertproblemafter%
+ \addvspace{\exf at config@skipproblembelow}%
+ \exf at solbelowis{problem*}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionmulti}{}}%
\ignorespacesafterend}
\define at key{exf at subproblem}{points}{\def\exf at subproblem@points{#1}}
@@ -865,22 +877,21 @@
\define at key{exf at subproblem}{label}{\def\exf at label{#1}}
\newenvironment{\exf at subproblemname}[1][]{%
- \par%
- {\exf at config@styletext\addvspace{\exf at config@skipsubproblemabove}}%
+ \par{\exf at config@styletext\addvspace{\exf at config@skipsubproblemabove}}%
\refstepcounter{\exf at subproblemcounter}%
\exf at config@insertsubproblembefore%
- \xdef\exf at prevsubprob{\csname the\exf at subproblemcounter\endcsname}%
- \ifcsname theH\exf at subproblemcounter\endcsname%
- \xdef\exf at prevsubprobhref{\exf at subproblemcounter.%
- \csname theH\exf at subproblemcounter\endcsname}%
- \fi%
\begingroup%
\def\exf at in@subproblem{}%
- \exf at init@intro{\exf at config@skipsubprobleminfo}%
+ \exf at init@block{\exf at config@skipsubprobleminfo}%
\let\exf at subproblem@points\@undefined%
\let\exf at label\@undefined%
\setkeys{exf at subproblem,exf at probleminfo}{#1}%
\ifdefined\exf at label\label{\exf at label}\fi%
+ \xdef\exf at prevsubprob{\csname the\exf at subproblemcounter\endcsname}%
+ \ifcsname theH\exf at subproblemcounter\endcsname%
+ \xdef\exf at prevsubprobhref{\exf at subproblemcounter.%
+ \csname theH\exf at subproblemcounter\endcsname}%
+ \fi%
\ifdefined\exf at subproblem@points%
\global\let\exf at prevpoints\exf at subproblem@points%
\global\addtolength{\exf at problem@points at dim}{\exf at subproblem@points pt}%
@@ -906,16 +917,13 @@
\csname the\exf at subproblemcounter\endcsname}}}%
\else%
\ifdim\exf at config@skipsubproblemitem>0pt%
- \setlength\exf at tmpdim{\exf at config@skipsubproblemitem}%
+ \setlength\exf at addmargin{\exf at config@skipsubproblemitem}%
\else%
- \settowidth\exf at tmpdim{%
+ \settowidth\exf at addmargin{%
\exf at config@styletitle\exf at config@styletitlesubproblem%
\exf at config@composeitemsubproblem{\exf at config@countersubproblemmax}%
\exf at config@composeitemsubproblemsep}%
\fi%
- \advance\leftskip\exf at tmpdim%
- \advance\linewidth -\exf at tmpdim%
- \advance\@totalleftmargin\exf at tmpdim%
\def\exf at introitem{\makebox[0cm][r]{%
\exf at config@styletitle\exf at config@styletitlesubproblem%
\exf at config@composeitemsubproblem%
@@ -928,14 +936,18 @@
\exf at config@insertpointsmargin\expandafter{\expandafter%
\exf at config@composepointsmargin\expandafter{\exf at subproblem@points}}}%
\let\exf at subproblem@points\@undefined\fi}%
- \exf at write@intro{\exf at config@skipsubproblemtitle}%
+ \exf at open@block{\exf at config@skipsubproblemtitle}%
\@afterindentfalse}%
{\exf at subpointsatis{end}{\showpoints}%
- \par\endgroup%
+ \par\exf at close@block%
+ \exf at solbelowis{subproblem*}{%
+ \exf at config@insertsubproblemsolution%
+ \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}}%
+ \endgroup%
+ \exf at config@insertsubproblemafter%
{\exf at config@styletext\addvspace{\exf at config@skipsubproblembelow}}%
- \exf at config@insertsubproblemafter%
- \exf at solbelowis{subproblem}{\exf at showsolutions%
- {\exf at config@composetitlesolutionsingle}{}}%
+ \exf at solbelowis{subproblem}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}}%
\ignorespacesafterend}
\define at key{exf at solution}{prob}{\def\exf at solprob{#1}}
@@ -948,8 +960,7 @@
\define at key{exf at solution}{probtitle}{\def\exf at solprobtitle{#1}}
\newenvironment{printsolution}[1]{%
- \par%
- {\exf at config@styletext\addvspace{\exf at config@skipsolutionabove}}%
+ \par{\exf at config@styletext\addvspace{\exf at config@skipsolutionabove}}%
\exf at config@insertsolutionbefore%
\ifexf at style@solutionequation%
\exf at eqsav\value{equation}%
@@ -963,7 +974,7 @@
\let\exf at label\@undefined%
\setlength{\exf at solution@points at dim}{0pt}%
\def\exf at solhref{}%
- \exf at init@intro{\exf at config@skipsolutioninfo}%
+ \exf at init@block{\exf at config@skipsolutioninfo}%
\setkeys{exf at solution,exf at probleminfo}{#1}%
\exf at csdo\def{the\exf at solutioncounter}%
{\exf at config@composeitemsolution{\exf at solprob}{\exf at solsubprob}}%
@@ -987,9 +998,9 @@
\fi%
\else%
\ifdim\exf at tmp>0pt%
- \setlength\exf at tmpdim{\exf at tmp}%
+ \setlength\exf at addmargin{\exf at tmp}%
\else%
- \settowidth\exf at tmpdim{%
+ \settowidth\exf at addmargin{%
\exf at config@styletitle\exf at config@styletitlesolution%
\ifx\exf at solsubprob\exf at empty%
\exf at config@composeitemsolution{\exf at config@counterproblemmax}%
@@ -999,9 +1010,6 @@
{\exf at config@countersubproblemmax}%
\fi\exf at config@composeitemsolutionsep}%
\fi%
- \advance\leftskip\exf at tmpdim%
- \advance\linewidth -\exf at tmpdim%
- \advance\@totalleftmargin\exf at tmpdim%
\ifx\exf at solsubprob\exf at empty%
\protected at edef\exf at solution@item%
{\exf at config@composeitemsolution{\exf at solprob}{\exf at empty}}%
@@ -1015,7 +1023,7 @@
\else\exf at solution@item\fi%
\exf at config@composeitemproblemsep}}%
\fi%
- \exf at write@intro{\exf at config@skipsolutiontitle}%
+ \exf at open@block{\exf at config@skipsolutiontitle}%
\@afterindentfalse}%
{\ifdefined\exf at solution@points\ifdim\exf at solution@points at dim=0pt\else%
\ifdim\exf at solution@points at dim=\exf at solution@points pt\else%
@@ -1023,13 +1031,14 @@
\ifexf at warntext\exf at config@insertwarnpoints{\exf at solutionname}%
{\strip at pt\exf at solution@points at dim}{\exf at solution@points}\fi%
\fi\fi\fi%
- \par\endgroup%
- {\exf at config@styletext\addvspace{\exf at config@skipsolutionbelow}}%
- \exf at config@insertsolutionafter%
+ \par\exf at close@block%
\ifexf at style@solutionequation%
\setcounter{exf at solutionequation}{\value{equation}}%
\setcounter{equation}{\exf at eqsav}%
\fi%
+ \endgroup%
+ {\exf at config@styletext\addvspace{\exf at config@skipsolutionbelow}}%
+ \exf at config@insertsolutionafter%
\ignorespacesafterend}
\newcommand{\solutionssection}[1]{\begingroup%
@@ -1044,6 +1053,8 @@
{\exf at config@composetocsolution{\exf at solprob}{\exf at solprobtitle}}}%
\exf at solbelowis{problem}{\let\exf at composetitle%
\exf at config@composetitlesolutionsproblemsingle}%
+ \exf at solbelowis{problem*}{\let\exf at composetitle%
+ \exf at config@composetitlesolutionsproblemsingle}%
\exf at solutionssection{\exf at config@styletitlesolutionsproblem}%
{\exf at composetitle{\exf at solprob}{\exf at solprobtitle}}%
{\exf at config@skipsolutionsproblem}%
@@ -1056,7 +1067,7 @@
\newenvironment{exf at scansolution}[2]{%
\exf at solbelowis{here}{\showpoints}%
\global\exf at bufcleanfalse%
- \ifexf at problem@solnewsec%
+ \ifdefined\exf at problem@solnewsec%
\def\exf at probarg{\ifdefined\exf at prevprob prob={\exf at prevprob}\fi%
\ifdefined\exf at prevprobtitle,probtitle={\exf at prevprobtitle}\fi%
\ifdefined\exf at prevprobhref,href={\exf at prevprobhref}\fi%
@@ -1063,12 +1074,13 @@
\ifdefined\exf at sollabel,label={\exf at sollabel}\fi}%
\exf at solbelowis{here}{\let\exf at probarg\@undefined}%
\exf at solbelowis{subproblem}{\let\exf at probarg\@undefined}%
+ \exf at solbelowis{subproblem*}{\let\exf at probarg\@undefined}%
\ifdefined\exf at probarg%
\ifexf at lineno\exf at addbufline{\exf at linesep}\exf at addbufline{\exf at lineno}\fi%
\exf at addbufline{\@backslashchar solutionssection{\exf at probarg}}%
\exf at addbufline{}%
\fi%
- \global\exf at problem@solnewsecfalse%
+ \global\let\exf at problem@solnewsec\@undefined%
\fi%
\ifexf at lineno\exf at addbufline{\exf at linesep}\exf at addbufline{\exf at lineno}\fi%
\def\exf at subprobarg{%
@@ -1096,10 +1108,16 @@
\ifsolutions\else\exf at clearbuf\fi%
\exf at solbelowis{here}{\exf at showsolutions%
{\exf at config@composetitlesolutionsingle}{}}%
- \exf at solbelowis{subproblem}{\ifdefined\exf at in@subproblem\else%
- \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}\fi}%
- \exf at solbelowis{problem}{\ifdefined\exf at in@problem\else%
- \exf at showsolutions{\exf at config@composetitlesolutionmulti}{}\fi}%
+ \ifdefined\exf at in@subproblem\else%
+ \exf at solbelowis{subproblem}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}}%
+ \exf at solbelowis{subproblem*}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionsingle}{}}\fi%
+ \ifdefined\exf at in@problem\else%
+ \exf at solbelowis{problem}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionmulti}{}}%
+ \exf at solbelowis{problem*}{%
+ \exf at showsolutions{\exf at config@composetitlesolutionmulti}{}}\fi%
\ignorespacesafterend}
\newcommand{\exf at solutionssection}[6]{%
More information about the tex-live-commits
mailing list