### How to make a stand alone eps file by using Feynmp

Computer/linux 2008.03.14 07:39
Feynmp(Feynmf) is found on http://www.ctan.org/tex-archive/macros/latex/contrib/feynmf/

# emacs test.tex &
\documentclass{article}
\usepackage{feynmp}
\pagestyle{empty}
\begin{document}
\unitlength = 1mm
\begin{fmffile}{example1}
\begin{fmfchar*}(40,25)
\fmfleft{em,ep} \fmflabel{$e^+$}{ep} \fmflabel{$e^-$}{em}
\fmf{fermion}{em,Zee,ep}
\fmf{photon,label=$\gamma,,Z$}{Zee,Zff}
\fmf{fermion}{fb,Zff,f}
\fmfright{fb,f} \fmflabel{$\bar f'$}{fb} \fmflabel{$f$}{f}
\fmfdot{Zee,Zff}
\end{fmfchar*}
\end{fmffile}
\end{document}
# latex test.tex
# mpost example1.mp
# latex test.tex

# dvips -E test.dvi -o test.eps

OR

# bash_script.sh

more.. bash_script.sh

The test.tex file is the exact same code that can be found in the simple examples of feynmp or feynmf except \pagestyle{empty} and the output file name such as example1.  Without the empty style,  dvips command cannot produce an eps file with the correct bounding box owing to the page number.

one more example is

more..source

The modified source is

more..

#### 'Computer > linux' 카테고리의 다른 글

 Icy cold Bohemian style beer and Linux  (0) 2008.03.31 2008.03.14 2008.03.13 2008.03.04

### How to fix the wrong bounding box information in eps files automatically with python

Computer/python 2007.11.08 07:21
To fix  the wrong bounding box information in the eps files, I use the following method
2007/05/13 - [computer/linux] - How to create a stand alone eps file by using pstricks

However, whenever I fix problems, I have to do the same procedure. It was very cumbersome procedures. I decide to make a lazy program, which do the same thing automatically. Here my second python script :

more..fixBBox.py

The  http://akaihola.blogspot.com/2007/09/goodie-for-your-pdf-toolbox-automatic.html post helps me in order to understand Popen and re. The other references are in the source code.
Note that the above script might delete or destory your eps file. Before using it, please backup your file.

2008.3.28 One guest pointed out a bug in the above script as
Thanks for this great script. But there is a small bug in the regexp. The Bbox can also contain negative numbers, in which case the compiled regular expressions won't replace the BBox string.
To fix it replace in the syntax_* variables '[\d ]+' with '[\-\d ]+'
I really appreciate this comment since this is the first and unique feedback. However, the suggestion is not enough to apply the real eps file when I realize ghostscript does not reply the correct bounding box information even if I change the regular expressions.  I found the useful note (see page 18) : http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf.

To fix these bug, I must redesign all python script. It also is a time-consuming work for me because I am not a professional programmer. Anyway, this is a sort of TODO list.

If you suffer from the negative bounding box informations, consult the adobe info booklet or try to understand the following differences. I think you will find the solution.

%%BoundingBox: -85 346 114 529
%%HiResBoundingBox: -85.509269 346.71008 113.18475 528.09641
%%Page: 1 1
0 560 translate

%%BoundingBox: -85 346 114 529
%%HiResBoundingBox: -85.509269 346.71008 113.18475 528.09641
%%Page: 1 1
200 560 translate
Then, You will open your eps file, translate, and save it.

### How to create a stand alone eps file by using pstricks

Computer/linux 2007.05.14 03:46
• In normal latex environment, pstricks works great. But, when I want to do this with pdflatex environment, it does not work. Then I decide to create eps file.
• make one stand alone TeX file

more..

• latex filename.tex
• dvips -E -o target_filename.eps  filename.dvi
This eps file has the wrong bounding box information, thus one must correct it.
• gs -sDEVICE=bbox -dNOPAUSE -dBATCH target_filename.eps
will return the information about a correct bounding box.

more..

• emacs target_filename.eps, replace %%BoundingBox information with the above return values, and save the file.

#### 'Computer > linux' 카테고리의 다른 글

 ROOT gui default fonts  (0) 2007.05.24 2007.05.14 2007.05.10 2007.03.10