I've found two answers for ``How to get a new PGF seed each compilation?'' 1 2, and they work wonderfully on PdfLaTeX.
However, neither of the methods work on XeLaTeX. I get the error
! Undefined control sequence.
<argument> \number \pdfrandomseed
l.6 \pgfmathsetseed{\number\pdfrandomseed}
when using the first method, and
! Undefined control sequence.
<argument> \pdfuniformdeviate
10000000
l.7 \pgfmathsetseed{\pdfuniformdeviate 10000000}
when using the second. How can these methods be fixed for XeLaTeX use? Is there a particular method for getting a random seed each time in XeLaTeX?
MWE
\documentclass{article}
\usepackage{tikz}
% Two ways to get a new seed every compilation
\pgfmathsetseed{\number\pdfrandomseed} % https://tex.stackexchange.com/a/144623
%\pgfmathsetseed{\pdfuniformdeviate 10000000} % http://tex.stackexchange.com/questions/212738/making-a-random-number
\pgfmathsetmacro\numr{rand}% Print a random number
\begin{document}
\numr
\end{document}
pdfprefix. It's\randomseed– Phelype Oleinik Dec 20 '20 at 19:53With XeLaTeX there's nothing similar.But I tried just using\randomseedand it didn't work either. The error changes but the random number still defaults to-1.0, just as before. – Imp54 Dec 20 '20 at 19:58\randomseedwas added to XeTeX on 2019, so you need a failrly recent system. – Phelype Oleinik Dec 20 '20 at 19:59