2

I am currently trying to migrate from exsheets to xsim and have some problems.

Since exsheets won't be supported, I am trying to migrate to xsim but I have some problems:

  1. How can I insert the subtitle? I want something of the form "Exercise A.1 (subtitle)." where the subtitle is bold - see picture. Default is "Exercise A.1. subtitle. This was possible with exsheets (solved below).

here here

  1. How can I suppress the automatic title with \printsolutions? (solved)

  2. Why are there so many files when I compile? This is very annoying if you have more than 20 questions.

1
  • 1
    Many LaTeX packages generate multiple files, for example beamer or minted. That is just a design decision, usually to provide faster or easier to manage processing. This is not generally seen as a big disadvantage, because the files do not necessarily have to bother the user - for example if you use a terminal as your main working environment then you don't see the extra files at all most of the time, and when you use a graphical file manager then you can you sort by most recently modified and the pdf will be always on top.
    – Marijn
    Commented Jul 8, 2019 at 11:13

2 Answers 2

3

Why are there so many files when I compile? This is very annoying if you have more than 20 questions.

The answer is: because I decided that way when creating the package. One advantage for me was that this allows verbatim material in exercises and their solutions…

I understand why you don't like this very much. This is why the manual says this:

Arguably one downside of the approach using external files for each exercise and its solution is that your project folder will be cluttered with files. In order to deal with this somehow xsim offers the following option:

path = {<path name>} With this option a subfolder or path within the main project folder can be given. Exercises will be written to and included from this path. The path must exist on your system before you can use it!

So with \xsimsetup{path=exercises} (and a folder named exercises inside your main folder) all exercise files be be written to that folder which would keep your main folder “clean”. :)


PS: I do plan to give users the option to switch the creating of new files off but I have no idea when I will find the time to work on this, so maybe it never comes…


EDIT Since v0.13 (2019/10/06) xsim has the package option no-files.

2

I can answer the first two questions:

  1. with \GetExercisePropertyT{subtitle}{ \textbf{(\PropertyValue)}}% \textbf{.} (see example below)

    here

  2. with \printsolutions[headings=false]

     \documentclass[11pt, a4paper, parskip=full]{scrartcl}
    \usepackage[ngerman]{babel}
    
    \usepackage[utf8]{inputenc}
    
       \usepackage{xsim}
    
    \renewcommand\thesection{\Alph{section}}
    \usepackage{xsim}
    
    \usepackage{needspace}
    \DeclareExerciseEnvironmentTemplate{runin}
      {%
        \par\vspace{\baselineskip}
        \Needspace*{2\baselineskip}
        \noindent
        \textbf{\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{counter}}%
      \GetExercisePropertyT{subtitle}{ \textbf{(\PropertyValue)}}% <<< notice the space
      \textbf{.} 
        \IfInsideSolutionF{%
          \GetExercisePropertyT{points}{%
            \marginpar{%
              \printgoal{\PropertyValue}%
              \GetExercisePropertyT{bonus-points}{+\printgoal{\PropertyValue}}%
    \,\IfExerciseGoalSingularTF{points}
        {\XSIMtranslate{point}}
        {\XSIMtranslate{points}}%
    }% 
    }%
    }% 
    }
    {}
    
    \xsimsetup{%     
        exercise/within = subsection ,      
        exercise/the-counter = \thesubsection.\arabic{exercise}
    }
    
    \SetExerciseParameters{exercise}{
     exercise-name = Aufgabe ,
     solution-name = Loesung ,
     exercise-template = runin ,
     solution-template = runin
    }
    
    
    
    
    \begin{document}
    \selectlanguage{ngerman}
    \section{Aufgaben} 
    \subsection{subsection}
    
    \begin{exercise}[subtitle=Test]
    Was ist 1 mal 1? 
    \end{exercise}  
    \begin{solution} 
    1 mal 1 ist 1.  siehe \ref{abba}
    \end{solution} 
    
    \begin{exercise} 
    Was ist 2 mal 2? 
    \end{exercise}  
    \begin{solution} 
    2 mal 2 ist 4. 
    \end{solution} 
    
    \section{Schwere Aufgaben} 
    \subsection{subsection}
    \begin{exercise}  
    Was ist 3 mal 3? 
    \end{exercise}  
    \subsection{subsection}
    \begin{solution} 
    3 mal 3 ist 9. 
    \end{solution} 
    
    \begin{exercise}  
    Was ist 4 mal 4? 
    \end{exercise}  
    \begin{solution} 
    4 mal 4 ist 16. 
    \end{solution} 
    
    
    \printsolutions[headings=false]
    
    \end{document}
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .