Skip to content

Commit ba6070a

Browse files
committed
change solution table color scheme
1 parent 797af79 commit ba6070a

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

examClass.cls

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@
114114
\renewcommand{\tablename}{Tab.}
115115
}
116116

117-
% Hook to apply blue color to table content
118-
\AtBeginEnvironment{solutiontable}{%
119-
\AtBeginEnvironment{tabular}{%
120-
\ifsolution
121-
\color{blue}%
122-
\fi
123-
}
124-
}
117+
% Color hook for solutiontable
118+
\newif\ifinsolutiontable
119+
\insolutiontablefalse
120+
\AtBeginEnvironment{solutiontable}{\insolutiontabletrue}
121+
\AtEndEnvironment{solutiontable}{\insolutiontablefalse}
122+
% Color only the tabular content within solutiontable; tabular forms a group, so color is local
123+
\AtBeginEnvironment{tabular}{\ifsolution\ifinsolutiontable\color{blue}\fi\fi}
124+
\AtBeginEnvironment{tabular*}{\ifsolution\ifinsolutiontable\color{blue}\fi\fi}
125125

126126

127127

exerciseClass.cls

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
\RequirePackage{titling}
3737
\RequirePackage{mathtools}
3838
\RequirePackage{placeins}
39+
\RequirePackage{etoolbox} % for environment hooks
3940

4041
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4142
%% Graphic path %%
@@ -74,14 +75,15 @@
7475
\renewcommand{\tablename}{Tab.}
7576
}
7677

77-
% Hook to apply blue color to table content
78-
\AtBeginEnvironment{solutiontable}{%
79-
\AtBeginEnvironment{tabular}{%
80-
\ifsolution
81-
\color{blue}%
82-
\fi
83-
}
84-
}
78+
% Color hook for solutiontable
79+
\newif\ifinsolutiontable
80+
\insolutiontablefalse
81+
\AtBeginEnvironment{solutiontable}{\insolutiontabletrue}
82+
\AtEndEnvironment{solutiontable}{\insolutiontablefalse}
83+
% Color only the tabular content within solutiontable; tabular forms a group, so color is local
84+
\AtBeginEnvironment{tabular}{\ifsolution\ifinsolutiontable\color{blue}\fi\fi}
85+
\AtBeginEnvironment{tabular*}{\ifsolution\ifinsolutiontable\color{blue}\fi\fi}
86+
8587

8688

8789
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

0 commit comments

Comments
 (0)