[cstex] Problém s komunikací s GNUPlotem

Tomáš Kubina tomas.kubina at vsb.cz
Mon Oct 26 21:26:19 CET 2009


Raději používám přímo gnuplot s výstupem "set term epslatex"
Za jednoho ještě světleho večera jsem si udělal skriptík, kterému řeknu 
který soubor má zpracovat v gnuplotu a v jakých rozměrech, tím získam 
soubory .tex a .eps. Vytvořený texovský soubor se vkládá přes \input do 
hlavního dokumentu a nejsou problémy. Navíc skrip mi pokračuje i 
vytvořením pdfka s obrazkem pomocí xelatexu, tak že použiji hlavičku 
definic shodnou s dokumentem, do kterého se bude obrázek vkládat. 
Případně ještě převod přes ImageMagic třeba do png nebo jpg, kdybych 
obrázek potřeboval někomu poslat, protože jej tímhle krokem navíc ořežu 
na rozměry stanovené na začátku.

(Xe)latex mívá někdy problémy, rozhodně _ a ^ lze používat jen v 
matematickém modu $ $. Tohle mi trvalo dlouho než sem to pochopil :-). 
Rovněž havaruje při použití znaku " %". Nevíte někdo fintu jak to 
jednoduše obejít?

Tomáš Kubina


Procházka Lukáš Ing. - Pontex s. r. o. napsal(a):

