Hot answers tagged

6 votes
Accepted

Expand command in an argument before the main command

With a current version of pdftex (that defines \expanded) you can define expanding versions of the commands as shown below. With older implementations without \expanded you can use \edef: \...
David Carlisle's user avatar
6 votes
Accepted

filehook error with memoir after update texlive 2019 in Oct 15

Update 2020-02-04: both memoir and filehook were updated and now this problem shouldn't happen. If it does, please update your TeX distribution. Here you have two problems at once. The first one was ...
Phelype Oleinik's user avatar
6 votes
Accepted

Could I do a different automatic exam copies -one for each student-?

This is an approach based on LaTeX that generates questions with order of choice across each compilation. The key is to use \randomize_env:nn command as follows: \randomize_env:nn {choices} {choice,...
Alan Xiang's user avatar
  • 4,892
5 votes
Accepted

xsim access exercises text

This should work: % arara: lualatex \documentclass{scrbook} \PreventPackageFromLoading{inputenc} % stop tcb from loading this \usepackage[most]{tcolorbox} \usepackage[clear-aux]{xsim} \...
cgnieder's user avatar
  • 66.2k
5 votes
Accepted

Change enumeration style in exercises using xsim

You can either add the re-definition with the pre-hook or begin-hook options to the exercise environments \documentclass{article} \usepackage{xsim} \xsimsetup{ exercise/begin-hook = \renewcommand\...
cgnieder's user avatar
  • 66.2k
5 votes
Accepted

xsim: What is the correct way to count exercises per section?

The xsim package provides the option exercise/within that determines when the exercise counter is reset, see page 20 of the manual. Code: \usepackage{xsim} \xsimsetup{ exercise/the-counter = \...
Marijn's user avatar
  • 35.7k
5 votes
Accepted

Use tabularray in xsim template

Use tabularray's expand option. Replace \XSIMexpandcode { \noexpand \begin {tblr} {\XSIMifblankTF{\ExerciseType}{l}{c}cc} \noexpand \ExerciseTableCode \noexpand \end {tblr} } by \...
cgnieder's user avatar
  • 66.2k
4 votes
Accepted

xsim and "conditional" printing

There is currently no user command which checks if a tag has been set but it is easy to add one. I'll add something to the next release. If you want to check if solutions are printed then use \...
cgnieder's user avatar
  • 66.2k
4 votes
Accepted

xsim: question/solution throws 'environment already defined'

The solution environment is predefined. Why don't you simply change the printed names? \documentclass{article} \usepackage{xsim} \xsimsetup{ exercise/name=Question, solution/print=true, ...
egreg's user avatar
  • 1.1m
4 votes
Accepted

xsim: LaTeX3 Error: File '' not found

This is due to a bug in \tl_set_from_file:Nnn, which has been deprecated and replaced by \file_get:nnN in expl3. A mistake in the order of arguments leads to the erroneous result. It will be fixed ...
Joseph Wright's user avatar
  • 256k
4 votes
Accepted

True/False type Questions with xsim package

So basically a true/false question is a multiple choice question with binary choices. Therefore I came to the same conclusion as leandriis in his comment and started with example 13 of the manual (...
TeXnician's user avatar
  • 33.3k
4 votes
Accepted

xsim-package: subexercises and points calculation

Ok, I think I found a solution that works at least for my purposes: I defined a counter that gets set to zero in the pre-hook of every exercise and a custom command \addpts which increases that ...
RL-S's user avatar
  • 229
4 votes
Accepted

From exsheets to xsim: runin

As stated in the xsim manual (page 29), the runin style is available through the style file layouts. Loading this style file using the command \loadxsimstyle{layouts} is sufficient to use the style in ...
Marijn's user avatar
  • 35.7k
4 votes
Accepted

Space after exercise

You can use post-hook, but I'd not recommend \medskip, because such a space would pile up with the space preceding another exercise. However, \addvspace{\medskipamount} does not work, because LaTeX ...
egreg's user avatar
  • 1.1m
4 votes
Accepted

Is the Exsheet package still under development?

Short answer: no. Longer answer: exsheets is effectively frozen. It can of course be used as it is and if bugs are found or appear because of development of packages it depends on or something similar ...
cgnieder's user avatar
  • 66.2k
4 votes
Accepted

Creating a solution label for an exercise using \declaretheoremstyle

An xsim attempt, based on the "Example 5: Crossreferencing between problems and answers" shown in package manual. \documentclass{article} \usepackage{amssymb} \usepackage{xsim,lipsum,...
muzimuzhi Z's user avatar
  • 25.5k
4 votes

Change \printsolutions header string in xsim

Changes I made: % in preamble: declare a new heading template \DeclareExerciseHeadingTemplate{solution}{% \section*{פתרונות לתרגילים בפרק \thechapter}% } % apply that template for \printsolutions ...
muzimuzhi Z's user avatar
  • 25.5k
4 votes
Accepted

Change \printsolutions header string in xsim

You can define a translation for the default-heading in Hebrew: \DeclareExerciseTranslations{default-heading}{ Hebrew = פתרונות לתרגילים בפרק \thechapter } Complete code: % arara: xelatex: { ...
cgnieder's user avatar
  • 66.2k
3 votes
Accepted

Adjusting margins for points in margin with xsim

The default style is defined like this: \DeclareExerciseEnvironmentTemplate{default}{% \subsection* {% \XSIMmixedcase{\GetExerciseName}\nobreakspace \GetExerciseProperty{counter}% ...
cgnieder's user avatar
  • 66.2k
3 votes

Custom label for references using tasks inside a xsim exercise

Address your request to the author of the tasks-package and make a bug report: The code of the tasks package comes without properly commented sources, just as a .sty-file and thus is inscrutable. ...
Ulrich Diez's user avatar
  • 26.9k
3 votes
Accepted

Analogue of examspace in xsim

blank-style={\phantom{#1}} seems to work. \documentclass{amsart} \usepackage{xsim} \begin{document} \begin{exercise}[subtitle={\texttt{phantom} look}] Question 1 \blank[blank-style={\phantom{#1}},...
Torbjørn T.'s user avatar
3 votes
Accepted

How can I print exercise with ID in xsim?

I tried [...] \printexercise{exercise}{q1,q3,q5} That actually doesn't make much sense as it doesn't follow the command description of \printexercise (p.19 of the current manual): \...
cgnieder's user avatar
  • 66.2k
3 votes
Accepted

more complex use of tags in xsim

You can assign multiple values to a tagging class by using a comma-separated list: \begin{exercise}[level={1,2}] Using this for the third exercise in your MWE I get the following:
cgnieder's user avatar
  • 66.2k
3 votes

Expand command in an argument before the main command

I present two solutions here. First solution This is in the same spirit as David Carlisle's solution, except that only one command needs to be defined for everything. You don't need a specific ...
frougon's user avatar
  • 24k
3 votes
Accepted

Questions: Migrating from exsheets to xsim (2)

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 ...
cgnieder's user avatar
  • 66.2k
3 votes
Accepted

Misplaced \PropertyValue with xsim package using own exercise definition

Comment the line \GetExerciseProperty{points} There is a missing { in \GetExercisePropertyT{points}\printgoal{\PropertyValue}}% just before \printgoal % The entire code \documentclass[a4paper,11pt]{...
Hafid Boukhoulda's user avatar
3 votes
Accepted

Collection of tasks, xsim, et al.: How to controll layout of printsolutions best way

I would simply use \labels and then \ref and \pageref them: \section{Equations}\label{sec:equations} ... \minisec{Solutions~\ref{sec:equations}, page~\pageref{sec:equations}} ... The complete code: ...
cgnieder's user avatar
  • 66.2k
3 votes
Accepted

Missing item error with xsim and TeXLive 2020

Starting with version 0.19 (2020/03/16) ox xsim both \ExerciseType and \ExerciseID are only set locally in order to allow nesting of different exercise types. As a consequence \Set(Expanded)...
cgnieder's user avatar
  • 66.2k
3 votes
Accepted

How could I change the points design?

You can enable the layouts style and choose the appropriate template for exercises. \documentclass{article} \usepackage{xsim} \loadxsimstyle{layouts} \xsimsetup{exercise/template=runin} \begin{...
egreg's user avatar
  • 1.1m

Only top scored, non community-wiki answers of a minimum length are eligible