Graphics, Figures & Tables ⇒ tikZ | Custom Arrows (GOST)
tikZ | Custom Arrows (GOST)
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Re: tikZ | Custom Arrows (GOST)
the image is missing. Could you upload it again?
Stefan
Re: tikZ | Custom Arrows (GOST)
Using my server now.
- 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
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)
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
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 6010 times
-
- arrow.png (12.69 KiB) Viewed 6011 times