Graphics, Figures & Tables ⇒ tikZ | Custom Arrows (GOST)
tikZ | Custom Arrows (GOST)
There is a Russian standard for the constructor documentation (GOST), where the arrows are defined to be:
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.
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: tikZ | Custom Arrows (GOST)
Hi,
the image is missing. Could you upload it again?
Stefan
the image is missing. Could you upload it again?
Stefan
LaTeX.org admin
Re: tikZ | Custom Arrows (GOST)
Sorry, I tried to upload it to your server. But did something wrong.
Using my server now.
Using my server now.
Last edited by usr345 on Mon Nov 28, 2011 3:44 pm, edited 1 time in total.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
tikZ | Custom Arrows (GOST)
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.usr345 wrote:Sorry, I tried to upload it your server. But did something wrong.
Using my server now.
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
tikZ | Custom Arrows (GOST)
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.
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
The code below defines the new arrow types "angle 20" and "triangle 20" along with their reversed counterparts.
Code: Select all
\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}
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
tikZ | Custom Arrows (GOST)
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.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.
- Attachments
-
- arrow2.PNG (9.55 KiB) Viewed 6008 times
-
- arrow.png (12.69 KiB) Viewed 6009 times