Featured Book

LaTeX Beginners Guide

Who is online

In total there are 9 users online :: 0 registered, 0 hidden and 9 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 9 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

tikZ | Custom Arrows (GOST)

Add tags Information and discussion about graphics, figures & tables in LaTeX documents.

tikZ | Custom Arrows (GOST)

Postby usr345 on Mon Nov 28th, 2011

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 1213 times

But in tikZ arrows with such angle are missing. How can I make them?
Last edited by usr345 on Tue Nov 29th, 2011, edited 4 times in total.
usr345
 
Posts: 37
Joined: Fri Apr 1st, 2011
Location: Moscow, Russia

Re: tikZ | Custom Arrows (GOST)

Postby Stefan_K on Mon Nov 28th, 2011

Hi,

the image is missing. Could you upload it again?

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6269
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: tikZ | Custom Arrows (GOST)

Postby usr345 on Mon Nov 28th, 2011

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

Using my server now.
Last edited by usr345 on Mon Nov 28th, 2011, edited 1 time in total.
usr345
 
Posts: 37
Joined: Fri Apr 1st, 2011
Location: Moscow, Russia

Re: tikZ | Custom Arrows (GOST)

Postby localghost on Mon Nov 28th, 2011

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
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: tikZ | Custom Arrows (GOST)

Postby localghost on Mon Nov 28th, 2011

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.
Code: Select all  •  Open in writeLaTeX
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{arrows}

\makeatletter
\pgfarrowsdeclare{angle 20}{angle 20
}
{
  \pgfutil@tempdima=0.3pt%
  \advance\pgfutil@tempdima by.25\pgflinewidth%
  \pgfutil@tempdimb=7.29\pgfutil@tempdima\advance\pgfutil@tempdimb by.5\pgflinewidth%
  \pgfarrowsleftextend{+-\pgfutil@tempdimb}
  \pgfutil@tempdimb=.5\pgfutil@tempdima\advance\pgfutil@tempdimb by1.6\pgflinewidth%
  \pgfarrowsrightextend{+\pgfutil@tempdimb}
}
{
  \pgfutil@tempdima=0.3pt%
  \advance\pgfutil@tempdima by.25\pgflinewidth%
  \pgfsetdash{}{+0pt}
  \pgfsetroundcap
  \pgfsetmiterjoin
  \pgfpathmoveto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{167}{18\pgfutil@tempdima}}}
  \pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}
  \pgfpathlineto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-167}{18\pgfutil@tempdima}}}
  \pgfusepathqstroke
}
\pgfarrowsdeclarereversed{angle 20 reversed}{angle 20 reversed}{angle 20}{angle 20}

\pgfarrowsdeclare{triangle 20}{triangle 20
}
{
  \pgfutil@tempdima=0.5pt%
  \advance\pgfutil@tempdima by.25\pgflinewidth%
  \pgfutil@tempdimb=7.29\pgfutil@tempdima\advance\pgfutil@tempdimb by.5\pgflinewidth%
  \pgfarrowsleftextend{+-\pgfutil@tempdimb}
  \pgfutil@tempdimb=.5\pgfutil@tempdima\advance\pgfutil@tempdimb by1.6\pgflinewidth%
  \pgfarrowsrightextend{+\pgfutil@tempdimb}
}
{
  \pgfutil@tempdima=0.5pt%
  \advance\pgfutil@tempdima by.25\pgflinewidth%
  \pgfsetdash{}{+0pt}
  \pgfsetmiterjoin
  \pgfpathmoveto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{167}{12\pgfutil@tempdima}}}
  \pgfpathlineto{\pgfqpoint{0.5\pgfutil@tempdima}{0\pgfutil@tempdima}}
  \pgfpathlineto{\pgfpointadd{\pgfqpoint{0.5\pgfutil@tempdima}{0pt}}{\pgfqpointpolar{-167}{12\pgfutil@tempdima}}}
  \pgfpathclose
  \pgfusepathqfillstroke
}
\pgfarrowsdeclarereversed{triangle 20 reversed}{triangle 20 reversed}{triangle 20}{triangle 20}
\makeatother

\begin{document}
  \begin{tikzpicture}
    \draw[angle 20-angle 20] (0,0) -- (2,0);
    \draw[triangle 20-triangle 20] (0,0.5) -- (2,0.5);
  \end{tikzpicture}
\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
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: tikZ | Custom Arrows (GOST)

Postby usr345 on Tue Nov 29th, 2011

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 1195 times
arrow.png
arrow.png (12.69 KiB) Viewed 1196 times
usr345
 
Posts: 37
Joined: Fri Apr 1st, 2011
Location: Moscow, Russia


Return to Graphics, Figures & Tables

Who is online

Users browsing this forum: No registered users and 9 guests