Consider the following example. (This is either the last one or the second to last.)


% pdflatex -shell-escape test.tex




% \psset{unit=\psunit}
   \pcline(\radius,0)(!\radius\space \lige\space add 0)
   \psarc(!\radius\space \lige\space add \radius\space){\radius}{270}{90}
   \pcline(!\radius\space \lige\space add 2 \radius\space mul)%
    (!\radius\space 2 \radius\space mul)
   \pcline[arrows=|*-|*](\radius,\radius)(!\radius\space \lige\space add \radius\space)
   \pcline(!\radius\space \lige\space add \radius\space)%
    (!2 \radius\space mul \lige\space add \radius\space)
   \pcline(\radius,\radius)(!\radius\space 2 \radius\space mul)
   \pcline(!\radius\space \lige\space add \radius\space)%
    (!\radius\space \lige\space add 0)
   \pcline(!\radius\space \lige\space add \radius\space)%
    (!\radius\space \lige\space add 2 \radius\space mul)



enter image description here


I have the desired output but the code is not very elegant. Furthermore, I still don't get how to use the \psunit (see this answer).

  • 1
    Request: Hi :) For PSTricks ignorant users like me and willing to learn, can you give details on "again" in Title means, "improved","elegant" , difference between earlier Q's with elaborate explanation to be understood for dummies like me. – texenthusiast Apr 25 '13 at 15:06
  • @texenthusiast "again" refers to this post, "improved" means that I use a lot of keystrokes to get what I want, and for "elegant", see comment regarding "improved". – Svend Tveskæg Apr 25 '13 at 15:09
  • Is it possible to absorb your comments and detailed explanation inside the question to be concise and clean to help wider audience :). – texenthusiast Apr 25 '13 at 15:10
  • @texenthusiast You are welcome to edit my post. I have to go now for today. – Svend Tveskæg Apr 25 '13 at 15:11
  • I have no idea on this topic so i don't deem fit for rephrasing it :) – texenthusiast Apr 26 '13 at 4:29

Another symmetrical object. Origin is the center:


\def\Radius{19.2}  \def\lige{33.3}
\newlength\R \R=\Radius\psunit %  relative setting to \psunit
\newlength\hW  \hW=\lige\psunit \hW=0.5\hW

  \psarc( \hW,0){\R}{270}{90}
  \psline[linestyle=dotted]( \hW,-\R)( \hW,\R)
  \psline(-\hW, \R)(\hW, \R)  
  \rput*(\dimexpr\hW+0.5\R,0) {\SI{\Radius}{\cm}}

  • Really great, as always! – Svend Tveskæg Apr 26 '13 at 4:08
  • 1
    Unfortunately \dimexpr does not fully support algebraic expressions such as trigonometric expressions, logarithmic expressions, etc. Then this answer is just a special lucky case. :-) – kiss my armpit Apr 26 '13 at 5:40

Using pst-sex package to provide constants in both TeX and PS worlds at the same time.

enter image description here




        \pnodes{P}(!Radius Height)(!Radius Width add Height)(!Radius Width add Radius)
    %\rput(!Radius Width add 0){\rput{180}(0,0){\rput(-\Radius,-\Height){\Semi}}}
    %\uput{0}[0]{180}(!Radius Width add 0){\rput(-\Radius,-\Height){\Semi}}
    \rput{180}(!Radius 2 mul Width add Height){\Semi}
    \pcline[linestyle=dotted](!Radius Radius)(!Radius Width add Radius)


Next time please use English names for the constants.

  • When I uncomment the \pstFPmul commands and try to use the \edef ones instead, the document won't compile. THe problem is probably regarding the unit definition, as Herbert mentioned in the other post. – Svend Tveskæg Apr 25 '13 at 14:55
  • Okay. \bredde = 2*\radius and \laengde = \bredde+\lige. (The \edefs are wrong.) – Svend Tveskæg Apr 25 '13 at 15:00
  • @Bugbusters I won't see your (or any others) post before tomorrow. Good day to everyone. – Svend Tveskæg Apr 25 '13 at 15:10
  • @Bugbusters can you do a favour of making this title more clear based on comments below Q :) – texenthusiast Apr 25 '13 at 15:15
  • 1
    @texenthusiast: I think I should not rephrase the title as the questioner should always provide more descriptive and specific title. :-) – kiss my armpit Apr 26 '13 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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