From 74697976d2ffe935077542593ccbb18a00603251 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 24 Oct 2022 03:03:39 +0000 Subject: CTAN sync 202210240303 --- graphics/pgf/contrib/tikz-ext/README.md | 1 + .../tikz-ext/tikz-ext-manual-en-calendar.tex | 100 ----- .../generic/tikz-ext/tikz-ext-manual-en-intro.tex | 31 -- .../tikz-ext-manual-en-library-calendar-plus.tex | 81 ---- .../tikz-ext/tikz-ext-manual-en-library-misc.tex | 246 ------------ .../tikz-ext-manual-en-library-node-families.tex | 124 ------ .../tikz-ext-manual-en-library-paths.arcto.tex | 110 ------ .../tikz-ext-manual-en-library-paths.ortho.tex | 199 ---------- .../tikz-ext-manual-en-library-paths.timer.tex | 92 ----- .../tikz-ext-manual-en-library-patterns.images.tex | 52 --- ...tikz-ext-manual-en-library-positioning-plus.tex | 183 --------- ...kz-ext-manual-en-library-topaths.arcthrough.tex | 63 ---- .../tikz-ext/tikz-ext-manual-en-library-trans.tex | 136 ------- .../tikz-ext/tikz-ext-manual-en-main-body.tex | 228 ----------- .../tikz-ext/tikz-ext-manual-en-main-preamble.tex | 402 -------------------- .../tikz-ext-manual-en-pgf-shapes-circlearrow.tex | 93 ----- ...z-ext-manual-en-pgf-shapes-circlecrosssplit.tex | 53 --- .../tikz-ext-manual-en-pgf-shapes-heatmark.tex | 83 ---- .../tikz-ext-manual-en-pgf-shapes-rectround.tex | 58 --- .../tikz-ext-manual-en-pgf-shapes-superellipse.tex | 105 ------ .../tikz-ext/tikz-ext-manual-en-pgf-trans.tex | 176 --------- .../doc/generic/tikz-ext/tikz-ext-manual.bib | 322 ---------------- .../doc/generic/tikz-ext/tikz-ext-manual.pdf | Bin 534933 -> 0 bytes .../doc/generic/tikz-ext/tikz-ext-manual.tex | 28 -- .../tikz-ext/doc/tikz-ext-manual-en-calendar.tex | 100 +++++ .../tikz-ext/doc/tikz-ext-manual-en-intro.tex | 31 ++ .../tikz-ext-manual-en-library-calendar-plus.tex | 81 ++++ .../doc/tikz-ext-manual-en-library-misc.tex | 289 ++++++++++++++ .../tikz-ext-manual-en-library-node-families.tex | 124 ++++++ .../doc/tikz-ext-manual-en-library-paths.arcto.tex | 110 ++++++ .../doc/tikz-ext-manual-en-library-paths.ortho.tex | 199 ++++++++++ .../doc/tikz-ext-manual-en-library-paths.timer.tex | 92 +++++ .../tikz-ext-manual-en-library-patterns.images.tex | 52 +++ ...tikz-ext-manual-en-library-positioning-plus.tex | 183 +++++++++ ...kz-ext-manual-en-library-topaths.arcthrough.tex | 63 ++++ .../doc/tikz-ext-manual-en-library-trans.tex | 136 +++++++ .../tikz-ext/doc/tikz-ext-manual-en-main-body.tex | 238 ++++++++++++ .../doc/tikz-ext-manual-en-main-preamble.tex | 419 +++++++++++++++++++++ .../tikz-ext-manual-en-pgf-shapes-circlearrow.tex | 93 +++++ ...z-ext-manual-en-pgf-shapes-circlecrosssplit.tex | 53 +++ .../doc/tikz-ext-manual-en-pgf-shapes-heatmark.tex | 83 ++++ .../tikz-ext-manual-en-pgf-shapes-rectround.tex | 58 +++ .../tikz-ext-manual-en-pgf-shapes-superellipse.tex | 105 ++++++ .../tikz-ext-manual-en-pgf-shapes-uncentered.tex | 99 +++++ .../tikz-ext/doc/tikz-ext-manual-en-pgf-trans.tex | 176 +++++++++ .../pgf/contrib/tikz-ext/doc/tikz-ext-manual.bib | 381 +++++++++++++++++++ .../pgf/contrib/tikz-ext/doc/tikz-ext-manual.pdf | Bin 0 -> 574442 bytes .../pgf/contrib/tikz-ext/doc/tikz-ext-manual.tex | 28 ++ .../tex/generic/tikz-ext/pgfcalendar-ext.code.tex | 2 +- .../pgfkeyslibraryext.pgfkeys-plus.code.tex | 139 +++++++ .../tikz-ext/pgflibraryext.pgfkeys-plus.code.tex | 11 + ...flibraryext.shapes.uncenteredrectangle.code.tex | 307 +++++++++++++++ .../generic/tikz-ext/tikzlibraryext.misc.code.tex | 77 +--- .../tikz-ext/tikzlibraryext.paths.arcto.code.tex | 4 +- 54 files changed, 3657 insertions(+), 3042 deletions(-) delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-calendar.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-intro.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-calendar-plus.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-misc.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-node-families.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.arcto.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.ortho.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.timer.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-patterns.images.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-positioning-plus.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-topaths.arcthrough.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-trans.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-main-body.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-main-preamble.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-circlearrow.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-circlecrosssplit.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-heatmark.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-rectround.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-superellipse.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-trans.tex delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.bib delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.pdf delete mode 100644 graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-calendar.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-intro.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-calendar-plus.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-misc.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.arcto.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.ortho.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.timer.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-patterns.images.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-positioning-plus.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-topaths.arcthrough.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-trans.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-body.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-preamble.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-circlearrow.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-circlecrosssplit.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-heatmark.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-rectround.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-superellipse.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-uncentered.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-trans.tex create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.bib create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.pdf create mode 100644 graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.tex create mode 100644 graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex create mode 100644 graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex create mode 100644 graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.shapes.uncenteredrectangle.code.tex (limited to 'graphics/pgf') diff --git a/graphics/pgf/contrib/tikz-ext/README.md b/graphics/pgf/contrib/tikz-ext/README.md index 33ec46d366..76ea094357 100644 --- a/graphics/pgf/contrib/tikz-ext/README.md +++ b/graphics/pgf/contrib/tikz-ext/README.md @@ -31,6 +31,7 @@ These are * `ext.shapes.heatmark` * `ext.shapes.rectangleroundedcorners` * `ext.shapes.superellipse` + * `ext.shapes.uncenteredrectangle` These were developed in response to questions on tex.stackexchange.com. Some of these can be find by searching for my [user id](https://tex.stackexchange.com/search?q=user%3A16595+%22my+library%22). \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-calendar.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-calendar.tex deleted file mode 100644 index 09bd261a21..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-calendar.tex +++ /dev/null @@ -1,100 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% - -\section{Calendar: Weeknumbers and more conditionals} -\label{sec:calendar} -\begin{package}{calendar-ext} - This package adds week numbers and more conditionals to the \pgfname\space package |pgfcalendar|. - (Despite the code example above, this package is not set up to work with Con\TeX t.) - \inspiration{WeekNum-Q,CalCond-Q,CalFullWeek-Q}{WeekNum-A,CalCond-A,CalFullWeek-A} -\end{package} - -%This package extends the |pgfcalendar| package. - -\begin{multicols}{2} - -\subsection{Extensions} - -The following tests are added. -\begin{itemize} -\itemcalendaroption{Jan} This test is passed by all dates that are in the month of January. -\itemcalendaroption{Feb} as above. -\itemcalendaroption{Mar} as above. -\itemcalendaroption{Apr} as above. -\itemcalendaroption{May} as above. -\itemcalendaroption{Jun} as above. -\itemcalendaroption{Jul} as above. -\itemcalendaroption{Aug} as above. -\itemcalendaroption{Sep} as above. -\itemcalendaroption{Oct} as above. -\itemcalendaroption{Nov} as above. -\itemcalendaroption{Dec} as above. -\itemcalendaroption{leap year}\opt{|=|\meta{year}} - This test checks whether the given year is a leap year. If - \meta{year} is omitted, it checks the year of the current date. -\itemcalendaroption{and}|=|\marg{tests} - This test passes when all \meta{tests} pass. -\itemcalendaroption{not}|=|\marg{tests} - This test passes when \meta{tests} do not pass. -\itemcalendaroption{week of month}|=|\meta{num} - This test passes when the date is in \meta{num}th week of the month. - The first week of the month start at day~1 and ends with day~7. -\itemcalendaroption{week of month'}|=|\meta{num} - As above but counts from the last day of the month. - For a month with 31~days, this means the ``1st'' week starts at day~25 and ends with day~31. -\itemcalendaroption{calendar week of month}|=|\meta{num} - This test passes when the date is in \meta{num}th calendar week of the month. - The first week starts at the first day of the month and ends at the next Sunday. -\itemcalendaroption{calendar week of month'}|=|\meta{num} - As above but counts from the last day of the month. -\begin{codeexample}[width=5cm,preamble=\usetikzlibrary{ext.calendar-plus}] -\tikz - \calendar[ - dates=2022-10-01 to 2022-10-31, - week list] - if (week of month=2) [red] - if (calendar week of month'=2) [blue]; -\end{codeexample} -\itemcalendaroption{yesterday}|=|\marg{tests} - This test passes when the previous day passes \meta{tests}. -\itemcalendaroption{week}|=|\meta{num} - This test passes when the current week of the year equals \marg{num}. -\end{itemize} -The shorthands for |d-| and |m-| are slightly changed so that they are -expandable. This makes it possible to use these shorthands inside of \pgfname math. -The shorthands for the week (see section~\ref{calendar:weeknumbering}) -are added. These are -\begin{itemize} -\item |n-| (shortest numerical representation), -\item |n=| (shortest but added horizontal space) and -\item |n0| (leading zero when below 10). -\end{itemize} - -\subsection{Week numbering (ISO~8601)} -\label{calendar:weeknumbering} -\begin{command}{\pgfcalendarjulianyeartoweek\marg{Julian day}\marg{year}\marg{week counter}} - This command calculates the week for the \meta{Julian day} of \meta{year}. - The \meta{week counter} must be a \TeX\space counter. - - The calculation follows the rule of ISO~8601 where the first week has that - year's first Thursday in it. -\end{command} - -Inside of |\pgfcalendar|\indexCommandO\pgfcalendar the command |\pgfcalendarcurrentweek| will be available. -\begin{command}{\pgfcalendarcurrentweek} - This command returns the current week number (always two digits -- use shorthand |n.| - to strip the leading zero). -\end{command} - -Inside of |\ifdate|\indexCommandO\ifdate the command |\pgfcalendarifdateweek| will be available. -\begin{command}{\pgfcalendarifdateweek} - This command returns the week number (always two digits). -\end{command} -\end{multicols} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-intro.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-intro.tex deleted file mode 100644 index f9468175cb..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-intro.tex +++ /dev/null @@ -1,31 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% -\part{Introduction} -\begin{multicols}{2} -\section{Usage} -This package is called |tikz-ext|, however, -one can't load it via |\usepackage|.% -\footnote{Except for \texttt{calendar-ext} of section~\ref{sec:calendar}.} -Instead, this package consists of multiple -\pgfname\space and \tikzname\space libraries -which are loaded by either |\usepgflibrary| or |\usetikzlibrary|. - -\section{Why do we need it?} -Since I have been answering questions on -\hyperlink{https://tex.stackexchange.com}{TeX.sx} -I've noticed that some questions come up again and again, -every time with a slightly different approach on how to solve them. - -I don't like reinventing the wheel which is why I've gathered -the solutions of my answers in this package. - -\section{Having problems?} -Don't hesitate to open an issue on GitHub. -\end{multicols} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-calendar-plus.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-calendar-plus.tex deleted file mode 100644 index bdfd225f3c..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-calendar-plus.tex +++ /dev/null @@ -1,81 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% - -\section{Calendar} -\begin{tikzlibrary}{ext.calendar-plus} - This library extends the \tikzname\space library \referenceLibraryandIndexO{calendar}. - \inspiration{WeekNum-Q,CalCond-Q,CalMath-Q}{WeekNum-A,CalCond-A,CalMath-A} -\end{tikzlibrary} - -\begin{multicols}{2} - -\subsection{Value-keys and nestable \texttt{if} key} - -The values of following keys are originally stored in some macros that are not -accessible by the user. These are now simple value-keys. -The |@|-protected macros are still available, of course. - -\begin{key}{/tikz/day xshift (initially 3ex)} -\end{key} -\begin{key}{/tikz/day yshift (initially 3.5ex)} -\end{key} -\begin{key}{/tikz/month xshift (initially 9ex)} -\end{key} -\begin{key}{/tikz/month yshift (initially 9ex)} -\end{key} - -It is now also possible to nest |/tikz/if| occurrences. -\begin{key}{/tikz/if=|(|\meta{conditions}|)|\meta{code or options}\opt{|else|\meta{else code or options}}} -\end{key} - -\subsection{\pgfname math functions} -\begin{math-function}{weeksinmonthofyear(\mvar{first weekday}, \mvar{month}, \mvar{year})} -\mathcommand - Returns the number of (partial) weeks in the month \mvar{month} of year \mvar{year} - when this month begins on a \mvar{first weekday}. -\end{math-function} -\begin{math-function}{lastdayinmonthofyear(\mvar{month}, \mvar{year})} -\mathcommand - Returns the last day (28, 29, 30 or 31) of month \mvar{month} of year \mvar{year}. -\end{math-function} - -\subsection{Week numbering (ISO~8601)} - -The actual week number algorithm is implemented by the |pgfcalendar-ext| package/module in section~\ref{calendar:weeknumbering}. -\begin{key}{/tikz/week code=\meta{code}} - Works like |/tikz/day code| or |/tikz/month code|, only for weeks.\indexKeyO{day code}\indexKeyO{month code} -\end{key} - -\begin{key}{/tikz/week text=\meta{text}} - Works like |/tikz/day text| or |/tikz/month text|, only for weeks.\indexKeyO{day text}\indexKeyO{month text} -\end{key} - -\begin{stylekey}{/tikz/every week} - Works like |/tikz/every day| or |/tikz/every month|, only for weeks.\indexKeyO{every day}\indexKeyO{every month} -\end{stylekey} - -\begin{stylekey}{/tikz/week label left} - Places the week label to the left of the first day of the month. (For - |week list| and |month list| where a week does not start on a Monday, the - position is chosen ``as if'' the week had started on a Monday -- which is - usually exactly what you want.) - % -\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}]; -\end{codeexample} - % -\end{stylekey} - -\end{multicols} -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-misc.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-misc.tex deleted file mode 100644 index 163097e6a1..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-misc.tex +++ /dev/null @@ -1,246 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% - -\section{And a little bit more} -\begin{tikzlibrary}{ext.misc} - This library adds miscellaneous utilities to \pgfname math, \pgfname\space or \tikzname. - \inspiration{FullArc-Q,ForeachUse-Q}{FullArc-A,ForeachUse-A} -\end{tikzlibrary} - -\subsection{\pgfname math} - -\begin{multicols}{2} -\pgfkeys{/codeexample/every codeexample/.append style={width=3cm}} -\subsubsection{Postfix operator \texttt{R}} - -Similar to |\segments[]| in PSTricks, the postfix operator |R| allows the user -to use an arbitrary number of segments of a circle to be used instead of an angle. - -\begin{key}{/tikz/full arc=\meta{num} (default |{}|)} - The number \meta{num} of segments will be set up. - Using |full arc| with an empty value disables the segmentation and |1R| equals $1^\circ$. - - The given value \meta{num} is evaluated when the key is used and doesn't change when - \meta{num} contains variables that change. -\end{key} -The |R| operator can then be used. -\begin{math-operator}{R}{postfix}{fullarc} - Multiplies \mvar{x} with $\frac{360}{\meta{num}}$. -\end{math-operator} - -\subsubsection{Functions} - -\begin{math-function}{strrepeat("\mvar{Text}", \mvar{x})} -\mathcommand - Returns a string with \mvar{Text} repeated \mvar{x} times. - -\begin{codeexample}[] -\pgfmathparse{strrepeat("foo", 5)} -\pgfmathresult -\end{codeexample} -\end{math-function} - -\begin{math-function}{isInString("\mvar{String}", "\mvar{Text}")} -\mathcommand - Returns |1| (true) if \mvar{Text} contains \mvar{String}, - otherwise |0| (false). - -\begin{codeexample}[] -\pgfmathparse{isInString("foo", "bar")} -\pgfmathresult \ and\ -\pgfmathparse{isInString("foo", "foobar")} -\pgfmathresult -\end{codeexample} -\end{math-function} - -\begin{math-function}{strcat("\mvar{Text A}", "\mvar{Text B}", …)} -\mathcommand - Returns the concatenation of all given parameters. - -\begin{codeexample}[] -\pgfmathparse{strcat("blue!", int(7*3), "!green")} -\pgfmathresult -\end{codeexample} -\end{math-function} - - -\begin{math-function}{isEmpty("\mvar{Text}")} -\mathcommand - Returns |1| (true) if \mvar{Text} is empty, otherwise |0| (false). - % -\begin{codeexample}[] -\pgfmathparse{isEmpty("foo")} \pgfmathresult\ and\ -\pgfmathparse{isEmpty("")} \pgfmathresult\ and\ -\def\emptyText{} -\pgfmathparse{isEmpty("\emptyText")} \pgfmathresult -\end{codeexample} -\end{math-function} - -\begin{math-function}{atanXY(\mvar{x},\mvar{y})} -\mathcommand - Arctangent of $\mvar y\div \mvar x$ in degrees. This also takes into account the quadrant. - This is just a argument-swapped version of |atan2|\indexMathFunctionO{atan2} which makes it easier to use - the |\p| commands of the |calc|\indexLibraryO{calc} library. - % -\begin{codeexample}[] -\pgfmathparse{atanXY(3,4)} \pgfmathresult -\end{codeexample} -\end{math-function} -\begin{math-function}{atanYX(\mvar{y},\mvar{x})} -\mathcommand - Arctangent of $y\div x$ in degrees. This also takes into account the quadrant. -\begin{codeexample}[] -\pgfmathparse{atanYX(4,3)} \pgfmathresult -\end{codeexample} -\end{math-function} - -\subsubsection{Functions: using coordinates} -The following functions can only be used with \pgfname\space and/or \tikzname. -Since the arguments are usually plain text (and not numbers) one has to wrap -them in |"|. -\begin{math-function}{anglebetween("\mvar{p1}", "\mvar{p2}")}\mathcommand - Return the angle between the centers of the nodes \mvar{p1} and \mvar{p2}. -\end{math-function} -\begin{math-function}{qanglebetween("\mvar{p}")}\mathcommand - Return the angle between the origin and the center of the node \mvar{p}. -\end{math-function} -\begin{math-function}{distancebetween("\mvar{p1}", "\mvar{p2}")}\mathcommand - Return the distance (in pt) between the centers of the nodes \mvar{p1} and \mvar{p2}. -\end{math-function} -\begin{math-function}{qdistancebetween("\mvar{p}")}\mathcommand - Return the distance (in pt) between the origin and the center of the node \mvar{p}. -\end{math-function} - -\end{multicols} - -\begin{codeexample}[width=6cm,preamble=\usetikzlibrary{calc,ext.misc,through}] -\begin{tikzpicture} -\path (0,0) coordinate (A) + (0:4) coordinate (B) +(75:4) coordinate (C); -\draw (A) -- (B) -- (C) -- cycle; -\foreach \cnt in {1,...,4}{ - \pgfmathsetmacro\triA{distancebetween("B","C")} - \pgfmathsetmacro\triB{distancebetween("C","A")} - \pgfmathsetmacro\triC{distancebetween("A","B")} - \path (barycentric cs:A=\triA,B=\triB,C=\triC) coordinate (M) - node [draw, circle through=($(A)!(M)!(C)$)] (M) {}; - \draw ($(C)-(A)$) coordinate (vecB) - (M.75-90) coordinate (@) - (intersection of @--[shift=(vecB)]@ and B--C) coordinate (C) -- - (intersection of @--[shift=(vecB)]@ and B--A) coordinate (A);} -\end{tikzpicture} -\end{codeexample} -\pagebreak -\subsection{\pgfname keys} -% -\begin{multicols}{2} -% -\subsubsection{Conditionals} - -\begin{key}{/utils/if=\meta{cond}\meta{true}\opt{\meta{false}}} - This key checks the conditional \meta{cond} and applies the styles \meta{true} - if \meta{cond} is true, otherwise \meta{false}. - \meta{cond} can be anything that \pgfname math understands. - - As a side effect on how \pgfname keys parses argument, the \meta{false} argument is - actually optional. -\end{key} - -The following keys use \TeX' macros |\if|, |\ifx|, |\ifnum| and |\ifdim| for faster -executions. - -\begin{key}{/utils/TeX/if=\meta{token A}\meta{token B}\meta{true}\opt{\meta{false}}} - This key checks via |\if| if \meta{token A} matches \meta{token B} - and applies the styles \meta{true} if it does, otherwise \meta{false}. - - As a side effect on how \pgfname keys parses argument, the \meta{false} argument is - actually optional. -\end{key} - -\begin{key}{/utils/TeX/ifx=\meta{token A}\meta{token B}\meta{true}\opt{\meta{false}}} - As above. -\end{key} - -\begin{key}{/utils/TeX/ifnum=\meta{num cond}\meta{true}\\opt{\meta{false}}} - This key checks |\ifnum|\meta{num cond} - and applies the styles \meta{true} if true, otherwise \meta{false}. - A delimiting |\relax| will be inserted after \meta{num cond}. - - As a side effect on how \pgfname keys parses argument, the \meta{false} argument is - actually optional. -\end{key} - -\begin{key}{/utils/TeX/ifdim=\meta{dim cond}\meta{true}\opt{\meta{false}}} - As above. -\end{key} - -\begin{key}{/utils/TeX/ifempty=\meta{Text}\meta{true}\opt{\meta{false}}} - This checks whether \meta{Text} is empty and applies styles \meta{true} if true, - otherwise \meta{false}. -\end{key} - - -\subsubsection{Handlers} - -While already a lot of values given to keys are evaluated by \pgfname math at some point, -not all of them are. - -\begin{handler}{{.pgfmath}|=|\meta{eval}} - This handler evaluates \meta{eval} before it is handed to the key. -\end{handler} - -\begin{handler}{{.pgfmath int}|=|\meta{eval}} - As above but truncates the result. -\end{handler} - -\begin{handler}{{.pgfmath strcat}|=|\meta{eval}} - As above but uses the |strcat| function. - - In the example below, one could have used the |/pgf/foreach/evaluate| key from |\foreach|. -\begin{codeexample}[width=3.7cm,preamble=\usetikzlibrary{misc}] -\tikz\foreach \i in {0,10,...,100} -\draw[ - line width=+.2cm, - color/.pgfmath strcat={"red!",sqrt(\i)*10,"!blue"} -] - (0,\i/50) -- +(right:3); -\end{codeexample} -\end{handler} - -\begin{handler}{{.List}|=|\meta{\meta{e1}, \meta{e2}, \dots, \meta{en}}} - This handler evaluates the given list with |\foreach| and concatenates the element and - the result is then given to the used key. -\end{handler} -\end{multicols} -\begin{codeexample}[width=6cm,preamble=\usetikzlibrary{fit,ext.misc}] -\begin{tikzpicture}[nodes={draw, dashed, inner sep=+10pt}] - \foreach \point [count=\cnt] in {(0,0), (0,2), (2,0), (2,2), (3,3), (-1,-1)} - \fill \point circle[radius=.1] coordinate (point-\cnt); - \node[gray, fit/.List={(point-1),(point-...),(point-4)}] {}; - \node[red, fit/.List={(point-1),(point-...),(point-5)}] {}; - \node[blue, fit/.List={(point-1),(point-...),(point-6)}] {}; -\end{tikzpicture} -\end{codeexample} - -\subsection{\pgfname for} - -Instead of |\foreach \var in {start, start + delta, ..., end}| one can use -|\foreach \var[use int=start to end step delta]|. - -\begin{key}{/pgf/foreach/use int=\meta{start}|to|\meta{end}\opt{|step|\meta{delta}}} -The values \meta{start}, \meta{end} and \meta{delta} are evaluates by \pgfname math at initialization. -The part |step |\meta{delta} is optional (\meta{delta} = 1). -\end{key} - -\begin{key}{/pgf/foreach/use float=\meta{start}|to|\meta{end}\opt{|step|\meta{delta}}} -Same as above, however the results are not truncated. -\end{key} - -%TODO: edges to and edges through -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-node-families.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-node-families.tex deleted file mode 100644 index d4b274511c..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-node-families.tex +++ /dev/null @@ -1,124 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% -\section{Node Families} -\begin{tikzlibrary}{ext.node-families} - With this library the user can instruct multiple nodes to have the same - width, height, text width, text height or text width. - This uses the hook \referenceKeyandIndexO{execute at end picture} to write the nodes' - measurements to the \filetype{aux} file. - - Unfortunately, this does not work with the |external| library.\indexLibraryO{external}% - \footnote{First of all, I can't figure out how to use the \textsc{aux} file during externalization since it gets written to the \textsc{log} instead. - And then there's the question about how \texttt{external} would notice the need to export the picture again until it's stable \dots} - - \inspiration{NodeFam-Q}{NodeFam-A} - -\end{tikzlibrary} - -Before we get to the interesting keys, a common prefix can be set for the families' names. -Initially this is |\pgfpictureid-| so that families of different pictures don't interact. -\begin{key}{/tikz/node family/prefix=\meta{prefix}(initially \string\pgfpictureid-)} -The family names are prefixed with the value of |/tikz/node family/prefix|. -\end{key} - -\subsection{Text Box} -\label{ssec:nf-text} -The following keys~-- when setup, see below~-- work with every shape with one single node part.% -\footnote{Technically, it will also work with shapes with multiple node parts but it will only affect the main node part.} -Initially though, only \referenceShapeandIndexO{circle} and \referenceShapeandIndexO{rectangle} are set up that way. -\begin{key}{/tikz/node family/text height=\meta{name} (initially \{\})} -Nodes with the same \meta{name} will have the same text height. -An empty \meta{name} disables the evaluation by the library. -\end{key} - -\begin{key}{/tikz/node family/text depth=\meta{name} (initially \{\})} -Nodes with the same \meta{name} will have the same text depth. -An empty \meta{name} disables the evaluation by the library. -\end{key} - -\begin{key}{/tikz/node family/text width=\meta{name} (initially \{\})} -Nodes with the same \meta{name} will have the same text width. -An empty \meta{name} disables the evaluation by the library. -\end{key} - -\begin{key}{/tikz/node family/text=\meta{name}} -Sets |text height|, |text depth| and |text width|. -\end{key} - -Since the width of the node's content's box is setup much earlier, -the previous key only extends the width of that box which would make the text -seem as if it where aligned to the left. -With |text width family align| this can changed. -\begin{key}{/tikz/node family/text width align=\meta{alignment}(initially center)} -\meta{alignment} is one of |left|, |center| or |right|. - -\begin{codeexample}[preamble=\usetikzlibrary{positioning,ext.node-families},/tikz/node distance=.5cm] -\tikzexternaldisable % ext.node-families does not work with active externalization -\begin{tikzpicture}[nodes={rectangle, draw, node family={text width=manual, text width align=right}}] -\node (a) {Foo}; -\node[below=of a] (b) {Foobar}; -\end{tikzpicture} -\end{codeexample} -\end{key} - -\begin{key}{/tikz/node family/setup shape=\meta{shape}} -This adds instructions to the \meta{shape}'s definition which -adjust the text box's dimensions according to the family. - -This should be only used once per shape. -\end{key} - -\subsection{Minimum Width/Height} -While the keys of the previous subsection work well enough for nodes of the same shape -(and the same |inner sep|s), for different node shapes the text box dimensions will be used -differently for the node's total dimension. - -For this, the following keys are necessary. -When one of the keys are used the values of |minimum width| and/or |minimum height| are set to |nf_width| or |nf_height| respectively. -\begin{key}{/tikz/node family/width=\meta{name} (initially \{\})} -Nodes with the same \meta{name} will have the same \referenceKeyandIndexO[/pgf/]{minimum width}. -An empty \meta{name} disables the evaluation by the library. -\begin{codeexample}[preamble=\usetikzlibrary{positioning,ext.node-families},/tikz/node distance=.5cm] -\tikzexternaldisable % ext.node-families does not work with active externalization -\begin{tikzpicture}[nodes={rectangle, draw, node family/width=manual}] -\node (a) {Foo}; -\node[below=of a] (b) {Foobar}; -\end{tikzpicture} -\end{codeexample} -\end{key} -\begin{key}{/tikz/node family/height=\meta{name} (initially \{\})} -Nodes with the same \meta{name} will have the same \referenceKeyandIndexO[/pgf/]{minimum height}. -An empty \meta{name} disables the evaluation by the library. -\end{key} -\begin{key}{/tikz/node family/size=\meta{name}} -Sets both |height| and |width|. -\end{key} - -\clearpage -\subsection{More shapes that support the keys \texttt{width} and \texttt{height}} -\begin{tikzlibrary}{ext.node-families.shapes.geometric} - This library adds support for the keys \referenceKeyandIndex[/tikz/node family/]{width} and - \referenceKeyandIndex[/tikz/node family/]{height} for the shapes of - the \pgfname\space library \referenceLibraryandIndexO{shapes.geometric}. - - \inspirationQ{NodeFam-Ellipse} -\end{tikzlibrary} -The shapes are also setup for the keys from subsection~\ref{ssec:nf-text}. - -\begin{codeexample}[width=9cm,preamble=\usetikzlibrary{ext.node-families.shapes.geometric}] -\tikzexternaldisable % ext.node-families does not work with active externalization -\begin{tikzpicture} -\foreach \cnt[count=\Cnt] in {a,...,h} - \node[draw, diamond, node family/text=aTOh] (\cnt) - at (right:\Cnt) {\cnt}; -\draw[help lines] (a.south) -- (h.south) (a.north) -- (h.north) (a.base-|a.west) -- (h.base-|h.east); -\end{tikzpicture} -\end{codeexample} -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.arcto.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.arcto.tex deleted file mode 100644 index 8ed660b3a3..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.arcto.tex +++ /dev/null @@ -1,110 +0,0 @@ -% !TeX root = tikz-ext-manual.tex -% !TeX spellcheck = en_US -% 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. -% - -\section{Arc \emph{to} a point} -\label{library:paths.arcto} - -\begin{tikzlibrary}{ext.paths.arcto} - This library adds the new path operation |arc to| that specifies an arc \emph{to} a point~-- - without the user having to specify any angles. -\end{tikzlibrary} - -\begin{codeexample}[width=.5\linewidth,preamble=\usetikzlibrary{ext.paths.arcto}] -\begin{tikzpicture}[ultra thick,dot/.style={label={#1}}] -\coordinate[dot=below left:$a$] (a) at (0,0); -\coordinate[dot=above right:$b$] (b) at (2,3); -\begin{scope}[ - radius=3, - nodes={ - shape=circle, - fill=white, - fill opacity=.9, - text opacity=1, - inner sep=+0pt, - sloped, - allow upside down - }] -\draw[blue] (a) arc to[] - node[near start] {.25} node {.5} node[near end] {.75} (b); -\draw[red] (a) arc to[clockwise] - node[near start] {.25} node {.5} node[near end] {.75} (b); -\draw[blue!50] (a) arc to[large] - node[near start] {.25} node {.5} node[near end] {.75} (b); -\draw[red!50] (a) arc to[large, clockwise] - node[near start] {.25} node {.5} node[near end] {.75} (b); -\end{scope} - -\fill[radius=2pt] (a) circle[] (b) circle[]; -\end{tikzpicture} -\end{codeexample} - -\begin{pathoperation}{arc to}{\opt{\oarg{options}}\meta{coordinate or cycle}} -When this operation is used, the path gets extended by an arc that goes through -the current point and \meta{coordinate}. - -For two points there exist two circles or four arcs that go through or connect -these two points. Which one of these is constructed is determined by the following -options that can be used inside of \meta{options}. - -\begin{stylekey}{/tikz/arc to/clockwise} - This constructs an arc that goes clockwise. -\end{stylekey} - -\begin{stylekey}{/tikz/arc to/counter clockwise} - This constructs an arc that goes counter clockwise. - - This is the default. -\end{stylekey} - -\begin{stylekey}{/tikz/arc to/large} - This constructs an arc whose angle is larger than $180^\circ$. -\end{stylekey} - -\begin{stylekey}{/tikz/arc to/small} - This constructs an arc whose angle is smaller than $180^\circ$. -\end{stylekey} - -\begin{key}{/tikz/arc to/rotate=\meta{degree}} - Rotates the arc by \meta{degree}. - This is only noticeable when |x radius| and |y radius| are different. -\end{key} - -\begin{key}{/tikz/arc to/x radius=\meta{value}} - This forwards the \meta{value} to \referenceKeyandIndexO{x radius}. - Its \meta{value} is used for the radius of the arc. -\end{key} - -\begin{key}{/tikz/arc to/y radius=\meta{value}} - This forwards the \meta{value} to \referenceKeyandIndexO{y radius}. - Its \meta{value} is used for the radius of the arc. -\end{key} - -\begin{key}{/tikz/arc to/radius=\meta{value}} - This forwards the \meta{value} to both |/tikz/x radius| and |/tikz/y radius|. - Its \meta{value} is used for radius of the arc. -\end{key} - -\begin{stylekey}{/tikz/every arc to} - After |/tikz/every arc| this will also be applied before any \meta{options} are set. -\end{stylekey} - -It should be noted that this uses |\pgfpatharcto| for which the \tikzname\space manual warns:\indexCommandO\pgfpatharcto -\begin{quote}\itshape - The internal computations necessary for this command are numerically very unstable. - In particular, the arc will not always really end at the \meta{target coordinate}, - but may be off by up to several points. - A more precise positioning is currently infeasible due to \TeX's numerical weaknesses. - The only case it works quite nicely is when the resulting angle is a multiple of $90^\circ$. -\end{quote} - -The |arc to| path operation will also work only in the |canvas| coordinate system. -The lengths of the vectors $(1, 0)$ and $(0, 1)$ will be used for the calculation of the radii -but no further consideration is done. -\end{pathoperation} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.ortho.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.ortho.tex deleted file mode 100644 index ba78f47dcb..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.ortho.tex +++ /dev/null @@ -1,199 +0,0 @@ -% !TeX root = tikz-ext-manual.tex -% !TeX spellcheck = en_US -% 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. -% - -\section{More Horizontal and Vertical Lines} -\label{library:paths.ortho} - -\begin{tikzlibrary}{ext.paths.ortho} - This library adds new path specifications \verb!|-|!, \verb!-|-! as well as - |r-ud|, |r-du|, |r-lr| and |r-rl|. -\end{tikzlibrary} - -\subsection{Zig-Zag} -Similar to the path operations \verb!|-! and \verb!-|! this library adds\indexPathOperationO{\protect\pgfmanualbar-}\indexPathOperationO{-\protect\pgfmanualbar} -the path operations \verb!|-|! and \verb!-|-!. -{\catcode`\|=12 -\begin{pathoperation}[noindex]{|-|}{\opt{\oarg{options}}\meta{coordinate or cycle}} - \index{---1@\protect\texttt{\protect\pgfmanualbar-\protect\pgfmanualbar} path operation}% - \index{Path operations!---1@\protect\texttt{\protect\pgfmanualbar-\protect\pgfmanualbar}}% - \pgfmanualpdflabel[\catcode`\|=12 ]{|-|}{}% - This operation means ``first vertical, then horizontal and then vertical again''. -\end{pathoperation} -\begin{pathoperation}[noindex]{-|-}{\opt{\oarg{options}}\meta{coordinate or cycle}} - \index{--1@\protect\texttt{-\protect\pgfmanualbar-} path operation}% - \index{Path operations!--1@\protect\texttt{-\protect\pgfmanualbar-}}% - \pgfmanualpdflabel[\catcode`\|=12 ]{-|-}{}% - This operation means ``first horizontal, then vertical and then horizontal again''. -\end{pathoperation} -} -\begin{key}{/tikz/ortho/ratio=\meta{ratio} (initially 0.5)} - This sets the ratio for the middle part of the Zig-Zag connection. - - For values $\meta{ratio} < 0$ and $\meta{ratio} > 1$ the Zig-Zag lines will - look more like Zig-Zig lines. -\begin{codeexample}[preamble=\usetikzlibrary{paths.ortho}] -\begin{tikzpicture}[very thick, rounded corners] -\draw[help lines] (-.25, -1.25) grid (2.25, 1.25); -\draw (0, 0) -|- (2, 1) -- - (2, 0) -|-[ratio=.25] (0,-1) -- cycle; -\end{tikzpicture} -\end{codeexample} -\end{key} -%TODO: hvvh/distance needs fixing, maybe? -\begin{key}{/tikz/ortho/distance=\meta{distance}} - This sets the distance between the start point - and the middle part of the Zig-Zag connection. - - For values $\meta{distance} < 0$ the distance will be used for the target coordinate. -\begin{codeexample}[width=8cm,preamble=\usetikzlibrary{ext.paths.ortho}] -\begin{tikzpicture}[very thick,-latex] -\draw[help lines,-] (-.25, -.25) grid (5.25, 3.25); -\draw (0, 0) -|-[distance= .5cm] ++(2, 1); -\draw (0, 2) -|-[distance=-.5cm] ++(2, 1); - -\tikzset{xshift=3cm} -\draw (2, 1) -|-[distance= .5cm] ++(-2, -1); -\draw (2, 3) -|-[distance=-.5cm] ++(-2, -1); -\end{tikzpicture} -\end{codeexample} -\end{key} -\begin{key}{/tikz/ortho/from center=\opt{\meta{true or false}} (default true)} - When nodes get connected the placement of the middle part of the Zig-Zag - and the Zig-Zig (see below) connections will be calculated from the border - of these nodes. - The middle part of the connections can be calculated from the nodes' center - if this key is set to |true|. -\end{key} - -New timers are setup for both the Zig-Zag and the Zig-Zig connections, -these can be configured through the following keys. -\begin{codeexample}[width=8cm,preamble=\usetikzlibrary{paths.ortho}] -\tikz \draw (0,0) -|- (2,3) - foreach \p in {0.0, 0.25, 0.5, 0.75, 1.0}{ - node [pos=\p] {\p}}; -\end{codeexample} -\begin{key}{/tikz/ortho/spacing=\meta{number} (initially 4)} - Unless $\meta{number} = 0$ is set - \begin{itemize} - \item |pos = 0| will be at the start,\indexKeyO{pos} - \item |pos = 1| will be at the end, - \item |pos = |$\frac{1}{\meta{number}}$ will be at the first kink, - \item |pos = |$\frac{\meta{number}-1}{\meta{number}}$ will be at the second kink and - \item |pos = .5| will be in the middle of the middle part of the connection. - \end{itemize} - - If $\meta{number} = 0$ then - \begin{itemize} - \item |pos = -1| will be at the start, - \item |pos = 2| will be at the end, - \item |pos = 0| will be at the first kink, - \item |pos = 1| will be at the second kink and - \item |pos = .5| will still be in the middle of the middle part of the connection. - \end{itemize} -\end{key} -\begin{key}{/tikz/ortho/middle 0 to 1} - This is an alias for |spacing = 0|. -\end{key} - -\subsection{Zig-Zig} -\begin{pathoperation}{r-ud}{\opt{\oarg{options}}\meta{coordinate or cycle}} - This operation means ``first up, then horizontal and then down''. - \begin{key}{/tikz/ortho/ud distance=\meta{length} (initially .5cm)} - This sets the distance between the start and the horizontal line to \meta{length}. - \end{key} -\end{pathoperation} -\begin{pathoperation}{r-du}{\opt{\oarg{options}}\meta{coordinate or cycle}} - This operation means ``first down, then horizontal and then up''. - \begin{key}{/tikz/ortho/du distance=\meta{length} (initially .5cm)} - This sets the distance between the start and the horizontal line to \meta{length}. - \end{key} -\end{pathoperation} -\begin{pathoperation}{r-lr}{\opt{\oarg{options}}\meta{coordinate or cycle}} - This operation means ``left down, then vertical and then right''. - \begin{key}{/tikz/ortho/lr distance=\meta{length} (initially .5cm)} - This sets the distance between the start and the vertical line to \meta{length}. - \end{key} -\end{pathoperation} -\begin{pathoperation}{r-rl}{\opt{\oarg{options}}\meta{coordinate or cycle}} - This operation means ``first right, then vertical and then down''. - \begin{key}{/tikz/ortho/rl distance=\meta{length} (initially .5cm)} - This sets the distance between the start and the vertical line to \meta{length}. - \end{key} -\end{pathoperation} - -All distances can be set with on key. -\begin{key}{/tikz/ortho/udlr distance=\meta{length}} - Sets all the previous distances to the same value \meta{length}. -\end{key} - -\subsection{Even more Horizontal and Vertical Lines} - -The following keys can be used to access vertical and horizontal line path operations. -\begin{stylekey}{/tikz/horizontal vertical} - This installs \verb!to path = -| (\tikztotarget) \tikztonodes!\indexKeyO{to path} - that can be used with the path operations |to| or |edge|. -\end{stylekey} -\begin{stylekey}{/tikz/vertical horizontal} - This installs \verb!to path = |- (\tikztotarget) \tikztonodes! - that can be used with the path operations |to| or |edge|. -\end{stylekey} -\begin{stylekey}{/tikz/horizontal vertical horizontal} - This installs \verb!to path = -|- (\tikztotarget) \tikztonodes! - that can be used with the path operations |to| or |edge|. -\end{stylekey} -\begin{stylekey}{/tikz/vertical horizontal vertical} - This installs \verb!to path = |-| (\tikztotarget) \tikztonodes! - that can be used with the path operations |to| or |edge|. -\end{stylekey} - -When connecting rectangular nodes, these keys could be useful as well. -They all need to be given to a |to| or |edge| path operation. -\begin{stylekey}{/tikz/only vertical second=\opt{\meta{length}} (default 0pt)} -This draws a vertical line from the start point to the target point so that -it connects to the target point in the center (or at its border in case it is a node). - -The optional \meta{length} can be used to shift the line orthogonally to its direction. -\end{stylekey} -\begin{stylekey}{/tikz/only horizontal second=\opt{\meta{length}} (default 0pt)} -This draws a horizontal line from the start point to the target point so that -it connects to the target point in the center (or at its border in case it is a node). - -The optional \meta{length} can be used to shift the line orthogonally to its direction. -\end{stylekey} -\begin{stylekey}{/tikz/only vertical first=\opt{\meta{length}} (default 0pt)} -This draws a vertical line from the start point to the target point so that -it connects to the start point in the center (or at its border in case it is a node). - -The optional \meta{length} can be used to shift the line orthogonally to its direction. -\end{stylekey} -\begin{stylekey}{/tikz/only horizontal first=\opt{\meta{length}} (default 0pt)} -This draws a horizontal line from the start point to the target point so that -it connects to the start point in the center (or at its border in case it is a node). - -The optional \meta{length} can be used to shift the line orthogonally to its direction. -\end{stylekey} - -\pagebreak -Since all previous key are rather cumbersome, one can install shortcuts for these. -\begin{stylekey}{/tikz/ortho/install shortcuts} -Installs the following shortcuts:\\ -{\ttfamily -\begin{tabular}{l@{\hspace{.5em}${}\to{}$\hspace{.5em}}l} - \pgfmanualbar- & vertical horizontal \\ - -\pgfmanualbar & horizontal vertical \\ - -\pgfmanualbar- & horizontal vertical horizontal \\ - \pgfmanualbar-\pgfmanualbar & vertical horizontal vertical \\ - \pgfmanualbar* & only vertical first \\ - *\pgfmanualbar & only vertical second \\ - \pgfmanualbar* & only vertical first \\ - *\pgfmanualbar & only vertical second -\end{tabular} -} -\end{stylekey} diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.timer.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.timer.tex deleted file mode 100644 index 595a647917..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-paths.timer.tex +++ /dev/null @@ -1,92 +0,0 @@ -% !TeX root = tikz-ext-manual.tex -% !TeX spellcheck = en_US -% 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. -% - -\section{Extending the Path Timers} -\label{library:timer} - -\begin{tikzlibrary}{ext.paths.timer} - This library adds timers to the path specifications |rectangle|, |parabola|, |sin| and |cos|. - - \inspiration{TimerRect-Q,TimerPara-Q}{TimerRect-A,TimerPara-A} -\end{tikzlibrary} - -In \tikzname, the path specification |rectangle|, |parabola|, |sin| and |cos| do not provide -their own timer, i.\,e. a node placing algorithm that is dependent on the actual path. -For |rectangle| the timer of the straight line between the rectangle's corners is used, for -the other paths, nodes, coordinates, pics, etc. are placed on the last coordinate. - -This library allows this. - -\subsection{Rectangle} -\indexPathOperationO{rectangle} - -For the |rectangle| path operator, the timer starts with |pos = 0| (= |at start|) from\indexKeyO{pos} -the starting coordinate in a counter-clockwise direction along the rectangle. -The corners will be at positions 0.0, 0.25, 0.5, 0.75 and 1.0. - -\begin{codeexample}[width=10cm,preamble=\usetikzlibrary{ext.paths.timer}] -\begin{tikzpicture}[scale=2, every pin edge/.style={latex-, gray}] -\coordinate [label=above right:Target] (A) at (0,0); -\coordinate [label=below left:Start] (B) at (1,2); -\draw[->, help lines] ([shift=(50:.3 and .75)] .5,1) - arc[start angle=50, delta angle=340, x radius=.3, y radius=.75]; -\draw (B) rectangle (A) - foreach \pos/\ang in {at start/60, very near start/90, near start/180, pos=.375/180, - midway/180, pos=.625/270, near end/0, very near end/0, at end/0}{ - node[pin=\ang:\pos, style/.expanded=\pos]{}}; -\end{tikzpicture} -\end{codeexample} - -\subsection{Parabola} -\indexPathOperationO{parabola}% - -For the |parabola| path operator the timer is similar to the |.. controls ..| operator. - -The position 0.5 will lie at the |bend|. -\begin{codeexample}[width=.3\linewidth,preamble=\usetikzlibrary{ext.paths.timer}] -\begin{tikzpicture} -\draw[help lines] (-2.25, -1.25) grid (2.25, 3.25); -\draw ( 2,-1) parabola bend (0,0) (-1,3); -\draw[ultra thick] (-2,-1) parabola bend (0,0) ( 1,3) - foreach \pos in {1,...,4,6,7,...,9}{ - node[ - pos=.\pos, sloped, fill=white, font=\small, inner sep=+0pt - ] {\pos} - }; -\end{tikzpicture} -\end{codeexample} - -If no |bend| is specified half the positions will collapse into one end of the curve. - -\begin{codeexample}[width=.3\linewidth,preamble=\usetikzlibrary{ext.paths.timer}] -\begin{tikzpicture}[every pin edge/.style={latex-, shorten <=1pt, gray}] -\draw (-2,-2) parabola (1,0) - foreach \pos in {0, 1, ..., 10} { - node [pos=\pos/10, pin={[anchor=-18*\pos+90]-18*\pos+270:\pos}]{} - }; -\end{tikzpicture} -\end{codeexample} - -\subsection{Sine/Cosine} -\indexPathOperationO{sin}\indexPathOperationO{cos}% - -The |sin| and |cos| path operators also allow placing of nodes along their paths. - -\begin{codeexample}[width=.3\linewidth,preamble=\usetikzlibrary{ext.paths.timer}] -\begin{tikzpicture}[mark nodes on line/.style={insert path={ - foreach \pos in {1, ..., 9} {node[ - sloped, fill=white, font=\small, inner sep=+0pt, pos=\pos/10] {\pos}}}}] -\draw[help lines] (-2.1,-2.1) grid (2.1,0.1); -\draw (-2,-2) sin (1,0) [mark nodes on line]; -\draw[shift=(0:1)](-2,-2) cos (1,0) [mark nodes on line]; -\end{tikzpicture} -\end{codeexample} - -\endinput diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-patterns.images.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-patterns.images.tex deleted file mode 100644 index c3c38a8517..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-patterns.images.tex +++ /dev/null @@ -1,52 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% -\clearpage -\section{Using Images as a Pattern} -\label{library:patterns.images} - -\begin{tikzlibrary}{ext.patterns.images} - This library allows to use an image to be used as a repeating pattern for a path. - - \inspiration{Pattern-Q}{Pattern-A} -\end{tikzlibrary} - -With this library arbitrary images (or indeed PDF documents) can be used as -a repeating pattern for the background of a path. - -This is a two-step process: -\begin{enumerate} -\item Declaring an image as an ``image-pattern''. -\item Using the ``image-pattern''. -\end{enumerate} - -\begin{command}{\pgfsetupimageaspattern\oarg{options}\marg{name}\marg{image}} -\end{command} - -\begin{key}{/tikz/image as pattern=\meta{options} (default \{\})} - -\begin{codeexample}[preamble=\usetikzlibrary{ext.patterns.images,shapes.geometric}] -\pgfsetupimageaspattern[width=.5cm]{grid}{example-image-1x1} -\tikz \node[star, minimum size=3cm, draw, - image as pattern={name=grid,options={left, bottom, y=-.5cm, rotate=45}}] {}; -\end{codeexample} -\end{key} - -\begin{key}{/tikz/image as pattern/name=\meta{name}} -Specifies the name of the ``image-pattern'' to be used. -\end{key} - -\begin{stylekey}{/tikz/image as pattern/option} -Options that will be used by the internal |\pgftext|,\indexCommandO{\pgftext} -only keys from |/pgf/text| should be used.\indexKeyO[/pgf/]{text} -\end{stylekey} - -\begin{stylekey}{/tikz/image as pattern/options=\meta{style}} -Appends style |/tikz/image as pattern/option|. -\end{stylekey} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-positioning-plus.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-positioning-plus.tex deleted file mode 100644 index 56c81376aa..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-positioning-plus.tex +++ /dev/null @@ -1,183 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% -\clearpage -\section{Positioning Plus} -\label{library:positioning-plus} -\tikzsetnextfilename{posplus} -\begin{tikzlibrary}{ext.positioning-plus} - With the help of the \referenceLibraryandIndexO{positioning} and the \referenceLibraryandIndexO{fit} library this extends the placement of nodes. -\end{tikzlibrary} - -\subsection{Useful corner anchors} -The anchors |corner north east|, |corner north west|, |corner south west| and |corner south east| -are defined as ``generic anchors'', i.\,e. they are defined for all shapes. -This is mostly useful for the placement of circular shapes. -\begin{stylekey}{/tikz/corner above left=\opt{\meta{specification}} (default 0pt)} - Similar as \referenceKeyandIndexO{above left} of the \tikzname\space library |positioning| - but uses the |corner north west| anchor. -\end{stylekey} -\begin{stylekey}{/tikz/corner below left=\opt{\meta{specification}} (default 0pt)} - Similar as \referenceKeyandIndexO{below left} of the \tikzname\space library |positioning| - but uses the |corner south west| anchor. -\end{stylekey} -\begin{stylekey}{/tikz/corner above right=\opt{\meta{specification}} (default 0pt)} - Similar as \referenceKeyandIndexO{above right} of the \tikzname\space library |positioning| - but uses the |corner north east| anchor. -\end{stylekey} -\begin{stylekey}{/tikz/corner below right=\opt{\meta{specification}} (default 0pt)} - Similar as \referenceKeyandIndexO{below right} of the \tikzname\space library |positioning| - but uses the |corner south east| anchor. -\end{stylekey} - -\begin{codeexample}[width=.6\linewidth,preamble=\usetikzlibrary{ext.positioning-plus}] -\Huge -\begin{tikzpicture} -\node[name=s,shape=circle,shape example] - {Circle\vrule width 1pt height 2cm}; -\foreach \anchor/\placement in { - 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, - text/left, 10/right, 130/above} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\draw (s.corner north west) rectangle (s.corner south east); -\foreach \anchor/\placement in { - corner north west/above left, corner north east/above right, - corner south west/below left, corner south east/below right} - \draw[red,shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} - -\subsection{Useful placement keys for vertical and horizontal alignment} -\begin{stylekey}{/tikz/north left=\opt{\meta{specification}} (default 0pt)} - Like \referenceKeyandIndexO{left} but aligns the nodes at their |north| border. - - This is basically the same as |left=of reference.north west, anchor=north east|. - % -\begin{codeexample}[preamble=\usetikzlibrary{ext.positioning-plus}] -\begin{tikzpicture}[nodes=draw] -\node[minimum height=2cm] (a) {}; -\node[minimum height=3cm, north right=of a] {}; -\end{tikzpicture} -\end{codeexample} -\end{stylekey} -\begin{stylekey}{/tikz/north right=\opt{\meta{specification}} (default 0pt)} - Like \referenceKeyandIndexO{right} but aligns the nodes at their |north| border. - - This is basically the same as |left=of reference.north east, anchor=north west|. -\end{stylekey} -\begin{stylekey}{/tikz/south left=\opt{\meta{specification}} (default 0pt)} - Like \referenceKeyandIndexO{left} but aligns the nodes at their |south| border. - - This is basically the same as |left=of reference.south west, anchor=south east|. -\end{stylekey} -\begin{stylekey}{/tikz/south right=\opt{\meta{specification}} (default 0pt)} - Like \referenceKeyandIndexO{right} but aligns the nodes at their |south| border. - - This is basically the same as |left=of reference.south east, anchor=south west|. -\end{stylekey} -\begin{stylekey}{/tikz/west above=\opt{\meta{specification}} (default 0pt)} - Like \referenceKeyandIndexO{above} but aligns the nodes at their |west| border. - - This is basically the same as |left=of reference.north west, anchor=south west|. -\end{stylekey} -\begin{stylekey}{/tikz/west below=\opt{\meta{specification}} (default 0pt)} - Like \referenceKeyandIndexO{below} but aligns the nodes at their |west| border. - - This is basically the same as |left=of reference.south west, anchor=north west|. -\end{stylekey} -\begin{stylekey}{/tikz/east above=\opt{\meta{specification}} (default 0pt)} - Like \referenceKeyandIndexO{above} but aligns the nodes at their |east| border. - - This is basically the same as |left=of reference.north east, anchor=south east|. -\end{stylekey} -\begin{stylekey}{/tikz/east below=\opt{\meta{specification}} (default 0pt)} - Like \referenceKeyandIndexO{below} but aligns the nodes at their |east| border. - - This is basically the same as |left=of reference.south east, anchor=north east|. -\end{stylekey} - -The same exist for the recently introduces corner anchors, too. -\begin{stylekey}{/tikz/corner north left=\opt{\meta{specification}} (default 0pt)} - The same as |/tikz/north left| but uses the new corner anchors. -\end{stylekey} -\begin{stylekey}{/tikz/corner north right=\opt{\meta{specification}} (default 0pt)} - The same as |/tikz/north right| but uses the new corner anchors. -\end{stylekey} -\begin{stylekey}{/tikz/corner south left=\opt{\meta{specification}} (default 0pt)} - The same as |/tikz/south left| but uses the new corner anchors. -\end{stylekey} -\begin{stylekey}{/tikz/corner south right=\opt{\meta{specification}} (default 0pt)} - The same as |/tikz/south right| but uses the new corner anchors. -\end{stylekey} -\begin{stylekey}{/tikz/corner west above=\opt{\meta{specification}} (default 0pt)} - The same as |/tikz/west above| but uses the new corner anchors. -\end{stylekey} -\begin{stylekey}{/tikz/corner west below=\opt{\meta{specification}} (default 0pt)} - The same as |/tikz/west below| but uses the new corner anchors. -\end{stylekey} -\begin{stylekey}{/tikz/corner east above=\opt{\meta{specification}} (default 0pt)} - The same as |/tikz/east above| but uses the new corner anchors. -\end{stylekey} -\begin{stylekey}{/tikz/corner east below=\opt{\meta{specification}} (default 0pt)} - The same as |/tikz/east below| but uses the new corner anchors. -\end{stylekey} - -While the \meta{specification} of all these keys still accept the same form as with \tikzname, -the |ext.positioning-plus| library extends this even more. - -The specification after |of| can contain a list of coordinates -(like the |fit| key of the |fit| library). -This means that the new node will be placed in relation to a rectangular bounding box -that fits around all this nodes in the list. - -If this list is prefixed with \verb!|!, |-| or |+|, -the new node will also have the same height (\verb!|!), -the same width (|-|) or both as this bounding box. - -\begin{codeexample}[preamble=\usetikzlibrary{ext.positioning-plus}] -\begin{tikzpicture}[nodes=draw] -\node (A) {A}; -\node[below=of A] (BCD) {BCD}; -\node[right=of |(A)(BCD)] (c) {}; -\node[below=.5:of -(A)(BCD)] (d) {}; -\draw[help lines] (BCD.south west) -- (c.south east) - (BCD.north east) -- (d.south east); -\end{tikzpicture} -\end{codeexample} - -This functionality is also available without the placement: -\begin{stylekey}{/tikz/fit bounding box=\meta{list of coordinates}} - Creates a rectangular node with the name |fit bounding box| that encompasses - the \meta{list of coordinates}. -\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 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 width of this bounding box. -\end{stylekey} -\begin{stylekey}{/tikz/span=\meta{list of coordinates}} - Is a combination of |/tikz/span vertical| and |/tikz/span horizontal|. -\end{stylekey} - -As you maybe noticed in the example above, the \meta{specification} also allows a prefix -delimited by |:| which the |node distance| will be multiplied to with for the placement.% -\footnote{This is probably more useful when \referenceKeyandIndexO{on grid} is used.} - -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-topaths.arcthrough.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-topaths.arcthrough.tex deleted file mode 100644 index 1d9e5ba9df..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-topaths.arcthrough.tex +++ /dev/null @@ -1,63 +0,0 @@ -% !TeX root = tikz-ext-manual.tex -% !TeX spellcheck = en_US -% 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. -% - -\section{Arcs through Three Points} -\label{library:topaths.arcthrough} -\begin{tikzlibrary}{ext.topaths.arcthrough} - This library allows to use an arc defined by three points. -\end{tikzlibrary} - -\begin{codeexample}[width=10cm,preamble=\usetikzlibrary{ext.topaths.arcthrough}] -\begin{tikzpicture} -\coordinate[label=above right:$A$] (A) at ( 3, 1); -\coordinate[label=above:$B$] (B) at ( 1, 2); -\coordinate[label=below left:$C$] (C) at (-2,-2); - -\draw[ultra thick, draw=green, fill=green!50] - (B) to[arc through={clockwise,(A)}] (C) - -- (arc through center) -- cycle; -\draw[ultra thick, draw=blue, fill=blue!50] - (B) to[arc through=(A)] (C) - -- (arc through center) -- cycle; - -\foreach \p in {A,B,C, arc through center} \fill[red] (\p) circle[radius=2pt]; -\end{tikzpicture} -\end{codeexample} - -This can only by used for circles in the |canvas| coordinate system. - -\begin{multicols}{2} -\begin{key}{/tikz/arc through/through=\meta{coordinate} (initially {(0,0)})} - The coordinate on the circle that defines~-- together with the - starting and target point~-- a circle. -\end{key} - -\begin{key}{/tikz/arc through/center suffix=\meta{suffix} (initially {})} - The |arc through| will define a coordinate named |arc through center|\meta{suffix} - so that it can be referenced later. -\end{key} - -\begin{key}{/tikz/arc through/clockwise} - The resulting arc will go clockwise from the starting point to the target point. - This will not necessarily go through the |through| point. -\end{key} - -\begin{key}{/tikz/arc through/counter clockwise} - The resulting arc will go counter clockwise from the starting point to the target point. - This will not necessarily go through the |through| point. -\end{key} - -\begin{key}{/tikz/arc through=\meta{key-value}} - This key should be used with |to|\indexPathOperationO{to} or |edge|\indexPathOperationO{edge}. - A parameter other than |center suffix|, |clockwise| or |counter clockwise| will - be assumed to be the |through| coordinate. -\end{key} -\end{multicols} -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-trans.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-trans.tex deleted file mode 100644 index 97011bc4d0..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-library-trans.tex +++ /dev/null @@ -1,136 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% - -\clearpage -\section{Mirror, Mirror on the Wall} -\label{library:mirror} - -\begin{tikzlibrary}{ext.transformations.mirror} - This library adds more transformations to \tikzname. -\end{tikzlibrary} - -As explained in section~\ref{pgflibrary:transformations}, there are two approaches to setting a mirror transformation. -As with the commands in \pgfname, we'll be using a lowercase |m| for the reflection matrix and an uppercase |M| for the built-in approach. - -\subsection{Using the reflection matrix} - -\begin{codeexample}[width=.4\linewidth,preamble=\usetikzlibrary{shapes.geometric,ext.transformations.mirror}] -\begin{tikzpicture}[line join=round, thick, reg poly/.style={ - shape=regular polygon, regular polygon sides={#1}}] -\node[reg poly=5, minimum size=+2cm, draw, very thick] (a) {}; -\foreach \i[evaluate={\col=(\i-1)/.04}] in {1,...,5} - \node [mirror=(a.corner \i)--(a.side \i), transform shape, - reg poly=5, minimum size=+2cm, draw=red!\col!blue] {}; -\end{tikzpicture} -\end{codeexample} - -\begin{key}{/tikz/xmirror=\meta{value or coordinate} (default 0pt)} - Sets up a transformation that mirrors along a horizontal line that goes through point $(\text{\meta{value}}, 0)$ or \meta{coordinate}. - -\begin{codeexample}[preamble=\usetikzlibrary{ext.transformations.mirror}] -\begin{tikzpicture} -\draw[help lines] (-0.25, -.25) grid (3.25, 1.25); -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); - -\draw[dashed] (1.5, -.25) coordinate (m) -- (1.5, 1.25); -\draw[xmirror=(m),-latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{key} - -\begin{key}{/tikz/ymirror=\meta{value or coordinate} (default 0pt)} - Sets up a transformation that mirrors along a vertical line that goes through point $(0, \text{\meta{value}})$ or \meta{coordinate}. -\end{key} - - -\begin{key}{/tikz/mirror x=\meta{coordinate} (default {(0,0)})} - Similar to |/tikz/xmirror|, this however uses the |xyz| coordinate system instead of the |canvas| system. -\begin{codeexample}[preamble=\usetikzlibrary{ext.transformations.mirror}] -\begin{tikzpicture}[x=.5cm, y=(45:1cm)] - -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); - -\draw[dashed] (1.5, -.25) coordinate (m) -- (1.5, 1.25); - -\draw[ xmirror=(m), -latex, red, dotted] (0,0) .. controls (.5,1) .. (1,1); -\draw[mirror x=(m), -latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{key} - -\begin{key}{/tikz/mirror y=\meta{coordinate} (default {(0,0)})} - Similar to |/tikz/ymirror|, this however uses the |xyz| coordinate system instead of the |canvas| system. -\end{key} - - -\begin{key}{/tikz/mirror=\meta{point A}|--|\meta{point B}} - Sets up a transformation that mirrors along a line that goes through \meta{point A} and \meta{point B}. - - When only \meta{point A} is given that line goes through \meta{point A} and the origin. -\end{key} - -\subsection{Using built-in transformations} - -\begin{codeexample}[width=.4\linewidth,preamble=\usetikzlibrary{shapes.geometric,ext.transformations.mirror}] -\begin{tikzpicture}[line join=round, thick, reg poly/.style={ - shape=regular polygon, regular polygon sides={#1}}] -\node[reg poly=5, minimum size=+2cm, draw, very thick] (a) {}; -\foreach \i[evaluate={\col=(\i-1)/.04}] in {1,...,5} - \node [Mirror=(a.corner \i)--(a.side \i), transform shape, - reg poly=5, minimum size=+2cm, draw=red!\col!blue] {}; -\end{tikzpicture} -\end{codeexample} - -\begin{key}{/tikz/xMirror=\meta{value or coordinate} (default 0pt)} - Sets up a transformation that mirrors along a horizontal line that goes through point $(\text{\meta{value}}, 0)$ or \meta{coordinate}. - -\begin{codeexample}[preamble=\usetikzlibrary{ext.transformations.mirror}] -\begin{tikzpicture} -\draw[help lines] (-0.25, -.25) grid (3.25, 1.25); -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); - -\draw[dashed] (1.5, -.25) coordinate (m) -- (1.5, 1.25); -\draw[xMirror=(m),-latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{key} - -\begin{key}{/tikz/yMirror=\meta{value or coordinate} (default 0pt)} - Sets up a transformation that mirrors along a vertical line that goes through point $(0, \text{\meta{value}})$ or \meta{coordinate}. -\end{key} - - -\begin{key}{/tikz/Mirror x=\meta{coordinate} (default {(0,0)})} - Similar to |/tikz/xMirror|, this however uses the |xyz| coordinate system instead of the |canvas| system. -\begin{codeexample}[preamble=\usetikzlibrary{ext.transformations.mirror}] -\begin{tikzpicture}[x=.5cm, y=(45:1cm)] - -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); - -\draw[dashed] (1.5, -.25) coordinate (m) -- (1.5, 1.25); - -\draw[ xMirror=(m), -latex, red, dotted] (0,0) .. controls (.5,1) .. (1,1); -\draw[Mirror x=(m), -latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{key} - -\begin{key}{/tikz/Mirror y=\meta{coordinate} (default {(0,0)})} - Similar to |/tikz/yMirror|, this however uses the |xyz| coordinate system instead of the |canvas| system. -\end{key} - - -\begin{key}{/tikz/Mirror=\meta{point A}\opt{|--|\meta{point B}}} - Sets up a transformation that mirrors along a line that goes through \meta{point A} and \meta{point B}. - - When only \meta{point A} is given that line goes through \meta{point A} and the origin. -\end{key} - -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-main-body.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-main-body.tex deleted file mode 100644 index fd071e009e..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-main-body.tex +++ /dev/null @@ -1,228 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% -\newcommand*\tikzextname{Ti\textit kZ-Extensions} -\newcommand*\tikzextversion{0.4} -\begin{document} -{\colorlet{blue}{black}% links shall be black -\title{\bfseries The \tikzextname\space Package\\ - \large Manual for version \tikzextversion\\[1mm] -\large\href{https://github.com/Qrrbrbirlbel/tikz-extensions} - {\texttt{https://github.com/Qrrbrbirlbel/tikz-extensions}} -\author{Qrrbrbirlbel}} - -\maketitle -\label{table-of-contents} - -\tableofcontents -} -\include{tikz-ext-manual-en-intro} - -\part{\tikzname\space Libraries} -\label{part:tikz} - -These libraries only work with \tikzname. -\vspace{1em} -\begin{center}\tikzsetnextfilename{main-cover} -\begin{tikzpicture}[ - very thick, - scale=2.7, - grow cyclic, - level distance=1cm, - level/.style={ - level distance/.expanded=\ifnum#1>1 \tikzleveldistance/1.5\else\tikzleveldistance\fi, - nodes/.expanded={\ifodd#1 fill\else fill=none\fi} - }, - level 1/.style={sibling angle=120}, - level 2/.style={sibling angle=90}, - level 3/.style={sibling angle=90}, - level 4/.style={sibling angle=45}, - nodes={circle,draw,inner sep=+0pt, minimum size=+5pt}, - ] -\path[rotate=30] - node {} - child foreach \cntI in {1,...,3} { - node {} - child foreach \cntII in {1,...,2} { - node {} - child foreach \cntIII in {1,...,2} { - node {} - child foreach \cntIV in {1,...,2} { - node {} - child foreach \cntV in {1,...,2} {} - } - } - } - }; -\end{tikzpicture} -\end{center} - -\tikzsetfigurename{calendar-plus} \include{tikz-ext-manual-en-library-calendar-plus} -\tikzsetfigurename{node-families} \include{tikz-ext-manual-en-library-node-families} -\tikzsetfigurename{paths.arcto} \include{tikz-ext-manual-en-library-paths.arcto} -\tikzsetfigurename{paths.ortho} \include{tikz-ext-manual-en-library-paths.ortho} -\tikzsetfigurename{paths.timer} \include{tikz-ext-manual-en-library-paths.timer} -\tikzsetfigurename{patterns.images} \include{tikz-ext-manual-en-library-patterns.images} -\tikzsetfigurename{positioning-plus} -\include{tikz-ext-manual-en-library-positioning-plus} -\tikzsetfigurename{topaths.arcthrough} -\include{tikz-ext-manual-en-library-topaths.arcthrough} -\tikzsetfigurename{trans} -\include{tikz-ext-manual-en-library-trans} - -\part{\pgfname\space Libraries} -\label{part:pgf} -These libraries (should) work with both \pgfname\space and \tikzname. - -\begin{center}\tikzsetnextfilename{main-graph} -\begin{codeexample}[width=10cm,preamble=% - \usetikzlibrary{graphs,graphdrawing,ext.misc} \usegdlibrary{force}] -\tikzset{ - mynode/.style={ - circle, minimum size=10mm, draw, densely dashdotted, thick, - decide color/.expand once=#1}, - decide color/.style 2 args={ - /utils/TeX/if=c#1 - {/utils/TeX/ifnum={#2<5}{bluelight}{bluedark}} - {/utils/TeX/ifnum={#2<8}{light}{dark}}}, - light/.style={fill=gray!20}, bluelight/.style={fill=blue!10}, - dark/.style ={fill=gray!60}, bluedark/.style ={fill=blue!30}} -\tikz\graph[ - spring electrical layout, vertical=c2 to p13, - node distance=1.5cm, typeset=$n_{\tikzgraphnodetext}$, - nodes={mynode=\tikzgraphnodetext}] { - % outer ring - c2 -- {p1, p11, p6}; - p1 -- {p8, c6, p11}; - p8 -- {p3, p10, c6}; - p3 -- {p13, p15, p10}; - p13 -- {p15, c7}; - c7 -- {c3, c4, p15}; - c3 -- {p14, c4}; - p14 -- {p7, c4}; - p7 -- {p9, p2, c4}; - p9 -- {c5, p12, p2}; - c5 -- {c1, p4, p12}; - c1 -- {p6, p4}; - p6 -- {p11, p4}; - % inner ring - p11 -- {c6, p12, p4}; - p5 -- {c6 -- {p10, p12}, p10 -- p15, p15 -- c4, c4 -- p2, p2 -- p12, p12 -- p4}; -}; -\end{codeexample} -\end{center} - -\tikzsetfigurename{PGF.trans}\include{tikz-ext-manual-en-pgf-trans} -\tikzsetfigurename{PGF.shapes}% -\include{tikz-ext-manual-en-pgf-shapes-circlearrow} -\include{tikz-ext-manual-en-pgf-shapes-circlecrosssplit} -\include{tikz-ext-manual-en-pgf-shapes-heatmark} -\include{tikz-ext-manual-en-pgf-shapes-rectround} -\include{tikz-ext-manual-en-pgf-shapes-superellipse} -\part{Utilities} - -\label{part:misc} -\vfill\tikzsetnextfilename{main-misc} -\begin{codeexample}[width=6cm, preamble=\usetikzlibrary{ext.misc}] -\begin{tikzpicture}[ - declare function={bigR(\n)=smallR+.05*\n;}, - declare constant={smallR=1; segments=20;}, - full arc=segments] -\foreach \iN[evaluate={\endRadius=bigR(\iN+1);}, use int=0 to segments-1] - \filldraw[fill=gray!50] (\iN R:\endRadius) - arc [radius=\endRadius, start angle=\iN R, delta angle=+1R] -- (\iN R+1R:smallR) - arc [radius=smallR, end angle=\iN R, delta angle=-1R] -- cycle; - -\node {$\phi^2$}; -\node at (north west:{sqrt 2 * bigR(segments/2)}) {$\{\Omega\}_{i=1}^n$}; -\node[rotate=-.5R, right] at (-.5R: bigR segments) {$\partial \varphi$}; - -\tikzset{yshift=-5cm, declare constant={segments=25;}, full arc=segments} -\filldraw[fill=gray!50] (right:smallR) - \foreach \iN[evaluate={\endRadius=bigR(\iN+1);}, use int=0 to segments-1] { - -- (\iN R:\endRadius) arc[radius=\endRadius, start angle=\iN R, delta angle=1R]} - -- (right:smallR) arc[radius=smallR, start angle=0, delta angle=-360]; - -\node {$\phi^2$}; -\node at (north west:{sqrt 2 * bigR(segments/2)}) {$\{\Omega\}_{i=1}^n$}; -\node[rotate=-.5R, right] at (-.5R: bigR segments) {$\partial \varphi$}; -\end{tikzpicture} -\end{codeexample} -\vfill - -\tikzsetfigurename{misc.calendar}\include{tikz-ext-manual-en-calendar} -\tikzsetfigurename{misc.misc}\include{tikz-ext-manual-en-library-misc} - -%%% END -\newcommand*{\addTikz}[1]{Added \tikzname\space library \texttt{ext.#1}.} -\newcommand*{\addPGF}[1]{Added \pgfname\space library \texttt{ext.#1}.} -\newcommand*{\addShape}[2][]{Added shape \texttt{\ifx\\#1\\#2\else#1\fi}\\(\pgfname\space library \texttt{ext.shapes.#2}).} -\part{Changelog, Index \& References} -\section*{Changelog}\addcontentsline{toc}{section}{Changelog} -\begin{multicols}{2}\raggedright -\noindent -Version 0.4 -\begin{itemize} -\item CTAN version of 0.3.1 -\end{itemize} -Version 0.3.1 -\begin{itemize} -\item Fixed |ext.paths.ortho| keys |only vertical first| and |only horizontal first|. -\item Moved all (except the |to path|s) to namespace |/tikz/ortho|. - |/tikz/hvvh| and |/tikz/udlr| are considered deprecated. -\item Fixed |\pgfcalendarjulianyeartoweek|. -\item Added more calendar tests. -\item Added directory structure. -\end{itemize} -Version 0.3 -\begin{itemize} -\item \addShape[circle arrow]{circlearrow} -\item \addShape[circle cross split]{circlecrosssplit} -\item \addShape{heatmark} -\item \addShape[rectangle with rounded corners]{rectangleroundedcorners} -\item \addShape{superellipse} -\item \addTikz{node-families.shapes.geometric} -\item Fixed |ext.node-families|' key |size|. -\item Renamed internal macros to use custom namespace starting with |\tikzext@|. -\item Added some references. -\end{itemize} -Version 0.2 -\begin{itemize} -\item \addTikz{positioning-plus} -\item \addTikz{node-families} -\end{itemize} -Version 0.1 -\begin{itemize} -\item \addTikz{calendar-plus} -\item \addTikz{misc} -\item \addTikz{paths.arcto} -\item \addTikz{paths.ortho} -\item \addTikz{paths.timer} -\item \addTikz{patterns.images} -\item \addTikz{topaths.arcthrough} -\item \addTikz{transformations.mirror} -\item \addPGF{transformations.mirror} -\end{itemize} -\end{multicols} -\printindex - -\makeatletter -\def\url#1{% - \in@{/16595}{#1}% - \ifin@ - \hyper@linkurl{\expandafter\Hurl\expandafter{\strip@url#1\relax}}{#1}% - \else - \hyper@linkurl{\Hurl{#1}}{#1}% - \fi -} -\def\strip@url#1/16595\relax{#1} -\makeatother -\printbibliography[heading=bibintoc] -%\typeout{Examples: \the\codeexamplecount}% -\end{document} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-main-preamble.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-main-preamble.tex deleted file mode 100644 index 494d63e012..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-main-preamble.tex +++ /dev/null @@ -1,402 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% - -\usepackage[version=latest]{pgf} - -\usepackage{xkeyval,calc,listings,tikz,fp} - -\usepackage{imakeidx} -\makeindex - -%%% Bibliography -\usepackage{csquotes} -\usepackage[backend=biber,style=numeric,backref]{biblatex} -\addbibresource{tikz-ext-manual.bib} - -\usepackage{hyperref} -\hypersetup{% - colorlinks=true, % use true to enable colors below: - linkcolor=blue,%red, - filecolor=blue,%magenta, - urlcolor=blue,%cyan, - citecolor=blue, - pdfborder=0 0 0, -} - -\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead,columnsep=1cm]{geometry} -\usepackage{amsmath,amssymb} -\usepackage{xxcolor} -\usepackage{pifont} - -\usepackage[T1]{fontenc} -% Promote `Missing character` reports to full errors -% require texlive 2021 or above -\tracinglostchars=3 - -\input{pgfmanual-en-macros} - -\usepackage{unicode-math} -\setmathfont[Scale=MatchUppercase]{libertinusmath-regular.otf} -\usepackage[ttscale=.85]{libertine} -\setmonofont[Scale=0.8]{Bitstream Vera Sans Mono} - -\makeatletter -\renewcommand*\l@section[2]{% - \ifnum \c@tocdepth >\z@ - \addpenalty\@secpenalty - \addvspace{1.0em \@plus\p@}% - \setlength\@tempdima{2.5em}% - \begingroup - \parindent \z@ \rightskip \@pnumwidth - \parfillskip -\@pnumwidth - \leavevmode \bfseries - \advance\leftskip\@tempdima - \hskip -\leftskip - #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par - \endgroup - \fi} -\renewcommand*\l@subsection{\@dottedtocline{2}{2.5em}{3.3em}} -\renewcommand*\l@subsubsection{\@dottedtocline{3}{5.8em}{4.2em}} -\def\@pnumwidth{2.2em} -\makeatother - -% Global styles: -\tikzset{ - every plot/.style={prefix=plots/pgf-}, - shape example/.style={ - color=black!30, - draw, - fill=yellow!30, - line width=.5cm, - inner xsep=2.5cm, - inner ysep=0.5cm} -} - -% Detect changed labels -% by David Carlisle https://tex.stackexchange.com/a/169245 -\makeatletter -\def\@testdef#1#2#3{% - \def\reserved@a{#3}% - \expandafter\ifx\csname #1@#2\endcsname\reserved@a\else - \typeout{^^JLabel `#2' changed:^^J\meaning\reserved@a^^J\expandafter\meaning\csname #1@#2\endcsname^^J}% - \@tempswatrue - \fi} -\makeatother - -\usetikzlibrary{ - ext.calendar-plus, - ext.misc, - ext.node-families, - ext.node-families.shapes.geometric, - ext.paths.arcto, - ext.paths.ortho, - ext.paths.timer, - ext.patterns.images, - ext.positioning-plus, - ext.shapes.heatmark, - ext.shapes.circlearrow, - ext.shapes.circlecrosssplit, - ext.shapes.rectangleroundedcorners, - ext.shapes.superellipse, - ext.topaths.arcthrough, - ext.transformations.mirror, - % - calc, - fit, - matrix, - shapes.geometric, - through, - trees, -} - -%% needs Lua! -\usetikzlibrary{graphs,graphdrawing} -\usegdlibrary{force} - -\makeatletter -\def\endofcodeexample#1{% original from tex/latex/pgf/doc/pgfmanual-en-macros.tex by Till Tantau et al - \endgroup% - \ifpgfmanual@setup@code% - \gdef\pgfmanual@do@this{% - {% - \returntospace% - \commenthandler% - \xdef\code@temp{#1}% removes returns and comments - }% - \edef\pgfmanualmcatcode{\the\catcode`\^^M}% - \catcode`\^^M=9\relax% - \expandafter\scantokens\expandafter{\code@temp}% - \catcode`\^^M=\pgfmanualmcatcode% - }% - \fi% - \ifcode@hidden\else - \ifcode@execute% - \setbox\codeexamplebox=\hbox{% - \ifx\code@render\pgfutil@empty% - {% - {% - \returntospace% - \commenthandler% - \xdef\code@temp{#1}% removes returns and comments - }% - \catcode`\^^M=9% - \colorbox{graphicbackground}{\color{black}\ignorespaces% - \code@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@post\ignorespaces}% - }% - \else% - \global\let\code@temp\code@render% - \colorbox{graphicbackground}{\color{black}\ignorespaces% - \code@render}% - \fi% - }% - \ifx\code@animation@list\pgfutil@empty% - \else% - \setbox\codeexampleboxanim=\vbox{% - \rightskip0pt\leftskip0pt plus1filll% - \ifdim\wd\codeexamplebox>\codeexamplewidth% - \else% - \hsize\codeexamplewidth% - \advance\hsize by2cm% - \fi% - \leavevmode\catcode`\^^M=9% - \foreach \pgfmanualtime/\pgfmanualtimehow in\code@animation@list{% - \setbox\codeexampleboxanim=\hbox{\colorbox{animationgraphicbackground}{% - \tikzset{make snapshot of=\pgfmanualtime}% - \scalebox{\pgfmanualanimscale}{\color{black}\ignorespaces% - \code@animation@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@animation@post\ignorespaces}% - }}% - \space\raise4pt\hbox to0pt{\vrule width0pt height1em\hbox - to\wd\codeexampleboxanim{\hfil\scriptsize$t{=}\pgfmanualtimehow \mathrm s$\hfil}\hss}% - \lower\ht\codeexampleboxanim\box\codeexampleboxanim\hfil\penalty0\hskip0ptplus-1fil% - }% - }% - \setbox\codeexampleboxanim=\hbox{\hbox{}\hskip-2cm\box\codeexampleboxanim}% - \fi% - \ifdim\wd\codeexamplebox>\codeexamplewidth% - \def\code@start{\par}% - \def\code@flushstart{}\def\code@flushend{}% - \def\code@mid{\parskip2pt\par\noindent}% - \def\code@width{\linewidth-6pt}% - \def\code@end{}% - \else% - \def\code@start{% -% \linewidth=\textwidth% removed this line - \parshape \@ne 0pt \linewidth - \leavevmode% - \hbox\bgroup}% - \def\code@flushstart{\hfill}% - \def\code@flushend{\hbox{}}% - \def\code@mid{\hskip6pt}% - \def\code@width{\linewidth-12pt-\codeexamplewidth}% - \def\code@end{\egroup}% - \fi% - \code@start% - \noindent% - \begin{minipage}[t]{\codeexamplewidth}\raggedright - \hrule width0pt% - \footnotesize\vskip-1em% - \code@flushstart\box\codeexamplebox\code@flushend% - \vskip0pt% - \leavevmode% - \box\codeexampleboxanim% - \vskip-1ex - \leavevmode% - \end{minipage}% - \else% - \def\code@mid{\par} - \def\code@width{\linewidth-6pt} - \def\code@end{} - \fi% - \code@mid% - \ifpgfmanual@multipage@code% - {% - \pgfkeysvalueof{/codeexample/prettyprint/base color}% - \pgfmanualdolisting{#1}% - }% - \else% - \colorbox{codebackground}{% - \pgfkeysvalueof{/codeexample/prettyprint/base color}% - \begin{minipage}[t]{\code@width}% - \pgfmanualdolisting{#1}% - \end{minipage}}% - \fi% - \code@end% - \par% - \medskip - \fi - \endcodeexample\endgroup% -} - -\newenvironment{pathoperation'}[3][]{ - \begin{pgfmanualentry} - \def\pgfmanualtest{#1}% - \pgfmanualentryheadline{% - \ifx\pgfmanualtest\@empty% - \pgfmanualpdflabel{#2}{}% - \fi% - %\textcolor{gray}{{\ttfamily\char`\\path}\ \ \dots} - %\declare{\texttt{\noligs{#2}}}#3\ \textcolor{gray}{\dots\texttt{;}} - }% - \ifx\pgfmanualtest\@empty% - \index{#2@\protect\texttt{#2} path operation}% - \index{Path operations!#2@\protect\texttt{#2}}% - \fi% - \pgfmanualbody -} -{ - \end{pgfmanualentry} -} -\makeatother - -\usepackage{paracol} - -%% normal references -\newcommand*{\indexLibrary}[1]{% - \index{#1@\protect\texttt{#1} library}% - \index{Libraries!#1@\protect\texttt{#1}}% -} -\newcommand*{\indexMathFunction}[1]{% - \index{#1@\protect\texttt{#1} math function}% - \index{Math functions!#1@\protect\texttt{#1}}% -} -\newcommand*{\indexShape}[1]{% - \index{#1@\protect\texttt{#1} shape}% - \index{Shapes!#1@\protect\texttt{#1}}% -} -\newcommand*{\indexHandler}[1]{% - \index{\gobble#1@\protect\texttt{#1} handler}% - \index{Key handlers!#1@\protect\texttt{#1}} -} -\newcommand*{\indexKey}[2][/tikz/]{% -\begingroup - \def\mykey{#1#2}% - \def\mypath{}% - \gdef\myname{}% - \firsttimetrue - \decompose#1#2/\nil -\endgroup -} -\newcommand*{\indexPathOperation}[1]{% - \index{#1@\protect\texttt{#1} path operation}% - \index{Path operations!#1@\protect\texttt{#1}}% -} - -%% references to original -\newcommand*{\indexLibraryO}[1]{% - \index{#1@\originalprefix\protect\texttt{\original{#1}} library\originalsuffix}% - \index{Libraries!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% -} -\newcommand*{\indexMathFunctionO}[1]{% - \index{#1@\protect\texttt{\original{#1}} math function\originalsuffix}% - \index{Math functions!#1@\protect\texttt{\original{#1}}\originalsuffix}% -} -\newcommand*{\indexShapeO}[1]{% - \index{#1@\originalprefix\protect\texttt{\original{#1}} shape\originalsuffix}% - \index{Shapes!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% -} -\newcommand*{\indexHandlerO}[1]{% - \index{\gobble#1@\originalprefix\protect\texttt{\original{#1}} handler\originalsuffix}% - \index{Key handlers!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix} -} -\newcommand*{\indexKeyO}[2][/tikz/]{%TODO - \begingroup\let\decomposetoodeep\decomposetoodeepO - \def\mykey{#1#2}% - \def\mypath{}% - \gdef\myname{}% - \firsttimetrue - \decomposeO#1#2/\nil - \endgroup -} -\def\decomposetoodeepO#1/#2/\nil{% - % avoid too-deep nesting in index - \index{#1/#2@\originalprefix\protect\texttt{\original{#1/#2}} key\originalsuffix}% - \index{\mypath#1/#2@\originalprefix\protect\texttt{\original{#1/#2}}\originalsuffix}% - \decomposefindlast/#1/#2/\nil% -} -\def\decomposeO/#1/#2\nil{% - \def\test{#2}% - \ifx\test\empty% - % aha. - \index{#1@\originalprefix\protect\texttt{\original{#1}} key\originalsuffix}% - \index{\mypath#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% - \gdef\myname{#1}% - \pgfmanualpdflabel{#1}{} - \else% - \advance\pgfmanualdecomposecount by1\relax% - \ifnum\pgfmanualdecomposecount>2\relax% - \decomposetoodeepO#1/#2\nil% - \else% - \iffirsttime% - \begingroup% - % also make a pdf link anchor with full key path. - \def\hyperlabelwithoutslash##1/\nil{% - \pgfmanualpdflabel{##1}{}% - }% - \hyperlabelwithoutslash/#1/#2\nil% - \endgroup% - \def\mypath{#1@\protect\texttt{/#1/}!}% - \firsttimefalse% - \else% - \expandafter\def\expandafter\mypath\expandafter{\mypath#1@\protect\texttt{#1/}!}% - \fi% - \def\firsttime{}% - \decomposeO/#2\nil% - \fi% - \fi% -} -\newcommand*{\indexPathOperationO}[1]{% - \index{#1@\originalprefix\protect\texttt{\original{#1}} path operation\originalsuffix}% - \index{Path operations!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% -} - -\newcommand*{\indexCommandO}[1]{% - \removeats{#1}% - \index{\strippedat @\originalprefix\protect\texttt{\original{\protect\string\protect#1}}\originalsuffix}% -} - -\newcommand*{\referenceKeyandIndexO}[2][/tikz/]{\texttt{#1#2}\indexKeyO[#1]{#2}} -\newcommand*{\referenceKeyandIndex}[2][/tikz/]{\texttt{#1#2}\indexKey[#1]{#2}} -\newcommand*{\referenceShapeandIndex}[1]{\texttt{#1}\indexShape{#1}} -\newcommand*{\referenceShapeandIndexO}[1]{\texttt{#1}\indexShapeO{#1}} -\newcommand*{\referenceLibraryandIndexO}[1]{\texttt{#1}\indexLibraryO{#1}} - -\colorlet{originalindex}{gray} -\newcommand*{\original}[1]{\textcolor{originalindex}{#1}} -\newcommand*{\originalsuffix}{}%\textsuperscript{\textdagger}}%\normalsize -\newcommand*{\originalprefix}{}%\footnotesize - -%\newcommand*{\original}[1]{\textcolor{originalindex}{#1}} -%\newcommand*{\original}[1]{#1}%\textcolor{originalindex}{#1}} -%\newcommand*{\originalsuffix}{}%\textsuperscript{\color{blue}\tikzname}} -%\DeclareRobustCommand*{\originalprefix}{\smash{\footnotesize\llap{\textbullet\space}}} - -\newcommand*{\filetype}[1]{\textsc{#1}} - -\makeatletter -\def\index@prologue{\section*{Index}\addcontentsline{toc}{section}{Index} - This index contains automatically generated entries as well as {\originalprefix\original{references}\originalsuffix} to - original functionalities of \pgfname/\tikzname. - \bigskip -} -\makeatother - -\DeclareMathOperator{\sgn}{sgn} - -\newenvironment{implementation}{% - \noindent\rule[.5ex]{\linewidth}{.4pt}\par - \paragraph*{Notes on Implementation:}\par% - \small - \begin{quotation}% -}{\end{quotation}} - -\newcommand*{\inspiration}[2]{% - \par\textbf{Q\,\&\,A:} \cite{#1} \& \cite{#2}\par -} -\newcommand*\inspirationQ[1]{\par\textbf{Q:} \cite{#1}} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-circlearrow.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-circlearrow.tex deleted file mode 100644 index e26711bb35..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-circlearrow.tex +++ /dev/null @@ -1,93 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% -\section{Shape: Circle Arrow} -\begin{pgflibrary}{ext.shapes.circlearrow} - A circular shape named |circle arrow| that has an arc as its background path that can have an arrow tip. - \inspiration{ShapeCircleArrow-Q}{ShapeCircleArrow-A} -\end{pgflibrary} -\begin{shape}{circle arrow} - This shape is an arrow whose path is an arc -- defined very similar to the |arc|% - \indexPathOperationO{arc} path operation -- that can possibly be customized with - arrow tips. - - \begin{key}{/pgf/circle arrow start angle=\meta{start angle} (initially \{\})} - Sets the start angle. - \end{key} - \begin{key}{/pgf/circle arrow end angle=\meta{end angle} (initially \{\})} - Sets the end angle. - \end{key} - \begin{key}{/pgf/circle arrow delta angle=\meta{delta angle} (initially \{\})} - Sets the delta angle. - \end{key} - \begin{key}{/pgf/circle arrow arrows=% - \meta{start arrow tip specification}-\meta{end arrow tip specification} (initially -)} - The specification will be forwarded to |\pgfsetarrows|\indexCommandO{\pgfsetarrows}. - \end{key} - - A few handful styles are pre-defined. - \begin{key}{/pgf/circle arrow turn left north} - Sets |circle arrow start angle = 100|, |circle arrow delta angle = 340| - and |circle arrow arrows = ->|. - \end{key} - \begin{key}{/pgf/circle arrow turn left east} - As above but |circle arrow start angle = 10|. - \end{key} - \begin{key}{/pgf/circle arrow turn left west} - As above but |circle arrow start angle = 280|. - \end{key} - \begin{key}{/pgf/circle arrow turn left south} - As above but |circle arrow start angle = 190|. - \end{key} - \begin{key}{/pgf/circle arrow turn right north} - Sets |circle arrow start angle = 100|, |circle arrow delta angle = 340| - and |circle arrow arrows = <-|. - \end{key} - \begin{key}{/pgf/circle arrow turn right east} - As above but |circle arrow start angle = 10|. - \end{key} - \begin{key}{/pgf/circle arrow turn right west} - As above but |circle arrow start angle = 280|. - \end{key} - \begin{key}{/pgf/circle arrow turn right south} - As above but |circle arrow start angle = 190|. - \end{key} - -{\catcode`\|=12 -\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.circlearrow,matrix}] -\begin{tikzpicture} -\matrix[matrix of nodes, draw=none, row sep=1em, column sep=1em, - every node/.style={draw=gray, shape=circle arrow, ultra thick, inner sep=1em} -] (m) { - |[circle arrow turn left north]| & |[circle arrow turn left east]| \\ - |[circle arrow turn left west]| & |[circle arrow turn left south]| \\ - |[circle arrow turn right north]| & |[circle arrow turn right east]| \\ - |[circle arrow turn right west]| & |[circle arrow turn right south]| \\ -}; -\end{tikzpicture} -\end{codeexample} -} -\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.circlearrow},width=16cm] -\begin{tikzpicture}\Huge -\node[name=s, 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, - 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, - text/left, 10/right, 130/above} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-circlecrosssplit.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-circlecrosssplit.tex deleted file mode 100644 index e7b2b9ba5a..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-circlecrosssplit.tex +++ /dev/null @@ -1,53 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% -\section{Shape: Circle Cross Split} -\begin{pgflibrary}{ext.shapes.circlecrosssplit} - A circular shape with four parts that can be individually filled. - \inspiration{ShapeSplitCircle-Q}{ShapeSplitCircle-A} -\end{pgflibrary} -\begin{shape}{circle cross split} -This shape has four node parts that are placed near the center of a circle. - -\begin{key}{/pgf/circle cross split part fill=\marg{list} (initially none)} -Sets the custom fill color for each node part shape. -The items in \meta{list} should be separated by commas -(so if there is more than one item in \meta{list}, it must be surrounded by braces). -If \meta{list} has less entries than node parts, -then the remaining node parts use the color from the last entry in the list. -This key will automatically set |/pgf/circle cross split uses custom fill|. -\end{key} -\begin{key}{/pgf/circle cross split uses custom fill=\opt{\meta{boolean}} (default true)} -This enables the use of a custom fill for each of the node parts -(including the area covered by the |inner sep|). -The background path for the shape should not be filled (e.\,g., in \tikzname, -the |fill| option for the node must be implicitly or explicitly set to |none|). -Internally, this key sets the \TeX-if |\ifpgfcirclecrosssplitcustomfill| appropriately. -\end{key} -\begin{codeexample}[preamble=\usepgflibrary{ext.shapes.circlecrosssplit}] -\begin{tikzpicture}\Huge -\node[name=s, shape=circle cross split, shape example, inner xsep=1.5cm, fill=none, - circle cross split part fill={green,blue,red,yellow!90!black}] - {\nodepart{text}text\nodepart{two}two - \nodepart{three}three\nodepart{four}four}; -\foreach \anchor/\placement in - {north west/above left, north/above, north east/above right, - west/left, center/left, east/right, - mid west/right, mid/left, mid east/left, - base west/left, base/left, base east/right, -lower base west/left, lower base/below, lower base east/right, - lower mid west/left, lower mid/above, lower mid east/right, - south west/below left, south/below, south east/below right, - text/below, 10/right, 130/above, two/left, three/left, four/left} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-heatmark.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-heatmark.tex deleted file mode 100644 index fa13cb0000..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-heatmark.tex +++ /dev/null @@ -1,83 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% -\section{Shape: Heatmark} -\begin{pgflibrary}{ext.shapes.heatmark} - A circular shape that has customizable rings around it. - \inspiration{ShapeHeat-Q}{ShapeHeat-A} -\end{pgflibrary} - -\begin{shape}{heatmark} - \begin{key}{/pgf/heatmark arcs=\meta{arcs num} (initially 3)} - Sets the number of arc around the circle to \meta{arcs num}. - \end{key} - \begin{key}{/pgf/heatmark arc width=\meta{arc width} (initially 4pt)} - Sets the width of the rings around the circle to \meta{arc width}. - \end{key} - \begin{key}{/pgf/heatmark arc sep=\meta{sep length} (initially 1pt)} - Sets the whitespace between the rings to \meta{sep length}. - \end{key} - \begin{key}{/pgf/heatmark arc rings=\meta{rings num} (initially 3)} - Sets the number of rings around the circle to \meta{rings num} - \end{key} - \begin{key}{/pgf/heatmark arc sep angle=\meta{sep angle} (initially 20)} - Sets the whitespace angle between the arcs in one ring to \meta{sep angle}. - \end{key} - \begin{key}{/pgf/heatmark inner opacity=\meta{inner opacity} (initially 0.8)} - Sets the opacity of the inner ring to \meta{inner opacity}. - \end{key} - \begin{key}{/pgf/heatmark outer opacity=\meta{low opacity} (initially 0.2)} - Sets the opacity of the outer ring to \meta{outer opacity}. - - The opacity of the rings between the outer and the inner ring will be interpolated by these two opacities. - \end{key} - -This shape takes the value of |/pgf/shape border rotate|% -\indexKeyO[/pgf/]{shape border rotate} into consideration. - -For every ring and for every arc the following styke keys are tried. -\begin{stylekey}{/pgf/heatmark ring \meta{ring number}} -\end{stylekey} -\begin{stylekey}{/pgf/heatmark arc \meta{arc number}} -\end{stylekey} -\begin{stylekey}{/pgf/heatmark ring \meta{ring number} arc \meta{arc number}} -\end{stylekey} - -The \pgfname shape is setup in a way that even \tikzname\space -styles can be used with a little bit work: -\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.heatmark}] -\tikz[ - shape border rotate=90, - /pgf/heatmark ring 1/.append style={/tikz/fill=green}, - /pgf/heatmark arc 1/.append style={/tikz/fill=blue}, - /pgf/heatmark ring 2 arc 2/.append style={/tikz/fill=yellow!70!black} -] \node[heatmark, fill=red] (n) {100}; -\end{codeexample} - -It is best to use this shape with no actual border (|draw = none|) and the |outer sep| set to zero. -\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.heatmark},width=16cm] -\begin{tikzpicture}\Huge -\node[name=s, shape=heatmark, shape example, - fill=blue!25, draw=none, outer sep=0pt] - {Heatmark\vrule width 1pt height 2cm}; -\foreach \anchor/\placement in - {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, - text/left, 10/right, 130/above} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-rectround.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-rectround.tex deleted file mode 100644 index 78bab76925..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-rectround.tex +++ /dev/null @@ -1,58 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% - -\section{Shape: Rectangle with Rounded Corners} -\begin{pgflibrary}{ext.shapes.rectangleroundedcorners} - A rectangle with rounded corners. -\end{pgflibrary} - -\begin{shape}{rectangle with rounded corners} -This library provides a |rectangle with rounded corners| where every corner can have a different radius. - -\begin{key}{/pgf/rectangle with rounded corners north west radius=\meta{dimen} (initially .5\string\pgflinewidth)} - Sets the north west radius to \meta{dimen}. -\end{key} -\begin{key}{/pgf/rectangle with rounded corners north east radius=\meta{dimen} (initially .5\string\pgflinewidth)} - Sets the north east radius to \meta{dimen}. -\end{key} -\begin{key}{/pgf/rectangle with rounded corners south west radius=\meta{dimen} (initially .5\string\pgflinewidth)} - Sets the south west radius to \meta{dimen}. -\end{key} -\begin{key}{/pgf/rectangle with rounded corners south east radius=\meta{dimen} (initially .5\string\pgflinewidth)} - Sets the south east radius to \meta{dimen}. -\end{key} -\begin{key}{/pgf/rectangle with rounded corners radius=\meta{dimen}} - Sets all radii to \meta{dimen}. -\end{key} - -\begin{codeexample}[preamble=\usepgflibrary{ext.shapes.rectangleroundedcorners}] -\begin{tikzpicture}\Huge -\node[name=s, shape=rectangle with rounded corners, shape example, - rectangle with rounded corners north west radius=10pt, - rectangle with rounded corners north east radius=20pt, - rectangle with rounded corners south west radius=30pt, - rectangle with rounded corners south east radius=40pt] {Rectangle with rounded corners\vrule width 1pt height 2cm}; -\foreach \anchor/\placement in - {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, - text/below, 10/right, 130/above, - north west center/below right, north east center/left, - south west center/above right, south east center/left, - below north west/left, above south west/left, above south east/right, below north east/right, - right north west/above, right south west/below, left south east/below, left north east/above} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -\end{shape} -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-superellipse.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-superellipse.tex deleted file mode 100644 index 580ef0d93f..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-shapes-superellipse.tex +++ /dev/null @@ -1,105 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% - -\section{Shape: Superellipse} -\begin{pgflibrary}{ext.shapes.superellipse} - Shape in the form of a ``superellipse''. - \inspiration{ShapeSuperEllipse-Q}{ShapeSuperEllipse-A} -\end{pgflibrary} - -\begin{shape}{superellipse} -This shape is defined by formula -\begin{equation*} - \biggl|\frac x{r_x}\biggr|^m + \biggl|\frac y{r_y}\biggr|^n = 1 -\end{equation*} -and will be plotted by -\begin{align*} - x(t) &= |\cos t|^{\frac 2m} \cdot r_x \sgn(\cos t) \\ - y(t) &= |\sin t|^{\frac 2n} \cdot r_y \sgn(\sin t) \\ -\end{align*} -where $r_x$ is half the node's width and $r_y$ is half the node's height. - -\begin{key}{/pgf/superellipse x exponent=\meta{x exponent}(initially 2.5)} -This sets $m$. -\end{key} -\begin{key}{/pgf/superellipse y exponent=\meta{y exponent}(initially 2.5)} -This sets $n$. -\end{key} -\begin{key}{/pgf/superellipse step=\meta{step}(initially 5)} -This specifies the step of the underlying plot handler. -The smaller \meta{step} is, the slower computation will be. - -Sensible values for \meta{step} are integer dividers of 90, i.\,e. -2, 3, 5, 6, 9, 10, 15, 18, 30 and 45. -\end{key} -\begin{key}{/pgf/superellipse exponent=\meta{exponent}} - Sets both |superellipse x exponent| and |superellipse y exponent| to \meta{exponent}. -\end{key} - -\paragraph{Notes on Implementation} -For implementing this shape, additional mathematical functions were declared. -\begin{math-function}{superellipsex(\mvar{t}, \mvar{2/m}, \mvar{$r_x$})} -\mathcommand -Returns the $x$ value on a point of the superellipse with its center on the origin following -\begin{equation*} - x = r_x\cos^{2/m} t -\end{equation*} -for values of $0 \leq t \leq 90$. -\end{math-function} -\begin{math-function}{superellipsey(\mvar{t}, \mvar{2/n}, \mvar{$r_y$})} -\mathcommand -Returns the $y$ value on a point of the superellipse with its center on the origin following -\begin{equation*} - y = r_y\cos^{2/n} t -\end{equation*} -for values of $0 \leq t \leq 90$. -\end{math-function} - -Both \pgfname math functions can be used at once with the following macro. -\begin{command}{\pgfmathsuperellipseXY\marg{t}\marg{2/m}\marg{2/n}\marg{a}\marg{b}} -Returns the $x$ value (in |\pgfmathresultX|) and the $y$ value (in |\pgfmathresultY|) of the superellipse with its center on the origin following -\begin{align*} - x & = a\cos^{2/m} t \\ - y & = b\cos^{2/n} t -\end{align*} -for values of $0 \leq t \leq 90$. - -Note: all arguments must be a valid number since they will not be parsed by \pgfname math. -\end{command} - -And additional internal macro was defined following the original naming scheme. -\def\temp{\begin{command}}% -\expandafter\temp\expandafter{\csname pgfutil@prefix@macrotomacro\endcsname\marg{macro 1}\marg{macro 2}} -Adds the once-expansion of \meta{macro 2} in front of \meta{macro 1}. -\end{command} - -\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.superellipse}] -\begin{tikzpicture}[superellipse step=1]\Huge -\node[name=s,shape=superellipse,shape example] {Superellipse\vrule width 1pt height 2cm}; -\foreach \anchor/\placement in - {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, - text/left, 10/right, 130/above} - \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} - node[\placement] {\scriptsize\texttt{(s.\anchor)}}; -\end{tikzpicture} -\end{codeexample} -% -\begin{codeexample}[width=8cm,preamble=\usetikzlibrary{ext.shapes.superellipse}] -\begin{tikzpicture}[minimum width=1cm, minimum height=3cm] -\foreach \xe/\ye[count=\i] in {.5/.5, 1/1, 2/2, 3/3, .5/5} - \node[draw, superellipse, superellipse x exponent=\xe, superellipse y exponent=\ye] at (1.5*\i,0) {}; -\end{tikzpicture} -\end{codeexample} -\end{shape} -\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-trans.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-trans.tex deleted file mode 100644 index ccd378a6e7..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual-en-pgf-trans.tex +++ /dev/null @@ -1,176 +0,0 @@ -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% 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. -% - -\section{Transformations: Mirroring} -\label{pgflibrary:transformations} - -\begin{purepgflibrary}{ext.transformations.mirror} - This library adds mirror transformations to \pgfname. -\end{purepgflibrary} - -Two approaches to mirror transformation exist: -\begin{enumerate} -\item Using the reflection matrix (see left column). - - This depends on |\pgfpointnormalised|\indexCommandO\pgfpointnormalised which involves - the sine\indexMathFunctionO{sin} and the cosine\indexMathFunctionO{cos} functions of \pgfname math. - -\item Using built-in transformations (see right column). - - This depends on |\pgfmathanglebetweenpoints|\indexCommandO\pgfmathanglebetweenpoints which - involves the arctangent (|atan2|\indexMathFunctionO{atan2}) function of \pgfname math. -\end{enumerate} - -Which one is better? I don't know. -Choose one you're comfortable with. - -\begin{paracol}{2} - -\subsection{Using the reflection matrix} - -The following commands use the reflection matrix that sets the transformation matrix following -\begin{equation*} - A = \frac{1}{\Vert\vec l\Vert^2} \begin{bmatrix} - l_x^2-l_y^2 & 2l_xl_y \\ - 2l_xl_y & l_y^2-l_x^2\\ - \end{bmatrix}. -\end{equation*} - -\switchcolumn% > - -\stepcounter{subsection} -\subsection{Using built-in transformations} - -The following commands use a combination of shifting, rotating, $-1$ scaling, -rotating back and shifting back to reach the mirror transformation. - -The commands are named the same as on the left side, -only the |m| in |mirror| is capitalized. - -\switchcolumn*% < - -\begin{command}{\pgftransformxmirror\marg{value}} - Sets up a transformation that mirrors along a vertical line that goes through point $(\text{\meta{value}}, 0)$. - -\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] -\begin{tikzpicture} -\draw[help lines] (-0.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); -\pgftransformxmirror{1.5} - -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{command} - -\switchcolumn% > - -\begin{command}{\pgftransformxMirror\marg{value}} - Sets up a transformation that mirrors along a vertical line that goes through point $(\text{\meta{value}}, 0)$. - -\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] -\begin{tikzpicture} -\draw[help lines] (-0.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); -\pgftransformxMirror{1.5} - -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{command} - -\switchcolumn*% < - -\begin{command}{\pgftransformymirror\marg{value}} - Sets up a transformation that mirrors along a horizontal line that goes through point $(0, \text{\meta{value})}$. -\end{command} - -\begin{command}{\pgftransformmirror\marg{point A}\marg{point B}} - Sets up a transformation that mirrors along the line that goes through \meta{point A} and \meta{point B}. - -\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] -\begin{tikzpicture} -\draw[help lines] (-.25, -2.25) grid (2.5, 1.25); -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); - -\draw[dashed] (0, -1) -- (2, 0); -\pgftransformmirror{\pgfpointxy{0}{-1}} - {\pgfpointxy{2}{ 0}} - -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{command} - -\switchcolumn% > - -\begin{command}{\pgftransformyMirror\marg{value}} - Sets up a transformation that mirrors along a horizontal line that goes through point $(0, \text{\meta{value})}$. -\end{command} - -\begin{command}{\pgftransformMirror\marg{point A}\marg{point B}} - Sets up a transformation that mirrors along the line that goes through \meta{point A} and \meta{point B}. - -\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] -\begin{tikzpicture} -\draw[help lines] (-.25, -2.25) grid (2.5, 1.25); -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); - -\draw[dashed] (0, -1) -- (2, 0); -\pgftransformMirror{\pgfpointxy{0}{-1}} - {\pgfpointxy{2}{ 0}} - -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{command} - -\switchcolumn*% < - -\begin{command}{\pgfqtransformmirror\marg{point A}} - Sets up a transformation that mirrors along the line that goes through the origin and \meta{point A}. - -\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] -\begin{tikzpicture} -\draw[help lines] (-.25, -.25) grid (2.25, 1.25); -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); - -\draw[dashed] (0, 0) -- (2, 1); -\pgfqtransformmirror{\pgfpointxy{2}{1}} - -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{command} - -\switchcolumn - -\begin{command}{\pgfqtransformMirror\marg{point A}} - Sets up a transformation that mirrors along the line that goes through the origin and \meta{point A}. - -\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] -\begin{tikzpicture} -\draw[help lines] (-.25, -.25) grid (2.25, 1.25); -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); - -\draw[dashed] (0, 0) -- (2, 1); -\pgfqtransformMirror{\pgfpointxy{2}{1}} - -\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); -\end{tikzpicture} -\end{codeexample} -\end{command} - -\end{paracol} -\endinput diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.bib b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.bib deleted file mode 100644 index 5a13e91d41..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.bib +++ /dev/null @@ -1,322 +0,0 @@ -' -@Misc{NodeFam-Q, - author = {Holene}, - month = apr, - title = {Dependent node size in {TikZ}}, - year = {2017}, - file = {Snapshot:https\://tex.stackexchange.com/questions/107227/dependent-node-size-in-tikz/121054#121054:text/html}, - url = {https://tex.stackexchange.com/q/107227/16595}, - urldate = {2022-09-24}, -} - -@Misc{NodeFam-A, - author = {Qrrbrbirlbel}, - month = jun, - title = {Answer to \enquote{{Dependent} node size in {TikZ}}}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/107227/dependent-node-size-in-tikz/121054#121054:text/html}, - url = {https://tex.stackexchange.com/a/121054/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{TimerRect-Q, - author = {CrazyArm}, - month = apr, - title = {Is {It} {Possible} to {Combine} {TikZ} {Distance} and {Line}-{To} {Operations}?}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/106558/is-it-possible-to-combine-tikz-distance-and-line-to-operations/106571#106571:text/html}, - url = {https://tex.stackexchange.com/q/106558/16595}, - urldate = {2022-09-24}, -} - -@Misc{TimerRect-A, - author = {Qrrbrbirlbel}, - month = apr, - title = {Answer to \enquote{{Is} {It} {Possible} to {Combine} {TikZ} {Distance} and {Line}-{To} {Operations}?}}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/106558/is-it-possible-to-combine-tikz-distance-and-line-to-operations/106571#106571:text/html}, - shorttitle = {Answer to "{Is} {It} {Possible} to {Combine} {TikZ} {Distance} and {Line}-{To} {Operations}?}, - url = {https://tex.stackexchange.com/a/106571/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{TimerPara-Q, - author = {cis}, - month = may, - title = {{TikZ}: {How} to place a coordinate at parabola-path-position?}, - year = {2020}, - file = {Snapshot:https\://tex.stackexchange.com/questions/543251/tikz-how-to-place-a-coordinate-at-parabola-path-position/621012#621012:text/html}, - shorttitle = {{TikZ}}, - url = {https://tex.stackexchange.com/q/543251/16595}, - urldate = {2022-09-24}, -} - -@Misc{TimerPara-A, - author = {Qrrbrbirlbel}, - month = nov, - title = {Answer to \enquote{{TikZ}: {How} to place a coordinate at parabola-path-position?}}, - year = {2021}, - file = {Snapshot:https\://tex.stackexchange.com/questions/543251/tikz-how-to-place-a-coordinate-at-parabola-path-position/621012#621012:text/html}, - shorttitle = {Answer to "{TikZ}}, - url = {https://tex.stackexchange.com/a/621012/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{Pattern-Q, - author = {knut}, - month = mar, - title = {{TikZ}: {Define} pattern with reference to external picture}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/103980/tikz-define-pattern-with-reference-to-external-picture/107144#107144:text/html}, - shorttitle = {{TikZ}}, - url = {https://tex.stackexchange.com/q/103980/16595}, - urldate = {2022-09-24}, -} - -@Misc{Pattern-A, - author = {Qrrbrbirlbel}, - month = apr, - title = {Answer to \enquote{{TikZ}: {Define} pattern with reference to external picture}}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/103980/tikz-define-pattern-with-reference-to-external-picture/107144#107144:text/html}, - shorttitle = {Answer to "{TikZ}}, - url = {https://tex.stackexchange.com/a/107144/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{WeekNum-Q, - author = {Fence}, - month = nov, - title = {Add week day to calendar}, - year = {2019}, - file = {Snapshot:https\://tex.stackexchange.com/questions/517338/add-week-day-to-calendar/651888#651888:text/html}, - url = {https://tex.stackexchange.com/q/517338/16595}, - urldate = {2022-09-24}, -} - -@Misc{WeekNum-A, - author = {Qrrbrbirlbel}, - month = jul, - title = {Answer to \enquote{{Add} week day to calendar}}, - year = {2022}, - file = {Snapshot:https\://tex.stackexchange.com/questions/517338/add-week-day-to-calendar/651888#651888:text/html}, - url = {https://tex.stackexchange.com/a/651888/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{CalCond-Q, - author = {healyp}, - month = oct, - title = {{TikZ} calendar and conditional tests}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/140948/tikz-calendar-and-conditional-tests/141027#141027:text/html}, - url = {https://tex.stackexchange.com/q/140948/16595}, - urldate = {2022-09-24}, -} - -@Misc{CalCond-A, - author = {Qrrbrbirlbel}, - month = oct, - title = {Answer to \enquote{{TikZ} calendar and conditional tests}}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/140948/tikz-calendar-and-conditional-tests/141027#141027:text/html}, - url = {https://tex.stackexchange.com/a/141027/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{CalMath-Q, - author = {cis}, - month = dec, - title = {{TikZ} / calendar: {Set} the height of a monthly calendar}, - year = {2018}, - file = {Snapshot:https\://tex.stackexchange.com/questions/464589/tikz-calendar-set-the-height-of-a-monthly-calendar/653146#653146:text/html}, - shorttitle = {{TikZ} / calendar}, - url = {https://tex.stackexchange.com/q/464589/16595}, - urldate = {2022-09-24}, -} - -@Misc{CalMath-A, - author = {Qrrbrbirlbel}, - month = aug, - title = {Answer to \enquote{{TikZ} / calendar: {Set} the height of a monthly calendar}}, - year = {2022}, - file = {Snapshot:https\://tex.stackexchange.com/questions/464589/tikz-calendar-set-the-height-of-a-monthly-calendar/653146#653146:text/html}, - shorttitle = {Answer to "{TikZ} / calendar}, - url = {https://tex.stackexchange.com/a/653146/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{FullArc-Q, - author = {Peter, Anthony}, - month = apr, - title = {A rather difficult ring like picture to be drawn}, - year = {2017}, - file = {Snapshot:https\://tex.stackexchange.com/questions/144293/a-rather-difficult-ring-like-picture-to-be-drawn/144297#144297:text/html}, - url = {https://tex.stackexchange.com/q/144293/16595}, - urldate = {2022-09-24}, -} - -@Misc{FullArc-A, - author = {Qrrbrbirlbel}, - month = nov, - title = {Answer to "{A} rather difficult ring like picture to be drawn"}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/144293/a-rather-difficult-ring-like-picture-to-be-drawn/144297#144297:text/html}, - url = {https://tex.stackexchange.com/a/144297/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{NodeFam-Ellipse, - author = {nkk}, - month = jun, - title = {How to prevent tikz custom node fill from covering the text when using node-families library}, - year = {2019}, - file = {Snapshot:https\://tex.stackexchange.com/questions/494862/how-to-prevent-tikz-custom-node-fill-from-covering-the-text-when-using-node-fami:text/html}, - url = {https://tex.stackexchange.com/q/494862/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{ShapeHeat-Q, - author = {boje}, - month = may, - title = {Heatmap over country like {Google} {Map}}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/112929/heatmap-over-country-like-google-map/113004#113004:text/html}, - url = {https://tex.stackexchange.com/q/112929/16595}, - urldate = {2022-09-24}, -} - -@Misc{ShapeHeat-A, - author = {Qrrbrbirlbel}, - month = may, - title = {Answer to \enquote{{Heatmap} over country like {Google} {Map}}}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/112929/heatmap-over-country-like-google-map/113004#113004:text/html}, - url = {https://tex.stackexchange.com/a/113004/16595}, - urldate = {2022-09-24}, -} - -' -@Misc{ShapeSplitCircle-Q, - author = {Marco}, - month = apr, - title = {{TikZ} - {Four} {Colored} {Circle} {Split}}, - year = {2017}, - file = {Snapshot:https\://tex.stackexchange.com/questions/121686/tikz-four-colored-circle-split/121767#121767:text/html}, - url = {https://tex.stackexchange.com/q/121686/16595}, - urldate = {2022-09-24}, -} - -@Misc{ShapeSplitCircle-A, - author = {Qrrbrbirlbel}, - month = jun, - title = {Answer to \enquote{{TikZ} - {Four} {Colored} {Circle} {Split}}}, - year = {2013}, - file = {Snapshot:https\://tex.stackexchange.com/questions/121686/tikz-four-colored-circle-split/121767#121767:text/html}, - url = {https://tex.stackexchange.com/a/121767/16595}, - urldate = {2022-09-24}, -} - -' -@Online{ShapeSuperEllipse-Q, - author = {somenxavier}, - file = {Snapshot:https\://tex.stackexchange.com/questions/649144/an-oval-surrounded-a-long-text-inside-in-tikz-equivalent-cover-background-of/654759#654759:text/html}, - month = aug, - title = {An oval surrounded a *long text* inside in {TikZ} [equivalent cover background of {METAFUN}]}, - titleaddon = {{TeX} - {LaTeX} Stack Exchange}, - url = {https://tex.stackexchange.com/q/649144/16595}, - urldate = {2022-09-24}, - year = {2022}, -} - -@Online{ShapeSuperEllipse-A, - author = {Qrrbrbirlbel}, - file = {Snapshot:https\://tex.stackexchange.com/questions/649144/an-oval-surrounded-a-long-text-inside-in-tikz-equivalent-cover-background-of/654759#654759:text/html}, - month = aug, - title = {Answer to \enquote{An oval surrounded a *long text* inside in {TikZ} [equivalent cover background of {METAFUN}]}}, - titleaddon = {{TeX} - {LaTeX} Stack Exchange}, - url = {https://tex.stackexchange.com/a/654759/16595}, - urldate = {2022-09-24}, - year = {2022}, -} - -' -@Online{ShapeCircleArrow-Q, - author = {projetmbc}, - file = {Snapshot:https\://tex.stackexchange.com/questions/95221/tikz-circled-arrow/95263#95263:text/html}, - month = jan, - title = {{TikZ} - \enquote{Circled} arrow}, - titleaddon = {{TeX} - {LaTeX} Stack Exchange}, - url = {https://tex.stackexchange.com/q/95221/16595}, - urldate = {2022-09-24}, - year = {2013}, -} - -@Online{ShapeCircleArrow-A, - author = {Qrrbrbirlbel}, - file = {Snapshot:https\://tex.stackexchange.com/questions/95221/tikz-circled-arrow/95263#95263:text/html}, - month = jan, - title = {Answer to \enquote{{TikZ} - \enquote{Circled} arrow}}, - titleaddon = {{TeX} - {LaTeX} Stack Exchange}, - url = {https://tex.stackexchange.com/a/95263/16595}, - urldate = {2022-09-24}, - year = {2013}, -} - -' -@Online{ForeachUse-Q, - author = {Bar, Foo}, - file = {Snapshot:https\://tex.stackexchange.com/questions/110962/how-to-use-declared-tikz-functions-in-foreach-condition/110996#110996:text/html}, - month = apr, - title = {How to use declared {TikZ} functions in {\textbackslash}foreach condition?}, - titleaddon = {{TeX} - {LaTeX} Stack Exchange}, - url = {https://tex.stackexchange.com/q/110962/16595}, - urldate = {2022-09-24}, - year = {2013}, -} - -@Online{ForeachUse-A, - author = {Qrrbrbirlbel}, - file = {Snapshot:https\://tex.stackexchange.com/questions/110962/how-to-use-declared-tikz-functions-in-foreach-condition/110996#110996:text/html}, - month = apr, - shorttitle = {Answer to "How to use declared {TikZ} functions in {\textbackslash}foreach condition?}, - title = {Answer to \enquote{How to use declared {TikZ} functions in {\textbackslash}foreach condition?}}, - titleaddon = {{TeX} - {LaTeX} Stack Exchange}, - url = {https://tex.stackexchange.com/a/110996/16595}, - urldate = {2022-09-24}, - year = {2013}, -} - -' -@Online{CalFullWeek-Q, - author = {jd6}, - file = {Snapshot:https\://tex.stackexchange.com/questions/576673/full-weeks-in-tikz-calendar/660335#660335:text/html}, - month = dec, - title = {Full weeks in Tikz Calendar}, - titleaddon = {{TeX} - {LaTeX} Stack Exchange}, - url = {https://tex.stackexchange.com/q/576673/16595}, - urldate = {2022-10-09}, - year = {2020}, -} - -@Online{CalFullWeek-A, - author = {Qrrbrbirlbel}, - file = {Snapshot:https\://tex.stackexchange.com/questions/576673/full-weeks-in-tikz-calendar/660335#660335:text/html}, - month = oct, - title = {Answer to \enquote{Full weeks in Tikz Calendar}}, - titleaddon = {{TeX} - {LaTeX} Stack Exchange}, - url = {https://tex.stackexchange.com/a/660335/16595}, - urldate = {2022-10-09}, - year = {2022}, -} - -@Comment{jabref-meta: databaseType:bibtex;} diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.pdf b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.pdf deleted file mode 100644 index f4a31a8c6a..0000000000 Binary files a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.pdf and /dev/null differ diff --git a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.tex b/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.tex deleted file mode 100644 index 253944ca7d..0000000000 --- a/graphics/pgf/contrib/tikz-ext/doc/generic/tikz-ext/tikz-ext-manual.tex +++ /dev/null @@ -1,28 +0,0 @@ -% !TeX TS-program = lualatex -% !TeX spellcheck = en_US -% !TeX root = tikz-ext-manual.tex -% arara: lualatex -% 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. -% - -\documentclass[a4paper,doc2,landscape]{ltxdoc} -\input{tikz-ext-manual-en-main-preamble.tex} -\usetikzlibrary{external} - \tikzexternalize[ - prefix=tikz/, -% mode=convert with system call, - %mode=list and make, - %mode=list only,export=true,% simply skips EVERY picture -> good for debugging the text. - ] - \tikzexternalenable -% \tikzexternaldisable - \tikzifexternalizing{ - \pgfkeys{/pdflinks/codeexample links=false} - }{} - -\input{tikz-ext-manual-en-main-body.tex} diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-calendar.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-calendar.tex new file mode 100644 index 0000000000..09bd261a21 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-calendar.tex @@ -0,0 +1,100 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\section{Calendar: Weeknumbers and more conditionals} +\label{sec:calendar} +\begin{package}{calendar-ext} + This package adds week numbers and more conditionals to the \pgfname\space package |pgfcalendar|. + (Despite the code example above, this package is not set up to work with Con\TeX t.) + \inspiration{WeekNum-Q,CalCond-Q,CalFullWeek-Q}{WeekNum-A,CalCond-A,CalFullWeek-A} +\end{package} + +%This package extends the |pgfcalendar| package. + +\begin{multicols}{2} + +\subsection{Extensions} + +The following tests are added. +\begin{itemize} +\itemcalendaroption{Jan} This test is passed by all dates that are in the month of January. +\itemcalendaroption{Feb} as above. +\itemcalendaroption{Mar} as above. +\itemcalendaroption{Apr} as above. +\itemcalendaroption{May} as above. +\itemcalendaroption{Jun} as above. +\itemcalendaroption{Jul} as above. +\itemcalendaroption{Aug} as above. +\itemcalendaroption{Sep} as above. +\itemcalendaroption{Oct} as above. +\itemcalendaroption{Nov} as above. +\itemcalendaroption{Dec} as above. +\itemcalendaroption{leap year}\opt{|=|\meta{year}} + This test checks whether the given year is a leap year. If + \meta{year} is omitted, it checks the year of the current date. +\itemcalendaroption{and}|=|\marg{tests} + This test passes when all \meta{tests} pass. +\itemcalendaroption{not}|=|\marg{tests} + This test passes when \meta{tests} do not pass. +\itemcalendaroption{week of month}|=|\meta{num} + This test passes when the date is in \meta{num}th week of the month. + The first week of the month start at day~1 and ends with day~7. +\itemcalendaroption{week of month'}|=|\meta{num} + As above but counts from the last day of the month. + For a month with 31~days, this means the ``1st'' week starts at day~25 and ends with day~31. +\itemcalendaroption{calendar week of month}|=|\meta{num} + This test passes when the date is in \meta{num}th calendar week of the month. + The first week starts at the first day of the month and ends at the next Sunday. +\itemcalendaroption{calendar week of month'}|=|\meta{num} + As above but counts from the last day of the month. +\begin{codeexample}[width=5cm,preamble=\usetikzlibrary{ext.calendar-plus}] +\tikz + \calendar[ + dates=2022-10-01 to 2022-10-31, + week list] + if (week of month=2) [red] + if (calendar week of month'=2) [blue]; +\end{codeexample} +\itemcalendaroption{yesterday}|=|\marg{tests} + This test passes when the previous day passes \meta{tests}. +\itemcalendaroption{week}|=|\meta{num} + This test passes when the current week of the year equals \marg{num}. +\end{itemize} +The shorthands for |d-| and |m-| are slightly changed so that they are +expandable. This makes it possible to use these shorthands inside of \pgfname math. +The shorthands for the week (see section~\ref{calendar:weeknumbering}) +are added. These are +\begin{itemize} +\item |n-| (shortest numerical representation), +\item |n=| (shortest but added horizontal space) and +\item |n0| (leading zero when below 10). +\end{itemize} + +\subsection{Week numbering (ISO~8601)} +\label{calendar:weeknumbering} +\begin{command}{\pgfcalendarjulianyeartoweek\marg{Julian day}\marg{year}\marg{week counter}} + This command calculates the week for the \meta{Julian day} of \meta{year}. + The \meta{week counter} must be a \TeX\space counter. + + The calculation follows the rule of ISO~8601 where the first week has that + year's first Thursday in it. +\end{command} + +Inside of |\pgfcalendar|\indexCommandO\pgfcalendar the command |\pgfcalendarcurrentweek| will be available. +\begin{command}{\pgfcalendarcurrentweek} + This command returns the current week number (always two digits -- use shorthand |n.| + to strip the leading zero). +\end{command} + +Inside of |\ifdate|\indexCommandO\ifdate the command |\pgfcalendarifdateweek| will be available. +\begin{command}{\pgfcalendarifdateweek} + This command returns the week number (always two digits). +\end{command} +\end{multicols} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-intro.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-intro.tex new file mode 100644 index 0000000000..f9468175cb --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-intro.tex @@ -0,0 +1,31 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% +\part{Introduction} +\begin{multicols}{2} +\section{Usage} +This package is called |tikz-ext|, however, +one can't load it via |\usepackage|.% +\footnote{Except for \texttt{calendar-ext} of section~\ref{sec:calendar}.} +Instead, this package consists of multiple +\pgfname\space and \tikzname\space libraries +which are loaded by either |\usepgflibrary| or |\usetikzlibrary|. + +\section{Why do we need it?} +Since I have been answering questions on +\hyperlink{https://tex.stackexchange.com}{TeX.sx} +I've noticed that some questions come up again and again, +every time with a slightly different approach on how to solve them. + +I don't like reinventing the wheel which is why I've gathered +the solutions of my answers in this package. + +\section{Having problems?} +Don't hesitate to open an issue on GitHub. +\end{multicols} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-calendar-plus.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-calendar-plus.tex new file mode 100644 index 0000000000..bdfd225f3c --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-calendar-plus.tex @@ -0,0 +1,81 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\section{Calendar} +\begin{tikzlibrary}{ext.calendar-plus} + This library extends the \tikzname\space library \referenceLibraryandIndexO{calendar}. + \inspiration{WeekNum-Q,CalCond-Q,CalMath-Q}{WeekNum-A,CalCond-A,CalMath-A} +\end{tikzlibrary} + +\begin{multicols}{2} + +\subsection{Value-keys and nestable \texttt{if} key} + +The values of following keys are originally stored in some macros that are not +accessible by the user. These are now simple value-keys. +The |@|-protected macros are still available, of course. + +\begin{key}{/tikz/day xshift (initially 3ex)} +\end{key} +\begin{key}{/tikz/day yshift (initially 3.5ex)} +\end{key} +\begin{key}{/tikz/month xshift (initially 9ex)} +\end{key} +\begin{key}{/tikz/month yshift (initially 9ex)} +\end{key} + +It is now also possible to nest |/tikz/if| occurrences. +\begin{key}{/tikz/if=|(|\meta{conditions}|)|\meta{code or options}\opt{|else|\meta{else code or options}}} +\end{key} + +\subsection{\pgfname math functions} +\begin{math-function}{weeksinmonthofyear(\mvar{first weekday}, \mvar{month}, \mvar{year})} +\mathcommand + Returns the number of (partial) weeks in the month \mvar{month} of year \mvar{year} + when this month begins on a \mvar{first weekday}. +\end{math-function} +\begin{math-function}{lastdayinmonthofyear(\mvar{month}, \mvar{year})} +\mathcommand + Returns the last day (28, 29, 30 or 31) of month \mvar{month} of year \mvar{year}. +\end{math-function} + +\subsection{Week numbering (ISO~8601)} + +The actual week number algorithm is implemented by the |pgfcalendar-ext| package/module in section~\ref{calendar:weeknumbering}. +\begin{key}{/tikz/week code=\meta{code}} + Works like |/tikz/day code| or |/tikz/month code|, only for weeks.\indexKeyO{day code}\indexKeyO{month code} +\end{key} + +\begin{key}{/tikz/week text=\meta{text}} + Works like |/tikz/day text| or |/tikz/month text|, only for weeks.\indexKeyO{day text}\indexKeyO{month text} +\end{key} + +\begin{stylekey}{/tikz/every week} + Works like |/tikz/every day| or |/tikz/every month|, only for weeks.\indexKeyO{every day}\indexKeyO{every month} +\end{stylekey} + +\begin{stylekey}{/tikz/week label left} + Places the week label to the left of the first day of the month. (For + |week list| and |month list| where a week does not start on a Monday, the + position is chosen ``as if'' the week had started on a Monday -- which is + usually exactly what you want.) + % +\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}]; +\end{codeexample} + % +\end{stylekey} + +\end{multicols} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-misc.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-misc.tex new file mode 100644 index 0000000000..44228a5445 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-misc.tex @@ -0,0 +1,289 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\section{And a little bit more} +\begin{tikzlibrary}{ext.misc} + This library adds miscellaneous utilities to \pgfname math, \pgfname\space or \tikzname. + \inspiration{FullArc-Q,ForeachUse-Q}{FullArc-A,ForeachUse-A} +\end{tikzlibrary} + +\subsection{\pgfname math} + +\begin{multicols}{2} +\pgfkeys{/codeexample/every codeexample/.append style={width=3cm}} +\subsubsection{Postfix operator \texttt{R}} + +Similar to |\segments[]| in PSTricks, the postfix operator |R| allows the user +to use an arbitrary number of segments of a circle to be used instead of an angle. + +\begin{key}{/tikz/full arc=\meta{num} (default |{}|)} + The number \meta{num} of segments will be set up. + Using |full arc| with an empty value disables the segmentation and |1R| equals $1^\circ$. + + The given value \meta{num} is evaluated when the key is used and doesn't change when + \meta{num} contains variables that change. +\end{key} +The |R| operator can then be used. +\begin{math-operator}{R}{postfix}{fullarc} + Multiplies \mvar{x} with $\frac{360}{\meta{num}}$. +\end{math-operator} + +\subsubsection{Functions} + +\begin{math-function}{strrepeat("\mvar{Text}", \mvar{x})} +\mathcommand + Returns a string with \mvar{Text} repeated \mvar{x} times. + +\begin{codeexample}[] +\pgfmathparse{strrepeat("foo", 5)} +\pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{isInString("\mvar{String}", "\mvar{Text}")} +\mathcommand + Returns |1| (true) if \mvar{Text} contains \mvar{String}, + otherwise |0| (false). + +\begin{codeexample}[] +\pgfmathparse{isInString("foo", "bar")} +\pgfmathresult \ and\ +\pgfmathparse{isInString("foo", "foobar")} +\pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{strcat("\mvar{Text A}", "\mvar{Text B}", …)} +\mathcommand + Returns the concatenation of all given parameters. + +\begin{codeexample}[] +\pgfmathparse{strcat("blue!", int(7*3), "!green")} +\pgfmathresult +\end{codeexample} +\end{math-function} + + +\begin{math-function}{isEmpty("\mvar{Text}")} +\mathcommand + Returns |1| (true) if \mvar{Text} is empty, otherwise |0| (false). + % +\begin{codeexample}[] +\pgfmathparse{isEmpty("foo")} \pgfmathresult\ and\ +\pgfmathparse{isEmpty("")} \pgfmathresult\ and\ +\def\emptyText{} +\pgfmathparse{isEmpty("\emptyText")} \pgfmathresult +\end{codeexample} +\end{math-function} + +\begin{math-function}{atanXY(\mvar{x},\mvar{y})} +\mathcommand + Arctangent of $\mvar y\div \mvar x$ in degrees. This also takes into account the quadrant. + This is just a argument-swapped version of |atan2|\indexMathFunctionO{atan2} which makes it easier to use + the |\p| commands of the |calc|\indexLibraryO{calc} library. + % +\begin{codeexample}[] +\pgfmathparse{atanXY(3,4)} \pgfmathresult +\end{codeexample} +\end{math-function} +\begin{math-function}{atanYX(\mvar{y},\mvar{x})} +\mathcommand + Arctangent of $y\div x$ in degrees. This also takes into account the quadrant. +\begin{codeexample}[] +\pgfmathparse{atanYX(4,3)} \pgfmathresult +\end{codeexample} +\end{math-function} + +\subsubsection{Functions: using coordinates} +The following functions can only be used with \pgfname\space and/or \tikzname. +Since the arguments are usually plain text (and not numbers) one has to wrap +them in |"|. +\begin{math-function}{anglebetween("\mvar{p1}", "\mvar{p2}")}\mathcommand + Return the angle between the centers of the nodes \mvar{p1} and \mvar{p2}. +\end{math-function} +\begin{math-function}{qanglebetween("\mvar{p}")}\mathcommand + Return the angle between the origin and the center of the node \mvar{p}. +\end{math-function} +\begin{math-function}{distancebetween("\mvar{p1}", "\mvar{p2}")}\mathcommand + Return the distance (in pt) between the centers of the nodes \mvar{p1} and \mvar{p2}. +\end{math-function} +\begin{math-function}{qdistancebetween("\mvar{p}")}\mathcommand + Return the distance (in pt) between the origin and the center of the node \mvar{p}. +\end{math-function} + +\end{multicols} + +\begin{codeexample}[width=6cm,preamble=\usetikzlibrary{calc,ext.misc,through}] +\begin{tikzpicture} +\path (0,0) coordinate (A) + (0:4) coordinate (B) +(75:4) coordinate (C); +\draw (A) -- (B) -- (C) -- cycle; +\foreach \cnt in {1,...,4}{ + \pgfmathsetmacro\triA{distancebetween("B","C")} + \pgfmathsetmacro\triB{distancebetween("C","A")} + \pgfmathsetmacro\triC{distancebetween("A","B")} + \path (barycentric cs:A=\triA,B=\triB,C=\triC) coordinate (M) + node [draw, circle through=($(A)!(M)!(C)$)] (M) {}; + \draw ($(C)-(A)$) coordinate (vecB) + (M.75-90) coordinate (@) + (intersection of @--[shift=(vecB)]@ and B--C) coordinate (C) -- + (intersection of @--[shift=(vecB)]@ and B--A) coordinate (A);} +\end{tikzpicture} +\end{codeexample} + +\subsection{\pgfname for} + +Instead of |\foreach \var in {start, start + delta, ..., end}| one can use +|\foreach \var[use int=start to end step delta]|. + +\begin{key}{/pgf/foreach/use int=\meta{start}|to|\meta{end}\opt{|step|\meta{delta}}} +The values \meta{start}, \meta{end} and \meta{delta} are evaluates by \pgfname math at initialization. +The part |step |\meta{delta} is optional (\meta{delta} = 1). +\end{key} + +\begin{key}{/pgf/foreach/use float=\meta{start}|to|\meta{end}\opt{|step|\meta{delta}}} +Same as above, however the results are not truncated. +\end{key} + +%TODO: edges to and edges through +%\pagebreak + +\subsection{\pgfname keys} +\begin{pgfkeyslibrary}{ext.pgfkeys-plus} + This extends \pgfname keys and adds helpful |/utils| keys as well as handlers. + This library gets loaded by the |ext.misc| library.% + \footnote{\texttt{\string\usepgfkeyslibrary} is an upcoming feature of \pgfname/\tikzname. + For now, you need to load \texttt{ext.misc} + or manually \texttt{\string\input} the file \texttt{pgfkeyslibraryext.pgfkeys-plus.code.tex} + with \texttt{@} being a letter.} +\end{pgfkeyslibrary} + +\begin{multicols}{2} +\subsubsection{Conditionals} + +\begin{key}{/utils/if=\marg{cond}\marg{true}\opt{\marg{false}}} + This key checks the conditional \meta{cond} and applies the styles \meta{true} + if \meta{cond} is true, otherwise \meta{false}. + \meta{cond} can be anything that \pgfname math understands. + + As a side effect on how \pgfname keys parses argument, the \meta{false} argument is + actually optional. +\end{key} + +The following keys use \TeX' macros |\if|, |\ifx|, |\ifnum| and |\ifdim| for faster +executions. + +\begin{key}{/utils/TeX/if=\meta{token A}\meta{token B}\marg{true}\opt{\marg{false}}} + This key checks via |\if| if \meta{token A} matches \meta{token B} + and applies the styles \meta{true} if it does, otherwise \meta{false}. + + As a side effect on how \pgfname keys parses argument, the \meta{false} argument is + actually optional. +\end{key} + +\begin{key}{/utils/TeX/ifx=\meta{token A}\meta{token B}\marg{true}\opt{\marg{false}}} + As above but via |\ifx|. +\end{key} + +\begin{key}{/utils/TeX/ifnum=\marg{num cond}\marg{true}\opt{\marg{false}}} + This key checks |\ifnum|\meta{num cond} + and applies the styles \meta{true} if true, otherwise \meta{false}. + A delimiting |\relax| will be inserted after \meta{num cond}. + + As a side effect on how \pgfname keys parses arguments, the \meta{false} argument is + actually optional. +\end{key} + +\begin{key}{/utils/TeX/ifdim=\meta{dim cond}\meta{true}\opt{\meta{false}}} + As above but with |\ifdim|. +\end{key} + +\begin{key}{/utils/TeX/ifempty=\meta{Text}\meta{true}\opt{\meta{false}}} + This checks whether \meta{Text} is empty and applies styles \meta{true} if true, + otherwise \meta{false}. +\end{key} +\begin{key}{/utils/TeX/ifxempty=\meta{Text}\meta{true}\opt{\meta{false}}} + This checks whether fully expanded \meta{Text} is empty and applies styles \meta{true} if true, + otherwise \meta{false}. +\end{key} + +\subsubsection{Handlers} + +While already a lot of values given to keys are evaluated by \pgfname math at some point, +not all of them are. + +\begin{handler}{{.pgfmath}|=|\meta{eval}} + This handler evaluates \meta{eval} before it is handed to the key. + + This handler works almost the same as the |.evaluated|\indexHandlerO{.evaluated} + handler but it does its evaluation in a group so that the result will + not overwrite any other results. +\end{handler} + +\begin{handler}{{.pgfmath int}|=|\meta{eval}} + As above but truncates the result. +\end{handler} + +\begin{handler}{{.pgfmath wrap}|=|\marg{wrapper}\marg{eval}} + This feeds the result of \meta{eval} as |#1| to \meta{wrapper}. + + In the example below, one could have used the \referenceKeyandIndexO[/pgf/foreach/]{evaluate} + key from the |\foreach| loop. +\begin{codeexample}[width=3.7cm,preamble=\usetikzlibrary{ext.pgfkeys-plus}] +\tikz\foreach \i in {0,10,...,100} +\draw[ + line width=+.25cm, + % needs ## because its inside the \foreach body + color/.pgfmath wrap={red!##1!blue}{sqrt(\i)*10} +] + (0,\i/40) -- +(right:3); +\end{codeexample} +\end{handler} + +\begin{handler}{{.pgfmath if}|=|\marg{cond}\marg{true}\opt{\marg{false}}} + Evaluates \meta{cond} with \pgfname Math and returns \meta{true} or \meta{false} to the used key respectively. +\end{handler} +\begin{handler}{{.if}|=|\meta{token A}\meta{token B}\marg{true}\opt{\marg{false}}} + Checks via |\if| if \meta{token A} matches \meta{token B} + and applies the value \meta{true} if it does, otherwise \meta{false}. +\end{handler} +\begin{handler}{{.ifx}|=|\meta{token A}\meta{token B}\marg{true}\opt{\marg{false}}} + As above but via |\ifx|. +\end{handler} +\begin{handler}{{.ifnum}|=|\marg{ifnum cond}\marg{true}\opt{\marg{false}}} + Checks via |\ifnum| if \meta{ifnum cond} + and applies the value \meta{true} if it does, otherwise \meta{false}. +\end{handler} +\begin{handler}{{.ifdim}|=|\marg{ifdim cond}\marg{true}\opt{\marg{false}}} + As above but via |\ifdim|. +\end{handler} +\begin{handler}{{.ifxempty}|=|\marg{Text}\marg{true}\opt{\marg{false}}} + Checks whether a fully expanded \meta{Text} is empty + and applies the value \meta{true} if it does, otherwise \meta{false}. +\end{handler} +\begin{handler}{{.ifempty}|=|\marg{Text}\marg{true}\opt{\marg{false}}} + Checks whether \meta{Text} is empty + and applies the value \meta{true} if it does, otherwise \meta{false}. +\end{handler} +\begin{handler}{{.List}|=|\marg{\meta{e1}, \meta{e2}, \dots, \meta{en}}} + This handler evaluates the given list with |\foreach| and concatenates the element and + the result is then given to the used key. +\end{handler} +\end{multicols} +\begin{codeexample}[width=6cm,preamble=\usetikzlibrary{fit,ext.misc}] +\begin{tikzpicture}[nodes={draw, dashed, inner sep=+10pt}] + \foreach \point [count=\cnt] in {(0,0), (0,2), (2,0), (2,2), (3,3), (-1,-1)} + \node[circle, fill, inner sep=1pt, text=white] (point-\cnt) at \point {\cnt}; + \node[gray, fit/.List={(point-1),(point-...),(point-4)}] {}; + \node[red, fit/.List={(point-1),(point-...),(point-5)}] {}; + \node[blue, fit/.List={(point-1),(point-...),(point-6)}] {}; +\end{tikzpicture} +\end{codeexample} + +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex new file mode 100644 index 0000000000..d4b274511c --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-node-families.tex @@ -0,0 +1,124 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% +\section{Node Families} +\begin{tikzlibrary}{ext.node-families} + With this library the user can instruct multiple nodes to have the same + width, height, text width, text height or text width. + This uses the hook \referenceKeyandIndexO{execute at end picture} to write the nodes' + measurements to the \filetype{aux} file. + + Unfortunately, this does not work with the |external| library.\indexLibraryO{external}% + \footnote{First of all, I can't figure out how to use the \textsc{aux} file during externalization since it gets written to the \textsc{log} instead. + And then there's the question about how \texttt{external} would notice the need to export the picture again until it's stable \dots} + + \inspiration{NodeFam-Q}{NodeFam-A} + +\end{tikzlibrary} + +Before we get to the interesting keys, a common prefix can be set for the families' names. +Initially this is |\pgfpictureid-| so that families of different pictures don't interact. +\begin{key}{/tikz/node family/prefix=\meta{prefix}(initially \string\pgfpictureid-)} +The family names are prefixed with the value of |/tikz/node family/prefix|. +\end{key} + +\subsection{Text Box} +\label{ssec:nf-text} +The following keys~-- when setup, see below~-- work with every shape with one single node part.% +\footnote{Technically, it will also work with shapes with multiple node parts but it will only affect the main node part.} +Initially though, only \referenceShapeandIndexO{circle} and \referenceShapeandIndexO{rectangle} are set up that way. +\begin{key}{/tikz/node family/text height=\meta{name} (initially \{\})} +Nodes with the same \meta{name} will have the same text height. +An empty \meta{name} disables the evaluation by the library. +\end{key} + +\begin{key}{/tikz/node family/text depth=\meta{name} (initially \{\})} +Nodes with the same \meta{name} will have the same text depth. +An empty \meta{name} disables the evaluation by the library. +\end{key} + +\begin{key}{/tikz/node family/text width=\meta{name} (initially \{\})} +Nodes with the same \meta{name} will have the same text width. +An empty \meta{name} disables the evaluation by the library. +\end{key} + +\begin{key}{/tikz/node family/text=\meta{name}} +Sets |text height|, |text depth| and |text width|. +\end{key} + +Since the width of the node's content's box is setup much earlier, +the previous key only extends the width of that box which would make the text +seem as if it where aligned to the left. +With |text width family align| this can changed. +\begin{key}{/tikz/node family/text width align=\meta{alignment}(initially center)} +\meta{alignment} is one of |left|, |center| or |right|. + +\begin{codeexample}[preamble=\usetikzlibrary{positioning,ext.node-families},/tikz/node distance=.5cm] +\tikzexternaldisable % ext.node-families does not work with active externalization +\begin{tikzpicture}[nodes={rectangle, draw, node family={text width=manual, text width align=right}}] +\node (a) {Foo}; +\node[below=of a] (b) {Foobar}; +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/node family/setup shape=\meta{shape}} +This adds instructions to the \meta{shape}'s definition which +adjust the text box's dimensions according to the family. + +This should be only used once per shape. +\end{key} + +\subsection{Minimum Width/Height} +While the keys of the previous subsection work well enough for nodes of the same shape +(and the same |inner sep|s), for different node shapes the text box dimensions will be used +differently for the node's total dimension. + +For this, the following keys are necessary. +When one of the keys are used the values of |minimum width| and/or |minimum height| are set to |nf_width| or |nf_height| respectively. +\begin{key}{/tikz/node family/width=\meta{name} (initially \{\})} +Nodes with the same \meta{name} will have the same \referenceKeyandIndexO[/pgf/]{minimum width}. +An empty \meta{name} disables the evaluation by the library. +\begin{codeexample}[preamble=\usetikzlibrary{positioning,ext.node-families},/tikz/node distance=.5cm] +\tikzexternaldisable % ext.node-families does not work with active externalization +\begin{tikzpicture}[nodes={rectangle, draw, node family/width=manual}] +\node (a) {Foo}; +\node[below=of a] (b) {Foobar}; +\end{tikzpicture} +\end{codeexample} +\end{key} +\begin{key}{/tikz/node family/height=\meta{name} (initially \{\})} +Nodes with the same \meta{name} will have the same \referenceKeyandIndexO[/pgf/]{minimum height}. +An empty \meta{name} disables the evaluation by the library. +\end{key} +\begin{key}{/tikz/node family/size=\meta{name}} +Sets both |height| and |width|. +\end{key} + +\clearpage +\subsection{More shapes that support the keys \texttt{width} and \texttt{height}} +\begin{tikzlibrary}{ext.node-families.shapes.geometric} + This library adds support for the keys \referenceKeyandIndex[/tikz/node family/]{width} and + \referenceKeyandIndex[/tikz/node family/]{height} for the shapes of + the \pgfname\space library \referenceLibraryandIndexO{shapes.geometric}. + + \inspirationQ{NodeFam-Ellipse} +\end{tikzlibrary} +The shapes are also setup for the keys from subsection~\ref{ssec:nf-text}. + +\begin{codeexample}[width=9cm,preamble=\usetikzlibrary{ext.node-families.shapes.geometric}] +\tikzexternaldisable % ext.node-families does not work with active externalization +\begin{tikzpicture} +\foreach \cnt[count=\Cnt] in {a,...,h} + \node[draw, diamond, node family/text=aTOh] (\cnt) + at (right:\Cnt) {\cnt}; +\draw[help lines] (a.south) -- (h.south) (a.north) -- (h.north) (a.base-|a.west) -- (h.base-|h.east); +\end{tikzpicture} +\end{codeexample} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.arcto.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.arcto.tex new file mode 100644 index 0000000000..8ed660b3a3 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.arcto.tex @@ -0,0 +1,110 @@ +% !TeX root = tikz-ext-manual.tex +% !TeX spellcheck = en_US +% 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. +% + +\section{Arc \emph{to} a point} +\label{library:paths.arcto} + +\begin{tikzlibrary}{ext.paths.arcto} + This library adds the new path operation |arc to| that specifies an arc \emph{to} a point~-- + without the user having to specify any angles. +\end{tikzlibrary} + +\begin{codeexample}[width=.5\linewidth,preamble=\usetikzlibrary{ext.paths.arcto}] +\begin{tikzpicture}[ultra thick,dot/.style={label={#1}}] +\coordinate[dot=below left:$a$] (a) at (0,0); +\coordinate[dot=above right:$b$] (b) at (2,3); +\begin{scope}[ + radius=3, + nodes={ + shape=circle, + fill=white, + fill opacity=.9, + text opacity=1, + inner sep=+0pt, + sloped, + allow upside down + }] +\draw[blue] (a) arc to[] + node[near start] {.25} node {.5} node[near end] {.75} (b); +\draw[red] (a) arc to[clockwise] + node[near start] {.25} node {.5} node[near end] {.75} (b); +\draw[blue!50] (a) arc to[large] + node[near start] {.25} node {.5} node[near end] {.75} (b); +\draw[red!50] (a) arc to[large, clockwise] + node[near start] {.25} node {.5} node[near end] {.75} (b); +\end{scope} + +\fill[radius=2pt] (a) circle[] (b) circle[]; +\end{tikzpicture} +\end{codeexample} + +\begin{pathoperation}{arc to}{\opt{\oarg{options}}\meta{coordinate or cycle}} +When this operation is used, the path gets extended by an arc that goes through +the current point and \meta{coordinate}. + +For two points there exist two circles or four arcs that go through or connect +these two points. Which one of these is constructed is determined by the following +options that can be used inside of \meta{options}. + +\begin{stylekey}{/tikz/arc to/clockwise} + This constructs an arc that goes clockwise. +\end{stylekey} + +\begin{stylekey}{/tikz/arc to/counter clockwise} + This constructs an arc that goes counter clockwise. + + This is the default. +\end{stylekey} + +\begin{stylekey}{/tikz/arc to/large} + This constructs an arc whose angle is larger than $180^\circ$. +\end{stylekey} + +\begin{stylekey}{/tikz/arc to/small} + This constructs an arc whose angle is smaller than $180^\circ$. +\end{stylekey} + +\begin{key}{/tikz/arc to/rotate=\meta{degree}} + Rotates the arc by \meta{degree}. + This is only noticeable when |x radius| and |y radius| are different. +\end{key} + +\begin{key}{/tikz/arc to/x radius=\meta{value}} + This forwards the \meta{value} to \referenceKeyandIndexO{x radius}. + Its \meta{value} is used for the radius of the arc. +\end{key} + +\begin{key}{/tikz/arc to/y radius=\meta{value}} + This forwards the \meta{value} to \referenceKeyandIndexO{y radius}. + Its \meta{value} is used for the radius of the arc. +\end{key} + +\begin{key}{/tikz/arc to/radius=\meta{value}} + This forwards the \meta{value} to both |/tikz/x radius| and |/tikz/y radius|. + Its \meta{value} is used for radius of the arc. +\end{key} + +\begin{stylekey}{/tikz/every arc to} + After |/tikz/every arc| this will also be applied before any \meta{options} are set. +\end{stylekey} + +It should be noted that this uses |\pgfpatharcto| for which the \tikzname\space manual warns:\indexCommandO\pgfpatharcto +\begin{quote}\itshape + The internal computations necessary for this command are numerically very unstable. + In particular, the arc will not always really end at the \meta{target coordinate}, + but may be off by up to several points. + A more precise positioning is currently infeasible due to \TeX's numerical weaknesses. + The only case it works quite nicely is when the resulting angle is a multiple of $90^\circ$. +\end{quote} + +The |arc to| path operation will also work only in the |canvas| coordinate system. +The lengths of the vectors $(1, 0)$ and $(0, 1)$ will be used for the calculation of the radii +but no further consideration is done. +\end{pathoperation} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.ortho.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.ortho.tex new file mode 100644 index 0000000000..18264156c9 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.ortho.tex @@ -0,0 +1,199 @@ +% !TeX root = tikz-ext-manual.tex +% !TeX spellcheck = en_US +% 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. +% + +\section{More Horizontal and Vertical Lines} +\label{library:paths.ortho} + +\begin{tikzlibrary}{ext.paths.ortho} + This library adds new path specifications \verb!|-|!, \verb!-|-! as well as + |r-ud|, |r-du|, |r-lr| and |r-rl|. +\end{tikzlibrary} + +\subsection{Zig-Zag} +Similar to the path operations \verb!|-! and \verb!-|! this library adds\indexPathOperationO{\protect\pgfmanualbar-}\indexPathOperationO{-\protect\pgfmanualbar} +the path operations \verb!|-|! and \verb!-|-!. +{\catcode`\|=12 +\begin{pathoperation}[noindex]{|-|}{\opt{\oarg{options}}\meta{coordinate or cycle}} + \index{---1@\protect\texttt{\protect\pgfmanualbar-\protect\pgfmanualbar} path operation}% + \index{Path operations!---1@\protect\texttt{\protect\pgfmanualbar-\protect\pgfmanualbar}}% + \pgfmanualpdflabel[\catcode`\|=12 ]{|-|}{}% + This operation means ``first vertical, then horizontal and then vertical again''. +\end{pathoperation} +\begin{pathoperation}[noindex]{-|-}{\opt{\oarg{options}}\meta{coordinate or cycle}} + \index{--1@\protect\texttt{-\protect\pgfmanualbar-} path operation}% + \index{Path operations!--1@\protect\texttt{-\protect\pgfmanualbar-}}% + \pgfmanualpdflabel[\catcode`\|=12 ]{-|-}{}% + This operation means ``first horizontal, then vertical and then horizontal again''. +\end{pathoperation} +} +\begin{key}{/tikz/ortho/ratio=\meta{ratio} (initially 0.5)} + This sets the ratio for the middle part of the Zig-Zag connection. + + For values $\meta{ratio} < 0$ and $\meta{ratio} > 1$ the Zig-Zag lines will + look more like Zig-Zig lines. +\begin{codeexample}[preamble=\usetikzlibrary{paths.ortho}] +\begin{tikzpicture}[very thick, rounded corners] +\draw[help lines] (-.25, -1.25) grid (2.25, 1.25); +\draw (0, 0) -|- (2, 1) -- + (2, 0) -|-[ratio=.25] (0,-1) -- cycle; +\end{tikzpicture} +\end{codeexample} +\end{key} +%TODO: hvvh/distance needs fixing, maybe? +\begin{key}{/tikz/ortho/distance=\meta{distance}} + This sets the distance between the start point + and the middle part of the Zig-Zag connection. + + For values $\meta{distance} < 0$ the distance will be used for the target coordinate. +\begin{codeexample}[width=8cm,preamble=\usetikzlibrary{ext.paths.ortho}] +\begin{tikzpicture}[very thick,-latex] +\draw[help lines,-] (-.25, -.25) grid (5.25, 3.25); +\draw (0, 0) -|-[distance= .5cm] ++(2, 1); +\draw (0, 2) -|-[distance=-.5cm] ++(2, 1); + +\tikzset{xshift=3cm} +\draw (2, 1) -|-[distance= .5cm] ++(-2, -1); +\draw (2, 3) -|-[distance=-.5cm] ++(-2, -1); +\end{tikzpicture} +\end{codeexample} +\end{key} +\begin{key}{/tikz/ortho/from center=\opt{\meta{true or false}} (default true)} + When nodes get connected the placement of the middle part of the Zig-Zag + and the Zig-Zig (see below) connections will be calculated from the border + of these nodes. + The middle part of the connections can be calculated from the nodes' center + if this key is set to |true|. +\end{key} + +New timers are setup for both the Zig-Zag and the Zig-Zig connections, +these can be configured through the following keys. +\begin{codeexample}[width=8cm,preamble=\usetikzlibrary{paths.ortho}] +\tikz \draw (0,0) -|- (2,3) + foreach \p in {0.0, 0.25, 0.5, 0.75, 1.0}{ + node [pos=\p] {\p}}; +\end{codeexample} +\begin{key}{/tikz/ortho/spacing=\meta{number} (initially 4)} + Unless $\meta{number} = 0$ is set + \begin{itemize} + \item |pos = 0| will be at the start,\indexKeyO{pos} + \item |pos = 1| will be at the end, + \item |pos = |$\frac{1}{\meta{number}}$ will be at the first kink, + \item |pos = |$\frac{\meta{number}-1}{\meta{number}}$ will be at the second kink and + \item |pos = .5| will be in the middle of the middle part of the connection. + \end{itemize} + + If $\meta{number} = 0$ then + \begin{itemize} + \item |pos = -1| will be at the start, + \item |pos = 2| will be at the end, + \item |pos = 0| will be at the first kink, + \item |pos = 1| will be at the second kink and + \item |pos = .5| will still be in the middle of the middle part of the connection. + \end{itemize} +\end{key} +\begin{key}{/tikz/ortho/middle 0 to 1} + This is an alias for |spacing = 0|. +\end{key} + +\subsection{Zig-Zig} +\begin{pathoperation}{r-ud}{\opt{\oarg{options}}\meta{coordinate or cycle}} + This operation means ``first up, then horizontal and then down''. + \begin{key}{/tikz/ortho/ud distance=\meta{length} (initially .5cm)} + This sets the distance between the start and the horizontal line to \meta{length}. + \end{key} +\end{pathoperation} +\begin{pathoperation}{r-du}{\opt{\oarg{options}}\meta{coordinate or cycle}} + This operation means ``first down, then horizontal and then up''. + \begin{key}{/tikz/ortho/du distance=\meta{length} (initially .5cm)} + This sets the distance between the start and the horizontal line to \meta{length}. + \end{key} +\end{pathoperation} +\begin{pathoperation}{r-lr}{\opt{\oarg{options}}\meta{coordinate or cycle}} + This operation means ``left down, then vertical and then right''. + \begin{key}{/tikz/ortho/lr distance=\meta{length} (initially .5cm)} + This sets the distance between the start and the vertical line to \meta{length}. + \end{key} +\end{pathoperation} +\begin{pathoperation}{r-rl}{\opt{\oarg{options}}\meta{coordinate or cycle}} + This operation means ``first right, then vertical and then down''. + \begin{key}{/tikz/ortho/rl distance=\meta{length} (initially .5cm)} + This sets the distance between the start and the vertical line to \meta{length}. + \end{key} +\end{pathoperation} + +All distances can be set with one key. +\begin{key}{/tikz/ortho/udlr distance=\meta{length}} + Sets all the previous distances to the same value \meta{length}. +\end{key} + +\subsection{Even more Horizontal and Vertical Lines} + +The following keys can be used to access vertical and horizontal line path operations. +\begin{stylekey}{/tikz/horizontal vertical} + This installs \verb!to path = -| (\tikztotarget) \tikztonodes!\indexKeyO{to path} + that can be used with the path operations |to| or |edge|. +\end{stylekey} +\begin{stylekey}{/tikz/vertical horizontal} + This installs \verb!to path = |- (\tikztotarget) \tikztonodes! + that can be used with the path operations |to| or |edge|. +\end{stylekey} +\begin{stylekey}{/tikz/horizontal vertical horizontal} + This installs \verb!to path = -|- (\tikztotarget) \tikztonodes! + that can be used with the path operations |to| or |edge|. +\end{stylekey} +\begin{stylekey}{/tikz/vertical horizontal vertical} + This installs \verb!to path = |-| (\tikztotarget) \tikztonodes! + that can be used with the path operations |to| or |edge|. +\end{stylekey} + +When connecting rectangular nodes, these keys could be useful as well. +They all need to be given to a |to| or |edge| path operation. +\begin{stylekey}{/tikz/only vertical second=\opt{\meta{length}} (default 0pt)} +This draws a vertical line from the start point to the target point so that +it connects to the target point in the center (or at its border in case it is a node). + +The optional \meta{length} can be used to shift the line orthogonally to its direction. +\end{stylekey} +\begin{stylekey}{/tikz/only horizontal second=\opt{\meta{length}} (default 0pt)} +This draws a horizontal line from the start point to the target point so that +it connects to the target point in the center (or at its border in case it is a node). + +The optional \meta{length} can be used to shift the line orthogonally to its direction. +\end{stylekey} +\begin{stylekey}{/tikz/only vertical first=\opt{\meta{length}} (default 0pt)} +This draws a vertical line from the start point to the target point so that +it connects to the start point in the center (or at its border in case it is a node). + +The optional \meta{length} can be used to shift the line orthogonally to its direction. +\end{stylekey} +\begin{stylekey}{/tikz/only horizontal first=\opt{\meta{length}} (default 0pt)} +This draws a horizontal line from the start point to the target point so that +it connects to the start point in the center (or at its border in case it is a node). + +The optional \meta{length} can be used to shift the line orthogonally to its direction. +\end{stylekey} + +\pagebreak +Since all previous key are rather cumbersome, one can install shortcuts for these. +\begin{stylekey}{/tikz/ortho/install shortcuts} +Installs the following shortcuts:\\ +{\ttfamily +\begin{tabular}{l@{\hspace{.5em}${}\to{}$\hspace{.5em}}l} + \pgfmanualbar- & vertical horizontal \\ + -\pgfmanualbar & horizontal vertical \\ + -\pgfmanualbar- & horizontal vertical horizontal \\ + \pgfmanualbar-\pgfmanualbar & vertical horizontal vertical \\ + \pgfmanualbar* & only vertical first \\ + *\pgfmanualbar & only vertical second \\ + -* & only horizontal first \\ + *- & only horizontal second +\end{tabular} +} +\end{stylekey} diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.timer.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.timer.tex new file mode 100644 index 0000000000..595a647917 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-paths.timer.tex @@ -0,0 +1,92 @@ +% !TeX root = tikz-ext-manual.tex +% !TeX spellcheck = en_US +% 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. +% + +\section{Extending the Path Timers} +\label{library:timer} + +\begin{tikzlibrary}{ext.paths.timer} + This library adds timers to the path specifications |rectangle|, |parabola|, |sin| and |cos|. + + \inspiration{TimerRect-Q,TimerPara-Q}{TimerRect-A,TimerPara-A} +\end{tikzlibrary} + +In \tikzname, the path specification |rectangle|, |parabola|, |sin| and |cos| do not provide +their own timer, i.\,e. a node placing algorithm that is dependent on the actual path. +For |rectangle| the timer of the straight line between the rectangle's corners is used, for +the other paths, nodes, coordinates, pics, etc. are placed on the last coordinate. + +This library allows this. + +\subsection{Rectangle} +\indexPathOperationO{rectangle} + +For the |rectangle| path operator, the timer starts with |pos = 0| (= |at start|) from\indexKeyO{pos} +the starting coordinate in a counter-clockwise direction along the rectangle. +The corners will be at positions 0.0, 0.25, 0.5, 0.75 and 1.0. + +\begin{codeexample}[width=10cm,preamble=\usetikzlibrary{ext.paths.timer}] +\begin{tikzpicture}[scale=2, every pin edge/.style={latex-, gray}] +\coordinate [label=above right:Target] (A) at (0,0); +\coordinate [label=below left:Start] (B) at (1,2); +\draw[->, help lines] ([shift=(50:.3 and .75)] .5,1) + arc[start angle=50, delta angle=340, x radius=.3, y radius=.75]; +\draw (B) rectangle (A) + foreach \pos/\ang in {at start/60, very near start/90, near start/180, pos=.375/180, + midway/180, pos=.625/270, near end/0, very near end/0, at end/0}{ + node[pin=\ang:\pos, style/.expanded=\pos]{}}; +\end{tikzpicture} +\end{codeexample} + +\subsection{Parabola} +\indexPathOperationO{parabola}% + +For the |parabola| path operator the timer is similar to the |.. controls ..| operator. + +The position 0.5 will lie at the |bend|. +\begin{codeexample}[width=.3\linewidth,preamble=\usetikzlibrary{ext.paths.timer}] +\begin{tikzpicture} +\draw[help lines] (-2.25, -1.25) grid (2.25, 3.25); +\draw ( 2,-1) parabola bend (0,0) (-1,3); +\draw[ultra thick] (-2,-1) parabola bend (0,0) ( 1,3) + foreach \pos in {1,...,4,6,7,...,9}{ + node[ + pos=.\pos, sloped, fill=white, font=\small, inner sep=+0pt + ] {\pos} + }; +\end{tikzpicture} +\end{codeexample} + +If no |bend| is specified half the positions will collapse into one end of the curve. + +\begin{codeexample}[width=.3\linewidth,preamble=\usetikzlibrary{ext.paths.timer}] +\begin{tikzpicture}[every pin edge/.style={latex-, shorten <=1pt, gray}] +\draw (-2,-2) parabola (1,0) + foreach \pos in {0, 1, ..., 10} { + node [pos=\pos/10, pin={[anchor=-18*\pos+90]-18*\pos+270:\pos}]{} + }; +\end{tikzpicture} +\end{codeexample} + +\subsection{Sine/Cosine} +\indexPathOperationO{sin}\indexPathOperationO{cos}% + +The |sin| and |cos| path operators also allow placing of nodes along their paths. + +\begin{codeexample}[width=.3\linewidth,preamble=\usetikzlibrary{ext.paths.timer}] +\begin{tikzpicture}[mark nodes on line/.style={insert path={ + foreach \pos in {1, ..., 9} {node[ + sloped, fill=white, font=\small, inner sep=+0pt, pos=\pos/10] {\pos}}}}] +\draw[help lines] (-2.1,-2.1) grid (2.1,0.1); +\draw (-2,-2) sin (1,0) [mark nodes on line]; +\draw[shift=(0:1)](-2,-2) cos (1,0) [mark nodes on line]; +\end{tikzpicture} +\end{codeexample} + +\endinput diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-patterns.images.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-patterns.images.tex new file mode 100644 index 0000000000..c3c38a8517 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-patterns.images.tex @@ -0,0 +1,52 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% +\clearpage +\section{Using Images as a Pattern} +\label{library:patterns.images} + +\begin{tikzlibrary}{ext.patterns.images} + This library allows to use an image to be used as a repeating pattern for a path. + + \inspiration{Pattern-Q}{Pattern-A} +\end{tikzlibrary} + +With this library arbitrary images (or indeed PDF documents) can be used as +a repeating pattern for the background of a path. + +This is a two-step process: +\begin{enumerate} +\item Declaring an image as an ``image-pattern''. +\item Using the ``image-pattern''. +\end{enumerate} + +\begin{command}{\pgfsetupimageaspattern\oarg{options}\marg{name}\marg{image}} +\end{command} + +\begin{key}{/tikz/image as pattern=\meta{options} (default \{\})} + +\begin{codeexample}[preamble=\usetikzlibrary{ext.patterns.images,shapes.geometric}] +\pgfsetupimageaspattern[width=.5cm]{grid}{example-image-1x1} +\tikz \node[star, minimum size=3cm, draw, + image as pattern={name=grid,options={left, bottom, y=-.5cm, rotate=45}}] {}; +\end{codeexample} +\end{key} + +\begin{key}{/tikz/image as pattern/name=\meta{name}} +Specifies the name of the ``image-pattern'' to be used. +\end{key} + +\begin{stylekey}{/tikz/image as pattern/option} +Options that will be used by the internal |\pgftext|,\indexCommandO{\pgftext} +only keys from |/pgf/text| should be used.\indexKeyO[/pgf/]{text} +\end{stylekey} + +\begin{stylekey}{/tikz/image as pattern/options=\meta{style}} +Appends style |/tikz/image as pattern/option|. +\end{stylekey} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-positioning-plus.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-positioning-plus.tex new file mode 100644 index 0000000000..56c81376aa --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-positioning-plus.tex @@ -0,0 +1,183 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% +\clearpage +\section{Positioning Plus} +\label{library:positioning-plus} +\tikzsetnextfilename{posplus} +\begin{tikzlibrary}{ext.positioning-plus} + With the help of the \referenceLibraryandIndexO{positioning} and the \referenceLibraryandIndexO{fit} library this extends the placement of nodes. +\end{tikzlibrary} + +\subsection{Useful corner anchors} +The anchors |corner north east|, |corner north west|, |corner south west| and |corner south east| +are defined as ``generic anchors'', i.\,e. they are defined for all shapes. +This is mostly useful for the placement of circular shapes. +\begin{stylekey}{/tikz/corner above left=\opt{\meta{specification}} (default 0pt)} + Similar as \referenceKeyandIndexO{above left} of the \tikzname\space library |positioning| + but uses the |corner north west| anchor. +\end{stylekey} +\begin{stylekey}{/tikz/corner below left=\opt{\meta{specification}} (default 0pt)} + Similar as \referenceKeyandIndexO{below left} of the \tikzname\space library |positioning| + but uses the |corner south west| anchor. +\end{stylekey} +\begin{stylekey}{/tikz/corner above right=\opt{\meta{specification}} (default 0pt)} + Similar as \referenceKeyandIndexO{above right} of the \tikzname\space library |positioning| + but uses the |corner north east| anchor. +\end{stylekey} +\begin{stylekey}{/tikz/corner below right=\opt{\meta{specification}} (default 0pt)} + Similar as \referenceKeyandIndexO{below right} of the \tikzname\space library |positioning| + but uses the |corner south east| anchor. +\end{stylekey} + +\begin{codeexample}[width=.6\linewidth,preamble=\usetikzlibrary{ext.positioning-plus}] +\Huge +\begin{tikzpicture} +\node[name=s,shape=circle,shape example] + {Circle\vrule width 1pt height 2cm}; +\foreach \anchor/\placement in { + 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, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\draw (s.corner north west) rectangle (s.corner south east); +\foreach \anchor/\placement in { + corner north west/above left, corner north east/above right, + corner south west/below left, corner south east/below right} + \draw[red,shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} + +\subsection{Useful placement keys for vertical and horizontal alignment} +\begin{stylekey}{/tikz/north left=\opt{\meta{specification}} (default 0pt)} + Like \referenceKeyandIndexO{left} but aligns the nodes at their |north| border. + + This is basically the same as |left=of reference.north west, anchor=north east|. + % +\begin{codeexample}[preamble=\usetikzlibrary{ext.positioning-plus}] +\begin{tikzpicture}[nodes=draw] +\node[minimum height=2cm] (a) {}; +\node[minimum height=3cm, north right=of a] {}; +\end{tikzpicture} +\end{codeexample} +\end{stylekey} +\begin{stylekey}{/tikz/north right=\opt{\meta{specification}} (default 0pt)} + Like \referenceKeyandIndexO{right} but aligns the nodes at their |north| border. + + This is basically the same as |left=of reference.north east, anchor=north west|. +\end{stylekey} +\begin{stylekey}{/tikz/south left=\opt{\meta{specification}} (default 0pt)} + Like \referenceKeyandIndexO{left} but aligns the nodes at their |south| border. + + This is basically the same as |left=of reference.south west, anchor=south east|. +\end{stylekey} +\begin{stylekey}{/tikz/south right=\opt{\meta{specification}} (default 0pt)} + Like \referenceKeyandIndexO{right} but aligns the nodes at their |south| border. + + This is basically the same as |left=of reference.south east, anchor=south west|. +\end{stylekey} +\begin{stylekey}{/tikz/west above=\opt{\meta{specification}} (default 0pt)} + Like \referenceKeyandIndexO{above} but aligns the nodes at their |west| border. + + This is basically the same as |left=of reference.north west, anchor=south west|. +\end{stylekey} +\begin{stylekey}{/tikz/west below=\opt{\meta{specification}} (default 0pt)} + Like \referenceKeyandIndexO{below} but aligns the nodes at their |west| border. + + This is basically the same as |left=of reference.south west, anchor=north west|. +\end{stylekey} +\begin{stylekey}{/tikz/east above=\opt{\meta{specification}} (default 0pt)} + Like \referenceKeyandIndexO{above} but aligns the nodes at their |east| border. + + This is basically the same as |left=of reference.north east, anchor=south east|. +\end{stylekey} +\begin{stylekey}{/tikz/east below=\opt{\meta{specification}} (default 0pt)} + Like \referenceKeyandIndexO{below} but aligns the nodes at their |east| border. + + This is basically the same as |left=of reference.south east, anchor=north east|. +\end{stylekey} + +The same exist for the recently introduces corner anchors, too. +\begin{stylekey}{/tikz/corner north left=\opt{\meta{specification}} (default 0pt)} + The same as |/tikz/north left| but uses the new corner anchors. +\end{stylekey} +\begin{stylekey}{/tikz/corner north right=\opt{\meta{specification}} (default 0pt)} + The same as |/tikz/north right| but uses the new corner anchors. +\end{stylekey} +\begin{stylekey}{/tikz/corner south left=\opt{\meta{specification}} (default 0pt)} + The same as |/tikz/south left| but uses the new corner anchors. +\end{stylekey} +\begin{stylekey}{/tikz/corner south right=\opt{\meta{specification}} (default 0pt)} + The same as |/tikz/south right| but uses the new corner anchors. +\end{stylekey} +\begin{stylekey}{/tikz/corner west above=\opt{\meta{specification}} (default 0pt)} + The same as |/tikz/west above| but uses the new corner anchors. +\end{stylekey} +\begin{stylekey}{/tikz/corner west below=\opt{\meta{specification}} (default 0pt)} + The same as |/tikz/west below| but uses the new corner anchors. +\end{stylekey} +\begin{stylekey}{/tikz/corner east above=\opt{\meta{specification}} (default 0pt)} + The same as |/tikz/east above| but uses the new corner anchors. +\end{stylekey} +\begin{stylekey}{/tikz/corner east below=\opt{\meta{specification}} (default 0pt)} + The same as |/tikz/east below| but uses the new corner anchors. +\end{stylekey} + +While the \meta{specification} of all these keys still accept the same form as with \tikzname, +the |ext.positioning-plus| library extends this even more. + +The specification after |of| can contain a list of coordinates +(like the |fit| key of the |fit| library). +This means that the new node will be placed in relation to a rectangular bounding box +that fits around all this nodes in the list. + +If this list is prefixed with \verb!|!, |-| or |+|, +the new node will also have the same height (\verb!|!), +the same width (|-|) or both as this bounding box. + +\begin{codeexample}[preamble=\usetikzlibrary{ext.positioning-plus}] +\begin{tikzpicture}[nodes=draw] +\node (A) {A}; +\node[below=of A] (BCD) {BCD}; +\node[right=of |(A)(BCD)] (c) {}; +\node[below=.5:of -(A)(BCD)] (d) {}; +\draw[help lines] (BCD.south west) -- (c.south east) + (BCD.north east) -- (d.south east); +\end{tikzpicture} +\end{codeexample} + +This functionality is also available without the placement: +\begin{stylekey}{/tikz/fit bounding box=\meta{list of coordinates}} + Creates a rectangular node with the name |fit bounding box| that encompasses + the \meta{list of coordinates}. +\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 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 width of this bounding box. +\end{stylekey} +\begin{stylekey}{/tikz/span=\meta{list of coordinates}} + Is a combination of |/tikz/span vertical| and |/tikz/span horizontal|. +\end{stylekey} + +As you maybe noticed in the example above, the \meta{specification} also allows a prefix +delimited by |:| which the |node distance| will be multiplied to with for the placement.% +\footnote{This is probably more useful when \referenceKeyandIndexO{on grid} is used.} + +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-topaths.arcthrough.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-topaths.arcthrough.tex new file mode 100644 index 0000000000..1d9e5ba9df --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-topaths.arcthrough.tex @@ -0,0 +1,63 @@ +% !TeX root = tikz-ext-manual.tex +% !TeX spellcheck = en_US +% 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. +% + +\section{Arcs through Three Points} +\label{library:topaths.arcthrough} +\begin{tikzlibrary}{ext.topaths.arcthrough} + This library allows to use an arc defined by three points. +\end{tikzlibrary} + +\begin{codeexample}[width=10cm,preamble=\usetikzlibrary{ext.topaths.arcthrough}] +\begin{tikzpicture} +\coordinate[label=above right:$A$] (A) at ( 3, 1); +\coordinate[label=above:$B$] (B) at ( 1, 2); +\coordinate[label=below left:$C$] (C) at (-2,-2); + +\draw[ultra thick, draw=green, fill=green!50] + (B) to[arc through={clockwise,(A)}] (C) + -- (arc through center) -- cycle; +\draw[ultra thick, draw=blue, fill=blue!50] + (B) to[arc through=(A)] (C) + -- (arc through center) -- cycle; + +\foreach \p in {A,B,C, arc through center} \fill[red] (\p) circle[radius=2pt]; +\end{tikzpicture} +\end{codeexample} + +This can only by used for circles in the |canvas| coordinate system. + +\begin{multicols}{2} +\begin{key}{/tikz/arc through/through=\meta{coordinate} (initially {(0,0)})} + The coordinate on the circle that defines~-- together with the + starting and target point~-- a circle. +\end{key} + +\begin{key}{/tikz/arc through/center suffix=\meta{suffix} (initially {})} + The |arc through| will define a coordinate named |arc through center|\meta{suffix} + so that it can be referenced later. +\end{key} + +\begin{key}{/tikz/arc through/clockwise} + The resulting arc will go clockwise from the starting point to the target point. + This will not necessarily go through the |through| point. +\end{key} + +\begin{key}{/tikz/arc through/counter clockwise} + The resulting arc will go counter clockwise from the starting point to the target point. + This will not necessarily go through the |through| point. +\end{key} + +\begin{key}{/tikz/arc through=\meta{key-value}} + This key should be used with |to|\indexPathOperationO{to} or |edge|\indexPathOperationO{edge}. + A parameter other than |center suffix|, |clockwise| or |counter clockwise| will + be assumed to be the |through| coordinate. +\end{key} +\end{multicols} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-trans.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-trans.tex new file mode 100644 index 0000000000..97011bc4d0 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-library-trans.tex @@ -0,0 +1,136 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\clearpage +\section{Mirror, Mirror on the Wall} +\label{library:mirror} + +\begin{tikzlibrary}{ext.transformations.mirror} + This library adds more transformations to \tikzname. +\end{tikzlibrary} + +As explained in section~\ref{pgflibrary:transformations}, there are two approaches to setting a mirror transformation. +As with the commands in \pgfname, we'll be using a lowercase |m| for the reflection matrix and an uppercase |M| for the built-in approach. + +\subsection{Using the reflection matrix} + +\begin{codeexample}[width=.4\linewidth,preamble=\usetikzlibrary{shapes.geometric,ext.transformations.mirror}] +\begin{tikzpicture}[line join=round, thick, reg poly/.style={ + shape=regular polygon, regular polygon sides={#1}}] +\node[reg poly=5, minimum size=+2cm, draw, very thick] (a) {}; +\foreach \i[evaluate={\col=(\i-1)/.04}] in {1,...,5} + \node [mirror=(a.corner \i)--(a.side \i), transform shape, + reg poly=5, minimum size=+2cm, draw=red!\col!blue] {}; +\end{tikzpicture} +\end{codeexample} + +\begin{key}{/tikz/xmirror=\meta{value or coordinate} (default 0pt)} + Sets up a transformation that mirrors along a horizontal line that goes through point $(\text{\meta{value}}, 0)$ or \meta{coordinate}. + +\begin{codeexample}[preamble=\usetikzlibrary{ext.transformations.mirror}] +\begin{tikzpicture} +\draw[help lines] (-0.25, -.25) grid (3.25, 1.25); +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); + +\draw[dashed] (1.5, -.25) coordinate (m) -- (1.5, 1.25); +\draw[xmirror=(m),-latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/ymirror=\meta{value or coordinate} (default 0pt)} + Sets up a transformation that mirrors along a vertical line that goes through point $(0, \text{\meta{value}})$ or \meta{coordinate}. +\end{key} + + +\begin{key}{/tikz/mirror x=\meta{coordinate} (default {(0,0)})} + Similar to |/tikz/xmirror|, this however uses the |xyz| coordinate system instead of the |canvas| system. +\begin{codeexample}[preamble=\usetikzlibrary{ext.transformations.mirror}] +\begin{tikzpicture}[x=.5cm, y=(45:1cm)] + +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); + +\draw[dashed] (1.5, -.25) coordinate (m) -- (1.5, 1.25); + +\draw[ xmirror=(m), -latex, red, dotted] (0,0) .. controls (.5,1) .. (1,1); +\draw[mirror x=(m), -latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/mirror y=\meta{coordinate} (default {(0,0)})} + Similar to |/tikz/ymirror|, this however uses the |xyz| coordinate system instead of the |canvas| system. +\end{key} + + +\begin{key}{/tikz/mirror=\meta{point A}|--|\meta{point B}} + Sets up a transformation that mirrors along a line that goes through \meta{point A} and \meta{point B}. + + When only \meta{point A} is given that line goes through \meta{point A} and the origin. +\end{key} + +\subsection{Using built-in transformations} + +\begin{codeexample}[width=.4\linewidth,preamble=\usetikzlibrary{shapes.geometric,ext.transformations.mirror}] +\begin{tikzpicture}[line join=round, thick, reg poly/.style={ + shape=regular polygon, regular polygon sides={#1}}] +\node[reg poly=5, minimum size=+2cm, draw, very thick] (a) {}; +\foreach \i[evaluate={\col=(\i-1)/.04}] in {1,...,5} + \node [Mirror=(a.corner \i)--(a.side \i), transform shape, + reg poly=5, minimum size=+2cm, draw=red!\col!blue] {}; +\end{tikzpicture} +\end{codeexample} + +\begin{key}{/tikz/xMirror=\meta{value or coordinate} (default 0pt)} + Sets up a transformation that mirrors along a horizontal line that goes through point $(\text{\meta{value}}, 0)$ or \meta{coordinate}. + +\begin{codeexample}[preamble=\usetikzlibrary{ext.transformations.mirror}] +\begin{tikzpicture} +\draw[help lines] (-0.25, -.25) grid (3.25, 1.25); +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); + +\draw[dashed] (1.5, -.25) coordinate (m) -- (1.5, 1.25); +\draw[xMirror=(m),-latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/yMirror=\meta{value or coordinate} (default 0pt)} + Sets up a transformation that mirrors along a vertical line that goes through point $(0, \text{\meta{value}})$ or \meta{coordinate}. +\end{key} + + +\begin{key}{/tikz/Mirror x=\meta{coordinate} (default {(0,0)})} + Similar to |/tikz/xMirror|, this however uses the |xyz| coordinate system instead of the |canvas| system. +\begin{codeexample}[preamble=\usetikzlibrary{ext.transformations.mirror}] +\begin{tikzpicture}[x=.5cm, y=(45:1cm)] + +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); + +\draw[dashed] (1.5, -.25) coordinate (m) -- (1.5, 1.25); + +\draw[ xMirror=(m), -latex, red, dotted] (0,0) .. controls (.5,1) .. (1,1); +\draw[Mirror x=(m), -latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{key} + +\begin{key}{/tikz/Mirror y=\meta{coordinate} (default {(0,0)})} + Similar to |/tikz/yMirror|, this however uses the |xyz| coordinate system instead of the |canvas| system. +\end{key} + + +\begin{key}{/tikz/Mirror=\meta{point A}\opt{|--|\meta{point B}}} + Sets up a transformation that mirrors along a line that goes through \meta{point A} and \meta{point B}. + + When only \meta{point A} is given that line goes through \meta{point A} and the origin. +\end{key} + +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-body.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-body.tex new file mode 100644 index 0000000000..41e56c390e --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-body.tex @@ -0,0 +1,238 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% +\newcommand*\tikzextname{Ti\textit kZ-Extensions} +\newcommand*\tikzextversion{0.4.1} +\begin{document} +{\colorlet{blue}{black}% links shall be black +\title{\bfseries The \tikzextname\space Package\\ + \large Manual for version \tikzextversion\\[1mm] +\large\href{https://github.com/Qrrbrbirlbel/tikz-extensions} + {\texttt{https://github.com/Qrrbrbirlbel/tikz-extensions}} +\author{Qrrbrbirlbel}} + +\maketitle +\label{table-of-contents} + +\tableofcontents +} +\include{tikz-ext-manual-en-intro} + +\part{\tikzname\space Libraries} +\label{part:tikz} + +These libraries only work with \tikzname. +\vspace{1em} +\begin{center}\tikzsetnextfilename{main-cover} +\begin{tikzpicture}[ + very thick, + scale=2.7, + grow cyclic, + level distance=1cm, + level/.style={ + level distance/.expanded=\ifnum#1>1 \tikzleveldistance/1.5\else\tikzleveldistance\fi, + nodes/.expanded={\ifodd#1 fill\else fill=none\fi} + }, + level 1/.style={sibling angle=120}, + level 2/.style={sibling angle=90}, + level 3/.style={sibling angle=90}, + level 4/.style={sibling angle=45}, + nodes={circle,draw,inner sep=+0pt, minimum size=+5pt}, + ] +\path[rotate=30] + node {} + child foreach \cntI in {1,...,3} { + node {} + child foreach \cntII in {1,...,2} { + node {} + child foreach \cntIII in {1,...,2} { + node {} + child foreach \cntIV in {1,...,2} { + node {} + child foreach \cntV in {1,...,2} {} + } + } + } + }; +\end{tikzpicture} +\end{center} + +\tikzsetfigurename{calendar-plus} \include{tikz-ext-manual-en-library-calendar-plus} +\tikzsetfigurename{node-families} \include{tikz-ext-manual-en-library-node-families} +\tikzsetfigurename{paths.arcto} \include{tikz-ext-manual-en-library-paths.arcto} +\tikzsetfigurename{paths.ortho} \include{tikz-ext-manual-en-library-paths.ortho} +\tikzsetfigurename{paths.timer} \include{tikz-ext-manual-en-library-paths.timer} +\tikzsetfigurename{patterns.images} \include{tikz-ext-manual-en-library-patterns.images} +\tikzsetfigurename{positioning-plus} +\include{tikz-ext-manual-en-library-positioning-plus} +\tikzsetfigurename{topaths.arcthrough} +\include{tikz-ext-manual-en-library-topaths.arcthrough} +\tikzsetfigurename{trans} +\include{tikz-ext-manual-en-library-trans} + +\part{\pgfname\space Libraries} +\label{part:pgf} +These libraries (should) work with both \pgfname\space and \tikzname. + +\begin{center}\tikzsetnextfilename{main-graph} +\begin{codeexample}[width=10cm,preamble=% + \usetikzlibrary{graphs,graphdrawing,ext.misc} \usegdlibrary{force}] +\tikzset{ + mynode/.style={ + circle, minimum size=10mm, draw, densely dashdotted, thick, + decide color/.expand once=#1}, + decide color/.style 2 args={ + /utils/TeX/if=c#1 + {/utils/TeX/ifnum={#2<5}{bluelight}{bluedark}} + {/utils/TeX/ifnum={#2<8}{light}{dark}}}, + light/.style={fill=gray!20}, bluelight/.style={fill=blue!10}, + dark/.style ={fill=gray!60}, bluedark/.style ={fill=blue!30}} +\tikz\graph[ + spring electrical layout, vertical=c2 to p13, + node distance=1.5cm, typeset=$n_{\tikzgraphnodetext}$, + nodes={mynode=\tikzgraphnodetext}] { + % outer ring + c2 -- {p1, p11, p6}; + p1 -- {p8, c6, p11}; + p8 -- {p3, p10, c6}; + p3 -- {p13, p15, p10}; + p13 -- {p15, c7}; + c7 -- {c3, c4, p15}; + c3 -- {p14, c4}; + p14 -- {p7, c4}; + p7 -- {p9, p2, c4}; + p9 -- {c5, p12, p2}; + c5 -- {c1, p4, p12}; + c1 -- {p6, p4}; + p6 -- {p11, p4}; + % inner ring + p11 -- {c6, p12, p4}; + p5 -- {c6 -- {p10, p12}, p10 -- p15, p15 -- c4, c4 -- p2, p2 -- p12, p12 -- p4}; +}; +\end{codeexample} +\end{center} + +\tikzsetfigurename{PGF.trans}\include{tikz-ext-manual-en-pgf-trans} +\tikzsetfigurename{PGF.shapes}% +\include{tikz-ext-manual-en-pgf-shapes-circlearrow} +\include{tikz-ext-manual-en-pgf-shapes-circlecrosssplit} +\include{tikz-ext-manual-en-pgf-shapes-heatmark} +\include{tikz-ext-manual-en-pgf-shapes-rectround} +\include{tikz-ext-manual-en-pgf-shapes-superellipse} +\include{tikz-ext-manual-en-pgf-shapes-uncentered} + +\part{Utilities} + +\label{part:misc} +\vfill\tikzsetnextfilename{main-misc} +\begin{codeexample}[width=6cm, preamble=\usetikzlibrary{ext.misc}] +\begin{tikzpicture}[ + declare function={bigR(\n)=smallR+.05*\n;}, + declare constant={smallR=1; segments=20;}, + full arc=segments] +\foreach \iN[evaluate={\endRadius=bigR(\iN+1);}, use int=0 to segments-1] + \filldraw[fill=gray!50] (\iN R:\endRadius) + arc [radius=\endRadius, start angle=\iN R, delta angle=+1R] -- (\iN R+1R:smallR) + arc [radius=smallR, end angle=\iN R, delta angle=-1R] -- cycle; + +\node {$\phi^2$}; +\node at (north west:{sqrt 2 * bigR(segments/2)}) {$\{\Omega\}_{i=1}^n$}; +\node[rotate=-.5R, right] at (-.5R: bigR segments) {$\partial \varphi$}; + +\tikzset{yshift=-5cm, declare constant={segments=25;}, full arc=segments} +\filldraw[fill=gray!50] (right:smallR) + \foreach \iN[evaluate={\endRadius=bigR(\iN+1);}, use int=0 to segments-1] { + -- (\iN R:\endRadius) arc[radius=\endRadius, start angle=\iN R, delta angle=1R]} + -- (right:smallR) arc[radius=smallR, start angle=0, delta angle=-360]; + +\node {$\phi^2$}; +\node at (north west:{sqrt 2 * bigR(segments/2)}) {$\{\Omega\}_{i=1}^n$}; +\node[rotate=-.5R, right] at (-.5R: bigR segments) {$\partial \varphi$}; +\end{tikzpicture} +\end{codeexample} +\vfill + +\tikzsetfigurename{misc.calendar}\include{tikz-ext-manual-en-calendar} +\tikzsetfigurename{misc.misc}\include{tikz-ext-manual-en-library-misc} + +%%% END +\newcommand*{\addTikz}[1]{Added \tikzname\space library \texttt{ext.#1}.} +\newcommand*{\addPGF}[1]{Added \pgfname\space library \texttt{ext.#1}.} +\newcommand*{\addPGFkeys}[1]{Added \pgfname keys library \texttt{ext.#1}.} +\newcommand*{\addShape}[2][]{Added shape \texttt{\ifx\\#1\\#2\else#1\fi}\\(\pgfname\space library \texttt{ext.shapes.#2}).} +\part{Changelog, Index \& References} +\section*{Changelog}\addcontentsline{toc}{section}{Changelog} +\begin{multicols}{2}\raggedright +\noindent +Version 0.4.1 +\begin{itemize} +\item Cleaned up directory structure of documentary. +\item \addPGFkeys{pgfkeys-plus} +\item \addShape[uncentered rectangle]{uncenteredrectangle} +\item Fixed |ext.paths.arcto| -- again \cite{GH2}. +\end{itemize} +Version 0.4 +\begin{itemize} +\item CTAN version of 0.3.1 +\end{itemize} +Version 0.3.1 +\begin{itemize} +\item Fixed |ext.paths.ortho| keys |only vertical first| and |only horizontal first|. +\item Moved all (except the |to path|s) to namespace |/tikz/ortho|. + |/tikz/hvvh| and |/tikz/udlr| are considered deprecated. +\item Fixed |\pgfcalendarjulianyeartoweek|. +\item Added more calendar tests. +\item Added directory structure. +\end{itemize} +Version 0.3 +\begin{itemize} +\item \addShape[circle arrow]{circlearrow} +\item \addShape[circle cross split]{circlecrosssplit} +\item \addShape{heatmark} +\item \addShape[rectangle with rounded corners]{rectangleroundedcorners} +\item \addShape{superellipse} +\item \addTikz{node-families.shapes.geometric} +\item Fixed |ext.node-families|' key |size|. +\item Renamed internal macros to use custom namespace starting with |\tikzext@|. +\item Added some references. +\end{itemize} +Version 0.2 +\begin{itemize} +\item \addTikz{positioning-plus} +\item \addTikz{node-families} +\end{itemize} +Version 0.1 +\begin{itemize} +\item \addTikz{calendar-plus} +\item \addTikz{misc} +\item \addTikz{paths.arcto} +\item \addTikz{paths.ortho} +\item \addTikz{paths.timer} +\item \addTikz{patterns.images} +\item \addTikz{topaths.arcthrough} +\item \addTikz{transformations.mirror} +\item \addPGF{transformations.mirror} +\end{itemize} +\end{multicols} +\printindex + +\makeatletter +\def\url#1{% + \in@{/16595}{#1}% + \ifin@ + \hyper@linkurl{\expandafter\Hurl\expandafter{\strip@url#1\relax}}{#1}% + \else + \hyper@linkurl{\Hurl{#1}}{#1}% + \fi +} +\def\strip@url#1/16595\relax{#1} +\makeatother +\printbibliography[heading=bibintoc] +%\typeout{Examples: \the\codeexamplecount}% +\end{document} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-preamble.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-preamble.tex new file mode 100644 index 0000000000..2ba6defa10 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-main-preamble.tex @@ -0,0 +1,419 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\usepackage[version=latest]{pgf} + +\usepackage{xkeyval,calc,listings,tikz,fp} + +\usepackage{imakeidx} +\makeindex + +%%% Bibliography +\usepackage{csquotes} +\usepackage[backend=biber,style=numeric,backref]{biblatex} +\addbibresource{tikz-ext-manual.bib} + +\usepackage{hyperref} +\hypersetup{% + colorlinks=true, % use true to enable colors below: + linkcolor=blue,%red, + filecolor=blue,%magenta, + urlcolor=blue,%cyan, + citecolor=blue, + pdfborder=0 0 0, +} + +\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead,columnsep=1cm]{geometry} +\usepackage{amsmath,amssymb} +\usepackage{xxcolor} +\usepackage{pifont} + +\usepackage[T1]{fontenc} +% Promote `Missing character` reports to full errors +% require texlive 2021 or above +\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} +\usepackage[ttscale=.85]{libertine} +\setmonofont[Scale=0.8]{Bitstream Vera Sans Mono} + +\makeatletter +\renewcommand*\l@section[2]{% + \ifnum \c@tocdepth >\z@ + \addpenalty\@secpenalty + \addvspace{1.0em \@plus\p@}% + \setlength\@tempdima{2.5em}% + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth + \leavevmode \bfseries + \advance\leftskip\@tempdima + \hskip -\leftskip + #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \endgroup + \fi} +\renewcommand*\l@subsection{\@dottedtocline{2}{2.5em}{3.3em}} +\renewcommand*\l@subsubsection{\@dottedtocline{3}{5.8em}{4.2em}} +\def\@pnumwidth{2.2em} +\makeatother + +% Global styles: +\tikzset{ + every plot/.style={prefix=plots/pgf-}, + shape example/.style={ + color=black!30, + draw, + fill=yellow!30, + line width=.5cm, + inner xsep=2.5cm, + inner ysep=0.5cm} +} + +% Detect changed labels +% by David Carlisle https://tex.stackexchange.com/a/169245 +\makeatletter +\def\@testdef#1#2#3{% + \def\reserved@a{#3}% + \expandafter\ifx\csname #1@#2\endcsname\reserved@a\else + \typeout{^^JLabel `#2' changed:^^J\meaning\reserved@a^^J\expandafter\meaning\csname #1@#2\endcsname^^J}% + \@tempswatrue + \fi} +\makeatother + +\usetikzlibrary{ + ext.calendar-plus, + ext.misc, + ext.node-families, + ext.node-families.shapes.geometric, + ext.paths.arcto, + ext.paths.ortho, + ext.paths.timer, + ext.patterns.images, + ext.positioning-plus, + ext.shapes.heatmark, + ext.shapes.circlearrow, + ext.shapes.circlecrosssplit, + ext.shapes.rectangleroundedcorners, + ext.shapes.superellipse, + ext.shapes.uncenteredrectangle, + ext.topaths.arcthrough, + ext.transformations.mirror, + % + calc, + cd, + fit, + matrix, + shapes.geometric, + through, + trees, +} + +%% needs Lua! +\usetikzlibrary{graphs,graphdrawing} +\usegdlibrary{force} + +\makeatletter +\def\endofcodeexample#1{% original from tex/latex/pgf/doc/pgfmanual-en-macros.tex by Till Tantau et al + \endgroup% + \ifpgfmanual@setup@code% + \gdef\pgfmanual@do@this{% + {% + \returntospace% + \commenthandler% + \xdef\code@temp{#1}% removes returns and comments + }% + \edef\pgfmanualmcatcode{\the\catcode`\^^M}% + \catcode`\^^M=9\relax% + \expandafter\scantokens\expandafter{\code@temp}% + \catcode`\^^M=\pgfmanualmcatcode% + }% + \fi% + \ifcode@hidden\else + \ifcode@execute% + \setbox\codeexamplebox=\hbox{% + \ifx\code@render\pgfutil@empty% + {% + {% + \returntospace% + \commenthandler% + \xdef\code@temp{#1}% removes returns and comments + }% + \catcode`\^^M=9% + \colorbox{graphicbackground}{\color{black}\ignorespaces% + \code@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@post\ignorespaces}% + }% + \else% + \global\let\code@temp\code@render% + \colorbox{graphicbackground}{\color{black}\ignorespaces% + \code@render}% + \fi% + }% + \ifx\code@animation@list\pgfutil@empty% + \else% + \setbox\codeexampleboxanim=\vbox{% + \rightskip0pt\leftskip0pt plus1filll% + \ifdim\wd\codeexamplebox>\codeexamplewidth% + \else% + \hsize\codeexamplewidth% + \advance\hsize by2cm% + \fi% + \leavevmode\catcode`\^^M=9% + \foreach \pgfmanualtime/\pgfmanualtimehow in\code@animation@list{% + \setbox\codeexampleboxanim=\hbox{\colorbox{animationgraphicbackground}{% + \tikzset{make snapshot of=\pgfmanualtime}% + \scalebox{\pgfmanualanimscale}{\color{black}\ignorespaces% + \code@animation@pre\expandafter\scantokens\expandafter{\code@temp\ignorespaces}\code@animation@post\ignorespaces}% + }}% + \space\raise4pt\hbox to0pt{\vrule width0pt height1em\hbox + to\wd\codeexampleboxanim{\hfil\scriptsize$t{=}\pgfmanualtimehow \mathrm s$\hfil}\hss}% + \lower\ht\codeexampleboxanim\box\codeexampleboxanim\hfil\penalty0\hskip0ptplus-1fil% + }% + }% + \setbox\codeexampleboxanim=\hbox{\hbox{}\hskip-2cm\box\codeexampleboxanim}% + \fi% + \ifdim\wd\codeexamplebox>\codeexamplewidth% + \def\code@start{\par}% + \def\code@flushstart{}\def\code@flushend{}% + \def\code@mid{\parskip2pt\par\noindent}% + \def\code@width{\linewidth-6pt}% + \def\code@end{}% + \else% + \def\code@start{% +% \linewidth=\textwidth% removed this line + \parshape \@ne 0pt \linewidth + \leavevmode% + \hbox\bgroup}% + \def\code@flushstart{\hfill}% + \def\code@flushend{\hbox{}}% + \def\code@mid{\hskip6pt}% + \def\code@width{\linewidth-12pt-\codeexamplewidth}% + \def\code@end{\egroup}% + \fi% + \code@start% + \noindent% + \begin{minipage}[t]{\codeexamplewidth}\raggedright + \hrule width0pt% + \footnotesize\vskip-1em% + \code@flushstart\box\codeexamplebox\code@flushend% + \vskip0pt% + \leavevmode% + \box\codeexampleboxanim% + \vskip-1ex + \leavevmode% + \end{minipage}% + \else% + \def\code@mid{\par} + \def\code@width{\linewidth-6pt} + \def\code@end{} + \fi% + \code@mid% + \ifpgfmanual@multipage@code% + {% + \pgfkeysvalueof{/codeexample/prettyprint/base color}% + \pgfmanualdolisting{#1}% + }% + \else% + \colorbox{codebackground}{% + \pgfkeysvalueof{/codeexample/prettyprint/base color}% + \begin{minipage}[t]{\code@width}% + \pgfmanualdolisting{#1}% + \end{minipage}}% + \fi% + \code@end% + \par% + \medskip + \fi + \endcodeexample\endgroup% +} + +\newenvironment{pathoperation'}[3][]{ + \begin{pgfmanualentry} + \def\pgfmanualtest{#1}% + \pgfmanualentryheadline{% + \ifx\pgfmanualtest\@empty% + \pgfmanualpdflabel{#2}{}% + \fi% + %\textcolor{gray}{{\ttfamily\char`\\path}\ \ \dots} + %\declare{\texttt{\noligs{#2}}}#3\ \textcolor{gray}{\dots\texttt{;}} + }% + \ifx\pgfmanualtest\@empty% + \index{#2@\protect\texttt{#2} path operation}% + \index{Path operations!#2@\protect\texttt{#2}}% + \fi% + \pgfmanualbody +} +{ + \end{pgfmanualentry} +} +\makeatother + +\usepackage{paracol} + +%% normal references +\newcommand*{\indexLibrary}[1]{% + \index{#1@\protect\texttt{#1} library}% + \index{Libraries!#1@\protect\texttt{#1}}% +} +\newcommand*{\indexMathFunction}[1]{% + \index{#1@\protect\texttt{#1} math function}% + \index{Math functions!#1@\protect\texttt{#1}}% +} +\newcommand*{\indexShape}[1]{% + \index{#1@\protect\texttt{#1} shape}% + \index{Shapes!#1@\protect\texttt{#1}}% +} +\newcommand*{\indexHandler}[1]{% + \index{\gobble#1@\protect\texttt{#1} handler}% + \index{Key handlers!#1@\protect\texttt{#1}} +} +\newcommand*{\indexKey}[2][/tikz/]{% +\begingroup + \def\mykey{#1#2}% + \def\mypath{}% + \gdef\myname{}% + \firsttimetrue + \decompose#1#2/\nil +\endgroup +} +\newcommand*{\indexPathOperation}[1]{% + \index{#1@\protect\texttt{#1} path operation}% + \index{Path operations!#1@\protect\texttt{#1}}% +} + +%% references to original +\newcommand*{\indexLibraryO}[1]{% + \index{#1@\originalprefix\protect\texttt{\original{#1}} library\originalsuffix}% + \index{Libraries!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% +} +\newcommand*{\indexMathFunctionO}[1]{% + \index{#1@\protect\texttt{\original{#1}} math function\originalsuffix}% + \index{Math functions!#1@\protect\texttt{\original{#1}}\originalsuffix}% +} +\newcommand*{\indexShapeO}[1]{% + \index{#1@\originalprefix\protect\texttt{\original{#1}} shape\originalsuffix}% + \index{Shapes!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% +} +\newcommand*{\indexHandlerO}[1]{% + \index{\gobble#1@\originalprefix\protect\texttt{\original{#1}} handler\originalsuffix}% + \index{Key handlers!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix} +} +\newcommand*{\indexKeyO}[2][/tikz/]{%TODO + \begingroup\let\decomposetoodeep\decomposetoodeepO + \def\mykey{#1#2}% + \def\mypath{}% + \gdef\myname{}% + \firsttimetrue + \decomposeO#1#2/\nil + \endgroup +} +\def\decomposetoodeepO#1/#2/\nil{% + % avoid too-deep nesting in index + \index{#1/#2@\originalprefix\protect\texttt{\original{#1/#2}} key\originalsuffix}% + \index{\mypath#1/#2@\originalprefix\protect\texttt{\original{#1/#2}}\originalsuffix}% + \decomposefindlast/#1/#2/\nil% +} +\def\decomposeO/#1/#2\nil{% + \def\test{#2}% + \ifx\test\empty% + % aha. + \index{#1@\originalprefix\protect\texttt{\original{#1}} key\originalsuffix}% + \index{\mypath#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% + \gdef\myname{#1}% + \pgfmanualpdflabel{#1}{} + \else% + \advance\pgfmanualdecomposecount by1\relax% + \ifnum\pgfmanualdecomposecount>2\relax% + \decomposetoodeepO#1/#2\nil% + \else% + \iffirsttime% + \begingroup% + % also make a pdf link anchor with full key path. + \def\hyperlabelwithoutslash##1/\nil{% + \pgfmanualpdflabel{##1}{}% + }% + \hyperlabelwithoutslash/#1/#2\nil% + \endgroup% + \def\mypath{#1@\protect\texttt{/#1/}!}% + \firsttimefalse% + \else% + \expandafter\def\expandafter\mypath\expandafter{\mypath#1@\protect\texttt{#1/}!}% + \fi% + \def\firsttime{}% + \decomposeO/#2\nil% + \fi% + \fi% +} +\newcommand*{\indexPathOperationO}[1]{% + \index{#1@\originalprefix\protect\texttt{\original{#1}} path operation\originalsuffix}% + \index{Path operations!#1@\originalprefix\protect\texttt{\original{#1}}\originalsuffix}% +} + +\newcommand*{\indexCommandO}[1]{% + \removeats{#1}% + \index{\strippedat @\originalprefix\protect\texttt{\original{\protect\string\protect#1}}\originalsuffix}% +} + +\newcommand*{\referenceKeyandIndexO}[2][/tikz/]{\texttt{#1#2}\indexKeyO[#1]{#2}} +\newcommand*{\referenceKeyandIndex}[2][/tikz/]{\texttt{#1#2}\indexKey[#1]{#2}} +\newcommand*{\referenceShapeandIndex}[1]{\texttt{#1}\indexShape{#1}} +\newcommand*{\referenceShapeandIndexO}[1]{\texttt{#1}\indexShapeO{#1}} +\newcommand*{\referenceLibraryandIndexO}[1]{\texttt{#1}\indexLibraryO{#1}} + +\colorlet{originalindex}{gray} +\newcommand*{\original}[1]{\textcolor{originalindex}{#1}} +\newcommand*{\originalsuffix}{}%\textsuperscript{\textdagger}}%\normalsize +\newcommand*{\originalprefix}{}%\footnotesize + +%\newcommand*{\original}[1]{\textcolor{originalindex}{#1}} +%\newcommand*{\original}[1]{#1}%\textcolor{originalindex}{#1}} +%\newcommand*{\originalsuffix}{}%\textsuperscript{\color{blue}\tikzname}} +%\DeclareRobustCommand*{\originalprefix}{\smash{\footnotesize\llap{\textbullet\space}}} + +\newcommand*{\filetype}[1]{\textsc{#1}} + +\makeatletter +\def\index@prologue{\section*{Index}\addcontentsline{toc}{section}{Index} + This index contains automatically generated entries as well as {\originalprefix\original{references}\originalsuffix} to + original functionalities of \pgfname/\tikzname. + \bigskip +} +\makeatother + +\DeclareMathOperator{\sgn}{sgn} + +\newenvironment{implementation}{% + \noindent\rule[.5ex]{\linewidth}{.4pt}\par + \paragraph*{Notes on Implementation:}\par% + \small + \begin{quotation}% +}{\end{quotation}} + +\newcommand*{\inspiration}[2]{% + \par\textbf{Q\,\&\,A:} \cite{#1} \& \cite{#2}\par +} +\newcommand*\inspirationQ[1]{\par\textbf{Q:} \cite{#1}} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-circlearrow.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-circlearrow.tex new file mode 100644 index 0000000000..e26711bb35 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-circlearrow.tex @@ -0,0 +1,93 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% +\section{Shape: Circle Arrow} +\begin{pgflibrary}{ext.shapes.circlearrow} + A circular shape named |circle arrow| that has an arc as its background path that can have an arrow tip. + \inspiration{ShapeCircleArrow-Q}{ShapeCircleArrow-A} +\end{pgflibrary} +\begin{shape}{circle arrow} + This shape is an arrow whose path is an arc -- defined very similar to the |arc|% + \indexPathOperationO{arc} path operation -- that can possibly be customized with + arrow tips. + + \begin{key}{/pgf/circle arrow start angle=\meta{start angle} (initially \{\})} + Sets the start angle. + \end{key} + \begin{key}{/pgf/circle arrow end angle=\meta{end angle} (initially \{\})} + Sets the end angle. + \end{key} + \begin{key}{/pgf/circle arrow delta angle=\meta{delta angle} (initially \{\})} + Sets the delta angle. + \end{key} + \begin{key}{/pgf/circle arrow arrows=% + \meta{start arrow tip specification}-\meta{end arrow tip specification} (initially -)} + The specification will be forwarded to |\pgfsetarrows|\indexCommandO{\pgfsetarrows}. + \end{key} + + A few handful styles are pre-defined. + \begin{key}{/pgf/circle arrow turn left north} + Sets |circle arrow start angle = 100|, |circle arrow delta angle = 340| + and |circle arrow arrows = ->|. + \end{key} + \begin{key}{/pgf/circle arrow turn left east} + As above but |circle arrow start angle = 10|. + \end{key} + \begin{key}{/pgf/circle arrow turn left west} + As above but |circle arrow start angle = 280|. + \end{key} + \begin{key}{/pgf/circle arrow turn left south} + As above but |circle arrow start angle = 190|. + \end{key} + \begin{key}{/pgf/circle arrow turn right north} + Sets |circle arrow start angle = 100|, |circle arrow delta angle = 340| + and |circle arrow arrows = <-|. + \end{key} + \begin{key}{/pgf/circle arrow turn right east} + As above but |circle arrow start angle = 10|. + \end{key} + \begin{key}{/pgf/circle arrow turn right west} + As above but |circle arrow start angle = 280|. + \end{key} + \begin{key}{/pgf/circle arrow turn right south} + As above but |circle arrow start angle = 190|. + \end{key} + +{\catcode`\|=12 +\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.circlearrow,matrix}] +\begin{tikzpicture} +\matrix[matrix of nodes, draw=none, row sep=1em, column sep=1em, + every node/.style={draw=gray, shape=circle arrow, ultra thick, inner sep=1em} +] (m) { + |[circle arrow turn left north]| & |[circle arrow turn left east]| \\ + |[circle arrow turn left west]| & |[circle arrow turn left south]| \\ + |[circle arrow turn right north]| & |[circle arrow turn right east]| \\ + |[circle arrow turn right west]| & |[circle arrow turn right south]| \\ +}; +\end{tikzpicture} +\end{codeexample} +} +\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.circlearrow},width=16cm] +\begin{tikzpicture}\Huge +\node[name=s, 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, + 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, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-circlecrosssplit.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-circlecrosssplit.tex new file mode 100644 index 0000000000..e7b2b9ba5a --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-circlecrosssplit.tex @@ -0,0 +1,53 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% +\section{Shape: Circle Cross Split} +\begin{pgflibrary}{ext.shapes.circlecrosssplit} + A circular shape with four parts that can be individually filled. + \inspiration{ShapeSplitCircle-Q}{ShapeSplitCircle-A} +\end{pgflibrary} +\begin{shape}{circle cross split} +This shape has four node parts that are placed near the center of a circle. + +\begin{key}{/pgf/circle cross split part fill=\marg{list} (initially none)} +Sets the custom fill color for each node part shape. +The items in \meta{list} should be separated by commas +(so if there is more than one item in \meta{list}, it must be surrounded by braces). +If \meta{list} has less entries than node parts, +then the remaining node parts use the color from the last entry in the list. +This key will automatically set |/pgf/circle cross split uses custom fill|. +\end{key} +\begin{key}{/pgf/circle cross split uses custom fill=\opt{\meta{boolean}} (default true)} +This enables the use of a custom fill for each of the node parts +(including the area covered by the |inner sep|). +The background path for the shape should not be filled (e.\,g., in \tikzname, +the |fill| option for the node must be implicitly or explicitly set to |none|). +Internally, this key sets the \TeX-if |\ifpgfcirclecrosssplitcustomfill| appropriately. +\end{key} +\begin{codeexample}[preamble=\usepgflibrary{ext.shapes.circlecrosssplit}] +\begin{tikzpicture}\Huge +\node[name=s, shape=circle cross split, shape example, inner xsep=1.5cm, fill=none, + circle cross split part fill={green,blue,red,yellow!90!black}] + {\nodepart{text}text\nodepart{two}two + \nodepart{three}three\nodepart{four}four}; +\foreach \anchor/\placement in + {north west/above left, north/above, north east/above right, + west/left, center/left, east/right, + mid west/right, mid/left, mid east/left, + base west/left, base/left, base east/right, +lower base west/left, lower base/below, lower base east/right, + lower mid west/left, lower mid/above, lower mid east/right, + south west/below left, south/below, south east/below right, + text/below, 10/right, 130/above, two/left, three/left, four/left} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-heatmark.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-heatmark.tex new file mode 100644 index 0000000000..fa13cb0000 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-heatmark.tex @@ -0,0 +1,83 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% +\section{Shape: Heatmark} +\begin{pgflibrary}{ext.shapes.heatmark} + A circular shape that has customizable rings around it. + \inspiration{ShapeHeat-Q}{ShapeHeat-A} +\end{pgflibrary} + +\begin{shape}{heatmark} + \begin{key}{/pgf/heatmark arcs=\meta{arcs num} (initially 3)} + Sets the number of arc around the circle to \meta{arcs num}. + \end{key} + \begin{key}{/pgf/heatmark arc width=\meta{arc width} (initially 4pt)} + Sets the width of the rings around the circle to \meta{arc width}. + \end{key} + \begin{key}{/pgf/heatmark arc sep=\meta{sep length} (initially 1pt)} + Sets the whitespace between the rings to \meta{sep length}. + \end{key} + \begin{key}{/pgf/heatmark arc rings=\meta{rings num} (initially 3)} + Sets the number of rings around the circle to \meta{rings num} + \end{key} + \begin{key}{/pgf/heatmark arc sep angle=\meta{sep angle} (initially 20)} + Sets the whitespace angle between the arcs in one ring to \meta{sep angle}. + \end{key} + \begin{key}{/pgf/heatmark inner opacity=\meta{inner opacity} (initially 0.8)} + Sets the opacity of the inner ring to \meta{inner opacity}. + \end{key} + \begin{key}{/pgf/heatmark outer opacity=\meta{low opacity} (initially 0.2)} + Sets the opacity of the outer ring to \meta{outer opacity}. + + The opacity of the rings between the outer and the inner ring will be interpolated by these two opacities. + \end{key} + +This shape takes the value of |/pgf/shape border rotate|% +\indexKeyO[/pgf/]{shape border rotate} into consideration. + +For every ring and for every arc the following styke keys are tried. +\begin{stylekey}{/pgf/heatmark ring \meta{ring number}} +\end{stylekey} +\begin{stylekey}{/pgf/heatmark arc \meta{arc number}} +\end{stylekey} +\begin{stylekey}{/pgf/heatmark ring \meta{ring number} arc \meta{arc number}} +\end{stylekey} + +The \pgfname shape is setup in a way that even \tikzname\space +styles can be used with a little bit work: +\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.heatmark}] +\tikz[ + shape border rotate=90, + /pgf/heatmark ring 1/.append style={/tikz/fill=green}, + /pgf/heatmark arc 1/.append style={/tikz/fill=blue}, + /pgf/heatmark ring 2 arc 2/.append style={/tikz/fill=yellow!70!black} +] \node[heatmark, fill=red] (n) {100}; +\end{codeexample} + +It is best to use this shape with no actual border (|draw = none|) and the |outer sep| set to zero. +\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.heatmark},width=16cm] +\begin{tikzpicture}\Huge +\node[name=s, shape=heatmark, shape example, + fill=blue!25, draw=none, outer sep=0pt] + {Heatmark\vrule width 1pt height 2cm}; +\foreach \anchor/\placement in + {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, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-rectround.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-rectround.tex new file mode 100644 index 0000000000..78bab76925 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-rectround.tex @@ -0,0 +1,58 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\section{Shape: Rectangle with Rounded Corners} +\begin{pgflibrary}{ext.shapes.rectangleroundedcorners} + A rectangle with rounded corners. +\end{pgflibrary} + +\begin{shape}{rectangle with rounded corners} +This library provides a |rectangle with rounded corners| where every corner can have a different radius. + +\begin{key}{/pgf/rectangle with rounded corners north west radius=\meta{dimen} (initially .5\string\pgflinewidth)} + Sets the north west radius to \meta{dimen}. +\end{key} +\begin{key}{/pgf/rectangle with rounded corners north east radius=\meta{dimen} (initially .5\string\pgflinewidth)} + Sets the north east radius to \meta{dimen}. +\end{key} +\begin{key}{/pgf/rectangle with rounded corners south west radius=\meta{dimen} (initially .5\string\pgflinewidth)} + Sets the south west radius to \meta{dimen}. +\end{key} +\begin{key}{/pgf/rectangle with rounded corners south east radius=\meta{dimen} (initially .5\string\pgflinewidth)} + Sets the south east radius to \meta{dimen}. +\end{key} +\begin{key}{/pgf/rectangle with rounded corners radius=\meta{dimen}} + Sets all radii to \meta{dimen}. +\end{key} + +\begin{codeexample}[preamble=\usepgflibrary{ext.shapes.rectangleroundedcorners}] +\begin{tikzpicture}\Huge +\node[name=s, shape=rectangle with rounded corners, shape example, + rectangle with rounded corners north west radius=10pt, + rectangle with rounded corners north east radius=20pt, + rectangle with rounded corners south west radius=30pt, + rectangle with rounded corners south east radius=40pt] {Rectangle with rounded corners\vrule width 1pt height 2cm}; +\foreach \anchor/\placement in + {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, + text/below, 10/right, 130/above, + north west center/below right, north east center/left, + south west center/above right, south east center/left, + below north west/left, above south west/left, above south east/right, below north east/right, + right north west/above, right south west/below, left south east/below, left north east/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-superellipse.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-superellipse.tex new file mode 100644 index 0000000000..580ef0d93f --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-superellipse.tex @@ -0,0 +1,105 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\section{Shape: Superellipse} +\begin{pgflibrary}{ext.shapes.superellipse} + Shape in the form of a ``superellipse''. + \inspiration{ShapeSuperEllipse-Q}{ShapeSuperEllipse-A} +\end{pgflibrary} + +\begin{shape}{superellipse} +This shape is defined by formula +\begin{equation*} + \biggl|\frac x{r_x}\biggr|^m + \biggl|\frac y{r_y}\biggr|^n = 1 +\end{equation*} +and will be plotted by +\begin{align*} + x(t) &= |\cos t|^{\frac 2m} \cdot r_x \sgn(\cos t) \\ + y(t) &= |\sin t|^{\frac 2n} \cdot r_y \sgn(\sin t) \\ +\end{align*} +where $r_x$ is half the node's width and $r_y$ is half the node's height. + +\begin{key}{/pgf/superellipse x exponent=\meta{x exponent}(initially 2.5)} +This sets $m$. +\end{key} +\begin{key}{/pgf/superellipse y exponent=\meta{y exponent}(initially 2.5)} +This sets $n$. +\end{key} +\begin{key}{/pgf/superellipse step=\meta{step}(initially 5)} +This specifies the step of the underlying plot handler. +The smaller \meta{step} is, the slower computation will be. + +Sensible values for \meta{step} are integer dividers of 90, i.\,e. +2, 3, 5, 6, 9, 10, 15, 18, 30 and 45. +\end{key} +\begin{key}{/pgf/superellipse exponent=\meta{exponent}} + Sets both |superellipse x exponent| and |superellipse y exponent| to \meta{exponent}. +\end{key} + +\paragraph{Notes on Implementation} +For implementing this shape, additional mathematical functions were declared. +\begin{math-function}{superellipsex(\mvar{t}, \mvar{2/m}, \mvar{$r_x$})} +\mathcommand +Returns the $x$ value on a point of the superellipse with its center on the origin following +\begin{equation*} + x = r_x\cos^{2/m} t +\end{equation*} +for values of $0 \leq t \leq 90$. +\end{math-function} +\begin{math-function}{superellipsey(\mvar{t}, \mvar{2/n}, \mvar{$r_y$})} +\mathcommand +Returns the $y$ value on a point of the superellipse with its center on the origin following +\begin{equation*} + y = r_y\cos^{2/n} t +\end{equation*} +for values of $0 \leq t \leq 90$. +\end{math-function} + +Both \pgfname math functions can be used at once with the following macro. +\begin{command}{\pgfmathsuperellipseXY\marg{t}\marg{2/m}\marg{2/n}\marg{a}\marg{b}} +Returns the $x$ value (in |\pgfmathresultX|) and the $y$ value (in |\pgfmathresultY|) of the superellipse with its center on the origin following +\begin{align*} + x & = a\cos^{2/m} t \\ + y & = b\cos^{2/n} t +\end{align*} +for values of $0 \leq t \leq 90$. + +Note: all arguments must be a valid number since they will not be parsed by \pgfname math. +\end{command} + +And additional internal macro was defined following the original naming scheme. +\def\temp{\begin{command}}% +\expandafter\temp\expandafter{\csname pgfutil@prefix@macrotomacro\endcsname\marg{macro 1}\marg{macro 2}} +Adds the once-expansion of \meta{macro 2} in front of \meta{macro 1}. +\end{command} + +\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.superellipse}] +\begin{tikzpicture}[superellipse step=1]\Huge +\node[name=s,shape=superellipse,shape example] {Superellipse\vrule width 1pt height 2cm}; +\foreach \anchor/\placement in + {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, + text/left, 10/right, 130/above} + \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)} + node[\placement] {\scriptsize\texttt{(s.\anchor)}}; +\end{tikzpicture} +\end{codeexample} +% +\begin{codeexample}[width=8cm,preamble=\usetikzlibrary{ext.shapes.superellipse}] +\begin{tikzpicture}[minimum width=1cm, minimum height=3cm] +\foreach \xe/\ye[count=\i] in {.5/.5, 1/1, 2/2, 3/3, .5/5} + \node[draw, superellipse, superellipse x exponent=\xe, superellipse y exponent=\ye] at (1.5*\i,0) {}; +\end{tikzpicture} +\end{codeexample} +\end{shape} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-uncentered.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-uncentered.tex new file mode 100644 index 0000000000..cb79e4ac7b --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-uncentered.tex @@ -0,0 +1,99 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\section{Shape: Uncentered Rectangle} +\begin{pgflibrary}{ext.shapes.uncenteredrectangle} + A rectangle that has a variable horizontal center with three node parts. + \inspiration{UncRectCD-Q,UncRectForest-Q}{UncRectCD-A,UncRectForest-A} +\end{pgflibrary} +\begin{shape}{uncentered rectangle} + +For some alignment problems, this shape could be useful. + +It has three node parts: the standard |text| part, +the |left| part that is to the left of |text| +and the |right| part that is to the right of |text|. + +When edges are to be connected with this shape, the +following key changes to which inner center this shape will +calculate the appropriate point on the border. +\begin{key}{/pgf/uncentered rectangle center=\meta{left}\textrm{ or }\meta{text}\textrm{ or }\meta{right}\textrm{ or }\meta{real} (initially text)} + Sets the center that is to be used for connecting edges. + + This will also move the anchors |north|, |mid|, |base| and |south| along. + In the picture below, this are marked red. +\end{key} + +For support of the \referenceLibraryandIndexO{cd} library of the |tikz-cd| package, +this shape also supports a dynamic $y$ value for its anchors |center|, |west| and |east|. +\begin{key}{/pgf/uncentered rectangle center yshift=\meta{dimension} (initially \{\})} + This determines the distance between the baseline and the |center| anchors. + + If \meta{dimension} is empty, the real center will be used which is the default. + + For use with |cd|, set this to |axis_height|. + Due to a bug with \referenceKeyandIndexO{execute at end node} + this needs a lot of fixing to be able to use in a commutative diagram, though. + +\tikzexternaldisable +\catcode`\|=12 +\begin{codeexample}[leave comments, preamble=\usetikzlibrary{cd, ext.shapes.uncenteredrectangle}] +\makeatletter +\tikzcdset{ + every diagram/.append style={ + /pgf/uncentered rectangle center=text, + /tikz/math align/.style={ + shape=uncentered rectangle, + /pgf/uncentered rectangle center yshift=axis_height, + commutative diagrams/math mode=false}, + /tikz/math align left/.style={ + math align, + /utils/exec={\def\mathalign####1=####2;{$####2$\nodepart{left}$####1={}$}}}, + /tikz/math align right/.style={ + math align, + /utils/exec={\def\mathalign####1=####2;{$####1$\nodepart{right}${}=####2$}}}, + /tikz/matrix of math nodes/.style={ + matrix of nodes, + nodes={ + execute at begin node=\iftikzcd@mathmode$\fi, + execute at end node =\iftikzcd@mathmode$\fi}}}} +\makeatother +\tikzcdset{install C shortcut/.code=\newcommand*\C[1]{C_{\%_{##1}}}} +\begin{tikzcd}[ + install C shortcut, + sep=tiny, + arrows={-, gray}, + cells={font=\strut, inner xsep=.2ex, inner ysep=.1ex} +] +\C{1} \drar & & |[math align right]| \mathalign m_{r_1} = \C{2}-C_\%; \dlar\\ + & C_\% \\ +\C{2} \urar & & |[math align right]| \mathalign m_{r_2} = \C{1}-C_\%; \ular +\end{tikzcd} +\end{codeexample} +\end{key} +\pagebreak +\begin{codeexample}[preamble=\usepgflibrary{ext.shapes.uncenteredrectangle}] +\begin{tikzpicture}[style north/.style=red, style south/.style=red, style center/.style=red, style base/.style=red, style mid/.style=red] +\Huge +\node[shape example, name=n, uncentered rectangle] + {centered \nodepart{left} Un \nodepart{right} \space Rectangle\vrule width 1pt height 2cm} + foreach \anchor/\pos in { + north west/above left, north/below, north east/above right, real north/above, left north/above, right north/above, text north/above, + west/left, center/above, east/right, real center/above, left center/above,right center/above,text center/below, + mid west/left, mid/left, mid east/right, real mid/above, left mid/above, right mid/above, text mid/above, + base west/left, base/right, base east/right, real base/below, left base/below, right base/below, text base/below, + south west/below left, south/above, south east/below right, real south/below, left south/below, right south/below, text south/below, + 10/right, 130/below, left/left, right/right, text/right}{ + plot[mark=x, only marks] coordinates {(n.\anchor)} + node[inner sep=.1em, style \anchor/.try, style/.expand once=\pos] {\tiny\ttfamily\anchor}}; +\end{tikzpicture} +\end{codeexample} +\end{shape} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-trans.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-trans.tex new file mode 100644 index 0000000000..ccd378a6e7 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-trans.tex @@ -0,0 +1,176 @@ +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% 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. +% + +\section{Transformations: Mirroring} +\label{pgflibrary:transformations} + +\begin{purepgflibrary}{ext.transformations.mirror} + This library adds mirror transformations to \pgfname. +\end{purepgflibrary} + +Two approaches to mirror transformation exist: +\begin{enumerate} +\item Using the reflection matrix (see left column). + + This depends on |\pgfpointnormalised|\indexCommandO\pgfpointnormalised which involves + the sine\indexMathFunctionO{sin} and the cosine\indexMathFunctionO{cos} functions of \pgfname math. + +\item Using built-in transformations (see right column). + + This depends on |\pgfmathanglebetweenpoints|\indexCommandO\pgfmathanglebetweenpoints which + involves the arctangent (|atan2|\indexMathFunctionO{atan2}) function of \pgfname math. +\end{enumerate} + +Which one is better? I don't know. +Choose one you're comfortable with. + +\begin{paracol}{2} + +\subsection{Using the reflection matrix} + +The following commands use the reflection matrix that sets the transformation matrix following +\begin{equation*} + A = \frac{1}{\Vert\vec l\Vert^2} \begin{bmatrix} + l_x^2-l_y^2 & 2l_xl_y \\ + 2l_xl_y & l_y^2-l_x^2\\ + \end{bmatrix}. +\end{equation*} + +\switchcolumn% > + +\stepcounter{subsection} +\subsection{Using built-in transformations} + +The following commands use a combination of shifting, rotating, $-1$ scaling, +rotating back and shifting back to reach the mirror transformation. + +The commands are named the same as on the left side, +only the |m| in |mirror| is capitalized. + +\switchcolumn*% < + +\begin{command}{\pgftransformxmirror\marg{value}} + Sets up a transformation that mirrors along a vertical line that goes through point $(\text{\meta{value}}, 0)$. + +\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] +\begin{tikzpicture} +\draw[help lines] (-0.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); +\pgftransformxmirror{1.5} + +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{command} + +\switchcolumn% > + +\begin{command}{\pgftransformxMirror\marg{value}} + Sets up a transformation that mirrors along a vertical line that goes through point $(\text{\meta{value}}, 0)$. + +\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] +\begin{tikzpicture} +\draw[help lines] (-0.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); +\pgftransformxMirror{1.5} + +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{command} + +\switchcolumn*% < + +\begin{command}{\pgftransformymirror\marg{value}} + Sets up a transformation that mirrors along a horizontal line that goes through point $(0, \text{\meta{value})}$. +\end{command} + +\begin{command}{\pgftransformmirror\marg{point A}\marg{point B}} + Sets up a transformation that mirrors along the line that goes through \meta{point A} and \meta{point B}. + +\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] +\begin{tikzpicture} +\draw[help lines] (-.25, -2.25) grid (2.5, 1.25); +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); + +\draw[dashed] (0, -1) -- (2, 0); +\pgftransformmirror{\pgfpointxy{0}{-1}} + {\pgfpointxy{2}{ 0}} + +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{command} + +\switchcolumn% > + +\begin{command}{\pgftransformyMirror\marg{value}} + Sets up a transformation that mirrors along a horizontal line that goes through point $(0, \text{\meta{value})}$. +\end{command} + +\begin{command}{\pgftransformMirror\marg{point A}\marg{point B}} + Sets up a transformation that mirrors along the line that goes through \meta{point A} and \meta{point B}. + +\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] +\begin{tikzpicture} +\draw[help lines] (-.25, -2.25) grid (2.5, 1.25); +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); + +\draw[dashed] (0, -1) -- (2, 0); +\pgftransformMirror{\pgfpointxy{0}{-1}} + {\pgfpointxy{2}{ 0}} + +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{command} + +\switchcolumn*% < + +\begin{command}{\pgfqtransformmirror\marg{point A}} + Sets up a transformation that mirrors along the line that goes through the origin and \meta{point A}. + +\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] +\begin{tikzpicture} +\draw[help lines] (-.25, -.25) grid (2.25, 1.25); +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); + +\draw[dashed] (0, 0) -- (2, 1); +\pgfqtransformmirror{\pgfpointxy{2}{1}} + +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{command} + +\switchcolumn + +\begin{command}{\pgfqtransformMirror\marg{point A}} + Sets up a transformation that mirrors along the line that goes through the origin and \meta{point A}. + +\begin{codeexample}[preamble=\usepgflibrary{transformations.mirror}] +\begin{tikzpicture} +\draw[help lines] (-.25, -.25) grid (2.25, 1.25); +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); + +\draw[dashed] (0, 0) -- (2, 1); +\pgfqtransformMirror{\pgfpointxy{2}{1}} + +\draw[-latex] (0,0) .. controls (.5,1) .. (1,1); +\end{tikzpicture} +\end{codeexample} +\end{command} + +\end{paracol} +\endinput diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.bib b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.bib new file mode 100644 index 0000000000..60cf094472 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.bib @@ -0,0 +1,381 @@ +' +@Misc{NodeFam-Q, + author = {Holene}, + month = apr, + title = {Dependent node size in {TikZ}}, + year = {2017}, + file = {Snapshot:https\://tex.stackexchange.com/questions/107227/dependent-node-size-in-tikz/121054#121054:text/html}, + url = {https://tex.stackexchange.com/q/107227/16595}, + urldate = {2022-09-24}, +} + +@Misc{NodeFam-A, + author = {Qrrbrbirlbel}, + month = jun, + title = {Answer to \enquote{{Dependent} node size in {TikZ}}}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/107227/dependent-node-size-in-tikz/121054#121054:text/html}, + url = {https://tex.stackexchange.com/a/121054/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{TimerRect-Q, + author = {CrazyArm}, + month = apr, + title = {Is {It} {Possible} to {Combine} {TikZ} {Distance} and {Line}-{To} {Operations}?}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/106558/is-it-possible-to-combine-tikz-distance-and-line-to-operations/106571#106571:text/html}, + url = {https://tex.stackexchange.com/q/106558/16595}, + urldate = {2022-09-24}, +} + +@Misc{TimerRect-A, + author = {Qrrbrbirlbel}, + month = apr, + title = {Answer to \enquote{{Is} {It} {Possible} to {Combine} {TikZ} {Distance} and {Line}-{To} {Operations}?}}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/106558/is-it-possible-to-combine-tikz-distance-and-line-to-operations/106571#106571:text/html}, + shorttitle = {Answer to "{Is} {It} {Possible} to {Combine} {TikZ} {Distance} and {Line}-{To} {Operations}?}, + url = {https://tex.stackexchange.com/a/106571/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{TimerPara-Q, + author = {cis}, + month = may, + title = {{TikZ}: {How} to place a coordinate at parabola-path-position?}, + year = {2020}, + file = {Snapshot:https\://tex.stackexchange.com/questions/543251/tikz-how-to-place-a-coordinate-at-parabola-path-position/621012#621012:text/html}, + shorttitle = {{TikZ}}, + url = {https://tex.stackexchange.com/q/543251/16595}, + urldate = {2022-09-24}, +} + +@Misc{TimerPara-A, + author = {Qrrbrbirlbel}, + month = nov, + title = {Answer to \enquote{{TikZ}: {How} to place a coordinate at parabola-path-position?}}, + year = {2021}, + file = {Snapshot:https\://tex.stackexchange.com/questions/543251/tikz-how-to-place-a-coordinate-at-parabola-path-position/621012#621012:text/html}, + shorttitle = {Answer to "{TikZ}}, + url = {https://tex.stackexchange.com/a/621012/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{Pattern-Q, + author = {knut}, + month = mar, + title = {{TikZ}: {Define} pattern with reference to external picture}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/103980/tikz-define-pattern-with-reference-to-external-picture/107144#107144:text/html}, + shorttitle = {{TikZ}}, + url = {https://tex.stackexchange.com/q/103980/16595}, + urldate = {2022-09-24}, +} + +@Misc{Pattern-A, + author = {Qrrbrbirlbel}, + month = apr, + title = {Answer to \enquote{{TikZ}: {Define} pattern with reference to external picture}}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/103980/tikz-define-pattern-with-reference-to-external-picture/107144#107144:text/html}, + shorttitle = {Answer to "{TikZ}}, + url = {https://tex.stackexchange.com/a/107144/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{WeekNum-Q, + author = {Fence}, + month = nov, + title = {Add week day to calendar}, + year = {2019}, + file = {Snapshot:https\://tex.stackexchange.com/questions/517338/add-week-day-to-calendar/651888#651888:text/html}, + url = {https://tex.stackexchange.com/q/517338/16595}, + urldate = {2022-09-24}, +} + +@Misc{WeekNum-A, + author = {Qrrbrbirlbel}, + month = jul, + title = {Answer to \enquote{{Add} week day to calendar}}, + year = {2022}, + file = {Snapshot:https\://tex.stackexchange.com/questions/517338/add-week-day-to-calendar/651888#651888:text/html}, + url = {https://tex.stackexchange.com/a/651888/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{CalCond-Q, + author = {healyp}, + month = oct, + title = {{TikZ} calendar and conditional tests}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/140948/tikz-calendar-and-conditional-tests/141027#141027:text/html}, + url = {https://tex.stackexchange.com/q/140948/16595}, + urldate = {2022-09-24}, +} + +@Misc{CalCond-A, + author = {Qrrbrbirlbel}, + month = oct, + title = {Answer to \enquote{{TikZ} calendar and conditional tests}}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/140948/tikz-calendar-and-conditional-tests/141027#141027:text/html}, + url = {https://tex.stackexchange.com/a/141027/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{CalMath-Q, + author = {cis}, + month = dec, + title = {{TikZ} / calendar: {Set} the height of a monthly calendar}, + year = {2018}, + file = {Snapshot:https\://tex.stackexchange.com/questions/464589/tikz-calendar-set-the-height-of-a-monthly-calendar/653146#653146:text/html}, + shorttitle = {{TikZ} / calendar}, + url = {https://tex.stackexchange.com/q/464589/16595}, + urldate = {2022-09-24}, +} + +@Misc{CalMath-A, + author = {Qrrbrbirlbel}, + month = aug, + title = {Answer to \enquote{{TikZ} / calendar: {Set} the height of a monthly calendar}}, + year = {2022}, + file = {Snapshot:https\://tex.stackexchange.com/questions/464589/tikz-calendar-set-the-height-of-a-monthly-calendar/653146#653146:text/html}, + shorttitle = {Answer to "{TikZ} / calendar}, + url = {https://tex.stackexchange.com/a/653146/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{FullArc-Q, + author = {Peter, Anthony}, + month = apr, + title = {A rather difficult ring like picture to be drawn}, + year = {2017}, + file = {Snapshot:https\://tex.stackexchange.com/questions/144293/a-rather-difficult-ring-like-picture-to-be-drawn/144297#144297:text/html}, + url = {https://tex.stackexchange.com/q/144293/16595}, + urldate = {2022-09-24}, +} + +@Misc{FullArc-A, + author = {Qrrbrbirlbel}, + month = nov, + title = {Answer to "{A} rather difficult ring like picture to be drawn"}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/144293/a-rather-difficult-ring-like-picture-to-be-drawn/144297#144297:text/html}, + url = {https://tex.stackexchange.com/a/144297/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{NodeFam-Ellipse, + author = {nkk}, + month = jun, + title = {How to prevent tikz custom node fill from covering the text when using node-families library}, + year = {2019}, + file = {Snapshot:https\://tex.stackexchange.com/questions/494862/how-to-prevent-tikz-custom-node-fill-from-covering-the-text-when-using-node-fami:text/html}, + url = {https://tex.stackexchange.com/q/494862/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{ShapeHeat-Q, + author = {boje}, + month = may, + title = {Heatmap over country like {Google} {Map}}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/112929/heatmap-over-country-like-google-map/113004#113004:text/html}, + url = {https://tex.stackexchange.com/q/112929/16595}, + urldate = {2022-09-24}, +} + +@Misc{ShapeHeat-A, + author = {Qrrbrbirlbel}, + month = may, + title = {Answer to \enquote{{Heatmap} over country like {Google} {Map}}}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/112929/heatmap-over-country-like-google-map/113004#113004:text/html}, + url = {https://tex.stackexchange.com/a/113004/16595}, + urldate = {2022-09-24}, +} + +' +@Misc{ShapeSplitCircle-Q, + author = {Marco}, + month = apr, + title = {{TikZ} - {Four} {Colored} {Circle} {Split}}, + year = {2017}, + file = {Snapshot:https\://tex.stackexchange.com/questions/121686/tikz-four-colored-circle-split/121767#121767:text/html}, + url = {https://tex.stackexchange.com/q/121686/16595}, + urldate = {2022-09-24}, +} + +@Misc{ShapeSplitCircle-A, + author = {Qrrbrbirlbel}, + month = jun, + title = {Answer to \enquote{{TikZ} - {Four} {Colored} {Circle} {Split}}}, + year = {2013}, + file = {Snapshot:https\://tex.stackexchange.com/questions/121686/tikz-four-colored-circle-split/121767#121767:text/html}, + url = {https://tex.stackexchange.com/a/121767/16595}, + urldate = {2022-09-24}, +} + +' +@Online{ShapeSuperEllipse-Q, + author = {somenxavier}, + file = {Snapshot:https\://tex.stackexchange.com/questions/649144/an-oval-surrounded-a-long-text-inside-in-tikz-equivalent-cover-background-of/654759#654759:text/html}, + month = aug, + title = {An oval surrounded a *long text* inside in {TikZ} [equivalent cover background of {METAFUN}]}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/649144/16595}, + urldate = {2022-09-24}, + year = {2022}, +} + +@Online{ShapeSuperEllipse-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/649144/an-oval-surrounded-a-long-text-inside-in-tikz-equivalent-cover-background-of/654759#654759:text/html}, + month = aug, + title = {Answer to \enquote{An oval surrounded a *long text* inside in {TikZ} [equivalent cover background of {METAFUN}]}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/654759/16595}, + urldate = {2022-09-24}, + year = {2022}, +} + +' +@Online{ShapeCircleArrow-Q, + author = {projetmbc}, + file = {Snapshot:https\://tex.stackexchange.com/questions/95221/tikz-circled-arrow/95263#95263:text/html}, + month = jan, + title = {{TikZ} - \enquote{Circled} arrow}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/95221/16595}, + urldate = {2022-09-24}, + year = {2013}, +} + +@Online{ShapeCircleArrow-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/95221/tikz-circled-arrow/95263#95263:text/html}, + month = jan, + title = {Answer to \enquote{{TikZ} - \enquote{Circled} arrow}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/95263/16595}, + urldate = {2022-09-24}, + year = {2013}, +} + +' +@Online{ForeachUse-Q, + author = {Bar, Foo}, + file = {Snapshot:https\://tex.stackexchange.com/questions/110962/how-to-use-declared-tikz-functions-in-foreach-condition/110996#110996:text/html}, + month = apr, + title = {How to use declared {TikZ} functions in {\textbackslash}foreach condition?}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/110962/16595}, + urldate = {2022-09-24}, + year = {2013}, +} + +@Online{ForeachUse-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/110962/how-to-use-declared-tikz-functions-in-foreach-condition/110996#110996:text/html}, + month = apr, + shorttitle = {Answer to "How to use declared {TikZ} functions in {\textbackslash}foreach condition?}, + title = {Answer to \enquote{How to use declared {TikZ} functions in {\textbackslash}foreach condition?}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/110996/16595}, + urldate = {2022-09-24}, + year = {2013}, +} + +' +@Online{CalFullWeek-Q, + author = {jd6}, + file = {Snapshot:https\://tex.stackexchange.com/questions/576673/full-weeks-in-tikz-calendar/660335#660335:text/html}, + month = dec, + title = {Full weeks in Tikz Calendar}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/576673/16595}, + urldate = {2022-10-09}, + year = {2020}, +} + +@Online{CalFullWeek-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/576673/full-weeks-in-tikz-calendar/660335#660335:text/html}, + month = oct, + title = {Answer to \enquote{Full weeks in Tikz Calendar}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/660335/16595}, + urldate = {2022-10-09}, + year = {2022}, +} + +' +@Software{GH2, + abstract = {{clockwise/counter clockwise does not seem to work reliably}}, + author = {marmotghost}, + month = oct, + title = {clockwise/counter clockwise does not seem to work reliably}, + url = {https://github.com/Qrrbrbirlbel/tikz-extensions/issues/2}, + urldate = {2022-10-23}, + year = {2022}, +} + +' +@Online{UncRectForest-Q, + author = {projetmbc}, + file = {Snapshot:https\://tex.stackexchange.com/questions/661726/forest-automatic-setting-of-the-alignment-of-some-labels/661746#661746:text/html}, + month = oct, + title = {forest - automatic setting of the alignment of some labels}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/661726/16595}, + urldate = {2022-10-23}, + year = {2022}, +} + +@Online{UncRectForest-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/661726/forest-automatic-setting-of-the-alignment-of-some-labels/661746#661746:text/html}, + month = oct, + title = {Answer to \enquote{forest - automatic setting of the alignment of some labels}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/661746/16595}, + urldate = {2022-10-23}, + year = {2022}, +} + +' +@Online{UncRectCD-Q, + author = {Szymankiewicz, Michał}, + file = {Snapshot:https\://tex.stackexchange.com/questions/657432/how-to-draw-a-mixing-rule-chemistry/657449#657449:text/html}, + month = sep, + shorttitle = {How to draw a mixing rule?}, + title = {How to draw a mixing rule? \#chemistry}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/q/657432/16595}, + urldate = {2022-10-23}, + year = {2022}, +} + +@Online{UncRectCD-A, + author = {Qrrbrbirlbel}, + file = {Snapshot:https\://tex.stackexchange.com/questions/657432/how-to-draw-a-mixing-rule-chemistry/657449#657449:text/html}, + month = sep, + shorttitle = {Answer to \enquote{How to draw a mixing rule?}}, + title = {Answer to \enquote{How to draw a mixing rule? \#chemistry}}, + titleaddon = {{TeX} - {LaTeX} Stack Exchange}, + url = {https://tex.stackexchange.com/a/657449/16595}, + urldate = {2022-10-23}, + year = {2022}, +} + +@Comment{jabref-meta: databaseType:bibtex;} diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.pdf b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.pdf new file mode 100644 index 0000000000..51ba04c7d1 Binary files /dev/null and b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.pdf differ diff --git a/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.tex b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.tex new file mode 100644 index 0000000000..253944ca7d --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual.tex @@ -0,0 +1,28 @@ +% !TeX TS-program = lualatex +% !TeX spellcheck = en_US +% !TeX root = tikz-ext-manual.tex +% arara: lualatex +% 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. +% + +\documentclass[a4paper,doc2,landscape]{ltxdoc} +\input{tikz-ext-manual-en-main-preamble.tex} +\usetikzlibrary{external} + \tikzexternalize[ + prefix=tikz/, +% mode=convert with system call, + %mode=list and make, + %mode=list only,export=true,% simply skips EVERY picture -> good for debugging the text. + ] + \tikzexternalenable +% \tikzexternaldisable + \tikzifexternalizing{ + \pgfkeys{/pdflinks/codeexample links=false} + }{} + +\input{tikz-ext-manual-en-main-body.tex} diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex index 90b42a0011..fae3508e15 100644 --- a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex +++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfcalendar-ext.code.tex @@ -359,7 +359,7 @@ \pgfcalendar@launch@ifdate{#2}{#3}{#4}% } -\pgfqkeys{/pgf/calendar/week}{.value required,.code=\ifnum#1=\pgfcalendarifdateweek\relax\expandafter\pgfcalendarmatchestrue\fi} +\pgfqkeys{/pgf/calendar/week}{.value required,.code={\ifnum#1=\pgfcalendarifdateweek\relax\expandafter\pgfcalendarmatchestrue\fi}} % Overwriting shorthands of pgfcalendar \expandafter\def\csname pgfcalendar@shorthand@d-\endcsname{% diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex new file mode 100644 index 0000000000..49aedb64c6 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgfkeyslibraryext.pgfkeys-plus.code.tex @@ -0,0 +1,139 @@ +% 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 pgfmath.tex + +%% Handlers +%% .pgfmath evaluates values given to keys in PGFmath before handing them over. +%% .pgfmath int truncates the result +%% .pgfmath strcat concatenates the given values +\pgfqkeys{/handlers}{ + .pgfmath/.code=% + \begingroup + \pgfmathparse{#1}% + \expandafter\endgroup\expandafter + \pgfkeys@exp@call\expandafter{\pgfmathresult}, + .pgfmath int/.code=% + \begingroup + \pgfmathint{#1}% + \expandafter\endgroup\expandafter + \pgfkeys@exp@call\expandafter{\pgfmathresult}, + .pgfmath wrap/.code 2 args={% + \def\pgfkeys@temp##1{\def\pgfkeys@temp{#1}}% + \begingroup + \pgfmathparse{#2}% + \expandafter\pgfkeys@temp\expandafter{\pgfmathresult}% + \expandafter\endgroup\expandafter + \pgfkeys@exp@call\expandafter{\pgfkeys@temp}% + }, + .pgfmath if/.code n args={3}{% + \begingroup + \pgfmathifthenelse{#1}{"1"}{"0"}% + \expandafter\endgroup\expandafter + \ifcase\pgfmathresult\relax + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi + {\pgfkeys@exp@call{#3}}% + {\pgfkeys@exp@call{#2}}% + }, + .if/.code n args={4}{% + \if#1#2% + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi + {\pgfkeys@exp@call{#3}}% + {\pgfkeys@exp@call{#4}}% + }, + .ifnum/.code n args={3}{% + \ifnum#1\relax + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi + {\pgfkeys@exp@call{#2}}% + {\pgfkeys@exp@call{#3}}% + }, + .ifdim/.code n args={3}{% + \ifdim#1\relax + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi + {\pgfkeys@exp@call{#2}}% + {\pgfkeys@exp@call{#3}}% + }, + .ifx/.code n args={4}{% + \ifx#1#2% + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi + {\pgfkeys@exp@call{#3}}% + {\pgfkeys@exp@call{#4}}% + }, + .ifxempty/.code n args={3}{% + \edef\pgfkeys@temp{#1}% + \pgfutil@ifxempty\pgfkeys@temp{\pgfkeys@exp@call{#2}}{\pgfkeys@exp@call{#3}}% + }, + .ifempty/.code n args={3}{% + \pgfutil@ifempty{#1}{\pgfkeys@exp@call{#2}}{\pgfkeys@exp@call{#3}}% + }, + %% http://tex.stackexchange.com/a/144187/16595 + %% key/.List={(point-1),(point-2),(point-...),(point-6)} will call + %% key=(point-1)(point-2)(point-3)(point-4)(point-5),(point-6) + .List/.code=% + \let\pgfkeys@global@temp\pgfutil@empty + \foreach\pgfkeys@temp in{#1}{% + \expandafter\pgfutil@g@addto@macro\expandafter\pgfkeys@global@temp\expandafter{\pgfkeys@temp}% + }% + \expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@global@temp}% +} + +\pgfqkeys{/utils}{ + if/.code n args={3}{% + \begingroup + \pgfmathifthenelse{#1}{"1"}{"0"}% + \expandafter\endgroup\expandafter + \ifcase\pgfmathresult\relax + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi + {\pgfkeysalso{#3}} + {\pgfkeysalso{#2}}% + }, + TeX/if/.code n args={4}{% + \if#1#2\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi + {\pgfkeysalso{#3}}{\pgfkeysalso{#4}}% + }, + TeX/ifnum/.code n args={3}{% + \ifnum#1\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi + {\pgfkeysalso{#2}}{\pgfkeysalso{#3}}% + }, + TeX/ifdim/.code n args={3}{% + \ifdim#1\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi + {\pgfkeysalso{#2}}{\pgfkeysalso{#3}}% + }, + TeX/ifx/.code n args={4}{% + \ifx#1#2\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi + {\pgfkeysalso{#3}}{\pgfkeysalso{#4}}% + }, + TeX/ifxempty/.code n args={3}{% + \edef\pgfkeys@temp{#1}% + \pgfutil@ifxempty\pgfkeys@temp{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}% + }, + TeX/ifempty/.code n args={3}{% + \pgfutil@ifempty{#1}{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}% + }, + tex/.search also=/utils/TeX, +} + +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex new file mode 100644 index 0000000000..6101ca8cad --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.pgfkeys-plus.code.tex @@ -0,0 +1,11 @@ +% 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/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.shapes.uncenteredrectangle.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.shapes.uncenteredrectangle.code.tex new file mode 100644 index 0000000000..630a22da14 --- /dev/null +++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/pgflibraryext.shapes.uncenteredrectangle.code.tex @@ -0,0 +1,307 @@ +% 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. +% +\pgfutil@IfUndefined{pgfnodepartthreebox}{% + \newbox\pgfnodepartleftbox + \newbox\pgfnodepartrightbox +}{% + \let\pgfnodepartleftbox\pgfnodeparttwobox + \let\pgfnodepartrightbox\pgfnodepartthreebox +} +\pgfset{ + uncentered rectangle center yshift/.initial=, + uncentered rectangle center/@center/.initial=2, + uncentered rectangle center/.is choice, + uncentered rectangle center/real/.code=\pgfkeyssetvalue{/pgf/uncentered rectangle center/@center}{0}, + uncentered rectangle center/left/.code=\pgfkeyssetvalue{/pgf/uncentered rectangle center/@center}{1}, + uncentered rectangle center/text/.code=\pgfkeyssetvalue{/pgf/uncentered rectangle center/@center}{2}, + uncentered rectangle center/right/.code=\pgfkeyssetvalue{/pgf/uncentered rectangle center/@center}{3}} + +\pgfdeclareshape{uncentered rectangle}{% + \nodeparts{text,left,right}% + \savedanchor\middleCenter{% + \pgf@x=.5\wd\pgfnodeparttextbox + % + \pgf@y=\dp\pgfnodeparttextbox + \ifdim\dp\pgfnodepartleftbox>\pgf@y + \pgf@y=\dp\pgfnodepartleftbox + \fi + \ifdim\dp\pgfnodepartrightbox>\pgf@y + \pgf@y=\dp\pgfnodepartrightbox + \fi + % + \pgf@ya=\ht\pgfnodeparttextbox + \ifdim\ht\pgfnodepartleftbox>\pgf@ya + \pgf@ya=\ht\pgfnodepartleftbox + \fi + \ifdim\ht\pgfnodepartrightbox>\pgf@ya + \pgf@ya=\ht\pgfnodepartrightbox + \fi + \advance\pgf@ya by -\pgf@y + \pgf@y=.5\pgf@ya + }% + \savedanchor\leftCenter{% + % y should be still the same as before + \pgf@x=-.5\wd\pgfnodepartleftbox + }% + \savedanchor\rightCenter{% + % y should be still the same as before + \pgf@x=.5\wd\pgfnodepartrightbox + \advance\pgf@x by \wd\pgfnodeparttextbox + }% + \savedanchor\realCenter{% + % y should be still the same as before + \pgf@x=-.5\wd\pgfnodepartleftbox + \advance\pgf@x by .5\wd\pgfnodeparttextbox + \advance\pgf@x by .5\wd\pgfnodepartrightbox + }% + \savedanchor\southwest{% + % total width + \pgf@xa=\wd\pgfnodepartleftbox + \advance\pgf@xa by\wd\pgfnodepartrightbox + \advance\pgf@xa by\wd\pgfnodeparttextbox + % + \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner xsep}}% + \advance\pgf@xa by 2\pgf@xc + \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}% + \ifdim\pgf@xb>\pgf@xa + \pgf@xa=\pgf@xb + \fi + % left side of shape + \advance\pgf@x by -.5\pgf@xa + \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}% + \advance\pgf@x by -\pgf@xa + % + % total height + \pgf@ya=\dp\pgfnodepartleftbox + \ifdim\pgf@ya<\dp\pgfnodeparttextbox + \pgf@ya=\dp\pgfnodeparttextbox + \fi + \ifdim\pgf@ya<\dp\pgfnodepartrightbox + \pgf@ya=\dp\pgfnodepartrightbox + \fi + \pgf@yb=\ht\pgfnodepartleftbox + \ifdim\pgf@yb<\ht\pgfnodeparttextbox + \pgf@yb=\ht\pgfnodeparttextbox + \fi + \ifdim\pgf@yb<\ht\pgfnodepartrightbox + \pgf@yb=\ht\pgfnodepartrightbox + \fi + \advance\pgf@ya by \pgf@yb + % + \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/inner ysep}}% + \advance\pgf@ya by 2\pgf@yc + \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}% + \ifdim\pgf@yb>\pgf@ya + \pgf@ya=\pgf@yb + \fi + % lower side of the shape + \advance\pgf@y by -.5\pgf@ya + \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}% + \advance\pgf@y by -\pgf@ya + }% + \savedanchor\northeast{% + % first, let's calculate the real center again: + % + \pgf@x=-.5\wd\pgfnodepartleftbox + \advance\pgf@x by .5\wd\pgfnodeparttextbox + \advance\pgf@x by .5\wd\pgfnodepartrightbox + % + \pgf@y=\dp\pgfnodeparttextbox + \ifdim\dp\pgfnodepartleftbox>\pgf@y + \pgf@y=\dp\pgfnodepartleftbox + \fi + \ifdim\dp\pgfnodepartrightbox>\pgf@y + \pgf@y=\dp\pgfnodepartrightbox + \fi + % + \pgf@ya=\ht\pgfnodeparttextbox + \ifdim\ht\pgfnodepartleftbox>\pgf@ya + \pgf@ya=\ht\pgfnodepartleftbox + \fi + \ifdim\ht\pgfnodepartrightbox>\pgf@ya + \pgf@ya=\ht\pgfnodepartrightbox + \fi + \advance\pgf@ya by -\pgf@y + \pgf@y=.5\pgf@ya + % + % now we can calculate the anchor + % total width + % + \pgf@xa=\wd\pgfnodepartleftbox + \advance\pgf@xa by\wd\pgfnodepartrightbox + \advance\pgf@xa by\wd\pgfnodeparttextbox + % + \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner xsep}}% + \advance\pgf@xa by 2\pgf@xc + \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}% + \ifdim\pgf@xb>\pgf@xa + \pgf@xa=\pgf@xb + \fi + % right side of shape + \advance\pgf@x by .5\pgf@xa + \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}% + \advance\pgf@x by \pgf@xa + % + % total height + \pgf@ya=\dp\pgfnodepartleftbox + \ifdim\pgf@ya<\dp\pgfnodeparttextbox + \pgf@ya=\dp\pgfnodeparttextbox + \fi + \ifdim\pgf@ya<\dp\pgfnodepartrightbox + \pgf@ya=\dp\pgfnodepartrightbox + \fi + \pgf@yb=\ht\pgfnodepartleftbox + \ifdim\pgf@yb<\ht\pgfnodeparttextbox + \pgf@yb=\ht\pgfnodeparttextbox + \fi + \ifdim\pgf@yb<\ht\pgfnodepartrightbox + \pgf@yb=\ht\pgfnodepartrightbox + \fi + \advance\pgf@ya by \pgf@yb + % + \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/inner ysep}}% + \advance\pgf@ya by 2\pgf@yc + \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}% + \ifdim\pgf@yb>\pgf@ya + \pgf@ya=\pgf@yb + \fi + % upper side of the shape + \advance\pgf@y by .5\pgf@ya + \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}% + \advance\pgf@y by \pgf@ya + }% + % + \anchor{center}{% + \ifcase\pgfkeysvalueof{/pgf/uncentered rectangle center/@center}\relax + \realCenter\or + \leftCenter\or + \middleCenter\or + \rightCenter\else + \realCenter + \fi + \pgfkeysgetvalue{/pgf/uncentered rectangle center yshift}\pgf@temp + \pgfutil@ifxempty\pgf@temp{% real center used + }{% calculate center + \pgfmathsetlength\pgf@y{\pgf@temp}% + }% + }% + \anchor{left} {\leftCenter \multiply\pgf@x by2 \pgf@y=0pt } + \anchor{right} {\middleCenter\multiply\pgf@x by2 \pgf@y=0pt } + \anchor{real center} {\realCenter} + \anchor{left center} {\leftCenter} + \anchor{right center}{\rightCenter} + \anchor{text center} {\middleCenter} + \anchor{south west} {\southwest} + \anchor{north east} {\northeast} + \anchor{mid}{% + \csname pgf@anchor@uncentered rectangle@center\endcsname + \pgfmathsetlength\pgf@y{.5ex}}% + \anchor{base}{% + \csname pgf@anchor@uncentered rectangle@center\endcsname + \pgf@y=0pt }% + \anchor{left mid} {\leftCenter \pgfmathsetlength\pgf@y{+.5ex}} + \anchor{text mid} {\middleCenter\pgfmathsetlength\pgf@y{+.5ex}} + \anchor{right mid} {\rightCenter \pgfmathsetlength\pgf@y{+.5ex}} + \anchor{real mid} {\realCenter \pgfmathsetlength\pgf@y{+.5ex}} + \anchor{left base} {\leftCenter \pgf@y=0pt } + \anchor{text base} {\middleCenter\pgf@y=0pt } + \anchor{right base} {\rightCenter \pgf@y=0pt } + \anchor{real base} {\realCenter \pgf@y=0pt } + \anchor{real south} {\pgf@anchor@rectangle@south} + \anchor{real north} {\pgf@anchor@rectangle@north} + \anchor{text north} {\pgf@anchor@rectangle@north\pgf@ya=\pgf@y\middleCenter\pgf@y=\pgf@ya} + \anchor{left north} {\pgf@anchor@rectangle@north\pgf@ya=\pgf@y\leftCenter \pgf@y=\pgf@ya} + \anchor{right north}{\pgf@anchor@rectangle@north\pgf@ya=\pgf@y\rightCenter \pgf@y=\pgf@ya} + \anchor{text south} {\pgf@anchor@rectangle@south\pgf@ya=\pgf@y\middleCenter\pgf@y=\pgf@ya} + \anchor{left south} {\pgf@anchor@rectangle@south\pgf@ya=\pgf@y\leftCenter \pgf@y=\pgf@ya} + \anchor{right south}{\pgf@anchor@rectangle@south\pgf@ya=\pgf@y\rightCenter \pgf@y=\pgf@ya} + \anchor{north}{% + \pgf@anchor@rectangle@north + \pgf@ya=\pgf@y + \csname pgf@anchor@uncentered rectangle@center\endcsname + \pgf@y=\pgf@ya + } + \anchor{south}{% + \pgf@anchor@rectangle@south + \pgf@ya=\pgf@y + \csname pgf@anchor@uncentered rectangle@center\endcsname + \pgf@y=\pgf@ya + } + %\anchor{base right}{\middleCenter\pgf@xa=2\pgf@x}% TODO + \anchor{real west}{% + \pgf@process{\northeast}% + \pgf@ya=.5\pgf@y + \pgf@process{\southwest}% + \pgf@y=.5\pgf@y + \advance\pgf@y by \pgf@ya + }% + \anchor{real east}{% + \pgf@process{\southwest}% + \pgf@ya=.5\pgf@y + \pgf@process{\northeast}% + \pgf@y=.5\pgf@y + \advance\pgf@y by \pgf@ya + }% + \anchor{west}{% + \pgf@process{\southwest}% + \pgf@xa=\pgf@x + \pgf@process{\csname pgf@anchor@uncentered rectangle@center\endcsname}% + \pgf@x=\pgf@xa + }% + \anchor{east}{% + \pgf@process{\northeast}% + \pgf@xa=\pgf@x + \pgf@process{\csname pgf@anchor@uncentered rectangle@center\endcsname}% + \pgf@x=\pgf@xa + }% + \inheritanchor[from=rectangle]{south west} + \inheritanchor[from=rectangle]{north west} + \inheritanchor[from=rectangle]{south east} + \inheritanchor[from=rectangle]{north east} + \inheritanchor[from=rectangle]{mid west} + \inheritanchor[from=rectangle]{mid east} + \inheritanchor[from=rectangle]{base west} + \inheritanchor[from=rectangle]{base east} + \inheritbackgroundpath[from=rectangle] + \anchorborder{% + % xa/ya is target + \pgf@xa=\pgf@x + \pgf@ya=\pgf@y + % xc/yc is "center" + \pgf@sh@reanchor{uncentered rectangle}{center}% + \pgf@xc=\pgf@x + \pgf@yc=\pgf@y + \ifdim\pgf@xa<0pt + % left side + \southwest + \advance\pgf@x by -\pgf@xc + \advance\pgf@y by -\pgf@yc + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + \edef\pgf@marshal{% + \noexpand\pgfpointborderrectangle + {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}} + {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}% + }% + \else + % right side + \northeast + \advance\pgf@x by -\pgf@xc + \advance\pgf@y by -\pgf@yc + \edef\pgf@marshal{% + \noexpand\pgfpointborderrectangle + {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}} + {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}% + }% + \fi + \pgf@process{\pgf@marshal}% + \advance\pgf@x by\pgf@xc + \advance\pgf@y by\pgf@yc + }% +} +\endinput \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex index 830b3513e5..a5a982020f 100644 --- a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex +++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.misc.code.tex @@ -5,6 +5,8 @@ % 1. under the LaTeX Project Public License and/or % 2. under the GNU Free Documentation License. % +\usepgflibrary{ext.pgfkeys-plus}% + %% full arc %% https://tex.stackexchange.com/a/144297/16595 %% The postfix operator R is added to PGFmath, @@ -73,28 +75,6 @@ {\tikzext@pgf@foreach@no@listfalse\pgffor@macro@list\tikzext@pgf@foreach@no@list@list} {\pgffor@@vars}}}}}% -%% Handlers -%% .pgfmath evaluates values given to keys in PGFmath before handing them over. -%% .pgfmath int truncates the result -%% .pgfmath strcat concatenates the given values -\pgfkeys{/handlers/.pgfmath/.code=\pgfmathparse{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfmathresult}} -\pgfkeys{/handlers/.pgfmath int/.code=\pgfmathint{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfmathresult}} -\pgfkeys{/handlers/.pgfmath strcat/.code=\pgfmathstrcat{#1}\expandafter\pgfkeys@exp@call\expandafter{\pgfmathresult}} - -%% http://tex.stackexchange.com/a/144187/16595 -%% key/.List={(point-1),(point-2),(point-...),(point-6)} will call -%% key=(point-1)(point-2)(point-3)(point-4)(point-5),(point-6) -\pgfkeys{/handlers/.List/.code={% - \let\pgfkeys@global@temp\pgfutil@empty - \foreach \pgfkeys@temp in{#1}{ - \ifx\pgfkeys@global@temp\pgfutil@empty - \global\let\pgfkeys@global@temp\pgfkeys@temp - \else - \expandafter\pgfutil@g@addto@macro\expandafter\pgfkeys@global@temp\expandafter - {\pgfkeys@temp}% - \fi}% - \expandafter\pgfkeys@exp@call\expandafter{\pgfkeys@global@temp}}} - %% PGFmath %% strrepeat("x", 5) = "xxxxx" \pgfmathdeclarefunction{strrepeat}{2}{% @@ -175,62 +155,11 @@ \pgfmathdeclarefunction{isEmpty}{1}{% \begingroup - \edef\pgfmath@temp{#1}% + \def\pgfmath@temp{#1}% \pgfutil@ifxempty\pgfmath@temp{\def\pgfmathresult{1}}{\def\pgfmathresult{0}}% \pgfmath@smuggleone\pgfmathresult \endgroup} -\pgfqkeys{/utils}{ - if/.code n args=3{% - \pgfmathparse{#1}% - \ifdim\pgfmathresult pt=0pt - \expandafter\pgfutil@firstoftwo - \else - \expandafter\pgfutil@secondoftwo - \fi - {\pgfkeysalso{#3}}% - {\pgfkeysalso{#2}}}, - IF/.code args={(#1)#2}{% - \pgfmathparse{#1}% - \pgfutil@in@{else}{#2}% - \ifpgfutil@in@ - \expandafter\pgfutil@firstoftwo - \else - \expandafter\pgfutil@secondoftwo - \fi - {\tikzext@misc@handle@else#2\pgf@stop}{\tikzext@misc@handle@else#2else\pgf@stop}% - }, - TeX/if/.code n args={4}{% - \if#1#2\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi - {\pgfkeysalso{#3}}{\pgfkeysalso{#4}}% - }, - TeX/ifnum/.code n args={3}{% - \ifnum#1\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi - {\pgfkeysalso{#2}}{\pgfkeysalso{#3}}% - }, - TeX/ifdim/.code n args={3}{% - \ifdim#1\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi - {\pgfkeysalso{#2}}{\pgfkeysalso{#3}}% - }, - TeX/ifx/.code n args={4}{% - \ifx#1#2\relax\expandafter\pgfutil@firstoftwo\else\expandafter\pgfutil@secondoftwo\fi - {\pgfkeysalso{#3}}{\pgfkeysalso{#4}}% - }, - TeX/ifempty/.code n args={3}{% - \edef\pgfkeys@temp{#1}% - \pgfutil@ifxempty\pgfkeys@temp{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}% - }, - tex/.search also=/utils/TeX, -} -\def\tikzext@misc@handle@else#1else#2\pgf@stop{% - \ifdim\pgfmathresult pt=0pt - \expandafter\pgfutil@firstoftwo - \else - \expandafter\pgfutil@secondoftwo - \fi - {\pgfkeysalso{#2}}% - {\pgfkeysalso{#1}}} - \pgfset{ declare constant/.code={% \let\pgfmathdeclareconstant@@@\pgfutil@empty diff --git a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex index c75f31b60a..e97bbf939d 100644 --- a/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex +++ b/graphics/pgf/contrib/tikz-ext/tex/generic/tikz-ext/tikzlibraryext.paths.arcto.code.tex @@ -306,12 +306,12 @@ % make sure direction is properly followed \ifdim\pgf@arcto@fS pt=1pt % counter clockwise - \ifdim\pgf@arcto@theta@end pt<\pgf@arcto@theta@start path + \ifdim\pgf@arcto@theta@end pt<\pgf@arcto@theta@start pt \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end+360}% \fi \else % clockwise - \ifdim\pgf@arcto@theta@end pt>\pgf@arcto@theta@start path + \ifdim\pgf@arcto@theta@end pt>\pgf@arcto@theta@start pt \pgfmathsetmacro\pgf@arcto@theta@end{\pgf@arcto@theta@end-360}% \fi \fi -- cgit v1.2.3