Using pdfLaTeX to check Shell-escape / Gnuplot environment settings (windows)












1















Shell escape not enabled, is a frequent issue especially when combined with components that are not native to a tex distro path such as Gnuplot in MiKTeX.



For my sins, I run dozens of editor configurations across multiple distros and frequently switch compilation settings, thus need a fairly uniform way to simply check what is or is not active.



I am unclear as to how much each TeX / OS platform variant can internally feed back with reliable file locations when target files are missing. As an example, when calling addplot3[contour gnuplot on windows I can run the following MWE, but think it could be better done or expanded for broader use by variables, such as a package name. Can any one point me towards good diagnostic routines, possibly platform independent?



documentclass[border=10pt]{standalone}
RequirePackage{ifplatform}
usepackage{ifpdf}
%% First sanity test if pdfLaTeX is active
ifpdf
errmessage{OK ! pdfLaTeX IS active PRESS ENTER TO CONTINUE}
else
errmessage{plain latex and dvipdf ? PLEASE SWITCH to pdfLaTeX}
fi
%% Second sanity test if shell escape is available
ifshellescape
errmessage{OK Shell-Escape IS active PRESS ENTER TO CONTINUE}
else
errmessage{Shell-Escape is NOT working. PLEASE ADD --shell-escape to pdfLaTeX arguments}
fi
begin{document}
%% if shell escape is working we can get console feedback
deftmpfile{w18-active-theyearthemonththedaythetime.cmd}
immediatewrite18{echo echo Shell-Escape is active > "tmpfile"}
ifpdf
immediatewrite18{echo echo You are using pdflatex >> "tmpfile"}
else
immediatewrite18{echo echo plain latex and dvipdf ? switch to pdflatex >> "tmpfile"}
fi
% Check where gnuplot is Fist check if we can get version info feedback
immediatewrite18{echo gnuplot -e 'show version long' >> "tmpfile"}
immediatewrite18{echo echo If you do not see version above then add any of the following locations to your path >> "tmpfile"}
% these lines are under review as it should traverse editor roots, but for present we check relative to root and system path
immediatewrite18{echo where /r gnuplot.exe >> "tmpfile"}
immediatewrite18{echo where gnuplot.exe >> "tmpfile"}

immediatewrite18{echo set path >> "tmpfile"}
% Store latest results WILL be overwritten on each run
immediatewrite18{"tmpfile" >results.txt}
% Add a pause in case user wants to manually edit / run cmd file
immediatewrite18{echo pause>> "tmpfile"}
immediatewrite18{"tmpfile"}
immediatewrite18{del "tmpfile"}
ALL DONE SEE CONSOLE OUTPUT OR Results.txt
end{document}









share|improve this question





























    1















    Shell escape not enabled, is a frequent issue especially when combined with components that are not native to a tex distro path such as Gnuplot in MiKTeX.



    For my sins, I run dozens of editor configurations across multiple distros and frequently switch compilation settings, thus need a fairly uniform way to simply check what is or is not active.



    I am unclear as to how much each TeX / OS platform variant can internally feed back with reliable file locations when target files are missing. As an example, when calling addplot3[contour gnuplot on windows I can run the following MWE, but think it could be better done or expanded for broader use by variables, such as a package name. Can any one point me towards good diagnostic routines, possibly platform independent?



    documentclass[border=10pt]{standalone}
    RequirePackage{ifplatform}
    usepackage{ifpdf}
    %% First sanity test if pdfLaTeX is active
    ifpdf
    errmessage{OK ! pdfLaTeX IS active PRESS ENTER TO CONTINUE}
    else
    errmessage{plain latex and dvipdf ? PLEASE SWITCH to pdfLaTeX}
    fi
    %% Second sanity test if shell escape is available
    ifshellescape
    errmessage{OK Shell-Escape IS active PRESS ENTER TO CONTINUE}
    else
    errmessage{Shell-Escape is NOT working. PLEASE ADD --shell-escape to pdfLaTeX arguments}
    fi
    begin{document}
    %% if shell escape is working we can get console feedback
    deftmpfile{w18-active-theyearthemonththedaythetime.cmd}
    immediatewrite18{echo echo Shell-Escape is active > "tmpfile"}
    ifpdf
    immediatewrite18{echo echo You are using pdflatex >> "tmpfile"}
    else
    immediatewrite18{echo echo plain latex and dvipdf ? switch to pdflatex >> "tmpfile"}
    fi
    % Check where gnuplot is Fist check if we can get version info feedback
    immediatewrite18{echo gnuplot -e 'show version long' >> "tmpfile"}
    immediatewrite18{echo echo If you do not see version above then add any of the following locations to your path >> "tmpfile"}
    % these lines are under review as it should traverse editor roots, but for present we check relative to root and system path
    immediatewrite18{echo where /r gnuplot.exe >> "tmpfile"}
    immediatewrite18{echo where gnuplot.exe >> "tmpfile"}

    immediatewrite18{echo set path >> "tmpfile"}
    % Store latest results WILL be overwritten on each run
    immediatewrite18{"tmpfile" >results.txt}
    % Add a pause in case user wants to manually edit / run cmd file
    immediatewrite18{echo pause>> "tmpfile"}
    immediatewrite18{"tmpfile"}
    immediatewrite18{del "tmpfile"}
    ALL DONE SEE CONSOLE OUTPUT OR Results.txt
    end{document}









    share|improve this question



























      1












      1








      1








      Shell escape not enabled, is a frequent issue especially when combined with components that are not native to a tex distro path such as Gnuplot in MiKTeX.



      For my sins, I run dozens of editor configurations across multiple distros and frequently switch compilation settings, thus need a fairly uniform way to simply check what is or is not active.



      I am unclear as to how much each TeX / OS platform variant can internally feed back with reliable file locations when target files are missing. As an example, when calling addplot3[contour gnuplot on windows I can run the following MWE, but think it could be better done or expanded for broader use by variables, such as a package name. Can any one point me towards good diagnostic routines, possibly platform independent?



      documentclass[border=10pt]{standalone}
      RequirePackage{ifplatform}
      usepackage{ifpdf}
      %% First sanity test if pdfLaTeX is active
      ifpdf
      errmessage{OK ! pdfLaTeX IS active PRESS ENTER TO CONTINUE}
      else
      errmessage{plain latex and dvipdf ? PLEASE SWITCH to pdfLaTeX}
      fi
      %% Second sanity test if shell escape is available
      ifshellescape
      errmessage{OK Shell-Escape IS active PRESS ENTER TO CONTINUE}
      else
      errmessage{Shell-Escape is NOT working. PLEASE ADD --shell-escape to pdfLaTeX arguments}
      fi
      begin{document}
      %% if shell escape is working we can get console feedback
      deftmpfile{w18-active-theyearthemonththedaythetime.cmd}
      immediatewrite18{echo echo Shell-Escape is active > "tmpfile"}
      ifpdf
      immediatewrite18{echo echo You are using pdflatex >> "tmpfile"}
      else
      immediatewrite18{echo echo plain latex and dvipdf ? switch to pdflatex >> "tmpfile"}
      fi
      % Check where gnuplot is Fist check if we can get version info feedback
      immediatewrite18{echo gnuplot -e 'show version long' >> "tmpfile"}
      immediatewrite18{echo echo If you do not see version above then add any of the following locations to your path >> "tmpfile"}
      % these lines are under review as it should traverse editor roots, but for present we check relative to root and system path
      immediatewrite18{echo where /r gnuplot.exe >> "tmpfile"}
      immediatewrite18{echo where gnuplot.exe >> "tmpfile"}

      immediatewrite18{echo set path >> "tmpfile"}
      % Store latest results WILL be overwritten on each run
      immediatewrite18{"tmpfile" >results.txt}
      % Add a pause in case user wants to manually edit / run cmd file
      immediatewrite18{echo pause>> "tmpfile"}
      immediatewrite18{"tmpfile"}
      immediatewrite18{del "tmpfile"}
      ALL DONE SEE CONSOLE OUTPUT OR Results.txt
      end{document}









      share|improve this question
















      Shell escape not enabled, is a frequent issue especially when combined with components that are not native to a tex distro path such as Gnuplot in MiKTeX.



      For my sins, I run dozens of editor configurations across multiple distros and frequently switch compilation settings, thus need a fairly uniform way to simply check what is or is not active.



      I am unclear as to how much each TeX / OS platform variant can internally feed back with reliable file locations when target files are missing. As an example, when calling addplot3[contour gnuplot on windows I can run the following MWE, but think it could be better done or expanded for broader use by variables, such as a package name. Can any one point me towards good diagnostic routines, possibly platform independent?



      documentclass[border=10pt]{standalone}
      RequirePackage{ifplatform}
      usepackage{ifpdf}
      %% First sanity test if pdfLaTeX is active
      ifpdf
      errmessage{OK ! pdfLaTeX IS active PRESS ENTER TO CONTINUE}
      else
      errmessage{plain latex and dvipdf ? PLEASE SWITCH to pdfLaTeX}
      fi
      %% Second sanity test if shell escape is available
      ifshellescape
      errmessage{OK Shell-Escape IS active PRESS ENTER TO CONTINUE}
      else
      errmessage{Shell-Escape is NOT working. PLEASE ADD --shell-escape to pdfLaTeX arguments}
      fi
      begin{document}
      %% if shell escape is working we can get console feedback
      deftmpfile{w18-active-theyearthemonththedaythetime.cmd}
      immediatewrite18{echo echo Shell-Escape is active > "tmpfile"}
      ifpdf
      immediatewrite18{echo echo You are using pdflatex >> "tmpfile"}
      else
      immediatewrite18{echo echo plain latex and dvipdf ? switch to pdflatex >> "tmpfile"}
      fi
      % Check where gnuplot is Fist check if we can get version info feedback
      immediatewrite18{echo gnuplot -e 'show version long' >> "tmpfile"}
      immediatewrite18{echo echo If you do not see version above then add any of the following locations to your path >> "tmpfile"}
      % these lines are under review as it should traverse editor roots, but for present we check relative to root and system path
      immediatewrite18{echo where /r gnuplot.exe >> "tmpfile"}
      immediatewrite18{echo where gnuplot.exe >> "tmpfile"}

      immediatewrite18{echo set path >> "tmpfile"}
      % Store latest results WILL be overwritten on each run
      immediatewrite18{"tmpfile" >results.txt}
      % Add a pause in case user wants to manually edit / run cmd file
      immediatewrite18{echo pause>> "tmpfile"}
      immediatewrite18{"tmpfile"}
      immediatewrite18{del "tmpfile"}
      ALL DONE SEE CONSOLE OUTPUT OR Results.txt
      end{document}






      packages installing






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago







      KJO

















      asked Oct 24 '18 at 18:18









      KJOKJO

      1,4601114




      1,4601114






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f456604%2fusing-pdflatex-to-check-shell-escape-gnuplot-environment-settings-windows%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f456604%2fusing-pdflatex-to-check-shell-escape-gnuplot-environment-settings-windows%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Lallio

          Unable to find Lightning Node

          Futebolista