cgnieder / xsim

eXercise Sheets IMproved
67 stars 23 forks source link

Fix random numbers unavailable warning #112

Open lkoehl opened 1 year ago

lkoehl commented 1 year ago

When using the package with XeLaTeX, the package warns you about the random selection of exercises. The last sentence is missing a 'not'. I also improved the sentence for better readability.

muzimuzhi commented 1 year ago

XeTeX has learnt random primitives since texlive 2019, see texlive release history, 2019

9.1.16 2019 XeTeX: New primitives ..., \normaldeviate, \uniformdeviate, \randomseed; ... .

and the XeTeX reference guide (Feb 19, 2023), sec. 8.3 Randomness .

One can double check by compiling below using xelatex

% !TeX TS-program = xelatex
\documentclass{article}
\usepackage{pgffor}

\begin{document}
\foreach \i in {1, ..., 10}
  { \fpeval{randint(10)}, }
\end{document}

Therefore the relevant warnings can be safely removed from xsim.

muzimuzhi commented 1 year ago

Therefore the relevant warnings can be safely removed from xsim.

Or change it to "Please be aware that random selection of exercises is not available in XeLaTeX older than 2020 (exclusive)."