From 29ef80d3c855001d3deca15a21d4f6a49afb34b4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 15 Jun 2022 20:10:05 +0000 Subject: pgf-pie (15jun22) git-svn-id: svn://tug.org/texlive/trunk@63603 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md | 13 ++++------- .../doc/latex/pgf-pie/demo/change-direction.tex | 5 ++++ .../doc/latex/pgf-pie/pgf-pie-manual.pdf | Bin 193458 -> 196172 bytes .../doc/latex/pgf-pie/pgf-pie-manual.tex | 26 ++++++++++++--------- Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty | 2 +- .../tex/latex/pgf-pie/tikzlibrarypie.code.tex | 26 +++++++++++++++++---- 6 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md b/Master/texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md index 7f474da868c..ae1e23bb9cf 100644 --- a/Master/texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md +++ b/Master/texmf-dist/doc/latex/pgf-pie/RELEASE_NOTES.md @@ -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 diff --git a/Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex b/Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex new file mode 100644 index 00000000000..1320c831993 --- /dev/null +++ b/Master/texmf-dist/doc/latex/pgf-pie/demo/change-direction.tex @@ -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} diff --git a/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.pdf b/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.pdf index 6a6cc8411e3..7eea54092a2 100644 Binary files a/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.pdf and b/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.pdf differ diff --git a/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.tex b/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.tex index a63da311393..0c872212a2e 100644 --- a/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.tex +++ b/Master/texmf-dist/doc/latex/pgf-pie/pgf-pie-manual.tex @@ -2,6 +2,15 @@ % chart. Written by Xu Yuan 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,23 +36,13 @@ }, } -\usepackage[ - colorlinks=true, - linkcolor=blue, - anchorcolor=black, - citecolor=olive, - filecolor=magenta, - menucolor=red, - urlcolor=blue -]{hyperref} - \newcommand\pgfpiename{\texttt{pgf-pie}} \begin{document} \title{Drawing Pie Chart by using \pgfpiename} \author{\href{mailto:xuyuan.cn@gmail.com}{Yuan Xu}} -\date{\today{}~(v0.6)} +\date{\today{}~(v0.7)} \maketitle \begin{abstract} @@ -103,6 +102,11 @@ number value and |sum|. \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} diff --git a/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty b/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty index 05e8e85ec50..ec8740ff2d0 100644 --- a/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty +++ b/Master/texmf-dist/tex/latex/pgf-pie/pgf-pie.sty @@ -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} diff --git a/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex b/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex index 6612fceb139..8b2963dd7aa 100644 --- a/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex +++ b/Master/texmf-dist/tex/latex/pgf-pie/tikzlibrarypie.code.tex @@ -73,7 +73,12 @@ % slice \draw[line join=round,fill={#6},\pgfpie@style] (pgfpie@O) -- ++({#1}:{#7}) arc ({#1}:{#2}:{#7}) -- cycle; - \pgfmathparse{min(((#2)-(#1)-10)/110*(-0.3),0)} + \pgfpie@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@innerpos\pgfmathresult @@ -182,6 +187,9 @@ \pgfpie@newif{legend} +\pgfpie@newif{changedirection} +\pgfqkeys{/pgfpie}{change direction/.is if=pgfpie@changedirection} + \pgfpie@newif{square} \pgfqkeys{/pgfpie}{square/.is if=pgfpie@square} @@ -233,13 +241,14 @@ text=label, sum=100, rotate=0, + change direction=false, polar=false, square=false, cloud=false, 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@theradius{\pgfpie@radius}% } + \pgfpie@ifchangedirection{% + \pgfmathsetlength{\pgfpie@angleEnd}{\pgfpie@sum} + }{}% \xdef\pgfpie@angleBegin{\the\pgfpie@angleEnd} % drawing loop \foreach \pgfpie@p/\pgfpie@t [count=\pgfpie@i from 0] in {#1} @@ -441,9 +453,13 @@ \pgfmathparse{sqrt(\pgfpie@p) * (\pgfpie@polarRadiusUnit)} \xdef\pgfpie@theradius{\pgfmathresult} }{% - % normal pie - \pgfmathaddtolength{\pgfpie@angleEnd}{\pgfpie@p} - } + % normal pie + \pgfpie@ifchangedirection{% + \pgfmathaddtolength{\pgfpie@angleEnd}{-(\pgfpie@p)} + }{% + \pgfmathaddtolength{\pgfpie@angleEnd}{\pgfpie@p} + }% + }% % find explode \pgfpie@findExplode{\pgfpie@i} -- cgit v1.2.3