Saturday, July 7, 2012

Gnuplot, shell escape and LaTeX

Failure to call gnuplot in LaTeX is very annoying and painful if you get tired to try for hours but in vain. Usually gnuplot is used together with pgfplots package. For running gnuplot in LaTeX, shell escape is required to execute that program because gnuplot is not part of LaTeX.

I offer to you some solutions for Windows user only,

  1. FIRST : check whether your computer  can run gnuplot or not
    Start > Run   type gnuplot and press OK
    Gnuplot should appear after you call it, otherwise you should download gnuplot from here
  2. If you still fail, make sure that you make your file title in one word only!. for example , don't type like this : my report.tex , but type like this myreport.tex and this solution is extremely important for my case. I don't need to to try solution number 3 and or 4 anymore.
  3. Try one of below command in user command. For LaTex editor Texmaker or TexStudio, you can find in Options > Configure Texstudio > Quick Build then select User and then add one of command below :
    %& --shell-escape
    %& -enable-write18
    %& -shell-escape
    %& -shell-escape-enable-write18
    %& --shell-escape-enable-write18

  4. check your gnuplot in
    right click my computer > system properties
    > Advanced > Environment Variables  
    look at System variables , click New  , then fill
      Variable name : gnuplot 
      Variable value : c:\program files\gnuplot\bin  (depend on location of your gnuplot program)
      and then press OK
  5. or.... if the above efforts still not successful, maybe you should try the answer from Harish Kumar here . You need to tick Add application directory to your PATH environment variable during gnuplot installation process. This solution works for Windows Vista and Windows 8. Maybe it can be used for Windows 7 too.  

I hope the above solutions can help you, if not, I am sorry, maybe other expert will help you.

Anjing Mawu - Anjing Terlatih dan Denda Emas dalam Naskah Tanjung Tanah

Naskah Tanjung Tanah merupakan suatu naskah fenomenal bagi masyarakat Sumatera. Naskah itu ditulis dengan menggunakan aksara Sumatera Kuno d...