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

# emacs test.tex &
\unitlength = 1mm
  \fmfleft{em,ep} \fmflabel{$e^+$}{ep} \fmflabel{$e^-$}{em}
  \fmfright{fb,f} \fmflabel{$\bar f'$}{fb} \fmflabel{$f$}{f}
# latex test.tex
# mpost example1.mp
# latex test.tex

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


# 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


사용자 삽입 이미지

The modified source is


사용자 삽입 이미지

posted by citadel
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 :


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.

posted by citadel
  • 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


  • 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.


  • 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
How to create a stand alone eps file by using pstricks  (0) 2007.05.14
sshfs  (0) 2007.05.10
Running programs in the background.  (0) 2007.03.10
posted by citadel