def execute_xelatex( latex, dir )
            success = false
            @log    = ''

            if @packages_path
                ENV['TEXINPUTS'] = "#{@packages_path}:"
            end
            Open3.popen2e( ErbLatex.config.xelatex_path,
              "--no-shell-escape", "-shell-restricted",
              "-jobname=output",   "-output-directory=#{dir}",
            ) do |stdin, output, wait_thr|
                stdin.write latex
                stdin.close
                @log    = output.read.strip
                success = ( 0 == wait_thr.value )
            end
            success
        end
def execute_xelatex( latex, dir )
            success = false
            @log    = ''

            if @packages_path
                ENV['TEXINPUTS'] = "#{@packages_path}:"
            end
            Open3.popen2e( ErbLatex.config.xelatex_path,
              "--no-shell-escape", "-shell-restricted",
              "-jobname=output",   "-output-directory=#{dir}",
            ) do |stdin, output, wait_thr|
                stdin.write latex
                stdin.close
                @log    = output.read.strip
                success = ( 0 == wait_thr.value )
            end
            success
        end
Execute xelatex on the file.
 @param latex [String] contents of the template after running ERB on it
 @param dir   [String] path to the temporary working directory