LaTeX forum ⇒ Graphics, Figures & TablestikZ | Custom Arrows (GOST)

Information and discussion about graphics, figures & tables in LaTeX documents.
usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm
Location: Moscow, Russia

tikZ | Custom Arrows (GOST)

Postby usr345 » Mon Nov 28, 2011 2:58 am

There is a Russian standard for the constructor documentation (GOST), where the arrows are defined to be:
gost.png
gost.png (1.33 KiB) Viewed 2604 times

But in tikZ arrows with such angle are missing. How can I make them?
Last edited by usr345 on Tue Nov 29, 2011 1:43 am, edited 4 times in total.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7803
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Mon Nov 28, 2011 10:01 am

Hi,

the image is missing. Could you upload it again?

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm
Location: Moscow, Russia

Postby usr345 » Mon Nov 28, 2011 12:00 pm

Sorry, I tried to upload it to your server. But did something wrong.

Using my server now.
Last edited by usr345 on Mon Nov 28, 2011 3:44 pm, edited 1 time in total.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Mon Nov 28, 2011 12:09 pm

usr345 wrote:Sorry, I tried to upload it your server. But did something wrong.

Using my server now.

The GIF file format is not allowed. I converted the image to PNG and uploaded it to the forum server. This way the picture will always be available. External links can expire.


Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Mon Nov 28, 2011 7:19 pm

Since the »arrows« library of the pgf/tikZ package does not define such arrow tips, you have to do that by yourself. The idea is to borrow code from similar arrow types and modify them.

The code below defines the new arrow types "angle 20" and "triangle 20" along with their reversed counterparts.
  1. \documentclass{minimal}
  2. \usepackage{tikz}
  3. \usetikzlibrary{arrows}
  4.  
  5. \makeatletter
  6. \pgfarrowsdeclare{angle 20}{angle 20}
  7. {
  8. \pgfutil@tempdima=0.3pt%
  9. \advance\pgfutil@tempdima by.25\pgflinewidth%
  10. \pgfutil@tempdimb=7.29\pgfutil@tempdima\advance\pgfutil@tempdimb by.5\pgflinewidth%
  11. \pgfarrowsleftextend{+-\pgfutil@tempdimb}
  12. \pgfutil@tempdimb=.5\pgfutil@tempdima\advance\pgfutil@tempdimb by1.6\pgflinewidth%
  13. \pgfarrowsrightextend{+\pgfutil@tempdimb}
  14. }
  15. {
  16. \pgfutil@tempdima=0.3pt%
  17. \advance\pgfutil@tempdima by.25\pgflinewidth%
  18. \pgfsetdash{}{+0pt}
  19. \pgfsetroundcap
  20. \pgfsetmiterjoin
  21. \pgfpathmoveto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{167}{18\pgfutil@tempdima}}}
  22. \pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}
  23. \pgfpathlineto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-167}{18\pgfutil@tempdima}}}
  24. \pgfusepathqstroke
  25. }
  26. \pgfarrowsdeclarereversed{angle 20 reversed}{angle 20 reversed}{angle 20}{angle 20}
  27.  
  28. \pgfarrowsdeclare{triangle 20}{triangle 20}
  29. {
  30. \pgfutil@tempdima=0.5pt%
  31. \advance\pgfutil@tempdima by.25\pgflinewidth%
  32. \pgfutil@tempdimb=7.29\pgfutil@tempdima\advance\pgfutil@tempdimb by.5\pgflinewidth%
  33. \pgfarrowsleftextend{+-\pgfutil@tempdimb}
  34. \pgfutil@tempdimb=.5\pgfutil@tempdima\advance\pgfutil@tempdimb by1.6\pgflinewidth%
  35. \pgfarrowsrightextend{+\pgfutil@tempdimb}
  36. }
  37. {
  38. \pgfutil@tempdima=0.5pt%
  39. \advance\pgfutil@tempdima by.25\pgflinewidth%
  40. \pgfsetdash{}{+0pt}
  41. \pgfsetmiterjoin
  42. \pgfpathmoveto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{167}{12\pgfutil@tempdima}}}
  43. \pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0\pgfutil@tempdima}}
  44. \pgfpathlineto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-167}{12\pgfutil@tempdima}}}
  45. \pgfpathclose
  46. \pgfusepathqfillstroke
  47. }
  48. \pgfarrowsdeclarereversed{triangle 20 reversed}{triangle 20 reversed}{triangle 20}{triangle 20}
  49. \makeatother
  50.  
  51. \begin{document}
  52. \begin{tikzpicture}
  53. \draw[angle 20-angle 20] (0,0) -- (2,0);
  54. \draw[triangle 20-triangle 20] (0,0.5) -- (2,0.5);
  55. \end{tikzpicture}
  56. \end{document}

This might need further adjustments. Whereas the "triangle 20" type looks good, I have the impression that the "angle 20" type is a bit distorted although I'm sure that I didn't modify parameters which could cause that. You may verify that with a printed document.


Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

usr345
Posts: 37
Joined: Fri Apr 01, 2011 11:39 pm
Location: Moscow, Russia

Postby usr345 » Tue Nov 29, 2011 1:43 am

localghost wrote:I have the impression that the "angle 20" type is a bit distorted although I'm sure that I didn't modify parameters which could cause that. You may verify that with a printed document.


I verified. It seems to be an optical illusion when you are looking with a little zoom. I zoomed to max: 6400% and it looks almost perfect.
Attachments
arrow2.PNG
arrow2.PNG (9.55 KiB) Viewed 2586 times
arrow.png
arrow.png (12.69 KiB) Viewed 2587 times

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests