diff --git a/docs/changelog.tex b/docs/changelog.tex index 1ba4200..6dbe3de 100644 --- a/docs/changelog.tex +++ b/docs/changelog.tex @@ -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 diff --git a/exercisebank.sty b/exercisebank.sty index 68f85c0..27db4b7 100644 --- a/exercisebank.sty +++ b/exercisebank.sty @@ -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{}} diff --git a/exercisebank.zip b/exercisebank.zip index fa25617..31170a0 100644 Binary files a/exercisebank.zip and b/exercisebank.zip differ diff --git a/release/example.zip b/release/example.zip index 8c4e539..447bfce 100644 Binary files a/release/example.zip and b/release/example.zip differ diff --git a/release/exercisebank-doc.pdf b/release/exercisebank-doc.pdf index 648f396..93c1d3c 100644 Binary files a/release/exercisebank-doc.pdf and b/release/exercisebank-doc.pdf differ diff --git a/releasing/do_release.rb b/releasing/do_release.rb deleted file mode 100755 index 34a3e52..0000000 --- a/releasing/do_release.rb +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env ruby -require_relative 'releaser' -require 'pathname' -require 'inifile' -require 'pp' -# p ARGV[0] -suggest_num_commits=20 -# n_commits=3 -FPATH=File.dirname(File.expand_path(__FILE__)) -def expath relpath - exercisebank_abspath=File.dirname(FPATH) - File.expand_path(File.join(exercisebank_abspath,relpath)) -end -ini_path=expath "/src/packaging/texpackvars.ini" -ini_path=File.expand_path(ini_path) -# ini_path="../src/packaging/texpackvars.ini" -myini = IniFile.load(ini_path) -version = myini[:global]['version'] -build = myini[:global]['build'] -# tag = "#{version}b#{build}-prerelease" -tag = "#{version}b#{build}-experimental" -$current_commit=`git log --pretty=format:'%H' -n 1` -r = Releaser.new(ENV['GH_TOKEN'], tag, 'Strauman/exercisebank') -r.get_release -def make_draft r - if ARGV.include?("-n") - n_commits=ARGV[ARGV.index("-n")+1] - else - $latest_commits=`git log --pretty=format:'%s' -n #{suggest_num_commits}` - $latest_commits = $latest_commits.split("\n") - $latest_commits.map!.with_index{|lc,i| "#{i+1}: #{lc}"} - puts($latest_commits) - print "Number of commit messages to include: " - n_commits=$stdin.gets - end - $current_body=`git log --pretty=format:'%B' -n #{n_commits}` - print $current_body - # exit 0 - r.push sha: $current_commit, body: $current_body - r.upload_asset(expath('release/exercisebank.sty')) - r.upload_asset(expath('release/exercisebank-doc.pdf')) - # r.upload_asset('../exercisebank.zip') -end -if ARGV.include?('--delete') - r.get_release - unless r.release.nil? - r.delete - r.get_release! - end -else - if r.release.nil? - make_draft r - elsif ARGV.include?('-f') - r.delete - r.get_release! - make_draft r - end - unless r.release.nil? - if r.release[:draft] - r.publish if ARGV.include?('--publish') - end - end - if r.release[:draft] - p 'DRAFT' - else - p 'NDRAFT' - end -end -pp r.release diff --git a/src/envcontrol.tex b/src/envcontrol.tex index f016db1..6ef3e32 100644 --- a/src/envcontrol.tex +++ b/src/envcontrol.tex @@ -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 } diff --git a/src/hidetags.tex b/src/hidetags.tex index d51bce2..0ef60a0 100644 --- a/src/hidetags.tex +++ b/src/hidetags.tex @@ -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{}} diff --git a/src/main.tex b/src/main.tex index f94c633..1912d06 100644 --- a/src/main.tex +++ b/src/main.tex @@ -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} diff --git a/src/packageoptions.tex b/src/packageoptions.tex index 0f25648..dcb17f8 100644 --- a/src/packageoptions.tex +++ b/src/packageoptions.tex @@ -1,5 +1,6 @@ %!TEX root = main.tex \makeatletter +% \ignoreOutlineSpaces \edef\@isTrue{1} \edef\@isFalse{0} %:§config @@ -34,6 +35,7 @@ \gdef\exb@currentPoints{0} %:§config %:- +% \obeyOutlineSpaces % ---- \exercisebanksetup ----- % \pgfkeys{ /exbanksetup/.is family, /exbanksetup, @@ -79,6 +81,7 @@ F/.initial = \@isFalse, False/.initial = \@isFalse, } +% \ignoreOutlineSpaces %:=\exercisebanksetup{[key/values]} \newcommand\exercisebanksetup[1]{ \pgfkeys{/exbanksetup, #1}% @@ -102,6 +105,7 @@ \filbreak% \fi% } +% \obeyOutlineSpaces %: Here is a list of the different keys and their meaning diff --git a/src/preamble.tex b/src/preamble.tex index 7f698ec..b649c75 100644 --- a/src/preamble.tex +++ b/src/preamble.tex @@ -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} @@ -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} diff --git a/src/spaceIgnore.tex b/src/spaceIgnore.tex new file mode 100644 index 0000000..b6a6419 --- /dev/null +++ b/src/spaceIgnore.tex @@ -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% +}