Skip to content

Commit

Permalink
Correct 'warning'-message if \DisplaySolutions is or is not shown. Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Strauman committed Nov 28, 2018
1 parent ab4660b commit 84b427a
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 76 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.tex
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
\change{Fixed bug where part problem header repeats if solution is itemize.}
\change{Introduced the \dac\rigid command for the \dac\At functionality. Also the \dac\ClearHook for deleting a hook}
\change{\dac\buildset now gives error if set does not exist.}
\change{Made \dac\HideTags cummulative.}
\change{Created \dac\ShowAllTags for clearing tags list}
\change{Raises error when pdf\TeX(or pdf\LaTeX) is not used}
\chlogtable


Expand Down
3 changes: 2 additions & 1 deletion exercisebank.sty
Original file line number Diff line number Diff line change
Expand Up @@ -892,4 +892,5 @@ nohead/.code = {\exb@noheadArgtrue\ea\gdef\csname setlist@\exb@currentSetID @noh
\fi
\fi
}
\gdef\HideTags#1{\xdef\exb@hidetaglist{#1}}
\gdef\HideTags#1{\xdef\exb@hidetaglist{\unexpanded\expandafter{\exb@hidetaglist},#1}}
\gdef\ShowAllTags#1{\gdef\exb@hidetaglist{}}
Binary file modified exercisebank.zip
Binary file not shown.
Binary file modified release/example.zip
Binary file not shown.
Binary file modified release/exercisebank-doc.pdf
Binary file not shown.
69 changes: 0 additions & 69 deletions releasing/do_release.rb

This file was deleted.

2 changes: 1 addition & 1 deletion src/envcontrol.tex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
%% ^ This should be fixed!
%%NB: DOC for \DisplaySolutions are moved down
\AtBeginDocument{
\ifexb@DisplaySolutions\isFalse
\ifexb@DisplaySolutions\else
\@latex@warning{Hiding solutions. Show them with \string\DisplaySolutions}
\fi
}
Expand Down
6 changes: 5 additions & 1 deletion src/hidetags.tex
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
%:=\HideTags{list}
%:Hide all exercises containing the list of tags when building a set.
%:-
\gdef\HideTags#1{\xdef\exb@hidetaglist{#1}}
\gdef\HideTags#1{\xdef\exb@hidetaglist{\unexpanded\expandafter{\exb@hidetaglist},#1}}
%:=\ShowAllTags
%:Reset tags set by \HideTags
%:-
\gdef\ShowAllTags{\gdef\exb@hidetaglist{}}
12 changes: 8 additions & 4 deletions src/main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
\usepackage{lipsum}

\exercisebanksetup{%
exercise directory=../exercises
exercise directory=../exercises
}

%% The \makeset{setname}{exercises,to,include} picks exercises from the exercises-folder
%% The \exclude{setname}{1,2,3,...,9} excludes partproblems 1,...,9 from setname
\makeset{electro}{capacitance}
\makeset{first}{firstexercise}
\makeset{2}{firstexercise, \exclude{secondexercise}{1,2}, \select{thirdexercise}{1,2}, \exclude{thirdexercise}{1,2}}
% \DisplaySolutions
% \DeclareExerciseCommand\extitle[1]{\strut{\vadjust{\vbox to 0pt{\hskip\pMarginLeft{\Large\bfseries #1}}}}%}
\DeclareExerciseCommand\problemtitle[1]{\stepcounter{problemcounter}%
\strut{\vadjust{\vbox to 0pt{\hskip\pMarginLeft{\Large{\bfseries Exercice \theproblemcounter.} #1}}}}%
}
\DisplaySolutions
\makeset[nohead]{2}{firstexercise, \exclude{secondexercise}{1,2}, \select{thirdexercise}{1,2}, \exclude{thirdexercise}{1,2}}
\begin{document}
\buildset{2}
\buildset{2}
\end{document}
4 changes: 4 additions & 0 deletions src/packageoptions.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
%!TEX root = main.tex
\makeatletter
% \ignoreOutlineSpaces
\edef\@isTrue{1}
\edef\@isFalse{0}
%:§config
Expand Down Expand Up @@ -34,6 +35,7 @@
\gdef\exb@currentPoints{0}
%:§config
%:-
% \obeyOutlineSpaces
% ---- \exercisebanksetup ----- %
\pgfkeys{
/exbanksetup/.is family, /exbanksetup,
Expand Down Expand Up @@ -79,6 +81,7 @@
F/.initial = \@isFalse,
False/.initial = \@isFalse,
}
% \ignoreOutlineSpaces
%:=\exercisebanksetup{[key/values]}
\newcommand\exercisebanksetup[1]{
\pgfkeys{/exbanksetup, #1}%
Expand All @@ -102,6 +105,7 @@
\filbreak%
\fi%
}
% \obeyOutlineSpaces


%: Here is a list of the different keys and their meaning
Expand Down
7 changes: 7 additions & 0 deletions src/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
\@ifundefined{ownLineNoSpacesGotIt}{
\@latex@warning{Compilation wont work unless \string\end{problem} and \string\end{solution} are on their own lines and without any spaces. This warning can be removed by doing \string\def\string\ownLineNoSpacesGotIt{} before \@backslashchar usepackage{exercisebank}}
}{}
\ifcsname pdfstrcmp\endcsname\else
\PackageError{exercisebank-@@VERSION}{Exercisebank currently only works with pdfLaTeX}{}\stop
\fi
%:\!begin{marker}DEPRECATED! use \refCom{exercisebanksetup} with \refKey{exercise directory} instead!\!end{marker}
%:=\setExercisesDir{directory}
%:\!begin{marker}\setExercisesDir is deprecated! use \refCom{exercisebanksetup} with \refKey{exercise directory} instead!\!end{marker}
Expand All @@ -26,10 +29,14 @@
\makeatother

\global\let\incl = \input
\input{spaceIgnore}
\input{ifs}
\input{packages}
% \ignoreOutlineSpaces
\input{helpers}
% \obeyOutlineSpaces%
\input{packageoptions}
% \ignoreOutlineSpaces
\input{stopfilbreak}
\input{i18n}
\input{at}
Expand Down
29 changes: 29 additions & 0 deletions src/spaceIgnore.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
%!TEX root = main.tex
\makeatletter
\def\exb@rememberCC#1{%
\edef\exbtmp@charcode{\the\numexpr#1}%
\expandafter\xdef\csname exb@remcc@\exbtmp@charcode\endcsname{\the\catcode#1}%
}
\def\exb@ignoreCC#1{%
\edef\exbtmp@charcode{\the\numexpr#1}
\exb@rememberCC{\exbtmp@charcode}%
\catcode\exbtmp@charcode=9%
}
\def\exb@resetCC#1{
\catcode#1=\csname exb@remcc@\the\numexpr#1\endcsname
}
% Ignores spaces that are not inline spaces
% (newlines and tabs)
\def\ignoreOutlineSpaces{%
\exb@ignoreCC{10}% line feed (New line)
\exb@ignoreCC{11}% Vertical Tab
\exb@ignoreCC{12}% Form Feed
\exb@ignoreCC{13}% Carriage Return
}
% Reset space ignore
\def\obeyOutlineSpaces{%
\exb@resetCC{10}%
\exb@resetCC{11}%
\exb@resetCC{12}%
\exb@resetCC{13}\ignorespaces%
}

0 comments on commit 84b427a

Please sign in to comment.