Ich habe mir folgende Aufgabenumgebung aus der Dokumentation erstellt: Öffne in Overleaf
\documentclass{scrartcl} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage[most]{tcolorbox} \usepackage{xsim} %Aufgabenumgebung \DeclareExerciseEnvironmentTemplate{tcolorbox} {% \tcolorbox[standard jigsaw, opacityback=0, opacityframe=0, coltitle=black, breakable , drop shadow , beforeafter skip = .5\baselineskip , title = \textbf{\GetExerciseName~\GetExerciseProperty{counter}}% \GetExercisePropertyT{subtitle}{ \textit{\PropertyValue}}% \IfInsideSolutionF{% \GetExercisePropertyT{points}{ % notice the space (% \printgoal{\PropertyValue} \IfExerciseGoalSingularTF{points} {\XSIMtranslate{point}} {\XSIMtranslate{points}}% )% }% }% ]% } {\endtcolorbox} \DeclareExerciseType{klausuraufgabe}{ exercise-env = aufgabe , solution-env = loesung , exercise-name = Aufgabe , solution-name = Loesung , exercise-template = tcolorbox , solution-template = tcolorbox } \begin{document} \begin{aufgabe}[points=2+2+2] Diese Aufgabe soll drei Unteraufgaben haben, welche jeweils 2 Punkte bringen. \end{aufgabe} \end{document} Die 2+2+2 Punkte werden automatisch in 6 Punkte umgewandelt, kann man auch die einzelnen Summanden dazu nehmen, d.h. anstatt |
Das machst Du quasi absichtlich, indem Du Öffne in Overleaf
\GetExercisePropertyT{points}{ % (\printgoal{\PropertyValue}% \IfExerciseGoalSingularTF{points} { \XSIMtranslate{point}} { \XSIMtranslate{points}}% )}% verwendest. Wenn Du statt dessen einfach Öffne in Overleaf
\GetExercisePropertyT{points}{ % ($\PropertyValue$% \IfExerciseGoalSingularTF{points} {\,\XSIMtranslate{point}} {\,\XSIMtranslate{points}}% )}% Mit Öffne in Overleaf
$\PropertyValue = \text{\points{\PropertyValue}}$ bekommst Du auch die Addition ( Übrigens, Deine ursprüngliche Variante bekommst Du auch, indem Du einfach Öffne in Overleaf
\NewDocumentCommand \printgoal {m} {\ExerciseGoalValuePrint{#1}{}{}} \NewDocumentCommand \points {m} {% \ExerciseGoalValuePrint{#1}{\,\XSIMtranslate{point}}{\,\XSIMtranslate{points}}% } Wenn nur gelegentlich Punkte durch Öffne in Overleaf
\ExplSyntaxOn \NewDocumentCommand \XSIMifinstrTF {mmmm} { \tl_if_in:onTF {#1} {#2} {#3} {#4} } \ExplSyntaxOff Dann kann man das so einsetzen: Öffne in Overleaf
\GetExercisePropertyT{points} {% \XSIMifinstrTF{\PropertyValue}{+} {$\PropertyValue = {}$}{}% \points{\PropertyValue}% }% Super, vielen Dank! Lässt sich auch eine Möglichkeit einbauen, damit bei eine Aufgabe mit nur einer Punktangabe nicht z.B.
(17 Okt '17, 19:05)
Hirshy
|