The behavior of the example below is very odd. Every file name suffix I've tried works -- except for .js! I've tested this on Windows, but not Linux. The behavior is the same whether run under TeXworks or with cygwin and pdflatex. It feels like a problem with Windows, but it's hard to see how.




\NewDocumentEnvironment{intfig} { > { \SplitArgument { 1 } { , } } m!o }
  % This will not work. The error is
  % I can't write on file 'blather.js'
  %\str_set:Nn \l_intfig_jinfile_str { blather.js }

  % But this works!
  \str_set:Nn \l_intfig_jinfile_str { blather.xyz }

  \xsim_file_write_start:nn { \c_false_bool } \l_intfig_jinfile_str



Here it comes

  test test test

There it goes


In some ways, this is a follow-up to the question I asked here: Saving the body of an environment to a file verbatim using xparse

Also, even with an acceptable file suffix, the first character of the body is omitted in the saved file.



Browse other questions tagged .