注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

随机过程

http://superware.blog.163.com

 
 
 

日志

 
 

Epslatex in gnuplot (II)  

2015-01-25 17:40:29|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

1.  Writing a program for handling the epslatex terminal in gnuplot

The program file named gnuepsplot which can be executed.

#!/bin/bash

if [ $# != 1 ]; then

echo
echo Usage: $(basename "${0}")
echo Generating template.gnuplot ...

output=template.gnuplot

echo '# gnuplot file for epslatex terminal' > ${output}
echo >> ${output}
echo 'set terminal epslatex standalone color size 12cm,9cm font "ptm" 14' >> ${output}
echo "set output 'template.tex'" >> ${output}
echo >> ${output}
echo 'set multiplot' >> ${output}
echo >> ${output}
echo 'set border linewidth 1.0' >> ${output}
echo >> ${output}
echo 'set samples 2000' >> ${output}
echo 'set grid' >> ${output}
echo >> ${output}
echo 'set tics scale 2' >> ${output}
echo >> ${output}
echo 'set xrange [0.0:pi]' >> ${output}
echo "set xtics('\$0.0\$' 0.0, '$\frac{\pi}{2}$' pi/2, '\$\pi\$' pi)" >> ${output}
echo 'set mxtics 4' >> ${output}
echo >> ${output}
echo 'set yrange [-2:10]' >> ${output}
echo 'set ytics -2.0, 2.0, 10.0' >> ${output}
echo 'set mytics 4' >> ${output}
echo >> ${output}
echo 'set key top right' >> ${output}
echo >> ${output}
echo "set xlabel '\$x\$'" >> ${output}
echo "set ylabel '\$y\$'" >> ${output}
echo >> ${output}
echo "plot exp(x)*sin(1/x) lw 4 title '\$e^x\sin\left(\frac{1}{x}\right)\$'" >> ${output}
echo >> ${output}
echo 'unset multiplot' >> ${output}

echo Done.
echo

else

echo
echo Usage: $(basename "${0}") input
echo Generating template.tex and then pdflatex template.tex ...
echo

full_name=$1
file_name=$(basename "$full_name")
prefix="${file_name%.*}"
suffix="${file_name##*.}"

quoted_texname=`awk '/output/ {print $3}' ${file_name}`
texname=${quoted_texname:1:(${#quoted_texname}-2)}

gnuplot ${file_name}
pdflatex ${texname}

rmstr="${texname%.*}"

rm ${rmstr}.aux ${rmstr}-inc.eps ${rmstr}-inc-eps-converted-to.pdf ${rmstr}.log

echo
echo Done.
echo

fi


2. Usage

$ gnuepsplot


Usage: gnuepsplot
Generating template.gnuplot ...
Done.


$ gnuepsplot template.gnuplot

Usage: gnuepsplot input
Generating template.tex and then pdflatex template.tex ...


This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
restricted \write18 enabled.
entering extended mode
(./template.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, pi
nyin, thai, loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
) (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg))
(/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
Using configuration file gnuplot.cfg
(/usr/share/texmf/tex/latex/gnuplot/gnuplot.cfg
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def)))
No file template.aux.
(/usr/share/texlive/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
*geometry* detected driver: pdftex
<template-inc-eps-converted-to.pdf, id=1, 361.35pt x 252.945pt>
<use template-inc-eps-converted-to.pdf> [1{/var/lib/texmf/fonts/map/pdftex/updm
ap/pdftex.map} <./template-inc-eps-converted-to.pdf>] (./template.aux) ) </home
/william/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecrm1095.600pk></usr/share/texl
ive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb></usr/share/texlive/te
xmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/share/texlive/texmf-di
st/fonts/type1/public/amsfonts/cm/cmmi8.pfb></usr/share/texlive/texmf-dist/font
s/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts/type1
/public/amsfonts/cm/cmr8.pfb>
Output written on template.pdf (1 page, 52516 bytes).
Transcript written on template.log.

Done.


The command

$ gnuepsplot

without  parameter can generate a file named template.gnuplot for the epslatex template. The users can modify the template file by themselves.

The  following command
$ gnuepsplot template.gnuplot
can generate a template.tex file and then do

$ pdflatex template.tex,

the template.pdf can be obtained.
  评论这张
 
阅读(108)| 评论(0)
推荐

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018