General"-shell -escape" error / inserting matlab .eps plot

General information and discussion about TeXnicCenter
hologfx
Posts: 10
Joined: Mon Aug 02, 2010 10:51 pm

"-shell -escape" error / inserting matlab .eps plot

Post by hologfx »

Hello Texers

I'm new to this and i'm having some trouble.

i just installed miktex and texniccenter (newest versions) and i want to write my thesis in tex. [im running win7 64bit with acrobat pro 9]
i'm using matlab and found a tool to save screens to .eps & .tex file (matlabfrag.m - http://www.mathworks.de/matlabcentral/f ... ange/21286 ) and i am now trying to insert them in the document.

the documentation of matlabfrag tells me two ways to insert:
1)
  • \usepackage{graphicx,psfrag}
    \input{FileName.tex}
    \includegraphics{FileName.eps}
2)
  • \usepackage{pstool}
    \psfragfig{FileName}

the first version gives this error:
removed, see log file

and the second version gives 5 errors including the note: ... -shell -escape not activated:
removed, see log file

i didnt found any option to activate this shell escape stuff ;/

so please help me :D

maybe you can help me with a better solution for my needs, ... some other way?

my code is visible on the screens but ill post it here again:

Code: Select all

%
% Beispiel 1
%
\documentclass[pdftex,a4paper]{scrartcl}
\usepackage{ngerman}
%\usepackage{graphicx,psfrag}
\usepackage{pstool}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\title{Erstes Beispiel}
\author{Dein Name}
\begin{document}
\maketitle
\tableofcontents
\section{Unser erstes Beispiel} Dies ist das erste Beispieldokument.
%\input{FileName.tex}
%\includegraphics{FileName.eps}
\psfragfig{FileName.eps}
\end{document}
%
% EOF
%
i attached my filename.eps & .tex ;o

thank you in advance!

K
Attachments
testing.log
errorlog of both version in one .txt file. scroll down for second error log
(24.83 KiB) Downloaded 316 times
FileName.tex
tex file?
(2.15 KiB) Downloaded 368 times
FileName.eps
eps file?
(40.15 KiB) Downloaded 360 times
Last edited by hologfx on Sat Aug 07, 2010 5:08 pm, edited 3 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

"-shell -escape" error / inserting matlab .eps plot

Post by localghost »

Since this issue has been discussed very often in the past, the Forum Search will yield appropriate solutions.

It is much more useful to post the exact error message (and not only a screen copy) directly from the log either by attaching the complete log file or posting the relevant excerpts by copy&paste (preferably in a »Code« environment).


Best regards and welcome to the board
Thorsten
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

"-shell -escape" error / inserting matlab .eps plot

Post by CrazyHorse »

hologfx wrote: and the second version gives 5 errors including the note: ... -shell -escape not activated:
removed, see log file

i didnt found any option to activate this shell escape stuff ;/
With Alt-F7 choose LaTeX=>PDF and then add on the right
side as optional argument "-shell-escape", just before the
existing entry -interactionmode=...

Herbert
hologfx
Posts: 10
Joined: Mon Aug 02, 2010 10:51 pm

"-shell -escape" error / inserting matlab .eps plot

Post by hologfx »

hello & good morning ;o

thanks for your answer!

just tried your tip and still getting an error:

(see attached screen)

Image


sorry for taking external hoster but the screenshot is too large

edit:

ah, ok. without space between shell & escape ...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

"-shell -escape" error / inserting matlab .eps plot

Post by localghost »

hologfx wrote:[…] sorry for taking external hoster but the screenshot is too large […]
Wouldn't be necessary if you reduce them to the relevant content and don't post full screens. Single windows can be copied to the clipboard by pressing "AltGr+Druck" (on a German keyboard). With IrfanView such shots become easier. See the attachment for a working configuration.
Attachments
TXC2alpha3-Compiler-CommandLine.png
TXC2alpha3-Compiler-CommandLine.png (48.07 KiB) Viewed 7890 times
hologfx
Posts: 10
Joined: Mon Aug 02, 2010 10:51 pm

Re: how to set: "-shell -escape" ? (inserting matlab eps plo

Post by hologfx »

thanks again,

i know how to screen single windows but i wanted to save the error message as well (therefor the larger screen...)

ok, now that -shell-escape question is cleared but im still getting A LOT errors when pressing F7

shall i open a new thread?

see attached file

i think there might be some directory error / problem ??
Attachments
testing.log
(19.15 KiB) Downloaded 378 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

"-shell -escape" error / inserting matlab .eps plot

Post by localghost »

hologfx wrote:[…] i know how to screen single windows but i wanted to save the error message as well (therefor the larger screen...) […]
Can be split in two small pictures with only the relevant information. Needs just a little bit of cutting where necessary.
hologfx wrote:[…] shall i open a new thread? […]
Generally yes because we now drift away from the topic title. But in this case it seems better to continue the discussion here because all necessary files are present.
hologfx
Posts: 10
Joined: Mon Aug 02, 2010 10:51 pm

"-shell -escape" error / inserting matlab .eps plot

Post by hologfx »

okay...

maybe you can teach me the exact way to go for my needs.

i want to use this nice option with .tex & .eps file, generated with matlabfrag from a plot/figure so i have the labeling the latex way

i'm using TeXnic in newest version and MiKTeX 2.8.

i have a .tex body like shown above, it this one suitable for me?
[actually i want to use it like this:]

Code: Select all

\documentclass[pdflatex,a4paper,11pt,titlepage,draft,openright]{scrreprt}
\usepackage{ngerman}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage{array}		% für Tabellen
%\usepackage{graphicx,psfrag}	% für Grafiken
%\usepackage{psfragx}		% für Matlab-Plots aus Skript
%\usepackage{pstool}		% für Matlab-Plots aus Skript
\title{Erstes Beispiel. wird ausgebaut!}
\author{STILL TESTING IT!}
\begin{document}
\maketitle
\begin{abstract}
hologfx
Posts: 10
Joined: Mon Aug 02, 2010 10:51 pm

"-shell -escape" error / inserting matlab .eps plot

Post by hologfx »

okay, noone helps me any further but i got a few steps on it!

Code: Select all

%
% Beispiel 1
%
\documentclass[pdftex,a4paper]{scrartcl}
\usepackage{ngerman}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{rotating}
\usepackage{epstopdf}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

\newenvironment{mattolaenv}[1][1.0]{\newcommand{\skalierung}{#1}}

\newcommand{\mattola}[2][1.0]{
	\begin{mattolaenv}[#1]
	\input{#2}
	\end{mattolaenv}}

\title{Erstes Beispiel}
\author{Dein Name}
\begin{document}
\maketitle
\tableofcontents
\section{Unser erstes Beispiel} Dies ist das erste Beispieldokument.

\mattola{spektrum.pct}

\end{document}
%
% EOF
%

it is working so far, but the text on the x axis in this figure is slightly to high, it overlaps into the image ;/

What i have done:

mattola.m produces 3 files i put in the project directory. this m file is nicely described. then add the epstopdf package and here we go ;)

it took a long time for me to find out, that pdflatex does not like .eps and then how to get it working with epstopdf.

maybe anyone can help me with the mis-fitting labeling?

K
Attachments
test2.pdf
pdf with mis-fitted label (x-axis)
(59.37 KiB) Downloaded 407 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

"-shell -escape" error / inserting matlab .eps plot

Post by localghost »

I think it would cause less trouble to export the data sets from Matlab as text files and plot them either with pgfplots (based on pgf/tikZ) or pst-plot (based on pstricks).
Post Reply