From 8fb71977a7dddf8f481f6b76bff864d98f00ffac Mon Sep 17 00:00:00 2001
From: Frank Fuhlbrück
Date: Wed, 9 Feb 2022 15:40:44 +0100
Subject: fragile framed exercises with lua

---
 exercisesheets.sty | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'exercisesheets.sty')

diff --git a/exercisesheets.sty b/exercisesheets.sty
index 501251a..6616f9a 100644
--- a/exercisesheets.sty
+++ b/exercisesheets.sty
@@ -194,6 +194,8 @@
   framed/.default={ignore},
   framed/.initial={ignore},
   framed/.code={\let\newframe\relax},
+  fragile/.default={ignore},
+  fragile/.initial={ignore},
 }
 \fi
 %%%%%%%%%%%%%%% END BEAMER-SPECIFIC %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1319,6 +1321,10 @@
   }
 }
 \newcommand{\solutiontitle}[1][\linewidth]{
+  \ifhmode \linebreak\fi\exsh@solutiontitle{#1}
+}
+
+\newcommand{\deferredsolutiontitle}[1][\linewidth]{
   \ifbool{exsh@defersolutiontitle}{%
     \ifhmode \linebreak\fi\exsh@solutiontitle{#1}
   }{}%
@@ -1654,8 +1660,9 @@
     !exsh@dlua<exsh_texprintlines(exsh_cur_exercise)>%
 >
 !global!long!def!exsh@start@lframed#1\end{solution}< %
-  !exsh@dlua<exsh_cur_solution=[[#1]]> %
+  !exsh@dlua<exsh_cur_solution=fragileframed([[#1]])> %
   !endgroup!end<solution>%
+    !exsh@dlua<exsh_texprintlines(exsh_cur_solution)>%
 >
 !endgroup
 
@@ -1673,6 +1680,8 @@
 \catcode`\~=12
 \catcode`\@=11
 \catcode`\%=12
+\catcode`\ =12
+\catcode9=12
 \catcode`\^^I=12
 \catcode`\^^J=12\catcode`\^^M=12\catcode`\\=11\endlinechar-1}
 
-- 
cgit v1.2.3

