From e2e61931409be2a7142b4d0f4b59a275b7f59e2a Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 2 Feb 2021 03:04:35 +0000 Subject: CTAN sync 202102020304 --- macros/latex/contrib/xsim/HISTORY | 10 +- macros/latex/contrib/xsim/README | 6 +- .../contrib/xsim/examples/xsim.texsx-549540.pdf | Bin 0 -> 60853 bytes .../contrib/xsim/examples/xsim.texsx-549540.tex | 153 +++++++++++++++++++++ macros/latex/contrib/xsim/xsim-manual.cls | 4 +- macros/latex/contrib/xsim/xsim-manual.pdf | Bin 1308757 -> 1353979 bytes macros/latex/contrib/xsim/xsim.sty | 4 +- .../latex/contrib/xsim/xsim.style.layouts.code.tex | 121 ++++++++++++++++ 8 files changed, 289 insertions(+), 9 deletions(-) create mode 100644 macros/latex/contrib/xsim/examples/xsim.texsx-549540.pdf create mode 100644 macros/latex/contrib/xsim/examples/xsim.texsx-549540.tex create mode 100644 macros/latex/contrib/xsim/xsim.style.layouts.code.tex (limited to 'macros/latex/contrib/xsim') diff --git a/macros/latex/contrib/xsim/HISTORY b/macros/latex/contrib/xsim/HISTORY index 0d3f7d417a..c898ca033c 100644 --- a/macros/latex/contrib/xsim/HISTORY +++ b/macros/latex/contrib/xsim/HISTORY @@ -7,15 +7,15 @@ Clemens Niederberger Web: https://github.com/cgnieder/xsim E-Mail: contact@mychemistry.eu -------------------------------------------------------------------------- -Copyright 2017--2020 Clemens Niederberger +Copyright 2017--2021 Clemens Niederberger This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either version 1.3 +conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt -and version 1.3 or later is part of all distributions of LaTeX -version 2005/12/01 or later. +and version 1.3c or later is part of all distributions of LaTeX +version 2008/05/04 or later. This work has the LPPL maintenance status `maintained'. @@ -176,3 +176,5 @@ HISTORY: - make `no-files' the default - new examples - various small fixes + v0.20a 2021/02/01 - re-add missing `layouts' style + - add example texsx-549540 diff --git a/macros/latex/contrib/xsim/README b/macros/latex/contrib/xsim/README index 3407220a29..82ac42689c 100644 --- a/macros/latex/contrib/xsim/README +++ b/macros/latex/contrib/xsim/README @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -XSIM 2021/01/31 v0.20 +XSIM 2021/02/01 v0.20a XSIMVERB 2021/01/31 v0.3 eXercise Sheets IMproved @@ -26,9 +26,10 @@ The Current Maintainer of this work is Clemens Niederberger. The xsim package consists of the code files: xsim.sty xsimverb.sty + xsim.style.layouts.code.tex -------------------------------------------------------------------------- The xsim package consists of the documentation files: - README HISTORY + README, HISTORY xsim-manual.tex, xsim-manual.pdf xsim-manual.cls -------------------------------------------------------------------------- @@ -66,6 +67,7 @@ The xsim package consists of the example files: xsim.texsx-395273.tex, xsim.texsx-395273.pdf xsim.texsx-466584.tex, xsim.texsx-466584.pdf xsim.texsx-498299.tex, xsim.texsx-498299.pdf + xsim.texsx-549540.tex, xsim.texsx-549540.pdf xsim.texsx-576998.tex, xsim.texsx-576998.pdf xsim.texsx-580636.tex, xsim.texsx-580636.pdf xsim.texwelt-6698.tex, xsim.texwelt-6698.pdf diff --git a/macros/latex/contrib/xsim/examples/xsim.texsx-549540.pdf b/macros/latex/contrib/xsim/examples/xsim.texsx-549540.pdf new file mode 100644 index 0000000000..3dbe7bb716 Binary files /dev/null and b/macros/latex/contrib/xsim/examples/xsim.texsx-549540.pdf differ diff --git a/macros/latex/contrib/xsim/examples/xsim.texsx-549540.tex b/macros/latex/contrib/xsim/examples/xsim.texsx-549540.tex new file mode 100644 index 0000000000..332e3d9920 --- /dev/null +++ b/macros/latex/contrib/xsim/examples/xsim.texsx-549540.tex @@ -0,0 +1,153 @@ +% https://tex.stackexchange.com/q/549540/ +\documentclass[12pt]{article} +\usepackage[T1]{fontenc} + +\usepackage{parskip} +\usepackage{geometry} +\geometry{ a4paper, left=5mm, right=5mm, top=15mm } + +\usepackage{amsmath,amssymb} + +\usepackage{multicol} +\setlength{\columnsep}{1mm} +\setlength{\columnseprule}{0.2pt} + +\usepackage[most]{tcolorbox} + +\usepackage{siunitx} +\usepackage{xsim} +\usepackage{tasks} + +\makeatletter +\newtcolorbox{examtitle}[2][]{ + halign=flush center, + colframe=gray!70!black, + fonttitle=\Large, + enhanced, + breakable, + colback=white, + attach boxed title to top right={yshift=-2pt}, title={#2}, + boxed title size=standard, + boxrule=0pt, + boxed title style={ + sharp corners, + rounded corners=northeast, + colback=tcbcolframe, + boxrule=0pt}, + sharp corners=north, + overlay unbroken={ + \path[fill=tcbcolback] + ([xshift=2pt]title.south west) + to[out=180, in=0] ([xshift=-1.5cm]title.west)-- + (title.west-|frame.west) |- + ([xshift=2pt]title.south west)--cycle; + \path[fill=tcbcolframe] (title.south west) + to[out=180, in=0] ([xshift=-1.5cm]title.west)-- + (title.west-|frame.west) + [rounded corners=\kvtcb@arc] |- + (title.north-|frame.north) + [sharp corners] -| (title.south west); + \draw[line width=.5mm, rounded corners=\kvtcb@arc, + tcbcolframe] + (title.north east) rectangle + (frame.south west); + }, + overlay first={ + \path[fill=tcbcolback] + ([xshift=2pt]title.south west) + to[out=180, in=0] ([xshift=-1.5cm]title.west)-- + (title.west-|frame.west) |- + ([xshift=2pt]title.south west)--cycle; + \path[fill=tcbcolframe] (title.south west) + to[out=180, in=0] ([xshift=-1.5cm]title.west)-- + (title.west-|frame.west) + [rounded corners=\kvtcb@arc] |- + (title.north-|frame.north) + [sharp corners] -| (title.south west); + \draw[line width=.5mm, rounded corners=\kvtcb@arc, + tcbcolframe] + (frame.south west) |- (title.north) -| + (frame.south east); + }, + overlay middle={ + \draw[line width=.5mm, tcbcolframe] + (frame.north west)--(frame.south west) + (frame.north east)--(frame.south east); + }, + overlay last={ + \draw[line width=.5mm, rounded corners=\kvtcb@arc, + tcbcolframe] + (frame.north west) |- (frame.south) -| + (frame.north east); + }, + #1 +} +\makeatother + +\xsimsetup{ + load-style = layouts , + exercise/template = minimal , + exercise/the-counter = \arabic{exercise}. , + exercise/end-hook = \vspace{\baselineskip} +} + +\NewTasksEnvironment[ + label = (\Alph*) , + label-format = \bfseries , + label-width = 21pt +]{choices}[\choice] + +\DeclareExerciseProperty{answer} +\newcommand*\answer[1]{% + \SetExpandedExerciseProperty{answer}{ \thetask\ \unexpanded{#1}}% + #1% +} + +\newcommand*\getanswers{% + \def\betweenanswers{\def\betweenanswers{\hspace{2em}}}% + \ForEachUsedExerciseByID{% + \betweenanswers##3\ExercisePropertyGet{##1}{##2}{answer}% + }% +} + +\begin{document} + +\begin{examtitle}{Test 1} + Angles in parallel lines +\end{examtitle} + +\begin{multicols*}{2} +\begin{exercise} + If the ratio of two supplementary angles is $\frac{4}{11}$, what is the + measure of the small angle? + \begin{choices}(5) + \choice \ang{36} + \choice \ang{44} + \choice \answer{\ang{48}} + \choice \ang{52} + \choice \ang{60} + \end{choices} + \end{exercise} + \begin{exercise} + Is this really a question? + \begin{choices}(4) + \choice \answer{yes} + \choice no + \choice maybe + \choice no idea + \end{choices} + \end{exercise} + \begin{exercise} + This really is a question! + \begin{choices}(4) + \choice yes + \choice \answer{no} + \choice maybe + \choice no idea + \end{choices} + \end{exercise} + \subsection*{Answers} + \getanswers +\end{multicols*} + +\end{document} diff --git a/macros/latex/contrib/xsim/xsim-manual.cls b/macros/latex/contrib/xsim/xsim-manual.cls index ed32a87fb3..600a7f60eb 100644 --- a/macros/latex/contrib/xsim/xsim-manual.cls +++ b/macros/latex/contrib/xsim/xsim-manual.cls @@ -941,7 +941,8 @@ \xsim@add@example{texsx-391530}{Exercises and sub-exercises} \xsim@add@example{texsx-395273}{Different aspects of exercises, highlighted solutions} \xsim@add@example{texsx-466584}{Flushright Solutions} -\xsim@add@example{texsx-498299}{Multiple choice questions with automated solutions} +\xsim@add@example{texsx-498299}{Multiple choice questions with automated solutions (1)} +\xsim@add@example{texsx-549540}{Multiple choice questions with automated solutions (2)} \xsim@add@example{texsx-576998}{Exercises at the end of section and sectionwise solutions} \xsim@add@example{texsx-580636}{Multiple hints per exercise with backlinks} \xsim@add@example{texwelt-6698}{Custom list of exercises} @@ -995,6 +996,7 @@ \xsim@add@version{0.19a} {2020-03-19} \xsim@add@version{0.19b} {2020-04-04} \xsim@add@version{0.20} {2021-01-31} +\xsim@add@version{0.20a} {2021-02-01} % ---------------------------------------------------------------------------- \newrobustcmd*\xsimauxfileinfo{% diff --git a/macros/latex/contrib/xsim/xsim-manual.pdf b/macros/latex/contrib/xsim/xsim-manual.pdf index 93245d124d..f78f19be58 100644 Binary files a/macros/latex/contrib/xsim/xsim-manual.pdf and b/macros/latex/contrib/xsim/xsim-manual.pdf differ diff --git a/macros/latex/contrib/xsim/xsim.sty b/macros/latex/contrib/xsim/xsim.sty index 94866005c4..e1953059a7 100644 --- a/macros/latex/contrib/xsim/xsim.sty +++ b/macros/latex/contrib/xsim/xsim.sty @@ -29,10 +29,10 @@ \ExplSyntaxOn -\tl_const:Nn \c_xsim_date_tl {2021/01/31} +\tl_const:Nn \c_xsim_date_tl {2021/02/01} \tl_const:Nn \c_xsim_version_major_number_tl {0} \tl_const:Nn \c_xsim_version_minor_number_tl {20} -\tl_const:Nn \c_xsim_version_subrelease_tl {} +\tl_const:Nn \c_xsim_version_subrelease_tl {a} \tl_const:Nx \c_xsim_version_number_tl { \c_xsim_version_major_number_tl . diff --git a/macros/latex/contrib/xsim/xsim.style.layouts.code.tex b/macros/latex/contrib/xsim/xsim.style.layouts.code.tex new file mode 100644 index 0000000000..31f5810bce --- /dev/null +++ b/macros/latex/contrib/xsim/xsim.style.layouts.code.tex @@ -0,0 +1,121 @@ +% ---------------------------------------------------------------------------- +% the XSIM package - layouts style +% +% eXercise Sheets IMproved +% +% ---------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/xsim +% E-Mail: contact@mychemistry.eu +% ---------------------------------------------------------------------------- +% Copyright 2017--2020 Clemens Niederberger +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Clemens Niederberger. +% ---------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% ---------------------------------------------------------------------------- +\xsimstyle{layouts}[2019/10/12] + +\RequirePackage{needspace} + +\DeclareExerciseEnvironmentTemplate{runin} + {% + \par\vspace{\baselineskip} + \Needspace*{2\baselineskip} + \noindent + \textbf{\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}}% + \GetExercisePropertyT{subtitle}{ \textit{#1}} % <<< notice the space + \IfInsideSolutionF{% + \GetExercisePropertyT{points}{% + \marginpar{% + \printgoal{\PropertyValue}% + \GetExercisePropertyT{bonus-points}{+\printgoal{\PropertyValue}}% + \,\IfExerciseGoalSingularTF{points} + {\XSIMtranslate{point}} + {\XSIMtranslate{points}}% + }% + }% + }% + } + {} + +\RequirePackage{array} + +\DeclareExerciseEnvironmentTemplate{margin} + {% + \trivlist + \item[\llap{% + \smash{% + \tabular[t]{@{}r@{}} + \textbf{\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}} + \IfExercisePropertySetT{points}{% + \tabularnewline + (% + \printgoal{\GetExerciseProperty{points}}% + \GetExercisePropertyT{bonus-points}{+\printgoal{#1}}% + \,\XSIMtranslate{point-abbr}% + )% + }% + \endtabular + }% + }]\relax + } + {\endtrivlist} + +\DeclareExerciseEnvironmentTemplate{inline} + {% + \textbf{\GetExerciseProperty{counter}}% + \IfInsideSolutionF{% + \GetExercisePropertyT{points}{ % <<< notice the space + (\printgoal{\PropertyValue}% + \GetExercisePropertyT{bonus-points}{+\printgoal{\PropertyValue}}% + \,\IfExerciseGoalSingularTF{points} + {\XSIMtranslate{point}} + {\XSIMtranslate{points}})% + }% + } % <<< notice the space + } + {} + +\DeclareExerciseEnvironmentTemplate{minimal} + {\par\UseExerciseTemplate{begin}{inline}} + {\UseExerciseTemplate{end}{inline}\par} + +\DeclareExerciseEnvironmentTemplate{centered} + {% + \par\vspace{\baselineskip} + \Needspace*{2\baselineskip} + \noindent + \hfil\textbf{\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}}% + \GetExercisePropertyT{subtitle}{ \textit{#1}}\hfil + \par\noindent + \IfInsideSolutionF{% + \GetExercisePropertyT{points}{% + \marginpar{% + \printgoal{\PropertyValue}% + \GetExercisePropertyT{bonus-points}{+\printgoal{\PropertyValue}}% + \,\IfExerciseGoalSingularTF{points} + {\XSIMtranslate{point}} + {\XSIMtranslate{points}}% + }% + }% + }% + } + {} + +% ---------------------------------------------------------------------------- +\endinput + +2020/02/23 - added: inline, centered + - adapt to removed \par from the generic environments -- cgit v1.2.3