[pdftex] eepic and pdflatex

Marc van Dongen dongen at cs.ucc.ie
Fri Feb 9 15:42:24 CET 2001


Don Robinson (drrobin at ilstu.edu) wrote:

: I teach statistics and use pdf files for various purposes.  When drawing
: distributions (normal, t, etc.) I use diagonal lines (e.g.
: \line(1,1){length}) to shade appropriate parts of the distribution.  For
: lines shorter than allowed by LaTeX's picture environment, my practice is
: to use bezier curves to fake straight lines (e.g.,
: \qbezier(x1,y1)(x1,y1)(x2,y2)).  The appearance in printed output is
: satisfactory, but in pdf files you can see the difference if the diagram is
: enlarged even slightly.  A few months ago I started using the eepic package
: and replaced all straight-line bezier curves.  The printed output looks
: better but when I try to create a pdf file I get the usual complaint:
: Non-pdf special ignored.  
: 
: Is there any way I can use the eepic package and create pdf files that show
: these lines?  I am using the current TeXLive 5.0.

This is not an answer to your question, but
have you ever considered using metapost?
If not, I would suggest you have a look at
http://www.tug.org/metapost.html

It is *ideal* for drawing graphs and text. I have
attached some quickly hacked metapost code to shade
a curve (it's a brute hack). I have also attached
the resulting output.

You can convert the eps to pdf, but pdflatex also
lets you input metapost generated eps directly.

Regards,

Marc van Dongen
-- 
     Marc van Dongen, CS Dept | phone:  +353 21 4903578
University College Cork, NUIC | Fax:    +353 21 4903113
  College Road, Cork, Ireland | Email: dongen at cs.ucc.ie
-------------- next part --------------
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: -1 -1 143 143 
%%Creator: MetaPost
%%CreationDate: 2000.09.26:1853
%%Pages: 1
%%DocumentFonts: eurm10 eurm7
 /eurm10 /eurm10 def
 /eurm7 /eurm7 def
/fshow {exch findfont exch scalefont setfont show}bind def
%%EndProlog
%%Page: 1 1
%%HiResBoundingBox: -0.99626 -0.99626 142.72852 142.72852
 0 1.99252 dtransform truncate idtransform setlinewidth pop [] 0 setdash
 1 setlinecap 1 setlinejoin 10 setmiterlimit
newpath 0 0 moveto
9.70753 0.21846 19.30159 2.1372 28.34645 5.66911 curveto
38.67326 9.7016 48.05318 15.73734 56.6929 22.67647 curveto
67.13878 31.06625 76.46675 40.73157 85.03935 51.02466 curveto
95.45514 63.53087 104.73114 76.92775 113.3858 90.70934 curveto
123.74034 107.19777 133.20276 124.22989 141.73225 141.73225 curveto stroke
 0 0.69739 dtransform truncate idtransform setlinewidth pop
newpath 0 0 moveto 0 0 rlineto stroke
newpath 4.72441 0 moveto
4.72441 0.24998 lineto stroke
 0.69739 0 dtransform exch truncate exch idtransform pop setlinewidth
newpath 9.44882 0 moveto
9.44882 0.75 lineto stroke
newpath 14.17323 0 moveto
14.17323 1.56248 lineto stroke
newpath 18.89763 0 moveto
18.89763 2.625 lineto stroke
newpath 23.62204 0 moveto
23.62204 3.99998 lineto stroke
newpath 28.34645 0 moveto
28.34645 5.68748 lineto stroke
newpath 33.07086 0 moveto
33.07086 7.6875 lineto stroke
newpath 37.79527 0 moveto
37.79527 9.99998 lineto stroke
newpath 42.51968 0 moveto
42.51968 12.68752 lineto stroke
newpath 47.24408 0 moveto
47.24408 15.68752 lineto stroke
newpath 51.96849 0 moveto
51.96849 19.06252 lineto stroke
newpath 56.6929 0 moveto
56.6929 22.6875 lineto stroke
newpath 61.41731 0 moveto
61.41731 26.625 lineto stroke
newpath 66.14172 0 moveto
66.14172 30.87502 lineto stroke
newpath 70.86613 0 moveto
70.86613 35.4375 lineto stroke
newpath 75.59053 0 moveto
75.59053 40.3125 lineto stroke
newpath 80.31494 0 moveto
80.31494 45.50002 lineto stroke
newpath 85.03935 0 moveto
85.03935 51 lineto stroke
newpath 89.76376 0 moveto
89.76376 56.87498 lineto stroke
newpath 94.48817 0 moveto
94.48817 63 lineto stroke
newpath 99.21259 0 moveto
99.21259 69.43748 lineto stroke
newpath 103.93698 0 moveto
103.93698 76.25002 lineto stroke
newpath 108.66139 0 moveto
108.66139 83.31248 lineto stroke
newpath 113.3858 0 moveto
113.3858 90.68752 lineto stroke
newpath 118.11021 0 moveto
118.11021 98.37502 lineto stroke
newpath 122.83463 0 moveto
122.83463 106.3125 lineto stroke
newpath 127.55904 0 moveto
127.55904 114.62498 lineto stroke
newpath 132.28343 0 moveto
132.28343 123.24998 lineto stroke
newpath 137.00784 0 moveto
137.00784 132.24998 lineto stroke
newpath 141.73225 0 moveto
141.73225 141.75 lineto stroke
 0 0.99626 dtransform truncate idtransform setlinewidth pop
newpath 70.86613 70.86613 moveto
87.59438 54.13797 lineto stroke
newpath 83.8988 55.66866 moveto
87.59438 54.13797 lineto
86.06363 57.83351 lineto
 closepath
gsave fill grestore stroke
58.66354 72.96613 moveto
(x) eurm10 9.96265 fshow
63.90504 76.58153 moveto
(2) eurm7 6.97385 fshow
showpage
%%EOF
-------------- next part --------------
verbatimtex
\documentclass{article}
\usepackage{euler}
\begin{document}
etex;

defaultfont := "cmr12";
defaultscale := 12pt /fontsize defaultfont;
input mp-tool;
prologues := 2;
input boxes;

u = 5cm;

def f( expr x ) = x*x enddef;

def shade( expr curve, lwb, upb, lines ) =
  pickup pencircle scaled 0.7pt;
  for i = 0 upto lines - 1:
    draw ((lwb+i*(upb-lwb)/(lines-1), 0)--
          (lwb+i*(upb-lwb)/(lines-1), infinity))
          cutafter curve;
  endfor;
enddef;

beginfig(0);
  path curve;
  pair posn;
  points = 6;
  size   = points - 1;

  curve = (0,u*f( 0 )) for i = 1 upto size: ..(u*i/size,u*f( i/size )) endfor;
  pickup pencircle scaled 2pt;
  draw curve;
  shade( curve, 0, u, 31 );

  pickup pencircle scaled 1pt;
  posn = (0.5u,0.5u);
  drawarrow posn--(((0,u)--(u,0)) intersectionpoint curve);
  label.ulft( btex $x^2$ etex, posn );
endfig;

end.


More information about the pdftex mailing list