texlive[63603] Master/texmf-dist: pgf-pie (15jun22)

commits+karl at tug.org commits+karl at tug.org
Wed Jun 15 22:10:06 CEST 2022


Revision: 63603
          http://tug.org/svn/texlive?view=revision&revision=63603
Author:   karl
Date:     2022-06-15 22:10:05 +0200 (Wed, 15 Jun 2022)
Log Message:
-----------
pgf-pie (15jun22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md
    trunk/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.pdf
    trunk/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.tex
    trunk/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty
    trunk/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex

Modified: trunk/Master/texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md	2022-06-15 14:37:45 UTC (rev 63602)
+++ trunk/Master/texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md	2022-06-15 20:10:05 UTC (rev 63603)
@@ -1,14 +1,9 @@
 # New features
 
-pgf-pie now wraps the entire pie into a \scope environment and additionally
-defers lookup of unknown /pgfpie keys to the /pgf and /tikz namespaces. This
-paves the way for all kinds of improvements such as easy setting of global pie
-options like font or placement on the background layer. Further is allows
-referring to the pie as a node via local bounding box and moving the pie around
-on the canvas using the shift key.
+The new option `change direction` will order the slices counterclockwise instead
+of the default clockwise.
 
 # Bug fixes
 
-pgf-pie tokenizes its arguments which led to breakage when used with babel.
-For now, babel functionality is simply disabled for the entire pie.
-
+The `\pie`command did not escape spaces properly which prevented using options
+starting with a spaces. #14

Added: trunk/Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex	2022-06-15 20:10:05 UTC (rev 63603)
@@ -0,0 +1,5 @@
+\begin{tikzpicture}
+  \pie[radius=2]{10/A, 20/B, 30/C, 40/D}
+
+  \pie[pos={6,0}, change direction, radius=2]{10/A, 20/B, 30/C, 40/D}
+\end{tikzpicture}


Property changes on: trunk/Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.tex	2022-06-15 14:37:45 UTC (rev 63602)
+++ trunk/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.tex	2022-06-15 20:10:05 UTC (rev 63603)
@@ -2,6 +2,15 @@
 % chart. Written by Xu Yuan <xuyuan.cn at gmail.com> This file is part of
 % pgf-pie you may get it at https://github.com/pgf-tikz/pgf-pie
 
+\PassOptionsToPackage{%
+  colorlinks=true,
+  linkcolor=blue,
+  anchorcolor=black,
+  citecolor=olive,
+  filecolor=magenta,
+  menucolor=red,
+  urlcolor=blue
+}{hyperref}
 \documentclass{ltxdoc}
 
 \usepackage{pgf-pie}
@@ -27,16 +36,6 @@
   },
 }
 
-\usepackage[
-  colorlinks=true,
-  linkcolor=blue,
-  anchorcolor=black,
-  citecolor=olive,
-  filecolor=magenta,
-  menucolor=red,
-  urlcolor=blue
-]{hyperref}
-
 \newcommand\pgfpiename{\texttt{pgf-pie}}
 
 \begin{document}
@@ -43,7 +42,7 @@
 
 \title{Drawing Pie Chart by using \pgfpiename}
 \author{\href{mailto:xuyuan.cn at gmail.com}{Yuan Xu}}
-\date{\today{}~(v0.6)}
+\date{\today{}~(v0.7)}
 \maketitle
 
 \begin{abstract}
@@ -103,6 +102,11 @@
 
 \codeexample[scale=0.4,from file={demo/sum.tex}]
 
+\subsection{Slice order}
+The slices order direction can be set to clockwise by setting |change direction|, default is counterclockwise.
+
+\codeexample[scale=0.4,from file={demo/change-direction.tex}]
+
 \subsection{Text}
 
 \subsubsection{Number}

Modified: trunk/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty	2022-06-15 14:37:45 UTC (rev 63602)
+++ trunk/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty	2022-06-15 20:10:05 UTC (rev 63603)
@@ -1,6 +1,6 @@
 % SPDX-License-Identifier: GPL-2.0-only OR LPPL-1.3c
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{pgf-pie}[2021/07/30 v0.6 Some LaTeX macros for pie
+\ProvidesPackage{pgf-pie}[2022/06/14 v0.7 Some LaTeX macros for pie
 chart by using PGF/Tikz package.]
 \RequirePackage{tikz}
 \usetikzlibrary{pie}

Modified: trunk/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex	2022-06-15 14:37:45 UTC (rev 63602)
+++ trunk/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex	2022-06-15 20:10:05 UTC (rev 63603)
@@ -73,7 +73,12 @@
   % slice
   \draw[line join=round,fill={#6},\pgfpie at style] (pgfpie at O) -- ++({#1}:{#7}) arc ({#1}:{#2}:{#7}) -- cycle;
 
-  \pgfmathparse{min(((#2)-(#1)-10)/110*(-0.3),0)}
+  \pgfpie at ifchangedirection{%
+    \pgfmathparse{min(((#1)-(#2)-10)/110*(-0.3),0)}
+  }{%
+    \pgfmathparse{min(((#2)-(#1)-10)/110*(-0.3),0)}
+  }%
+  
   \pgfmathparse{(max(\pgfmathresult,-0.5) + 0.8)*(#7)}
   \let\pgfpie at innerpos\pgfmathresult
 
@@ -182,6 +187,9 @@
 
 \pgfpie at newif{legend}
 
+\pgfpie at newif{changedirection}
+\pgfqkeys{/pgfpie}{change direction/.is if=pgfpie at changedirection}
+
 \pgfpie at newif{square}
 \pgfqkeys{/pgfpie}{square/.is if=pgfpie at square}
 
@@ -233,6 +241,7 @@
     text=label,
     sum=100,
     rotate=0,
+    change direction=false,
     polar=false,
     square=false,
     cloud=false,
@@ -239,7 +248,7 @@
     scale font=false,
     hide number=false,
     hide label=false,
-    every pie/.try,
+    every pie/.try,%
     % load user's parameters
     #1]
 
@@ -430,6 +439,9 @@
     \xdef\pgfpie at theradius{\pgfpie at radius}%
   }
 
+  \pgfpie at ifchangedirection{%
+    \pgfmathsetlength{\pgfpie at angleEnd}{\pgfpie at sum}
+  }{}%
   \xdef\pgfpie at angleBegin{\the\pgfpie at angleEnd}
   % drawing loop
   \foreach \pgfpie at p/\pgfpie at t [count=\pgfpie at i from 0] in {#1}
@@ -441,9 +453,13 @@
       \pgfmathparse{sqrt(\pgfpie at p) * (\pgfpie at polarRadiusUnit)}
       \xdef\pgfpie at theradius{\pgfmathresult}
     }{%
-    % normal pie
-    \pgfmathaddtolength{\pgfpie at angleEnd}{\pgfpie at p}
-    }
+      % normal pie
+      \pgfpie at ifchangedirection{%
+        \pgfmathaddtolength{\pgfpie at angleEnd}{-(\pgfpie at p)}
+      }{%
+        \pgfmathaddtolength{\pgfpie at angleEnd}{\pgfpie at p}
+      }%
+    }%
 
     % find explode
     \pgfpie at findExplode{\pgfpie at i}



More information about the tex-live-commits mailing list.