# Error in print latex standalone

6 messages
Open this post in threaded view
|

## Error in print latex standalone

 Hi I want to generate standalone plots with superscripts/Latex annotations in the text, but I am getting error messages. An example from the manual (https://octave.org/doc/v4.4.0/Printing-and-Saving-Plots.html): x = 0:0.01:3; hf = figure (); plot (x, erf (x)); hold on; plot (x, x, "r"); axis ([0, 3, 0, 1]); text (0.65, 0.6175, ['$\displaystyle\leftarrow x = {2 \over \sqrt{\pi}}'... '\int_{0}^{x} e^{-t^2} dt = 0.6175$'], "interpreter", "latex"); xlabel ("x"); ylabel ("erf (x)"); title ("erf (x) with text annotation"); print (hf, "plot15_7.pdf", "-dpdflatexstandalone"); yields: error: print.m: error opening file 'plot15_7.tex' error: called from     print>latex_standalone at line 686 column 5     __opengl_print__ at line 176 column 5     print at line 434 column 14 The version is GNU Octave, version 4.0.0 and the operating system is Ubuntu 16.04.5 LTS. Any suggestion is appreciated.
Open this post in threaded view
|

## Re: Error in print latex standalone

 Joao Rodrigues wrote > Hi > > I want to generate standalone plots with superscripts/Latex annotations > in the text, but I am getting error messages. > > An example from the manual > (https://octave.org/doc/v4.4.0/Printing-and-Saving-Plots.html):> > x = 0:0.01:3; > hf = figure (); > plot (x, erf (x)); > hold on; > plot (x, x, "r"); > axis ([0, 3, 0, 1]); > text (0.65, 0.6175, ['$\displaystyle\leftarrow x = {2 \over > \sqrt{\pi}}'... > '\int_{0}^{x} e^{-t^2} dt = 0.6175$'], >        "interpreter", "latex"); > xlabel ("x"); > ylabel ("erf (x)"); > title ("erf (x) with text annotation"); > print (hf, "plot15_7.pdf", "-dpdflatexstandalone"); > > yields: > > error: print.m: error opening file 'plot15_7.tex' > error: called from >      print>latex_standalone at line 686 column 5 >      __opengl_print__ at line 176 column 5 >      print at line 434 column 14 > > The version is GNU Octave, version 4.0.0 and the operating system is > Ubuntu 16.04.5 LTS. > > Any suggestion is appreciated. This code works for me and I can compile the generated tex file from octave using system "pdflatex plot15_7.tex" Does the simple script bellow yield the same error? clf; plot (1:10) print -dpdflatexstandalone toto.tex system "pdflatex toto.tex" Pantxo -- Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Open this post in threaded view
|

## Re: Error in print latex standalone

 In reply to this post by Joao Rodrigues On Thu, Sep 13, 2018 at 8:51 AM Joao Rodrigues <[hidden email]> wrote: print (hf, "plot15_7.pdf", "-dpdflatexstandalone"); yields: error: print.m: error opening file 'plot15_7.tex' error: called from     print>latex_standalone at line 686 column 5     __opengl_print__ at line 176 column 5     print at line 434 column 14 The version is GNU Octave, version 4.0.0 and the operating system is Ubuntu 16.04.5 LTS. Any suggestion is appreciated. It looks to me it is a file write permission problem.Make sure you have write permission to the working directory, and if this directory hasthe plot15_7.tex file already you have write permission to it as well. Dmitri.--
Open this post in threaded view
|

## Re: Error in print latex standalone

 On 13-09-18 21:06, Dmitri A. Sergatskov wrote: On Thu, Sep 13, 2018 at 8:51 AM Joao Rodrigues <[hidden email]> wrote: print (hf, "plot15_7.pdf", "-dpdflatexstandalone"); yields: error: print.m: error opening file 'plot15_7.tex' error: called from     print>latex_standalone at line 686 column 5     __opengl_print__ at line 176 column 5     print at line 434 column 14 The version is GNU Octave, version 4.0.0 and the operating system is Ubuntu 16.04.5 LTS. Any suggestion is appreciated. It looks to me it is a file write permission problem. Make sure you have write permission to the working directory, and if this directory has the plot15_7.tex file already you have write permission to it as well. Dmitri. -- I want to thank Dmitri and Pantxo for their suggestions. I do have write permission for the directory and the 'toto' script did work on the original machine. I tried running the manual example and the 'toto' simplified version in a computer with Ubuntu 18.04 and Octave 4.4 (or 4.2, perhaps) and both scripts worked fine. I then ran them in yet another machine with Ubuntu 16.04 and Octave 4.0 and that worked fine but there it was pdflatex that yielded an error... I will just upgrade all machines to the latest version of Octave and pdflatex. Joao