TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have drawn the following figure, showing a Euro symbol:

% http://upload.wikimedia.org/wikipedia/commons/5/57/Euro_Construction.svg



  \cs_new_eq:NN \calc \fp_eval:n


  unit = 0.8,
  linejoin = 1

   fillstyle = solid,
   fillcolor = yellow!70
         {\calc{ 90+round(acosd(1/10),9)}}%
  \psline(\calc{ 5*cos(2/9*pi)},\calc{-5*sin(2/9*pi)})%
         (\calc{ 5*cos(2/9*pi)},\calc{-sqrt(36-25*cos(2/9*pi)^2)})
         {\calc{ 90+round(acosd(1/12),9)}}



Is there a way of drawing the same figure using PSTricks without all the hard-coded values?

(See the link for how to make a geometrical construction of the symbol.)

share|improve this question
Which hard-coded values are you referring to? The angles would be the same regardless of the size. The lengths are relative to xunit/yunit/unit, so that doesn't really leave much else other than including an existing symbol (from a font, say, eurosym) or including the image after converting it. – Werner Jul 21 '14 at 19:40
@Werner I'm thinking of using something like, say, pst-eucl to 'construct' the symbol. – Svend Tveskæg Jul 21 '14 at 20:12
Explain what you mean by "without hard-coded values", please. Are you interested in scaling the image and the hard-coded values make this difficult? Or you just want something that is cleaner? Even with pst-eucl I don't think you'll get much cleaner. I still think my answer is the easiest and uses PSTricks. – Werner Jul 21 '14 at 20:19
By 'hard-coded' I'm thinking of all the values inside the \calcs. If I can construct the symbol and only use the values on the image in the link, I would like that. – Svend Tveskæg Jul 21 '14 at 20:22
@Werner: Your last link titled my answer points to a wrong target, I think. – kiss my armpit Jul 22 '14 at 15:05
up vote 8 down vote accepted

The Euro symbol is hard coded (http://en.wikipedia.org/wiki/File:EuroConstLarge.png). However, you can simplify it. Straight connections between two points can be omitted \pscustom does it by default when building the path:


  /c40 {40 cos }bind def
  /s40 {40 sin }bind def
  /s65 {6 5 s40 mul add }bind def
  \psarc(0,0){5}{40}{! 180 0.3 ATAN1 sub }
  \psline(! 37.5 c40 mul s65 div 1.5)(! 32.5 c40 mul s65 div 0.5)
  \psarc(0,0){5}{!180 0.1 ATAN1 sub}{!180 0.1 ATAN1 add}
  \psline(! 27.5 c40 mul s65 div -0.5)(! 22.5 c40 mul s65 div -1.5)
  \psarc(0,0){5}{!180 0.3 ATAN1 add}{320}  
  \psarcn(0,0){6}{! 270 5 c40 mul 36 25 c40 dup mul mul sub sqrt div ATAN1 add } 
                 {! 270 0.25 Acos sub }
  \psline(-7.5,-1.5)(!5 c40 mul s65 div 7.5 sub -0.5)
  \psarcn(0,0){6}{!180 1 12 atan add}{!180 1 12 atan sub} 
  \psline(-7.5,0.5)(! 5 c40 mul s65 div 7.5 sub 1.5)
  \psarcn(0,0){6}{!180 1.5 6 atan sub}
          {! 1 c40 div 10 div 36 25 10 sin mul sub 60 s40 mul add mul s65 div ATAN1}


enter image description here

share|improve this answer
Thanks! Just to be clear: What do you mean by "streight lines"? (All lines are streight.) – Svend Tveskæg Jul 21 '14 at 21:43
Compare my \psline sequences and yours. You have four coordinates and I used only two – Herbert Jul 22 '14 at 6:24

A solution with MetaPost which needs only the radius. Run it with context <file>:


boolean trace_euro ; trace_euro := false ;
vardef euro_symbol = image ( % begin_of_euro
 if unknown euro_radius   : euro_radius := 2cm; fi;
 if unknown euro_width    : euro_width := 3euro_radius/16; fi;
 if unknown euro_r_offset : euro_r_offset:= euro_width; fi;
 if unknown euro_l_offset : euro_l_offset := euro_radius/32 ; fi ;
 if unknown euro_l_shift  : euro_l_shift := euro_r_offset ; fi ;
 if unknown euro_v_delta  : euro_v_delta := euro_width/4 ; fi ;
  outer_circle, inner_circle, hor_bar,
  right_line, right_slant, top_slant, bot_slant,
  euro_circle, euro_topbar, euro_botbar ;
  outer_circle, inner_circle, hor_bar,
  right_line, right_slant, top_slant, bot_slant,
  euro_circle, euro_topbar, euro_botbar ;
outer_circle := fullcircle scaled euro_radius ;
inner_circle := fullcircle scaled (euro_radius-euro_width) ;
if trace_euro : 
  for i = outer_circle, inner_circle :
    draw i withpen pencircle scaled 1pt withcolor .5white ;
  endfor ; 
fi ;
right_line := (lrcorner outer_circle -- urcorner outer_circle) shifted (-euro_r_offset,0) ;
outer_circle := outer_circle cutbefore right_line ;
right_slant := point 0 of outer_circle -- origin shifted (0,ypart lrcorner outer_circle) ;
euro_circle := buildcycle(outer_circle, right_line, reverse inner_circle, reverse right_slant) ;
hor_bar := (-euro_radius,0) -- (euro_radius,0) ;
top_slant := right_slant shifted (-euro_radius+euro_r_offset-euro_l_offset,0) ;
bot_slant := top_slant shifted (0,-euro_l_shift) ;
if trace_euro : 
  for i = right_line, right_slant, top_slant, bot_slant :
    draw i withpen pencircle scaled 1pt withcolor .5white ;
  endfor ; 
fi ;
euro_topbar := buildcycle (top_slant, hor_bar shifted (0, euro_v_delta),
                right_slant, hor_bar shifted (0, euro_v_delta+euro_width/2)) ;
euro_botbar := buildcycle (bot_slant, hor_bar shifted (0,-euro_v_delta),
                right_slant, hor_bar shifted (0,-euro_v_delta-euro_width/2)) ;
for i = euro_circle, euro_topbar, euro_botbar :
  draw i withpen pencircle scaled 0 ;
endfor ;
for i = euro_circle, euro_topbar, euro_botbar :
  fill i withpen pencircle scaled 0 ;
endfor ;
if trace_euro : 
  drawpoints euro_circle withcolor red;
  drawpoints euro_topbar withcolor green ;
  drawpoints euro_botbar withcolor blue ;
fi ;
) enddef ; % end_of_euro
euro_radius := 4cm ; draw euro_symbol withcolor 0.8yellow ;
trace_euro := true ; draw euro_symbol shifted (5cm,0) ;


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.