From 04a585df0c1efc659651ea6535edbb43558c83ca Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 4 Feb 2022 22:19:22 +0000 Subject: sankey (4feb22) git-svn-id: svn://tug.org/texlive/trunk@61874 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/sankey/sankey.dtx | 258 +++++++++++++++++++---- 1 file changed, 215 insertions(+), 43 deletions(-) (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/sankey/sankey.dtx b/Master/texmf-dist/source/latex/sankey/sankey.dtx index 451472c5b27..0338d1f761c 100644 --- a/Master/texmf-dist/source/latex/sankey/sankey.dtx +++ b/Master/texmf-dist/source/latex/sankey/sankey.dtx @@ -70,7 +70,7 @@ % \DoNotIndex{\NewDocumentCommand,\NewDocumentEnvironment,\IfBooleanTF} % \DoNotIndex{\NeedsTeXFormat,\ProvidesPackage,\RequirePackage,\PackageError,\PackageWarning} % \DoNotIndex{\newtoggle,\toggletrue,\togglefalse,\iftoggle,\ifdefempty,\ifundef,\ifdefstrequal} -% \DoNotIndex{\ifbool,\ifdef,\ifnumequal,\ifpgfmathcond,\colorlet,\fpeval,\inteval,\newbool} +% \DoNotIndex{\ifbool,\ifdef,\ifnumequal,\colorlet,\fpeval,\inteval,\newbool} % \DoNotIndex{\pgfmathsetmacro,\pgfdeclarelayer,\pgfdeclareshape,\pgfkeys,\pgfset,\usetikzlibrary} % \DoNotIndex{\the,\pgf@x,\pgf@y,\tikz@scan@one@point,\pgfutil@firstofone} % \DoNotIndex{\pgfsetlayers,\inheritsavedanchors,\inheritanchor,\inheritanchorborder,\anchor,\pgf@process,\northeast,\southwest} @@ -316,10 +316,10 @@ % path} and its \VAR{draw path}. % \end{sankeyoption} % -% \emph{Fill} and \emph{draw} paths are build in a TikZ scope where the -% origin is the center of the current Sankey node (its name is accessible -% via \code{\name}) and the coordinate system is rotated by its -% orientation. +% The \VAR{fill path} and the \VAR{draw path} are build in a TikZ scope +% where the origin is the center of the current Sankey node (its name is +% accessible via \code{\name}) and the coordinate system is rotated by +% its orientation. % %^^A % ------------------------------------------------------------ % \subsection{The \emph{debug} key} @@ -1598,7 +1598,7 @@ round-mode=places, round-precision=1, add-decimal-zero, - round-integer-to-decimal, + round-pad=true, } \begin{sankeydiagram} \colorlet{energy}{blue!30!cyan!80!black} @@ -2575,7 +2575,7 @@ % % \manualparts % -% \part{Implementation} +% \part{Installation \& Implementation} % \label{implementation} %^^A % ------------------------------------------------------------ % @@ -2584,6 +2584,39 @@ % \localtableofcontents % } % +% +% \changes{v3.0.1}{2022/02/04}{fix options used by the new version of siunitx} +% +%^^A % ------------------------------------------------------------ +% \section{Compiling \texttt{sankey}} +%^^A % ------------------------------------------------------------ +% +% \changes{v3.0.1}{2022/02/04}{instructions for compiling and installing the +% package} +% +% To produce the \code{sankey} package: +% +% \begin{lstlisting}[style=bashsmall] +% pdflatex sankey.ins # or 'latex sankey.ins' +% \end{lstlisting} +% +% To finish the installation you have to move the +% \code{tikzlibrarydubins.code.tex} and +% \code{sankey.sty} files into a directory searched by \LaTeX. +% +% To compile the \code{sankey} documentation (the +% \code{sankey.pdf} file): +% +% \begin{lstlisting}[style=bashsmall] +% pdflatex sankey.dtx +% makeindex -s gind.ist -o sankey.ind sankey.idx +% pdflatex sankey.dtx +% makeindex -s gind.ist -o sankey.ind sankey.idx +% pdflatex sankey.dtx +% pdflatex sankey.dtx +% \end{lstlisting} +% +% %^^A % ------------------------------------------------------------ % \section{The \texttt{sankey.sty} file} %^^A % ------------------------------------------------------------ @@ -2591,7 +2624,7 @@ % Poorly commented source code... % % \changes{v1.0}{2016/03/06}{first version} -% \changes{v2.0}{2021/01/27}{first public version (on CTAN)} +% \changes{v2.0}{2021/01/27}{first public version (on \CTAN)} % \changes{v3.0}{2021/03/14}{better naming rule} % \changes{v3.0}{2021/03/14}{use .ins and .dtx files} % @@ -2603,7 +2636,7 @@ % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[2015/10/01] -\ProvidesPackage{sankey}[2021/03/14 v3.0 to draw Sankey diagrams] +\ProvidesPackage{sankey}[2022/02/04 v3.0.1 to draw Sankey diagrams] % \end{macrocode} % % All required packages and TikZ libraries: @@ -2806,7 +2839,7 @@ % % The \code{\sankeyset} macro processes % its parameter as a list of comma separated pairs of the form -% \emph{key=value} with the default path set to \texttt{/sankey}. +% \emph{key=value} with \texttt{/sankey} as default path. % % \begin{macrocode} \pgfkeys{/sankey/.is family} @@ -3977,7 +4010,7 @@ % % The \code{\sankeyqtytolen} macro converts quantity % to length using \code{\fpeval} and the ratio determined -% by \code{\snk@totalqty} and \code{sankeytotallen}. +% by \code{\snk@totalqty} and \code{\snk@totallen}. % % \begin{macrocode} \def\sankeyqtytolen##1{\fpeval{(##1)/\snk@totalqty*\snk@totallen}} @@ -4072,34 +4105,54 @@ % \iffalse %<*tikzlibrarydubins.code.tex> % \fi +% \begin{macro}{\tikzlibrarydubins@version} +% \begin{macro}{\tikzlibrarydubins@date} +% \begin{macrocode} +\def\tikzlibrarydubins@version{v3.0.1} +\def\tikzlibrarydubins@date{2022/02/04} +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macrocode} -\def\tikzlibrarydubins@version{v3.0} -\def\tikzlibrarydubins@date{2021/03/14} - \usetikzlibrary{calc} \RequirePackage{etoolbox} \RequirePackage{xfp} \newbool{dubinspathreverse} - +% \end{macrocode} +% +% \begin{macro}{\ifpgfmathcond} +% \begin{macrocode} \def\ifpgfmathcond#1{% \pgfmathparse{(#1)?1:0}% \ifnumequal{\pgfmathresult}{1}% } - - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@getxy} +% \begin{macrocode} \def\dbp@getxy#1#2#3{% \tikz@scan@one@point\pgfutil@firstofone(#3)\relax% \edef#1{\the\pgf@x}% \edef#2{\the\pgf@y}% } - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@anglebetween} +% \begin{macrocode} \def\dbp@anglebetween#1#2#3{%macro, s, t \dbp@getxy\dbp@ax\dbp@ay{#2} \dbp@getxy\dbp@bx\dbp@by{#3} \pgfmathsetmacro#1{atan2(\dbp@by-\dbp@ay,\dbp@bx-\dbp@ax)} } - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@distancebetween} +% \begin{macrocode} \def\dbp@distancebetween#1#2#3{%macro, s, t \dbp@getxy\dbp@ax\dbp@ay{#2} \dbp@getxy\dbp@bx\dbp@by{#3} @@ -4108,7 +4161,10 @@ +(\dbp@by-\dbp@ay)*(\dbp@by-\dbp@ay)% )}}% } - +% \end{macrocode} +% \end{macro} +% \begin{macro}{\dbp@rsr} +% \begin{macrocode} \newcommand\dbp@rsr{% s, sa, t, ta, as, len, at, r let \p{tr}=([shift={(\dbp@angb-90:\dbp@radius pt)}]\dbp@b), @@ -4120,7 +4176,11 @@ -- ([shift={(\p{tr})}]\n3:\dbp@rradius pt) arc(\n3:\n2:\dbp@rradius pt) } - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@lsl} +% \begin{macrocode} \newcommand\dbp@lsl{% s, sa, t, ta, as, len, at, r let \p{tl}=([shift={(\dbp@angb+90:\dbp@radius pt)}]\dbp@b), @@ -4131,7 +4191,11 @@ -- ([shift={(\p{tl})}]\n4:\dbp@lradius pt) arc(\n4:\n3:\dbp@lradius pt) } - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@rsl} +% \begin{macrocode} \newcommand\dbp@rsl{% s, sa, t, ta, as, len, at, r let \p{tl}=([shift={(\dbp@angb+90:\dbp@radius pt)}]\dbp@b), @@ -4142,7 +4206,11 @@ -- ([shift={(\p{tl})}]\n4:\dbp@lradius pt) arc(\n4:\n3:\dbp@lradius pt) } - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@lsr} +% \begin{macrocode} \newcommand\dbp@lsr{% s, sa, t, ta, as, len, at, r let \p{tr}=([shift={(\dbp@angb-90:\dbp@radius pt)}]\dbp@b), @@ -4153,7 +4221,11 @@ -- ([shift={(\p{tr})}]\n4:\dbp@rradius pt) arc(\n4:\n3:\dbp@rradius pt) } - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@lrl} +% \begin{macrocode} \newcommand\dbp@lrl{% s, sa, t, ta, as, ai, at, r let \n1={\dbp@anga-90},\n2={\n1+\dbp@firstangle}, @@ -4163,7 +4235,11 @@ arc(\n2+180:\n2+180-\dbp@midparam:\dbp@rradius pt) arc(\n4:\n3:\dbp@lradius pt) } - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@rlr} +% \begin{macrocode} \newcommand\dbp@rlr{% s, sa, t, ta, as, ai, at, r let \n1={\dbp@anga+90},\n2={\n1-\dbp@firstangle}, @@ -4173,14 +4249,47 @@ arc(\n2+180:\n2+180+\dbp@midparam:\dbp@lradius pt) arc(\n4:\n3:\dbp@rradius pt) } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@rev@lsl} +% \begin{macrocode} \newcommand\dbp@rev@lsl{\dbp@rsr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@rev@rsr} +% \begin{macrocode} \newcommand\dbp@rev@rsr{\dbp@lsl} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@rev@lsr} +% \begin{macrocode} \newcommand\dbp@rev@lsr{\dbp@lsr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@rev@rsl} +% \begin{macrocode} \newcommand\dbp@rev@rsl{\dbp@rsl} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@rev@lrl} +% \begin{macrocode} \newcommand\dbp@rev@lrl{\dbp@rlr} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@rev@rlr} +% \begin{macrocode} \newcommand\dbp@rev@rlr{\dbp@lrl} - - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dubinspath} +% \begin{macrocode} \newcommand\dubinspath[1]{% \pgfextra{ \dubinspathset{#1} @@ -4208,10 +4317,12 @@ } \csname dbp@\dbp@method\endcsname% } - - -%% solution - +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbp@store} +% \begin{macro}{\dbp@get} +% \begin{macrocode} \def\dbp@store#1#2{% \expandafter\xdef\csname dbp@store@#1@#2\endcsname% {\csname dbp@#2\endcsname}% @@ -4219,7 +4330,11 @@ \def\dbp@get#1#2{% \csname dbp@store@#1@#2\endcsname% } - +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\dbp@setparams} +% \begin{macrocode} \def\dbp@setparams#1#2#3#4#5{% % method, length, fisrt angle, middle param, last angle \edef\dbp@method{#1} @@ -4233,13 +4348,19 @@ } }{} } - +% \end{macrocode} +% \end{macro} +% \begin{macro}{\dbp@updateparams} +% \begin{macrocode} \def\dbp@updateparams#1#2#3#4#5{ \ifpgfmathcond{#2<\dbp@length}{ \dbp@setparams{#1}{#2}{#3}{#4}{#5} }{} } - +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} \tikzset{ dubins path/.is family, dubins path, @@ -4270,9 +4391,17 @@ middle param/.store in=\dbp@midparam, reverse/.is if=dubinspathreverse, } - +% \end{macrocode} +% +% \begin{macro}{\dubinspathset} +% \begin{macrocode} \newcommand\dubinspathset[1]{\tikzset{dubins path,#1}} - +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\dubinspathcalc} +% \begin{macrocode} \newcommand\dubinspathcalc[1]{% \begingroup \dubinspathset{#1} @@ -4428,6 +4557,7 @@ \endgroup } % \end{macrocode} +% \end{macro} % \iffalse % % \fi @@ -4441,7 +4571,7 @@ % % \iffalse %<*sankeydocpreamble> -\usepackage[paper=a4paper,vmargin=1.5cm,left=4.5cm,right=3.5cm]{geometry} +\usepackage[paper=a4paper,vmargin=1.5cm,left=4.5cm,right=3.5cm,marginparwidth=3.5cm]{geometry} \usepackage[utf8]{inputenc} \usepackage{cmap} \usepackage[T1]{fontenc} @@ -4449,6 +4579,7 @@ \usepackage[final,protrusion=true,expansion=true]{microtype} \usepackage{xcolor} \PassOptionsToPackage{final,colorlinks,linkcolor=red!60!orange!85!black}{hyperref} +\usepackage{dtxdescribe} \usepackage[numbered]{hypdoc} \usepackage{fancyvrb} \usepackage[final]{listings} @@ -4467,7 +4598,7 @@ \embedfile[mimetype=text/plain]{sankey.ins} \usepackage{sankey} -\colorlet{bgcode}{yellow!50!gray!5} +\colorlet{bgcode}{yellow!50!gray!10} \colorlet{keyword}{blue!50!cyan!50!black} \colorlet{comment}{red!75!black} @@ -4524,6 +4655,14 @@ \lstdefinestyle{textscriptsize}{basicstyle=\color{black}\scriptsize\mdseries\ttfamily} \lstdefinestyle{texttiny}{basicstyle=\color{black}\tiny\mdseries\ttfamily} +\lstdefinestyle{bash}{ + language=bash, + backgroundcolor=\color{gray!10}, +} +\lstdefinestyle{bashsmall}{style=bash,style=textsmall} +\lstdefinestyle{bashfootnotesize}{style=bash,style=footnotesize} +\lstdefinestyle{bashscriptsize}{style=bash,style=scriptsize} + \lstdefinestyle{LaTeX}{ language=[LaTeX]TeX, moretexcs={ @@ -4595,6 +4734,7 @@ \begingroup % \def\keypath{#1}% + \ifdefempty{\keypath}{\def\keypath{\sankeykeysprefix}}{}% \def\key{#2}% \def\val{#3}% \def\default{#4}% @@ -4603,9 +4743,10 @@ % \vspace{.25\baselineskip plus .25\baselineskip minus 0mm} \parfillskip 0pt plus 1fil% \leavevmode% + \DescribeKey{\key}% \ttfamily% - \hspace*{-1cm}% - \textcolor{red!75!black}{\texttt{\docprefix{\ifdefempty{\keypath}{\sankeykeysprefix/}{\keypath/}}\key}}% + %\hspace*{-1cm}% + \textcolor{red!75!black}{\texttt{\docprefix{\keypath/}\key}}% \ifdefempty{\val}{}{=\val}% \hfill% \ifdefempty{\default}{\null}{(default:\,\constant{\default})}% @@ -4619,7 +4760,7 @@ \enditemize% } -\newcommand\MACRO{\hspace*{-1cm}} +\newcommand\MACRO{\hspace*{0cm}} \newlist{sankeyconstantsdesc}{description}{1} \setlist[sankeyconstantsdesc]{align=right,labelindent=1.5em,labelsep=.5em,leftmargin=!,font=\normalfont} @@ -4664,9 +4805,40 @@ \fontencoding\encodingdefault \fontfamily\ttdefault \fontseries\mddefault - \fontshape\shapedefault - \footnotesize% + \fontshape\updefault + \footnotesize +} + +\renewcommand*{\DescribeMacro}[2][]{% + \@bsphack% + \@ifundefined{@captype}{% not float? + \leavevmode% + \marginpar{% + \hbadness=10000% + \hfuzz=5em% + \raggedleft% + \ifblank{#1}{}{{\scriptsize\textsf{[#1]}} }% class + \MacroFont\cmd{#2}% name + }% marginpar + }{}% not float? + \begingroup% + \DTXD@origwrindex{% + \DTXD@macroname{#2}\actualchar\DTXD@verbatimcmd{#2}% name + \ifblank{#1}{}{\levelchar[#1]}% class + \encapchar usage}% + \ifblank{#1}% + {}% no class + {% class given + \begingroup% + \DTXD@origwrindex{% + #1\actualchar[#1]:\levelchar% + \DTXD@macroname{#2}\actualchar\DTXD@verbatimcmd{#2}% + \encapchar usage}% + }% class given + \@esphack% + \ignorespaces% } + % % \fi \endinput -- cgit v1.2.3