texlive[57592] Master/texmf-dist: xsim (1feb21)

commits+karl at tug.org commits+karl at tug.org
Mon Feb 1 23:32:38 CET 2021


Revision: 57592
          http://tug.org/svn/texlive?view=revision&revision=57592
Author:   karl
Date:     2021-02-01 23:32:37 +0100 (Mon, 01 Feb 2021)
Log Message:
-----------
xsim (1feb21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/xsim/HISTORY
    trunk/Master/texmf-dist/doc/latex/xsim/README
    trunk/Master/texmf-dist/doc/latex/xsim/xsim-manual.pdf
    trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.pdf
    trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.tex
    trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex

Modified: trunk/Master/texmf-dist/doc/latex/xsim/HISTORY
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/HISTORY	2021-02-01 22:32:15 UTC (rev 57591)
+++ trunk/Master/texmf-dist/doc/latex/xsim/HISTORY	2021-02-01 22:32:37 UTC (rev 57592)
@@ -7,15 +7,15 @@
 Web:    https://github.com/cgnieder/xsim
 E-Mail: contact at 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 @@
                    - make `no-files' the default
                    - new examples
                    - various small fixes
+ v0.20a 2021/02/01 - re-add missing `layouts' style
+                   - add example texsx-549540

Modified: trunk/Master/texmf-dist/doc/latex/xsim/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/README	2021-02-01 22:32:15 UTC (rev 57591)
+++ trunk/Master/texmf-dist/doc/latex/xsim/README	2021-02-01 22:32:37 UTC (rev 57592)
@@ -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 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 @@
    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

Added: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.pdf	2021-02-01 22:32:15 UTC (rev 57591)
+++ trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.pdf	2021-02-01 22:32:37 UTC (rev 57592)

Property changes on: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.tex	2021-02-01 22:32:37 UTC (rev 57592)
@@ -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 at arc] |- 
+      (title.north-|frame.north) 
+      [sharp corners] -| (title.south west);
+    \draw[line width=.5mm, rounded corners=\kvtcb at 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 at arc] |- 
+      (title.north-|frame.north) 
+      [sharp corners] -| (title.south west);
+    \draw[line width=.5mm, rounded corners=\kvtcb at 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 at 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}


Property changes on: trunk/Master/texmf-dist/doc/latex/xsim/examples/xsim.texsx-549540.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/xsim/xsim-manual.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls	2021-02-01 22:32:15 UTC (rev 57591)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim-manual.cls	2021-02-01 22:32:37 UTC (rev 57592)
@@ -941,7 +941,8 @@
 \xsim at add@example{texsx-391530}{Exercises and sub-exercises}
 \xsim at add@example{texsx-395273}{Different aspects of exercises, highlighted solutions}
 \xsim at add@example{texsx-466584}{Flushright Solutions}
-\xsim at add@example{texsx-498299}{Multiple choice questions with automated solutions}
+\xsim at add@example{texsx-498299}{Multiple choice questions with automated solutions (1)}
+\xsim at add@example{texsx-549540}{Multiple choice questions with automated solutions (2)}
 \xsim at add@example{texsx-576998}{Exercises at the end of section and sectionwise solutions}
 \xsim at add@example{texsx-580636}{Multiple hints per exercise with backlinks}
 \xsim at add@example{texwelt-6698}{Custom list of exercises}
@@ -995,6 +996,7 @@
 \xsim at add@version{0.19a} {2020-03-19}
 \xsim at add@version{0.19b} {2020-04-04}
 \xsim at add@version{0.20}  {2021-01-31}
+\xsim at add@version{0.20a} {2021-02-01}
 
 % ----------------------------------------------------------------------------
 \newrobustcmd*\xsimauxfileinfo{%

Modified: trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty	2021-02-01 22:32:15 UTC (rev 57591)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.sty	2021-02-01 22:32:37 UTC (rev 57592)
@@ -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 .

Added: trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex	2021-02-01 22:32:37 UTC (rev 57592)
@@ -0,0 +1,121 @@
+% ----------------------------------------------------------------------------
+% the XSIM package - layouts style
+% 
+%   eXercise Sheets IMproved
+% 
+% ----------------------------------------------------------------------------
+% Clemens Niederberger
+% Web:    https://github.com/cgnieder/xsim
+% E-Mail: contact at 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


Property changes on: trunk/Master/texmf-dist/tex/latex/xsim/xsim.style.layouts.code.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


More information about the tex-live-commits mailing list.