summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/exam/README3
-rw-r--r--Master/texmf-dist/doc/latex/exam/exam.md56
-rw-r--r--Master/texmf-dist/doc/latex/exam/examdoc.pdfbin493628 -> 496243 bytes
-rw-r--r--Master/texmf-dist/doc/latex/exam/examdoc.tex104
-rw-r--r--Master/texmf-dist/tex/latex/exam/exam.cls200
5 files changed, 258 insertions, 55 deletions
diff --git a/Master/texmf-dist/doc/latex/exam/README b/Master/texmf-dist/doc/latex/exam/README
index c640150cd66..c3b4ae7e90d 100644
--- a/Master/texmf-dist/doc/latex/exam/README
+++ b/Master/texmf-dist/doc/latex/exam/README
@@ -1,5 +1,4 @@
-This is version 2.7 of the exam document class, dated February 26,
-2021.
+This is version 2.704 of the exam document class, dated July 9, 2023.
The exam document class, together with its user's guide examdoc.tex,
attempts to make it easy for even a LaTeX novice to prepare exams.
diff --git a/Master/texmf-dist/doc/latex/exam/exam.md5 b/Master/texmf-dist/doc/latex/exam/exam.md5
index c7a6e049d91..44ae8fcbec6 100644
--- a/Master/texmf-dist/doc/latex/exam/exam.md5
+++ b/Master/texmf-dist/doc/latex/exam/exam.md5
@@ -1,3 +1,3 @@
-b210b790c86d89aeccb508074bd001ae exam.cls
-08261e0c96d341f948483d8fbf78a118 examdoc.pdf
-b44eb4ab2c875e46f5239d5c27c37d64 examdoc.tex
+cf61070d137ac4d18fa1ab3aa514381e exam.cls
+4d780e1174ccd0bf6457779c74cc98ee examdoc.pdf
+2ac54d161ee18bd44b0a1289f662e305 examdoc.tex
diff --git a/Master/texmf-dist/doc/latex/exam/examdoc.pdf b/Master/texmf-dist/doc/latex/exam/examdoc.pdf
index dcd7c71f3d3..4ae10be84cf 100644
--- a/Master/texmf-dist/doc/latex/exam/examdoc.pdf
+++ b/Master/texmf-dist/doc/latex/exam/examdoc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/exam/examdoc.tex b/Master/texmf-dist/doc/latex/exam/examdoc.tex
index dfca897c850..9b733c935b1 100644
--- a/Master/texmf-dist/doc/latex/exam/examdoc.tex
+++ b/Master/texmf-dist/doc/latex/exam/examdoc.tex
@@ -8,7 +8,7 @@
% The exam documentclass itself is in the file exam.cls.
-%%% Copyright (c) 1997, 2000, 2004, 2008, 2011, 2015, 2017, 2021
+%%% Copyright (c) 1997, 2000, 2004, 2008, 2011, 2015, 2017, 2021, 2023
% Philip S. Hirschhorn
%
% This work may be distributed and/or modified under the
@@ -52,8 +52,8 @@
% Usage: \texttt{\bs documentclass}
\newcommand{\bs}{\texorpdfstring{\char`\\}{}}
-\newcommand{\docversion}{2.7}
-\newcommand{\docdate}{August 14, 2022}
+\newcommand{\docversion}{2.704}
+\newcommand{\docdate}{July 9, 2023}
%\newcommand{\docdate}{Draft: \today}
%--------------------------------------------------------------------
@@ -74,7 +74,7 @@
\newcommand{\indtsub}[2]{\index{#1@\texttt{#1}!#2}}
\newcommand{\indtstart}[1]{\index{#1@\texttt{#1}|(}}
\newcommand{\indtstop}[1]{\index{#1@\texttt{#1}|)}}
-
+\index{xcolor|see{color}}
%---------------------------------------------------------------------
\newenvironment{example}%
{\bigskip\filbreak
@@ -132,7 +132,7 @@
Wellesley, MA 02481\\
psh@math.mit.edu\\[\bigskipamount]
Copyright \copyright~1994, 1997, 2000, 2004, 2008, 2011, 2015, 2017,
- 2021\\
+ 2021, 2023\\
Philip Hirschhorn\\
All rights reserved}
@@ -3547,10 +3547,10 @@ which would cause correct choices to be printed in italics when
solutions are being printed.
For another example, if you give the command
-\verb"\usepackage{color}"\indt{color} in the preamble\index{preamble}
-of your document (i.e., after the \verb"\documentclass" command and
-before the \verb"\begin{document}"), and then give the
- command\indc{CorrectChoiceEmphasis}\indc{color}
+\verb"\usepackage{color}"\indt{color} (or \verb"\usepackage{xcolor}")
+in the preamble\index{preamble} of your document (i.e., after the
+\verb"\documentclass" command and before the \verb"\begin{document}"),
+ and then give the command\indc{CorrectChoiceEmphasis}
\begin{center}
\verb"\CorrectChoiceEmphasis{\color{red}}"
\end{center}
@@ -3558,9 +3558,10 @@ then when solutions are being printed the correct choices will be
printed in red (assuming your printer can produce that color).
For another example, if you give the command
-\verb"\usepackage{color}"\indt{color} in the preamble of your document
-(i.e., after the \verb"\documentclass" command and before the
-\verb"\begin{document}" command) and then give the command\indc{color}
+\verb"\usepackage{color}"\indt{color} (or \verb"\usepackage{xcolor}")
+in the preamble of your document (i.e., after the
+\verb"\documentclass" command and before the \verb"\begin{document}"
+ command) and then give the command
\begin{center}
\verb"\CorrectChoiceEmphasis{\color{red}\bfseries}"
\end{center}
@@ -4219,9 +4220,10 @@ commands\indc{colorfillwithlines}\index{color package}
\verb"\colorfillwithlines"
\end{tabular}
\end{center}
-then the lines will be in color, by default a light gray. That
-default color was defined by the
-command\indc{definecolor}\indt{FillWithLinesColor}
+(or \verb"\usepackage{xcolor}" instead of
+\verb"\usepackage{color}")(or \verb"\usepackage{xcolor}") then the
+lines will be in color, by default a light gray. That default color
+was defined by the command\indc{definecolor}\indt{FillWithLinesColor}
\begin{center}
\verb"\definecolor{FillWithLinesColor}{gray}{0.8}"
\end{center}
@@ -4360,6 +4362,7 @@ commands\indc{colorfillwithdottedlines}\index{color package}
\verb"\colorfillwithdottedlines"
\end{tabular}
\end{center}
+(or \verb"\usepackage{xcolor}" instead of \verb"\usepackage{color}")
then the dotted lines will be in color, by default a light gray. That
default color was defined by the
command\indc{definecolor}\indt{FillWithDottedLinesColor}
@@ -4490,6 +4493,7 @@ commands\indc{colorgrids}\index{color package}
\verb"\colorgrids"
\end{tabular}
\end{center}
+(or \verb"\usepackage{xcolor}" instead of \verb"\usepackage{color}")
then the grids will be in color, by default a light gray. That
default color was defined by the
command\indc{definecolor}\indt{GridColor}
@@ -4605,7 +4609,8 @@ the following into your preamble (i.e., after the
{}
{Page \thepage\ of \numpages}
\end{verbatim}
-
+(You could also use \verb"\usepackage{xcolor}" instead of
+\verb"\usepackage{color}")
%--------------------------------------------------------------------
\subsubsection{Printing graph paper}
@@ -5072,9 +5077,11 @@ command\index{color package}
\begin{center}
\verb"\usepackage{color}"
\end{center}
-in the preamble of your document (i.e., after the
-\verb"\documentclass" command and before the \verb"\begin{document}"
- command), then you can give the command\indc{shadedsolutions}
+(or the \verb"xcolor" package with the command
+\verb"\usepackage{xcolor}") in the preamble of your document (i.e.,
+after the \verb"\documentclass" command and before the
+\verb"\begin{document}" command), then you can give the
+ command\indc{shadedsolutions}
\begin{center}
\verb"\shadedsolutions"
\end{center}
@@ -5246,10 +5253,11 @@ example, you give the command
\verb"\SolutionEmphasis{\itshape\small}"
\end{center}
then the solutions will be set in italics, in small type. For another
-example, if you've given the command \verb"\usepackage{color}" in the
-preamble of your document (i.e., after the \verb"\documentclass"
-command and before the \verb"\begin{document}") and you give the
-command\indc{SolutionEmphasis}
+example, if you've given the command \verb"\usepackage{color}" (or
+\verb"\usepackage{xcolor}") in the preamble of your document (i.e.,
+after the \verb"\documentclass" command and before the
+\verb"\begin{document}") and you give the
+ command\indc{SolutionEmphasis}
\begin{center}
\verb"\SolutionEmphasis{\color{red}}"
\end{center}
@@ -5562,9 +5570,10 @@ If you've given the command
\begin{center}
\verb"\usepackage{color}"\index{color package}
\end{center}
-in the preamble of your document (i.e., after the
-\verb"\documentclass" command and before the \verb"\begin{document}"
-command), then you can give the command\indc{colorsolutionboxes}
+(or \verb"\usepackage{xcolor}") in the preamble of your document
+(i.e., after the \verb"\documentclass" command and before the
+\verb"\begin{document}" command), then you can give the
+ command\indc{colorsolutionboxes}
\begin{center}
\verb"\colorsolutionboxes"
\end{center}
@@ -5584,6 +5593,49 @@ the command\indc{nocolorsolutionboxes}
\verb"\nocolorsolutionboxes"
\end{center}
+%--------------------------------------------------------------------
+\subsection{Equations inside solutions}
+\label{sec:EqsInSolutions}
+
+If you use an \verb"equation" environment inside of a solution, then
+that environment (like all \verb"equation" environments) will be
+numbered using the \verb"equation" counter%
+\index{equation counter@\texttt{equation} counter}, which will affect
+the numbering of equations that follow. However, if you then print a
+version of your exam without using the \verb"\printanswers" command
+(or the documentclass option \verb"answers"), then the equation inside
+the solution environment will not appear, and this will change the
+equation numbers of the later \verb"equation" environments.
+
+If you want to avoid having \verb"equation" numbers change depending
+on whether or not solutions are being printed, you can do this either
+by using the documentclass option
+\begin{center}
+ \verb"solutionsreseteqcounter"
+\end{center}
+or by giving the command
+\begin{center}
+ \verb"\solutionsreseteqcounter"\indc{solutionsreseteqcounter}
+\end{center}
+at the beginning of your file. That command causes equation numbers
+inside each solution to be independent of the equation numbers outside
+of the solution environment or in other solution environments.
+
+In more detail: If you give the command
+\verb"\solutionsreseteqcounter" then every time you begin one of the
+solution environments, the \verb"equation" counter will be reset to
+zero (so that the first \verb"equation" environment in the solution
+will be number 1), and when you end that solution environment the
+\verb"equation" counter will be restored to whatever it was before the
+solution environment.
+
+If you've given the command \verb"\solutionsreseteqcounter" and you
+want to change back to not having solutions reset the equation
+counter, you can do that by giving the command
+\begin{center}
+ \verb"\nosolutionsreseteqcounter"\indc{nosolutionsreseteqcounter}
+\end{center}
+
%--------------------------------------------------------------------
diff --git a/Master/texmf-dist/tex/latex/exam/exam.cls b/Master/texmf-dist/tex/latex/exam/exam.cls
index ae851ef2031..002100639d7 100644
--- a/Master/texmf-dist/tex/latex/exam/exam.cls
+++ b/Master/texmf-dist/tex/latex/exam/exam.cls
@@ -4,7 +4,7 @@
%% exam.cls
%% Copyright (c) 1994, 1997, 2000, 2004, 2008, 2011,
-%% 2015, 2017, 2021 Philip S. Hirschhorn
+%% 2015, 2017, 2021, 2023 Philip S. Hirschhorn
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -32,8 +32,8 @@
% from my web page: http://www-math.mit.edu/~psh/
-\def\fileversion{2.7}
-\def\filedate{2021/02/26}
+\def\fileversion{2.704}
+\def\filedate{2023/07/09}
%---------------------------------------------------------------------
%---------------------------------------------------------------------
%
@@ -86,6 +86,53 @@
% Changelog since version 2.4:
%--------------------------------------------------------------------
+% Version 2.704, 2023/07/08
+
+% No longer betatest.
+
+%--------------------------------------------------------------------
+% Version 2.703$\beta$, 2023/02/12
+
+% We modify the definition of \colorfbox to eliminate the warning
+
+% Package xcolor Warning: Incompatible color definition
+
+% when the user has loaded xcolor.sty instead of color.sty. We fixed
+% this by having \colorfbox check whether the user has loaded
+% xcolor.sty or color.sty, and then using the appropriate command when
+% saving the current color.
+
+%--------------------------------------------------------------------
+% Version 2.702$\beta$, 2022/07/04
+
+% We modify the changes in version 2.701$\beta$ so that they only have
+% effect if the user gives the command \solutionsreseteqcounter, so
+% that the default behavior is identical to the behavior before
+% version 2.701$\beta$. This can be cancelled at any point by giving
+% the command \nosolutionsreseteqcounter. There is also a new
+% documentclass option ``solutionsreseteqcounter'', which is
+% equivalent to giving the command \solutionsreseteqcounter at the
+% beginning of the file.
+%
+%--------------------------------------------------------------------
+% Version 2.701$\beta$, 2022/07/02
+
+% All solution environments (solution, solutionorbox, solutionorlines,
+% solutionordottedlines, solutionorgrid, and solutionbox) now save the
+% current value of the equation counter and then reset the equation
+% counter to zero, so that equations numbers start from one within
+% each solution, and then restore the saved value of the equation
+% counter at the end of the environment. This corrects the problemn
+% that if an equation anvironment appeared inside of a solution, it
+% would affect the equation numbers appearing later in the document,
+% even if solutions weren't being printed.
+%
+% Note: This was modified in version 2.702$\beta$ so that it only
+% takes effect if the user gives the command \solutionsreseteqcounter,
+% and so the default behavior is identical tothe behavior before
+% version 2.701$\beta$.
+
+%--------------------------------------------------------------------
% Version 2.7, 2021/02/26
% No longer betatest.
@@ -646,6 +693,11 @@
\DeclareOption{cancelspace}{\cancelspacetrue}
\DeclareOption{nocancelspace}{\cancelspacefalse}
+\newif\ifsolutionsreseteqcounter
+\solutionsreseteqcounterfalse
+\DeclareOption{solutionsreseteqcounter}{\solutionsreseteqcountertrue}
+\DeclareOption{nosolutionsreseteqcounter}{\solutionsreseteqcounterfalse}
+
% The following keeps track of whether the user has requested that we
% add up the points on the exam. We make the default false so that
% users who put other than numbers into the points argument of a
@@ -4609,9 +4661,9 @@
in order to use the command \protect\colorfillwithlines
\MessageBreak
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -4708,9 +4760,9 @@
in order to use the command \protect\colorfillwithdottedlines
\MessageBreak
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -4799,9 +4851,9 @@
\space\space\protect\usepackage{color}\MessageBreak
in order to use the command \protect\colorgrids
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -7621,7 +7673,17 @@
\def\nounstarredvspace{\@unstarredvspacefalse}
\nounstarredvspace
+% If the documentclass options include ``solutionsreseteqcounter'',
+% then the command \solutionsreseteqcounter is given at the beginning
+% of the run.
+% If the documentclass options include ``nosolutionsreseteqcounter'',
+% then the command \nosolutionsreseteqcounter is given at the beginning
+% of the run.
+
+\def\solutionsreseteqcounter{\solutionsreseteqcountertrue}
+\def\nosolutionsreseteqcounter{\solutionsreseteqcounterfalse}
+
% \if@insolution will be true while we're inside of any of the
% solution environments. This is used to supress \PgInfo@write and
% \label commands generated if there's a parts (or subparts, or
@@ -7636,6 +7698,12 @@
}
\SolutionEmphasis{}
+% When we enter any of the solution (etc.) environments we save the
+% value of the equation counter, set the equation counter to zero, and
+% then restore the value of the equation counter at the end of the
+% environment.
+\newcounter{exam@saved@eqnum}
+
% If printanswers is true, we print the solution using a TheSolution
% environment. If printanswers is false and cancelspace is false, we
% insert blank vertical space equal to the optional argument (the
@@ -7644,6 +7712,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7669,6 +7741,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
% If printanswers is true, we print the solution using a TheSolution
@@ -7681,6 +7756,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7720,6 +7799,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
% If printanswers is true, we print the solution using a TheSolution
@@ -7730,6 +7812,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7751,6 +7837,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
% If printanswers is true, we print the solution using a TheSolution
@@ -7761,6 +7850,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7782,6 +7875,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
% If printanswers is true, we print the solution using a TheSolution
@@ -7792,6 +7888,10 @@
{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\ifprintanswers
\begingroup
\Solution@Emphasis
@@ -7813,6 +7913,9 @@
\else
\egroup
\fi
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}%
@@ -7874,9 +7977,9 @@
in order to use the command \protect\shadedsolutions
\MessageBreak
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -7947,9 +8050,9 @@
in order to use the command \protect\colorsolutionboxes
\MessageBreak
}{%
- This command makes use of the package color.sty,\MessageBreak
- and so you have to load color.sty before your\MessageBreak
- \protect\begin{document} command.\MessageBreak
+ This command requires either the package color.sty\MessageBreak
+ or xcolor.sty, and so you have to load one of those before \MessageBreak
+ your \protect\begin{document} command.\MessageBreak
}%
}%
{%
@@ -7963,6 +8066,10 @@
\newenvironment{solutionbox}[1]{%
\@insolutiontrue % cancelled by the end of the environment
\@addpointsfalse % cancelled by the end of the environment
+ \ifsolutionsreseteqcounter
+ \setcounter{exam@saved@eqnum}{\value{equation}}%
+ \setcounter{equation}{0}%
+ \fi
\def\solutionbox@size{#1}% saved for end of environment
% Change, 2016/02/08: So that the solutionbox environment will work
% correctly inside of a tabular environment, we use \hsize instead of
@@ -8022,12 +8129,16 @@
% Starting in version 2.502, 2016/03/23,the decision of whether to
% color the box is made in the \makeemptybox command:
\makeemptybox{\solutionbox@size}
+ \ifsolutionsreseteqcounter
+ \setcounter{equation}{\value{exam@saved@eqnum}}%
+ \fi
}% End of the second argument of \newenvironment{solutionbox}
%--------------------------------------------------------------------
%--------------------------------------------------------------------
% Added in version 2.502: 2016/03/23, \colorfbox
+% Modified in version 2.703, 2023/02/12
% The \colorfbox command is used in our modification of framed.sty
% that allows us to print the frame around the solution in color when
@@ -8035,25 +8146,66 @@
% arguments, the first being the color for the frame, and the second
% being the stuff to be framed.
+% When you define a color mycolor using either color.sty or
+% xcolor.sty, a macro \csname\string\color@ mycolor\endcsname is
+% defined (i.e., the macro name is \\color@mycolor).
+
% If we had assumed that xcolor.sty was used (instead of just
% color.sty), then the line that saves the current color in
% saved@color could have been just
% \colorlet{saved@color}{.}
-% but we wanted to make this work even if color.sty is being used.
+% but we wanted to make this work even if color.sty was being used, when
+% the command needed to save the color is
-% When you define a color mycolor using either color.sty or
-% xcolor.sty, a macro \csname\string\color@ mycolor\endcsname is
-% defined (i.e., the macro name is \\color@mycolor).
+% \expandafter\let\csname\string\color@saved@color\endcsname\current@color
+
+% To make this useable whether either color.sty or xcolor.sty was
+% being used, the original version of this command saved the current
+% color using the command that works for color.sty, which also seemed
+% to work for xcolor.sty. Alas, it turned out that if the user was
+% using xcolor sty, then \colorsolutionboxes worked OK except that
+% xcolor.sty put the warning
+
+% Package xcolor Warning: Incompatible color definition
+
+% into the log file. It turned out that the reason for the warning is
+% that, although both color.sty and xcolor.sty create the same macro
+% name, xcolor.sty puts more information into that macro than
+% color.sty does, and so when xcolor.sty sees a color definition in
+% the form used by color.sty, it generates that warning.
+
+% To eliminate that warning, in version 2.703 we changed the
+% \colorfbox command to check whether xcolor.sty is loaded (in which
+% case we use the \colorlet command) or color.sty is loaded (in which
+% case we use the longer command that works for color.sty).
+
+% \newcommand{\colorfbox}[2]{%
+% % Save the current color in saved@color:
+% \expandafter\let\csname\string\color@saved@color\endcsname\current@color
+% % Create the box in color #1, with the text in saved@color
+% % (the braces are to confine the color change commands):
+% {\color{#1}\fbox{\color{saved@color}#2}}%
+% }% colorfbox
+
\newcommand{\colorfbox}[2]{%
% Save the current color in saved@color:
- \expandafter\let\csname\string\color@saved@color\endcsname\current@color
+ \@ifundefined{colorlet}{%
+ % color.sty was used
+ \expandafter\let\csname\string\color@saved@color\endcsname\current@color
+ }%
+ {%
+ % xcolor.sty was used
+ \colorlet{saved@color}{.}%
+ }%
% Create the box in color #1, with the text in saved@color
% (the braces are to confine the color change commands):
{\color{#1}\fbox{\color{saved@color}#2}}%
-}% colorfbox
+}% newcommand
+
+
%--------------------------------------------------------------------
%--------------------------------------------------------------------