1

Below is a minimalized template I have been using without any trouble for quite some time (Edit: Simplified the code and updated the error message). It no longer runs on my system. I do not know if it's a problem with the xsim package, with one of its dependencies or just some weird local issue that should not be happening. I have updated my texlive installation. I'm on MacOS High Sierra. I am compiling with pdflatex Any ideas?

The error message I get:

! LaTeX3 Error: File '' not found.

MWE:

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{QuestionBank.tex}
\begin{question}[ID={Q001}, points={10}, tags={easy}]
First Question: Select one of the following solutions:
\begin{enumerate}
\item A
\item B
\item C
\end{enumerate}
\end{question}
\begin{answer}
Solution to First Question
\end{answer}
\end{filecontents*}

\usepackage{xsim}
\usepackage[most]{tcolorbox}

\newcommand*\includeQuestion[1]{%
  \XSIMexpandcode{\printexercise{question}{\GetExerciseIdForProperty{ID}{#1}}}%
}

\newcommand*\includeSolution[1]{%
  \XSIMexpandcode{\printsolution{question}{\GetExerciseIdForProperty{ID}{#1}}}%
}

\DeclareExerciseType{question}{
    exercise-env = question,
    solution-env = answer,
    exercise-name = question, % used with headings=true
    solution-name = solution,  % used with headings=true
    exercise-template = default,
    solution-template = default,
}

\DeclareExerciseCollection{myCollection}

\begin{document}

\collectexercises{myCollection}
\input{QuestionBank.tex}
\collectexercisesstop{myCollection}

\includeQuestion{Q001}
\includeSolution{Q001}

\end{document}
PatrickT
  • 2,923
  • On my Windows machine (with MikTeX) aux is not allowed as a folder name. With blub or a different name I can get things to compile. Later on I get a ! LaTeX3 Error: File '' not found. which doesn't look right. Do things work if you set path = {},? I don't know about the security settings of TeX live on a Mac, but maybe TeX is not allowed to write in the directory. – moewe Feb 14 '19 at 07:41
  • You have to first create the aux subfolder, TeX will not create it. About the empty file name I don't know. – egreg Feb 14 '19 at 11:35
  • @moewe, @egreg, you're both right. Thanks! I have edited the question. In my haste I prepared a minimal example and forgot to create the aux directory. With the aux directory created, I get the ! LaTeX3 Error: File '' not found. error. And that is new. – PatrickT Feb 14 '19 at 13:05
  • @moewe, for me same thing whether the directory is called aux or blub. – PatrickT Feb 14 '19 at 13:09
  • The problem is associated with \includeSolution{Q001}: If I comment that line out, the error message disappears. – PatrickT Feb 14 '19 at 13:38

1 Answers1

4

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 shortly, for the present try

\ExplSyntaxOn
\cs_set_protected:Npn \tl_set_from_file:Nnn #1#2#3
  { \file_get:nnN {#3} {#2} #1 }
\ExplSyntaxOff
Ulrike Fischer
  • 327,261
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • I'm suddenly having problems with this again, but very likely caused by something else. I'll link the questions with this comment. https://tex.stackexchange.com/questions/617147/xsim-question-counter-does-not-print – PatrickT Sep 30 '21 at 10:25