diff --git a/doc/tikz-ext-manual-en-library-calendar-plus.tex b/doc/tikz-ext-manual-en-library-calendar-plus.tex index bdfd225..a9b4802 100644 --- a/doc/tikz-ext-manual-en-library-calendar-plus.tex +++ b/doc/tikz-ext-manual-en-library-calendar-plus.tex @@ -69,10 +69,12 @@ \subsection{Week numbering (ISO~8601)} % \begin{codeexample}[preamble={\usetikzlibrary{ext.calendar-plus}}] \tikz - \calendar [week list, month label above centered, - dates=2022-07-01 to 2022-07-31, - week label left, - every week/.append style={gray!50!black,font=\sffamily}]; + \calendar[ + week list, month label above centered, + dates=2022-07-01 to 2022-07-31, + week label left, + every week/.append style={ + gray!50!black, font=\sffamily}]; \end{codeexample} % \end{stylekey} diff --git a/doc/tikz-ext-manual-en-library-misc.tex b/doc/tikz-ext-manual-en-library-misc.tex index 227317e..87891a3 100644 --- a/doc/tikz-ext-manual-en-library-misc.tex +++ b/doc/tikz-ext-manual-en-library-misc.tex @@ -294,7 +294,7 @@ \subsection{\tikzname} \begin{multicols}{2} \begin{key}{/tikz/reverse clip=\meta{direction} (default counter clockwise)} This key installs a very big rectangle which is either constructed -|counter clockwise| (like the \referencePathOperationandIndexO{circle} +\texttt{counter clockwise} (like the \referencePathOperationandIndexO{circle} path operation) or |clockwise|. \end{key} \begin{key}{/tikz/clip rule=\meta{direction} (default even odd)} diff --git a/doc/tikz-ext-manual-en-library-nodes.tex b/doc/tikz-ext-manual-en-library-nodes.tex index 37d4f79..e30accf 100644 --- a/doc/tikz-ext-manual-en-library-nodes.tex +++ b/doc/tikz-ext-manual-en-library-nodes.tex @@ -22,13 +22,14 @@ \subsection{Pic as a node} for example as a label. \begin{codeexample}[preamble=\usetikzlibrary{ext.nodes, ext.misc}] \begin{tikzpicture}[ - slsl/.pic={\draw (-2pt, 1.5pt) -- (2pt, .5pt) - (2pt, -1.5pt) -- (-2pt, -.5pt);}] -\node[draw, minimum width=3cm, minimum height=1cm, - label={[pic ] east:slsl}, - label={[pic, rotate=90] north:slsl}, - label={[pic ] west:slsl}, - label={[pic, rotate=-90]south:slsl}]{}; + slsl/.pic={\draw(-2pt, 1.5pt)--( 2pt, .5pt) + ( 2pt,-1.5pt)--(-2pt,-.5pt);}] +\node[ + draw, minimum width=3cm, minimum height=1cm, + label={[pic ] east:slsl}, + label={[pic, rotate= 90]north:slsl}, + label={[pic ] west:slsl}, + label={[pic, rotate=-90]south:slsl}]{}; \end{tikzpicture} \end{codeexample} \end{key} diff --git a/doc/tikz-ext-manual-en-library-positioning-plus.tex b/doc/tikz-ext-manual-en-library-positioning-plus.tex index 56c8137..a44041c 100644 --- a/doc/tikz-ext-manual-en-library-positioning-plus.tex +++ b/doc/tikz-ext-manual-en-library-positioning-plus.tex @@ -164,12 +164,12 @@ \subsection{Useful placement keys for vertical and horizontal alignment} \end{stylekey} \begin{stylekey}{/tikz/span vertical=\meta{list of coordinates}} Creates a rectangular node with the name |fit bounding box| that encompasses - the \meta{list of coordinates} \emph{and} sets the \referenceKeyandIndexO[/pgf]{minimum height} to + the \meta{list of coordinates} \emph{and} sets the \referenceKeyandIndexO[/pgf/]{minimum height} to the height of this bounding box. \end{stylekey} \begin{stylekey}{/tikz/span horizontal=\meta{list of coordinates}} Creates a rectangular node with the name |fit bounding box| that encompasses - the \meta{list of coordinates} \emph{and} sets the \referenceKeyandIndexO[/pgf]{minimum width} to + the \meta{list of coordinates} \emph{and} sets the \referenceKeyandIndexO[/pgf/]{minimum width} to the width of this bounding box. \end{stylekey} \begin{stylekey}{/tikz/span=\meta{list of coordinates}} diff --git a/doc/tikz-ext-manual-en-main-body.tex b/doc/tikz-ext-manual-en-main-body.tex index 12d96ca..198245b 100644 --- a/doc/tikz-ext-manual-en-main-body.tex +++ b/doc/tikz-ext-manual-en-main-body.tex @@ -8,10 +8,11 @@ % 2. under the GNU Free Documentation License. % \newcommand*\tikzextname{Ti\textit kZ-Extensions} -\newcommand*\tikzextversion{0.5} +\newcommand*\tikzextversion{0.5.1} %\includeonly{ -% tikz-ext-manual-en-library-misc, -% tikz-ext-manual-en-library-nodes, +%% tikz-ext-manual-en-library-misc, +%% tikz-ext-manual-en-library-nodes, +% tikz-ext-manual-en-pgf-arrows, %} \begin{document} {\colorlet{blue}{black}% links shall be black @@ -126,6 +127,7 @@ \part{\pgfname\space Libraries} \end{codeexample} \end{center} +\tikzsetfigurename{PGF.arrows}\include{tikz-ext-manual-en-pgf-arrows} \tikzsetfigurename{PGF.trans}\include{tikz-ext-manual-en-pgf-trans} \tikzsetfigurename{PGF.shapes}% \include{tikz-ext-manual-en-pgf-shapes-circlearrow} @@ -180,6 +182,11 @@ \part{Changelog, Index \& References} \section*{Changelog}\addcontentsline{toc}{section}{Changelog} \begin{multicols}{2}\raggedright \noindent +Version 0.5.1 +\begin{itemize} +\item \addPGF{arrows} +\item Bugfix to |ext.pgfkeys-plus|. \cite{GH6} +\end{itemize} Version 0.5 \begin{itemize} \item \addPackage{pgffor} diff --git a/doc/tikz-ext-manual-en-main-preamble.tex b/doc/tikz-ext-manual-en-main-preamble.tex index 30b21de..91b9565 100644 --- a/doc/tikz-ext-manual-en-main-preamble.tex +++ b/doc/tikz-ext-manual-en-main-preamble.tex @@ -41,21 +41,6 @@ \tracinglostchars=3 \input{pgfmanual-en-macros} -\newenvironment{pgfkeyslibrary}[1]{% from pgfmanual-en-macros - \begin{pgfmanualentry}% - \pgfmanualentryheadline{% - \pgfmanualpdflabel{#1}{}% - \textbf{pgfkeys Library} \texttt{\declare{#1}}}% - \index{#1@\protect\texttt{#1} pgfkeys library}% - \index{pgfkeys Libraries!#1@\protect\texttt{#1}}% - \vskip.25em - {{\ttfamily\char`\\usepgfkeyslibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX\space and plain \TeX}}\\ - {{\ttfamily\char`\\usepgfkeyslibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}}\\[.5em]% - \pgfmanualbody -}% -{% - \end{pgfmanualentry}% -} \usepackage{unicode-math} \setmathfont[Scale=MatchUppercase]{libertinusmath-regular.otf} @@ -104,8 +89,9 @@ \@tempswatrue \fi} \makeatother - +\usepgfkeyslibrary{ext.pgfkeys-plus} \usetikzlibrary{ + ext.arrows, ext.calendar-plus, ext.misc, ext.node-families, @@ -408,6 +394,12 @@ \index{#1@\originalprefix\protect\texttt{\original{#1}} environment\originalsuffix}% \index{Environments!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% } + +\newcommand*{\indexArrowtipO}[1]{% + \index{#1@\originalprefix\protect\texttt{\original{#1}} arrow tip\originalsuffix}% + \index{Arrow tips!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% +} +\newcommand*{\referenceArrowtipandIndexO}[1]{\texttt{#1}\indexArrowtipO{#1}} \newcommand*{\referenceEnvironmentandIndexO}[1]{\texttt{#1}\indexEnvironmentO{#1}} \newcommand*{\referenceDecorationandIndexO}[1]{\texttt{#1}\indexDecorationO{#1}} \newcommand*{\referenceKeyandIndexO}[2][/tikz/]{\texttt{#1#2}\indexKeyO[#1]{#2}} @@ -500,4 +492,43 @@ } { \end{pgfmanualentry} -} \ No newline at end of file +} + +\usepackage{booktabs} + +\renewenvironment{arrowtip}[4]{ + \begin{pgfmanualentry} + \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}} + \index{#1@\protect\texttt{#1} arrow tip}% + \index{Arrow tips!#1@\protect\texttt{#1}}% + \pgfmanualbody + \def\currentarrowtype{#1} + \begin{minipage}[t]{\dimexpr\linewidth-5cm\relax} + #2 + \end{minipage}\hskip5mm\begin{minipage}[t]{4.75cm} + \leavevmode\vskip-2em + \tikz{ + \draw [black!50,line width=5mm,-{#1[#3,color=black]}] (-4,0) -- (0,0); + \foreach \action in {#4} + { \expandafter\processaction\action\relax } + } + \end{minipage}\par\smallskip + } +{ + \end{pgfmanualentry} +} +\makeatletter +\def\arrowexample@#1[#2]{% + {\sfcode`\.1000\scriptsize\texttt{#1[#2]}} \> + \tikz [baseline,>={#1[#2]}] \draw [line + width=0.4pt,->] (0,.5ex) -- (2em,.5ex); thin \> + \tikz [baseline,>={#1[#2]}] \draw [line + width=0.8pt,->] (0,.5ex) -- (2em,.5ex); \textbf{thick} \> + \tikz [baseline,>={#1[#2]}] \draw [line + width=1.6pt,->] (0,.5ex) -- (3em,.5ex); \\ +} +\def\manual@action@radius#1/#2/#3\relax{% + \draw [red,|<->|,semithick] ([xshift=-#1,yshift=#1]current bounding + box.north east) -- node [above, overlay] {\texttt{radius}} ++(-#1,0); +} +\makeatother \ No newline at end of file diff --git a/doc/tikz-ext-manual-en-pgf-arrows.tex b/doc/tikz-ext-manual-en-pgf-arrows.tex new file mode 100644 index 0000000..d330360 --- /dev/null +++ b/doc/tikz-ext-manual-en-pgf-arrows.tex @@ -0,0 +1,268 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% Copyright 2023 by Qrrbrbirlbel +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% + +\section{Arrow Tips} +\label{pgflibrary:arrows} +\tikzset{external/export/.try=false}% +\begin{pgflibrary}{ext.arrows} + This library adds arrows to \pgfname/\tikzname. + + \inspiration{ArrowLoop-Q,ArrowHug-Q,ArrowUntipped1-Q,ArrowUntipped2-Q} + {ArrowLoop-A,ArrowHug-A,ArrowUntipped1-A,ArrowUntipped2-A} +\end{pgflibrary} +\begin{multicols}{2} +The arrow tips of the \referenceLibraryandIndexO{arrows.meta} library always +just touch the end of original line -- which is usually +what you want. + +But for some arrow tips (and when they lie along a path) it makes sense +that these tips shoot a bit over the end of the line. +This is why these arrow tips exist. +They can be categorized into three groups: +\begin{enumerate} +\item Centered +\item Untipped +\item Overtipped\footnote{The Overtipped arrow tips aren't yet implemented.} +\end{enumerate} +Not all original arrow tips got all variants. +For a summary, refer to table on the right side. +As with the original tips of the \referenceLibraryandIndexO{arrows.meta} library +these can be organized in the following categories. +\newcolumn +\begin{center} +\newcommand*\tip[2][]{% + \tikzset{external/export/.try=false}% + \tikz[arrows={#2 \arrowtiprow[reversed] - \arrowtiprow[sep] . #2 \arrowtiprow[]}, baseline=+-.5ex, + trim left=+-3mm, trim right=+13mm] + \draw[line width=+.5mm, postaction={draw, gray, thin,-}] (0,0) -- + (right:1);% +}% +\def\tiprow#1 &{#1\gdef\arrowtiprow{#1} &}% +\def\Tiprow#1 &{\quad#1\gdef\arrowtiprow{#1} &}% +%\centering +%\caption{Variants of the original \texttt{arrows.meta} arrow tips. +% For each example, the order is 1. reversed variant, 2. original, 3. variant. +% They gray line shows where the path actually ends. +%}\label{tab:tips} +\begin{tabular}{ll ccc} + \toprule + Group & Original & Centered & Untipped & Overtipped \\ \midrule + Barbed & \tiprow Arc Barb & \tip{Centered} & \tip{Untipped} & -- \\ + & \Tiprow Parenthesis & \tip{Centered} & \tip{Untipped} & -- \\ + & \tiprow Hooks & \tip{Centered} & -- & -- \\ + & \tiprow Straight Barb & \tip{Centered} & -- & -- \\ + & \tiprow Tee Barb & \tip{Centered} & \tip{Untipped} & -- \\ + & \Tiprow Bar & \tip{Centered} & \tip{Untipped} & -- \\ + & \Tiprow Bracket & \tip{Centered} & \tip{Untipped} & -- \\ \midrule +% Mathematical & Classical TikZ Rightarrow & -- & -- & -- \\ +% & Computer Modern Rightarrow & -- & -- & -- \\ +% & \quad To & -- & -- & -- \\ +% & Implies & -- & -- & -- \\ \midrule + Geometric & \tiprow Circle & \tip{Centered} & \tip{Untipped} & -- \\ + & \Tiprow Ellipse & \tip{Centered} & \tip{Untipped} & -- \\ + & \tiprow Kite & \tip{Centered} & -- & -- \\ + & \Tiprow Diamond & \tip{Centered} & -- & -- \\ + & \Tiprow Turned Square & \tip{Centered} & -- & -- \\ + & \tiprow LaTeX & -- & -- & -- \\ + & \tiprow Square & \tip{Centered} & -- & -- \\ + & \Tiprow Rectangle & \tip{Centered} & -- & -- \\ + & \tiprow Stealth & \tip{Centered} & -- & -- \\ + & \Tiprow Triangle & \tip{Centered} & -- & -- \\ \midrule +% Caps & & -- & -- & -- \\ + Rays & \tiprow Rays & \tip{Centered} & -- & -- \\ \bottomrule +\end{tabular} +\end{center} +\newcolumn + +\subsection{Centered} +\subsubsection{Barbed Arrow Tips} +\begin{arrowtipsimple}{Centered Arc Barb} + This is a variant of the \referenceArrowtipandIndexO{Arc Barb} tip. + The center of the arc lies on the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Bar} + A variant of the simple \referenceArrowtipandIndexO{Bar} tip. + This is a simple instance of |Centered Tee Barb| for length zero. + + The middle of the line will lie on original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Bracket} + This is a variant of the \referenceArrowtipandIndexO{Bracket} tip and + therefore an instance of the |Centered Tee Barb| arrow tip that results in something + resembling a bracket. + + The middle of the vertical part will lie on the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Hooks} + A variant of the \referenceArrowtipandIndexO{Hooks} tip. + The starting point of the hooks will lie on the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Parenthesis} + This is a variant of the \referenceArrowtipandIndexO{Parenthesis} tip and + thus an instance of the |Centered Arc Barb| arrow tip. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Straight Barb} + A variant of the \referenceArrowtipandIndexO{Straight Barb} tip. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Tee Barb} + A variant of the \referenceArrowtipandIndexO{Tee Barb} tip. + + The middle of the vertical part will lie on the original end of the path. +\end{arrowtipsimple} + +\subsubsection{Geometric Arrow Tips} +\begin{arrowtipsimple}{Centered Circle} + A variant of the \referenceArrowtipandIndexO{Circle} tip. + The center of the circle will lie on the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Diamond} + This is a variant of the \referenceArrowtipandIndexO{Diamond} tip and + thus an instance of |Centered Kite| where the length is larger than the width. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Ellipse} + This is a variant of the \referenceArrowtipandIndexO{Ellipse} tip + and thus another name for the |Centered Circle| tip + that is twice as wide as high. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Kite} + A variant of the \referenceArrowtipandIndexO{Kite} tip. + + The widest part will lie on the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Rectangle} + A variant of the \referenceArrowtipandIndexO{Rectangle} tip. + By default, it is twice as long as high. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Square} + A variant of the \referenceArrowtipandIndexO{Square} tip. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Stealth} + This is a variant of the \referenceArrowtipandIndexO{Stealth} tip. + + The weighted center will lie at the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Triangle} + This is a variant of the \referenceArrowtipandIndexO{Triangle} tip and + thus an instance of the |Centered Kite| tip with zero inset. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Centered Turned Square} + This is a variant of the \referenceArrowtipandIndexO{Turned Square} tip and + thus an instance of the |Centered Kite| tip with identical width and height and mid-inset. +\end{arrowtipsimple} + +\subsubsection{Special Arrow Tips} +\begin{arrowtipsimple}{Centered Rays} + A variant of the \referenceArrowtipandIndexO{Rays} tip. + The origin of the rays will lie on the original end of the path. +\end{arrowtipsimple} + +\subsection{Untipped} +\subsubsection{Barbed Arrow Tips} +\begin{arrowtipsimple}{Centered Arc Barb} + This is a variant of the \referenceArrowtipandIndexO{Arc Barb} tip. + The arrow tip will protrude half its line width over the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Untipped Bar} + A variant of the simple \referenceArrowtipandIndexO{Bar} tip. + This is a simple instance of |Untipped Tee Barb| for length zero. + + The middle of the line will lie on original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Untipped Bracket} + This is a variant of the \referenceArrowtipandIndexO{Bracket} tip and + therefore an instance of the |Untipped Tee Barb| arrow tip that results in something + resembling a bracket. + + The arrow tip will protrude half its line width over the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Untipped Parenthesis} + This is a variant of the \referenceArrowtipandIndexO{Parenthesis} tip and + thus an instance of the |Untipped Arc Barb| arrow tip. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Untipped Tee Barb} + A variant of the \referenceArrowtipandIndexO{Tee Barb} tip. + + The middle of the vertical part will lie on the original end of the path. +\end{arrowtipsimple} + +\subsubsection{Geometric Arrow Tips} +\begin{arrowtipsimple}{Untipped Circle} + A variant of the \referenceArrowtipandIndexO{Circle} tip. + This tip will protrude half its line width over the original end of the path. +\end{arrowtipsimple} + +\begin{arrowtipsimple}{Untipped Ellipse} + This is a variant of the \referenceArrowtipandIndexO{Ellipse} tip + and thus another name for the |Untipped Circle| tip + that is twice as wide as high. +\end{arrowtipsimple} + +\subsection{Original Arrow Tips} +\begin{arrowtipsimple}{Hug Cap} +This arrow tips will hug a circle that would touch the end of the path. + +Use the \referenceKeyandIndexO[/pgf/arrow keys/]{length} key to set up the radius of that circle. + +\begin{codeexample}[preamble=\usepgflibrary{ext.arrows}] +\begin{tikzpicture}[ + dot/.style 2 args={ + shape=circle, outer sep=+0pt, fill={#1}, minimum size={#2}}] +\node[dot={red} {2cm}] (A) {}; +\node[dot={blue}{3cm}] (B) at (6,0) {}; +\draw[ + line width=1.5cm, + arrows={Hug Cap[length=1cm]-Hug Cap[length=1.5cm]} +] (A) to[out=45, in=180] (B); +\end{tikzpicture} +\end{codeexample} +\end{arrowtipsimple} + +\begin{arrowtip}{Loop}{ + This arrow tip attaches a one-sided loop to the end of the line. + The |length| refers to the length of the whole tip while the |radius| + specifies the radius of the three rounded corners. + The width of the tip is twice the |length| (but can't specified independently). +}{length=1.5cm,radius=3.5mm}{length=1.5cm,radius=3.5mm} + \begin{arrowexamples} + \arrowexample[] + \arrowexampledup[sep] + \arrowexampledupdot[sep] + \arrowexample[open] + \arrowexample[open, swap] + \arrowexample[length=5pt,radius=0pt] + \arrowexample[reversed] + \arrowexample[slant=.3] + \arrowexample[red] + \end{arrowexamples} + % + The following options have no effect: |harpoon|, |round|, |line width|. + + On |double| lines, the arrow tip will not look correct. +\end{arrowtip} +\end{multicols} +\tikzset{external/export/.try=true}% +\endinput diff --git a/doc/tikz-ext-manual-en-pgf-shapes-circlearrow.tex b/doc/tikz-ext-manual-en-pgf-shapes-circlearrow.tex index e26711b..0d6340a 100644 --- a/doc/tikz-ext-manual-en-pgf-shapes-circlearrow.tex +++ b/doc/tikz-ext-manual-en-pgf-shapes-circlearrow.tex @@ -79,11 +79,13 @@ \section{Shape: Circle Arrow} circle arrow turn left west, shape example] {Circle Arrow\vrule width 1pt height 2cm}; \foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, + {north west/above left, north/above, + north east/above right, west/left, center/above, east/right, mid west/right, mid/above, mid east/left, base west/left, base/below, base east/right, - south west/below left, south/below, south east/below right, + south west/below left, south/below, + south east/below right, text/left, 10/right, 130/above} \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} node[\placement] {\scriptsize\texttt{(s.\anchor)}}; diff --git a/doc/tikz-ext-manual-en-pgf-trans.tex b/doc/tikz-ext-manual-en-pgf-trans.tex index ccd378a..1250fd8 100644 --- a/doc/tikz-ext-manual-en-pgf-trans.tex +++ b/doc/tikz-ext-manual-en-pgf-trans.tex @@ -61,7 +61,7 @@ \subsection{Using built-in transformations} \begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] \begin{tikzpicture} -\draw[help lines] (-0.25, -.25) grid (3.25, 1.25); +\draw[help lines] (-.25, -.25) grid (3.25, 1.25); \draw[-latex] (0,0) .. controls (.5,1) .. (1,1); \draw[dashed] (1.5, -.25) -- (1.5, 1.25); @@ -79,7 +79,7 @@ \subsection{Using built-in transformations} \begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] \begin{tikzpicture} -\draw[help lines] (-0.25, -.25) grid (3.25, 1.25); +\draw[help lines] (-.25, -.25) grid (3.25, 1.25); \draw[-latex] (0,0) .. controls (.5,1) .. (1,1); \draw[dashed] (1.5, -.25) -- (1.5, 1.25); diff --git a/doc/tikz-ext-manual.bib b/doc/tikz-ext-manual.bib index 25c736c..721837b 100644 --- a/doc/tikz-ext-manual.bib +++ b/doc/tikz-ext-manual.bib @@ -494,4 +494,107 @@ @Online{UncRectCD2-Q year = {2022}, } +' +@Software{GH6, + abstract = {{Latest version of ext.misc on CTAN appears to have a typo}}, + author = {marmotghost}, + month = mar, + title = {Latest version of ext.misc on CTAN appears to have a typo}, + url = {https://github.com/Qrrbrbirlbel/tikz-extensions/issues/6}, + urldate = {2023-04-01}, + year = {2023}, +} + +' +@Online{ArrowLoop-Q, + author = {{IV}, Edgar A. Bering}, + file = {Snapshot:https\://tex.stackexchange.com/questions/565010/set-the-color-of-a-tikz-cd-glyph-arrow-tip-with-xelatex/681474#681474:text/html}, + month = oct, + title = {Set the color of a tikz-cd Glyph arrow tip with xelatex}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/565010/16595}, + urldate = {2023-04-01}, + year = {2020}, +} + +@Online{ArrowLoop-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/565010/set-the-color-of-a-tikz-cd-glyph-arrow-tip-with-xelatex/681474#681474:text/html}, + month = apr, + title = {Answer to \enquote{Set the color of a tikz-cd Glyph arrow tip with xelatex}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/681474/16595}, + urldate = {2023-04-01}, + year = {2023}, +} + +' +@Online{ArrowHug-Q, + author = {{DC}, Alejandro}, + file = {Snapshot:https\://tex.stackexchange.com/questions/241074/better-fitting-line-to-node-in-tikz/241303#241303:text/html}, + month = apr, + title = {Better fitting line to node in {TiKZ}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/241074/16595}, + urldate = {2023-04-01}, + year = {2015}, +} + +@Online{ArrowHug-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/241074/better-fitting-line-to-node-in-tikz/241303#241303:text/html}, + month = apr, + title = {Answer to \enquote{Better fitting line to node in {TiKZ}}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/241303/16595}, + urldate = {2023-04-01}, + year = {2015}, +} + +' +@Online{ArrowUntipped1-Q, + author = {Christian}, + file = {Snapshot:https\://tex.stackexchange.com/questions/111051/tikz-arrow-tip-is-displaced?noredirect=1&lq=1:text/html}, + month = apr, + title = {{TikZ} arrow tip is displaced}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/111051/16595}, + urldate = {2023-04-02}, + year = {2013}, +} + +@Online{ArrowUntipped1-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/111051/tikz-arrow-tip-is-displaced?noredirect=1&lq=1:text/html}, + month = apr, + title = {Answer to \enquote{{TikZ} arrow tip is displaced}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/111053/16595}, + urldate = {2023-04-02}, + year = {2013}, +} + +' +@Online{ArrowUntipped2-Q, + author = {Hlavacek, Jan}, + file = {Snapshot:https\://tex.stackexchange.com/questions/11871/modifying-and-o-style-tikz-arrows-so-that-they-are-centered-at-the-end-of?noredirect=1&lq=1:text/html}, + month = feb, + title = {Modifying \texttt{*} and \texttt{o} style tikz arrows so that they are centered at the end of line}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/11871/16595}, + urldate = {2023-04-02}, + year = {2011}, +} + +@Online{ArrowUntipped2-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/11871/modifying-and-o-style-tikz-arrows-so-that-they-are-centered-at-the-end-of?noredirect=1&lq=1:text/html}, + month = sep, + title = {Answer to \enquote{Modifying \texttt{*} and \texttt{o} style tikz arrows so that they are centered at the end of line}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/656241/16595}, + urldate = {2023-04-02}, + year = {2022}, +} + @Comment{jabref-meta: databaseType:bibtex;} diff --git a/doc/tikz-ext-manual.pdf b/doc/tikz-ext-manual.pdf index c04e209..57ac4fa 100644 Binary files a/doc/tikz-ext-manual.pdf and b/doc/tikz-ext-manual.pdf differ diff --git a/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex b/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex index 50cbe7a..b78bc60 100644 --- a/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex +++ b/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex @@ -103,7 +103,7 @@ {\the\numexpr\pgfkeysvalueof{\pgfkeyscurrentpath}+1\relax}, .value/.code=% copies the value of one key to another w/o expanding it \pgfkeysgetvalue{#1}\pgfkeys@temp - \expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@temp}} + \expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@temp}% } \pgfqkeys{/utils}{ diff --git a/tex/generic/tikz-ext/pgflibraryext.arrows.code.tex b/tex/generic/tikz-ext/pgflibraryext.arrows.code.tex new file mode 100644 index 0000000..f1181e9 --- /dev/null +++ b/tex/generic/tikz-ext/pgflibraryext.arrows.code.tex @@ -0,0 +1,288 @@ +% Copyright 2023 by Qrrbrbirlbel +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Free Documentation License. +% + +\usepgflibrary{arrows.meta} + +\pgfqkeys{/pgf/@arrows decl}{ + clone/.code={% + \pgfutil@namelet{pgf@decl@arrow@code}{pgf@ar@code@#1}% + \pgfutil@namelet{pgf@decl@arrow@defaults}{pgf@ar@defaults@#1}% + \pgfutil@namelet{pgf@decl@arrow@setup}{pgf@ar@setup@#1}% + \pgfutil@namelet{pgf@decl@arrow@bending@mode}{pgf@ar@bending@mode@#1}% + \pgfutil@namelet{pgf@decl@arrow@par}{pgf@ar@par@#1}% + \pgfutil@namelet{pgf@decl@arrow@cache}{pgf@ar@do@cache@#1}% + }, + append setup code/.code= + \begingroup + \pgfutil@toks@\expandafter{\pgf@decl@arrow@setup#1}% + \expandafter\endgroup + \expandafter\def\expandafter\pgf@decl@arrow@setup\expandafter + {\the\pgfutil@toks@ }, + % append parameters/.code= + % \begingroup + % \show\pgf@decl@arrow@par + % \pgfutil@toks@\expandafter{\pgf@decl@arrow@par#1}% + % \expandafter\endgroup + % \expandafter\def\expandafter\pgf@decl@arrow@par\expandafter + % {\the\pgfutil@toks@ } +} +% \pgfkeyssetvalue{/pgf/arrow keys/weight}{true} + +%%% Barbed +% Arc Barb, Parenthesis +\pgfdeclarearrow{ + clone = Arc Barb, + name = Centered Arc Barb, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{0pt} + \else + \pgfarrowssettipend{0pt} + \fi +} +\pgfdeclarearrow{ + clone = Arc Barb, + name = Untipped Arc Barb, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{\pgfarrowlength} + \else + \pgfarrowssettipend{\pgfarrowlength} + \fi +} + +% Hooks +\pgfdeclarearrow{ + clone = Hooks, + name = Centered Hooks, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{0pt} + \else + \pgfarrowssettipend{0pt} + \fi +} + +% Straight Barb +\pgfdeclarearrow{ + clone = Straight Barb, + name = Centered Straight Barb, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{.5\pgfarrowlength} + \else + \pgfarrowssettipend{.5\pgfarrowlength} + \fi +} + +% Tee Barb, Bar, Bracket +\pgfdeclarearrow{ + clone = Tee Barb, + name = Centered Tee Barb, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{0pt} + \else + \pgfarrowssettipend{0pt} + \fi +} +\pgfdeclarearrow{ + clone = Tee Barb, + name = Untipped Tee Barb, + append setup code = + \ifpgfarrowreversed\expandafter\pgfarrowssetbackend\else\expandafter\pgfarrowssettipend\fi + {\pgfutil@tempdima + \ifpgfutil@tempswa % does it not extend to the right? + \advance\pgf@x-.5\pgfarrowlinewidth + \else + \ifpgfutil@tempswb + \else + \pgf@x=.5\pgfarrowlength + \fi + \ifpgfarrowroundcap\else + \advance\pgf@x-.5\pgfarrowlinewidth + \fi + \fi + } +} +%%% Mathematical +% Classical TikZ Rightarrow +% Computer Modern Rightarrow, To +% Implies + +%%% Geometric +% Circle, Ellipse +\pgfdeclarearrow{ + clone = Circle, + name = Centered Circle, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{.5\pgfarrowlength} + \else + \pgfarrowssettipend{.5\pgfarrowlength} + \fi +} +\pgfdeclarearrow{ + clone = Circle, + name = Untipped Circle, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{\pgfarrowlength \advance\pgf@x -.5\pgfarrowlinewidth} + \else + \pgfarrowssettipend{\pgfarrowlength \advance\pgf@x -.5\pgfarrowlinewidth} + \fi +} + +% Kite, Diamond, Turned Square +\pgfdeclarearrow{ + clone = Kite, + name = Centered Kite, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{\pgfarrowinset} + \else + \pgfarrowssettipend{\pgfarrowinset} + \fi +} + +% LaTeX +% Square, Rectangle +\pgfdeclarearrow{ + clone = Square, + name = Centered Square, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{.5\pgfarrowlength} + \else + \pgfarrowssettipend{.5\pgfarrowlength} + \fi +} + +% Stealth, Triangle +\pgfdeclarearrow{ + clone = Stealth, + name = Centered Stealth, + append setup code = + % \pgfkeysgetvalue{/pgf/arrow keys/weight}\pgf@temp + % \ifx\pgf@temp\pgf@truetext + \ifpgfarrowreversed + \pgfarrowssetbackend{.25\pgfarrowlength \advance\pgf@x .25\pgfarrowinset} + \else + \pgfarrowssettipend{.25\pgfarrowlength \advance\pgf@x .25\pgfarrowinset} + \fi + % \else + % \ifpgfarrowreversed + % \pgfarrowssetbackend{\pgf@temp\pgfarrowlength} + % \else + % \pgfarrowssettipend{\pgf@temp\pgfarrowlength} + % \fi + % \fi + , + % append parameters = {,\pgfkeysvalueof{/pgf/arrow keys/weight}}, + % parameters = { + % \the\pgfarrowlinewidth,% + % \the\pgfarrowlength,% + % \the\pgfarrowwidth,% + % \the\pgfarrowinset,% + % \pgfkeysvalueof{/pgf/arrow keys/weight},% + % \ifpgfarrowharpoon h\fi% + % \ifpgfarrowopen o\fi% + % \ifpgfarrowroundjoin j\fi% + % }, +} +%%% Caps + +%%% Rays +\pgfdeclarearrow{ + clone = Rays, + name = Centered Rays, + append setup code = + \ifpgfarrowreversed + \pgfarrowssetbackend{0pt} + \else + \pgfarrowssettipend{0pt}%\pgfarrowssetvisualtipend{\pgf@xa} + \fi +} + +%%% Variants +\pgfkeys{ + Centered Ellipse /.tip = {Centered Circle[length=+3.3pt +4.95, width'=+0pt +0.5]}, + Centered Parenthesis /.tip = {Centered Arc Barb[arc=+120,length=+1.725pt +2.3]}, + Centered Bar /.tip = {Centered Tee Barb[length=+0pt]}, + Centered Bracket /.tip = {Centered Tee Barb[inset'=+0pt +1,length=+0.75pt +1]}, + Centered Diamond /.tip = {Centered Kite[inset'=+0pt .5]}, + Centered Turned Square /.tip = {Centered Kite[length=+3pt 4,width'= +0pt 1,inset'= +0pt 0.5]}, + Centered Rectangle /.tip = {Centered Square[length=+3pt +4.5,width'=+0pt +.5]}, + Centered Triangle /.tip = {Centered Stealth[inset=+0pt, angle=+60:+2.7pt +3.6]}, + Untipped Ellipse /.tip = {Untipped Circle[length=+3.3pt +4.95, width'=+0pt +0.5]}, + Untipped Parenthesis /.tip = {Untipped Arc Barb[arc=+120,length=+1.725pt +2.3]}, + Untipped Bar /.tip = {Untipped Tee Barb[length=+0pt]}, + Untipped Bracket /.tip = {Untipped Tee Barb[inset'=+0pt +1,length=+0.75pt +1]}, +} + +%%% New Arrows +\pgfdeclarearrow{ + name = Hug Cap, + parameters = \the\pgfarrowlength, + defaults = { + length = +0pt +1 + }, + setup code={ + % h = r - .5 sqrt(4 r^2 - s^2) + \ifdim2\pgfarrowlength<\pgflinewidth + \pgfarrowlength=.51\pgflinewidth + \fi + \pgfmathsetlengthmacro\pgfarrowh{\pgfarrowlength-.5*sqrt(4*\pgfarrowlength*\pgfarrowlength-\pgflinewidth*\pgflinewidth} + % a = asin(s / (2 r)) + \pgfmathsetmacro\pgfarrowangle{asin(\the\pgflinewidth/(2*\the\pgfarrowlength))} + \pgfarrowssavethe\pgfarrowlength % radius + \pgfarrowssave\pgfarrowh % h + \pgfarrowssave\pgfarrowangle % a + \pgfarrowsupperhullpoint{0pt}{.5\pgflinewidth} + \pgfarrowsupperhullpoint{\pgfarrowh}{.5\pgflinewidth} + }, + drawing code={ + \pgfpathmoveto{\pgfqpoint{\pgfarrowh}{-.5\pgflinewidth}} + \pgfpatharc{180+\pgfarrowangle}{180-\pgfarrowangle}{\pgfarrowlength} + \pgfpathlineto{\pgfqpoint{-.1pt}{.5\pgflinewidth}} + \pgfpathlineto{\pgfqpoint{-.1pt}{-.5\pgflinewidth}} + \pgfpathclose + \pgfusepathqfill + } +} + +\pgfqkeys{/pgf/arrow keys}{radius/.style={/pgf/arrow keys/inset={#1}}} +\pgfdeclarearrow{ + name = Loop, + parameters = {\the\pgfarrowlength,\the\pgfarrowinset,\ifpgfarrowopen o\fi}, + defaults = {length = +3pt +1 +0, inset = +.75pt +1 +0}, + setup code = + \ifdim\pgfarrowlength<\dimexpr2\pgfarrowinset+\pgflinewidth\relax + \pgfarrowlength\dimexpr2\pgfarrowinset+\pgflinewidth\relax + \fi + \pgfarrowssettipend{\pgfarrowlength}% + \pgfarrowssetlineend{.5\pgflinewidth}% + \pgfarrowssavethe\pgfarrowlength + \pgfarrowssavethe\pgfarrowinset, + drawing code={% + \pgfsetroundcap + \pgfpathmoveto{\pgfqpoint{.5\pgflinewidth}{0pt}}% + \pgfpathlineto{\pgfqpoint{\dimexpr\pgfarrowlength-.5\pgflinewidth-\pgfarrowinset} + {0pt}}% + \pgfpatharc{+-90}{+0}{+\pgfarrowinset}% + \pgfpathlineto{\pgfqpoint{\dimexpr\pgfarrowlength-.5\pgflinewidth} + {\dimexpr\pgfarrowlength-.5\pgflinewidth-\pgfarrowinset}}% + \pgfpatharc{+0}{+90}{+\pgfarrowinset}% + \pgfpathlineto{\pgfqpoint{\dimexpr\pgfarrowinset+.5\pgflinewidth} + {\dimexpr\pgfarrowlength-.5\pgflinewidth}}% + \pgfpatharc{+90}{+180}{+\pgfarrowinset}% + \pgfpathlineto{\pgfqpoint{\dimexpr\pgfarrowinset+.5\pgflinewidth-\pgfarrowinset} + {\dimexpr-\pgfarrowlength+.5\pgflinewidth}}% + \ifpgfarrowopen\pgfusepathqstroke\else\pgfusepathqfillstroke\fi + } +} \ No newline at end of file diff --git a/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex b/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex deleted file mode 100644 index 6101ca8..0000000 --- a/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex +++ /dev/null @@ -1,11 +0,0 @@ -% Copyright 2022 by Qrrbrbirlbel -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Free Documentation License. -% - -\input pgfkeyslibraryext.pgfkeys-plus.code.tex - -\endinput \ No newline at end of file diff --git a/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex b/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex index 0f06079..5b02075 100644 --- a/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex +++ b/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex @@ -5,7 +5,7 @@ % 1. under the LaTeX Project Public License and/or % 2. under the GNU Free Documentation License. % -\usepgflibrary{ext.pgfkeys-plus}% +\usepgfkeyslibrary{ext.pgfkeys-plus}% %% full arc %% https://tex.stackexchange.com/a/144297/16595