diff options
author | Norbert Preining <norbert@preining.info> | 2022-06-16 03:01:30 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-06-16 03:01:30 +0000 |
commit | b83d15e1ff2e551eb7391d45becd87dce59d39b8 (patch) | |
tree | 756378eacbe575ca119b77f81022940f022c69d9 /graphics/pgf | |
parent | da68bce1d25d68087ca3b70134a61ae1c3a96b67 (diff) |
CTAN sync 202206160301
Diffstat (limited to 'graphics/pgf')
-rw-r--r-- | graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md | 13 | ||||
-rw-r--r-- | graphics/pgf/contrib/pgf-pie/demo/change-direction.tex | 5 | ||||
-rw-r--r-- | graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf | bin | 193458 -> 196172 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex | 26 | ||||
-rw-r--r-- | graphics/pgf/contrib/pgf-pie/pgf-pie.sty | 2 | ||||
-rw-r--r-- | graphics/pgf/contrib/pgf-pie/tikzlibrarypie.code.tex | 26 |
6 files changed, 46 insertions, 26 deletions
diff --git a/graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md b/graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md index 7f474da868..ae1e23bb9c 100644 --- a/graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md +++ b/graphics/pgf/contrib/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/graphics/pgf/contrib/pgf-pie/demo/change-direction.tex b/graphics/pgf/contrib/pgf-pie/demo/change-direction.tex new file mode 100644 index 0000000000..1320c83199 --- /dev/null +++ b/graphics/pgf/contrib/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/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf b/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf Binary files differindex 6a6cc8411e..7eea54092a 100644 --- a/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf +++ b/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf diff --git a/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex b/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex index a63da31139..0c872212a2 100644 --- a/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex +++ b/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex @@ -2,6 +2,15 @@ % chart. Written by Xu Yuan <xuyuan.cn@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,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/graphics/pgf/contrib/pgf-pie/pgf-pie.sty b/graphics/pgf/contrib/pgf-pie/pgf-pie.sty index 05e8e85ec5..ec8740ff2d 100644 --- a/graphics/pgf/contrib/pgf-pie/pgf-pie.sty +++ b/graphics/pgf/contrib/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/graphics/pgf/contrib/pgf-pie/tikzlibrarypie.code.tex b/graphics/pgf/contrib/pgf-pie/tikzlibrarypie.code.tex index 6612fceb13..8b2963dd7a 100644 --- a/graphics/pgf/contrib/pgf-pie/tikzlibrarypie.code.tex +++ b/graphics/pgf/contrib/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} |