> Zdravím účastníky konference,
>
> prosil bych o radu, jak rozchodit komunikaci s GNUPlotem.
>
> Mám .texový soubor:
>
> \documentclass[10pt,a4paper]{article}
>
> \usepackage[cp1250]{inputenc}
> \usepackage{czech,a4wide}
> \usepackage{fancyvrb}
> \usepackage{gnuplottex}
>
> \begin{document}
>
>  A
>
>  \begin{gnuplot}
>    plot sin(x)
>  \end{gnuplot}
>
> \end{document}
>
> Ale nedaří se mi vykreslit graf. Objevuje se:
>
> C:\Lukas\Jobs\Manuals\Test3>C:\TeXLive2007\bin\win32\pdflatex.exe 
> -shell-escape t-GPlot.tex
> This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
> \write18 enabled.
> %&-line parsing enabled.
> entering extended mode
> (./t-GPlot.tex
> LaTeX2e <2005/12/01>
> Babel <v3.8h> and hyphenation patterns for english, usenglishmax, 
> dumylang, noh
> yphenation, arabic, basque, bulgarian, coptic, welsh, german, ngerman, 
> danish,
> esperanto, spanish, catalan, galician, estonian, farsi, finnish, 
> french, greek,
> monogreek, ancientgreek, croatian, hungarian, interlingua, ibycus, 
> indonesian,
> icelandic, italian, latin, mongolian, dutch, norsk, polish, 
> portuguese, pinyin
> , romanian, russian, slovenian, uppersorbian, serbian, swedish, 
> turkish, ukengl
> ish, ukrainian, czech:IL2, czech:T1, czechX, slovak:IL2, slovak:T1, 
> slovakX, lo
> aded.
> (c:/TeXLive2007/texmf-dist/tex/latex/base/article.cls
> Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
> (c:/TeXLive2007/texmf-dist/tex/latex/base/size10.clo))
> (c:/TeXLive2007/texmf-dist/tex/latex/base/inputenc.sty
> (c:/TeXLive2007/texmf-dist/tex/latex/base/cp1250.def))
> (c:/TeXLive2007/texmf-var/tex/generic/csh-babel/czech.sty
> (c:/TeXLive2007/texmf-var/tex/generic/csh-babel/czech.ldf
> (c:/TeXLive2007/texmf-var/tex/generic/csh-babel/babel.def)
> cslatex compatibility mode
> (c:/TeXLive2007/texmf-dist/tex/latex/cslatex/il2enc.def)))
> (c:/TeXLive2007/texmf-dist/tex/latex/ltxmisc/a4wide.sty
> (c:/TeXLive2007/texmf-dist/tex/latex/ntgclass/a4.sty))
> (c:/TeXLive2007/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
> Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/07/17> (tvz)
> (c:/TeXLive2007/texmf-dist/tex/latex/graphics/keyval.sty)
> No file fancyvrb.cfg.
> ) (c:/TeXLive2007/texmf-dist/tex/latex/gnuplottex/gnuplottex.sty
> (c:/TeXLive2007/texmf-dist/tex/latex/base/latexsym.sty)
> (c:/TeXLive2007/texmf-dist/tex/latex/graphics/graphicx.sty
> (c:/TeXLive2007/texmf-dist/tex/latex/graphics/graphics.sty
> (c:/TeXLive2007/texmf-dist/tex/latex/graphics/trig.sty)
> (c:/TeXLive2007/texmf/tex/latex/config/graphics.cfg)
> (c:/TeXLive2007/texmf-dist/tex/latex/pdftex-def/pdftex.def)))
> (c:/TeXLive2007/texmf-dist/tex/latex/moreverb/moreverb.sty
> (c:/TeXLive2007/texmf-dist/tex/latex/tools/verbatim.sty))*touch není 
> názvem vnitřního ani vnějšího příkazu,
> spustitelného programu nebo dávkového souboru.*
>
>
> Package gnuplottex Warning: *Shell escape not enabled.*
> (gnuplottex)                You'll need to convert the graphs yourself..
>
> ) (./t-GPlot.aux) 
> (c:/TeXLive2007/texmf-dist/tex/context/base/supp-pdf.tex
> [Loading MPS to PDF converter (version 2006.09.02).]
> ) Opening gnuplot stream t-GPlot-gnuplottex-fig1.gnuplot
>
> *Package gnuplottex Warning: Please convert 
> t-GPlot-gnuplottex-fig1.gnuplot manu
> ally.*
>
> [1{c:/TeXLive2007/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] 
> (./t-GPlot.aux
> ) )<c:/TeXLive2007/texmf-dist/fonts/type1/public/cs/csr10.pfb>
> Output written on t-GPlot.pdf (1 page, 3597 bytes).
> Transcript written on t-GPlot.log.
>
> Podle manuálu gnuplottex.pdf jsem již zjistil, že pdflatex.exe musím 
> volat se -shell-escape; což dělám.
>
> Problémem by mohlo být volání "touch" (soudě podle chybové hlášky); 
> nevím však, jakou hraje úlohu a jak jej "emulovat" ve Windows.
>
> A dále mě mate hláška "Shell escape not enabled".
>
> Co jsem také zkusil, a nefunguje:
>
> Zároveň mít na cestě (PATH) soubor gnuplot.bat, který volá 
> [w]GNUPlot.exe plnou cestou.
>
> Stejně tak nepomohlo mít gnuplot.bat ve stejném adresáři, kde je 
> umístěn t-GNUPlot.tex.
>
> Zkusil jsem nastavit PATH i do adresáře, kde je GNUPlot - bezvýsledně.
>
> Pokud přeložím vygenerovaný t-GPlot-gnuplottex-fig1.gnuplot *ručne*, 
> tj. "gnuplot.bat t-GPlot-gnuplottex-fig1.gnuplot", vznikne žádaný 
> t-GPlot-gnuplottex-fig1.tex, který se má natáhnout do t-GPlot.tex.
>
> Nevěděl by někdo, kde by mohla být chyba, či jakou použít "obezličku"?
>
> WinXP, TL2007.
>
> Předem děkuji a zdravím.
>
> Lukáš Procházka
>
>
>------------------------------------------------------------------------
>
>\documentclass[10pt,a4paper]{article}
>
>\usepackage[cp1250]{inputenc}
>\usepackage{czech,a4wide}
>\usepackage{fancyvrb}
>\usepackage{gnuplottex}
>
>\begin{document}
>
>  A
>
>  \begin{gnuplot}
>    plot sin(x)
>  \end{gnuplot}
>
>\end{document}
>
>  
>
>------------------------------------------------------------------------
>
>set terminal latex
>set output 't-GPlot-gnuplottex-fig1.tex'
>plot sin(x)
>  
>
>  
>
>_______________________________________________
>csTeX mailing list
>csTeX at cs.felk.cvut.cz
>http://lists.felk.cvut.cz/mailman/listinfo/cstex
>  
>




More information about the csTeX mailing list