diff options
Diffstat (limited to 'graphics/pgf')
164 files changed, 13681 insertions, 3520 deletions
diff --git a/graphics/pgf/contrib/aiplans/Aiplans-Introduction.pdf b/graphics/pgf/contrib/aiplans/Aiplans-Introduction.pdf Binary files differnew file mode 100644 index 0000000000..9c8cc89460 --- /dev/null +++ b/graphics/pgf/contrib/aiplans/Aiplans-Introduction.pdf diff --git a/graphics/pgf/contrib/aiplans/LICENSE.txt b/graphics/pgf/contrib/aiplans/LICENSE.txt new file mode 100644 index 0000000000..4db9b5af29 --- /dev/null +++ b/graphics/pgf/contrib/aiplans/LICENSE.txt @@ -0,0 +1,415 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % This work may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://www.latex-project.org/lppl.txt + % and version 1.3 or later is part of all distributions of LaTeX + % version 2005/12/01 or later. + % + % This work has the LPPL maintenance status `maintained'. + % + % The Current Maintainer of this work is M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. diff --git a/graphics/pgf/contrib/aiplans/README.md b/graphics/pgf/contrib/aiplans/README.md new file mode 100644 index 0000000000..7e50eef9c0 --- /dev/null +++ b/graphics/pgf/contrib/aiplans/README.md @@ -0,0 +1,80 @@ +# <aiplans>: A TikZ-Based Library for Drawing POCL Plans
+
+<aiplans> is a specialized LaTeX package designed to assist scientists, students, and professionals in creating high-quality graphical representations, particularly Partial Order Causal Link (POCL) plans. Built on the robust TikZ framework, this library simplifies the process of generating complex, precise diagrams that are essential for academic and scientific communication. Our package is especially useful in fields such as artificial intelligence and automated planned, where visualizing causal relationships and dependencies is fundamental.
+
+## Content
+
+- [Project Structure](#project-structure)
+- [License](#license)
+- [Future Improvements Plan](#future-improvements-plan)
+- [Contact Information](#contact-information)
+- [Team Members](#team-members)
+
+## Project Structure
+
+Aiplans/
+
+├── **README.md**
+
+├── **README.pdf**
+
+├── **Aiplans-Introdution-source-code.zip**
+
+├── **Aiplans-Introdution.pdf**
+
+├── **tikzlibraryaiplans.code.tex**
+
+└── **License.txt**
+
+
+### Explanation
+
+- **README**: This file provides an overview of the project, including installation instructions, system requirements, and other essential information.
+- **Aiplans-Introdution-source-code.zip**: Introduction file Latex source code.
+- **Aiplans-Introdution.pdf**: Detailed instructions on how to use the TikZ library included in this package. It covers the steps needed to generate diagrams using LaTeX.
+- **tikzlibraryaiplans.code.tex**: The core of the project, this file contains the TikZ library specifically designed for generating AI plan diagrams. This package is crucial for the functionality provided by this project.
+- **License.txt**: The license file outlines the terms under which the package can be used, modified, and distributed.
+
+
+## License
+
+This material is subject to the [LaTeX Project Public License 1.3c](https://ctan.org/license/lppl1.3).
+
+## Future Improvements Plan
+
+As we continue to improve and expand the `<aiplans>` package, the following developments are planned for the upcoming future:
+
+### In Scope
+
+1. **Extension Features for v1.0**:
+ - **Vertical Diagram Support**: We aim to enhance the package by introducing the ability to create vertical diagrams, which will provide more flexibility in visualizing POCL plans.
+ - **Dynamic Precondition/Effect Lengths**: After the package update, the lengths of the lines will be automatically adjusted based on the actual length of the text labels. In other words, if the label's text content is longer, the corresponding line will also be lengthened; if the label's text content is shorter, the line will be shortened accordingly. This dynamic adjustment allows the diagram to more flexibly adapt to various content requirements, resulting in a final diagram that is more visually appealing and clear.
+
+2. **Code Translator**:
+ - **PDDL/HDDL Code Translation**: We are developing a code translator that can accurately convert PDDL (Planning Domain Definition Language) and HDDL (Hierarchical Domain Definition Language) code into the schema format used by our `<aiplans>` library. This feature will streamline the process of diagram creation from existing codebases or at least allow to specify the tikz code in another syntax that might be more familiar to some.
+
+## Contact Information
+
+If you have any questions, feedback, or suggestions regarding this project, please feel free to reach out to us. We are always happy to assist and appreciate your input.
+
+**Email:** [u7166251@anu.edu.au](mailto:u7166251@anu.edu.au) (Yikai Ge)
+For reporting bugs or requesting features.
+
+We strive to respond to all inquiries as quickly as possible.
+
+## Team Members
+
+This project is developed by a team of students from the Australian National University (ANU), guided by our client. He provided us with the initial idea and relevant references, playing a crucial role in shaping the direction of our research.
+
+### Client
+- **Pascal Bercher**
+
+### Maintainers
+- **Yikai Ge**
+- **Chen Wang**
+- **Cheng Zhou**
+- **Lujia Li**
+- **Yinyin Chen**
+- **Xinni Song**
+
+We have worked closely with our client to ensure that the project meets their requirements and delivers high-quality results.
diff --git a/graphics/pgf/contrib/aiplans/README.pdf b/graphics/pgf/contrib/aiplans/README.pdf Binary files differnew file mode 100644 index 0000000000..cca41d75a7 --- /dev/null +++ b/graphics/pgf/contrib/aiplans/README.pdf diff --git a/graphics/pgf/contrib/aiplans/tikzlibraryaiplans.code.tex b/graphics/pgf/contrib/aiplans/tikzlibraryaiplans.code.tex new file mode 100644 index 0000000000..5b6d23860c --- /dev/null +++ b/graphics/pgf/contrib/aiplans/tikzlibraryaiplans.code.tex @@ -0,0 +1,121 @@ +\ProvidesPackage{aiplan} +\RequirePackage{tikz} +\RequirePackage{listofitems} +\usetikzlibrary{calc} +\usetikzlibrary{decorations.pathreplacing, decorations.markings} + + +\tikzset{ + action/.style n args={8}{ + draw, + minimum width=3cm, + fill=blue, + rounded corners, + minimum height={max(#1,#2)*\baseHeight cm + 0.5*\baseHeight cm}, + label={center:#7}, + append after command={ + \pgfextra{ + % Define the node name + \edef\nodename{\tikzlastnode} + \ifx#3\empty % Check if label list is empty + \else % Process only if not empty + % Read the label content + \setsepchar{,} + \readlist\nameparts{\nodename} + \setsepchar{,} + + \ifnum#8=0\relax + % Define positions for preconditions and effects relative to the node with shifts + \ifnum#1>0 + \readlist\labellist{#3} + \foreach \i in {1,...,#1} { + % Precondition coordinates and lines + \coordinate (\nodename-pre-\i) at ([xshift=-#5cm, yshift=(-\i + (#1)/2+0.25) * \baseHeight cm] \nodename.west); + \draw (\nodename.west |- \nodename-pre-\i) -- +(-#5,0) node [midway, above, sloped, font=\scriptsize] {\labellist[\i]}; + } + \fi; + \readlist\labellist{#4} + \ifnum#2>0 + \foreach \j in {1,...,#2} { + % Effect coordinates and lines + \coordinate (\nodename-eff-\j) at ([xshift=#6cm, yshift=(-\j + (#2)/2+0.25) * \baseHeight cm] \nodename.east); + \draw (\nodename.east |- \nodename-eff-\j) -- +(#6,0) node [midway, above, sloped, font=\scriptsize] {\labellist[\j]}; + } + \fi; + \else + \ifnum#1>0 + \readlist\labellist{#3} + \foreach \i in {1,...,#1} { + % Precondition coordinates and lines + \coordinate (\nodename-pre-\i) at ([xshift=-#5 cm, yshift=(-\i + (#1)/2+0.25) * \baseHeight cm] \nodename.west); + \draw (\nodename.west |- \nodename-pre-\i) -- +(-#5,0) node [midway, anchor=east, xshift=-0.5 cm, sloped, font=\scriptsize]{\labellist[\i]}; + } + \fi; + \readlist\labellist{#4} + \ifnum#2>0 + \foreach \j in {1,...,#2} { + % Effect coordinates and lines + \coordinate (\nodename-eff-\j) at ([xshift=#6 cm, yshift=(-\j + (#2)/2+0.25) * \baseHeight cm] \nodename.east); + \draw (\nodename.east |- \nodename-eff-\j) -- +(#6,0) node [midway,anchor=west, xshift=0.5 cm, font=\scriptsize] {\labellist[\j]}; + } + \fi; + \fi; + \fi; + } + }, + label content/.initial={#3} + } +} + + +% Common base style for nodes +\tikzset{ + % COMMENT MISSING + base/.style n args={5}{ + draw, + minimum width=0.05cm, + fill=black, + minimum height={#1*\baseHeight cm}, + append after command={ + \pgfextra{ + \edef\nodename{\tikzlastnode} + \setsepchar{,} + \readlist\labellist{#2} + \foreach \i in {1,...,#1} { + \coordinate (\nodename-#5-\i) at ([xshift=#3 cm, yshift=(-\i + (#1)/2+0.25) * \baseHeight cm] \nodename.#4); + \draw (\nodename.#4 |- \nodename-#5-\i) -- +(#3,0) + node [midway, above, sloped, font=\scriptsize] {\labellist[\i]}; + } + } + } + } +} + +\tikzset{ + % Init style + init/.style n args={3}{ + base={#1}{#2}{#3}{east}{eff} + } +} + +\tikzset{ + % Goal style + goal/.style n args={3}{ + base={#1}{#2}{-#3}{west}{pre} + } +} + + + +\tikzset{ + dot/.style={ + circle,fill,inner sep=0.1em + } +} + +\tikzset{ + causallink/.style={ + ->, shorten <= 0.2cm, shorten >= 0.1cm + } +} + diff --git a/graphics/pgf/contrib/argumentation/README.md b/graphics/pgf/contrib/argumentation/README.md index b0df71dbd0..b015ce3555 100644 --- a/graphics/pgf/contrib/argumentation/README.md +++ b/graphics/pgf/contrib/argumentation/README.md @@ -4,5 +4,5 @@ The argumentation package provides utility to create abstract argumentation fram For bug reports and feedback, please contact: Lars Bengel <lars.bengel@fernuni-hagen.de> -Version: 1.2 [2024/06/07] +Version: 1.4 [2024/11/03] This package is subject to the LaTeX Project Public License 1.3c
\ No newline at end of file diff --git a/graphics/pgf/contrib/argumentation/argumentation-doc.pdf b/graphics/pgf/contrib/argumentation/argumentation-doc.pdf Binary files differindex 48f396a1fe..f9c4defd43 100644 --- a/graphics/pgf/contrib/argumentation/argumentation-doc.pdf +++ b/graphics/pgf/contrib/argumentation/argumentation-doc.pdf diff --git a/graphics/pgf/contrib/argumentation/argumentation-doc.tex b/graphics/pgf/contrib/argumentation/argumentation-doc.tex index d524e50afd..58fa51c006 100644 --- a/graphics/pgf/contrib/argumentation/argumentation-doc.tex +++ b/graphics/pgf/contrib/argumentation/argumentation-doc.tex @@ -1,142 +1,164 @@ -\documentclass{article} - -\title{The \argumentation Package} -\author{Lars Bengel\footnote{Please report any issues at \url{https://github.com/aig-hagen/tikz_argumentation}}\\\small lars.bengel@fernuni-hagen.de} -\date{Version 1.2 [2024/06/07]} - -%%%%%%%%% IMPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage[]{argumentation} % Main Package -\usepackage{amsmath} % For example environment -\usepackage{xspace} % For dynamic spacing after commands -\usepackage{xcolor} % Coloring -\usepackage[hidelinks]{hyperref} % Hyperlinks -\usepackage{subcaption} % For two-part figures +\documentclass{scrartcl} + +\usepackage[top=1.35in, bottom=1.33in, left=1.35in, right=1.35in]{geometry} +\usepackage[macros,beamer]{argumentation} % Main Package +\usepackage[T1]{fontenc} % Font Encoding +\usepackage[utf8]{inputenc} % Input font encoding +\usepackage[english]{babel} % Language +\usepackage{subcaption} % Multi-part Figures +\usepackage[nohyperref]{doc} % Showing Commands (must load before tcolorbox) +\usepackage[breakable]{tcolorbox} % Fancier Examples +\usepackage{booktabs} % Fancier Tables +\usepackage{enumitem} % Fancier Enumeration +\usepackage[hidelinks, % Setting Meta-Data and hyperlinks + pdfauthor={Lars Bengel}, + pdftitle={The argumentation LaTeX-package}, + pdfsubject={Documentation of the argumentation LaTeX-package}, + pdfkeywords={argumentation,tikz,graphs}]{hyperref} + +%%% Document settings +\KOMAoptions{ + paper=a4, + fontsize=10pt, + cleardoublepage=empty, + footinclude=true +} %%% Various commands used in the document \newcommand{\todo}[1]{\textcolor{magenta}{TODO: #1}} % for todos \newcommand{\tikzname}{Ti\emph{k}Z\xspace} \newcommand{\argumentation}{\texttt{argumentation}\xspace} -\newcommand{\opt}[2][red]{\ensuremath{\textcolor{#1}{\langle #2\rangle}}} \newtheorem{example}{Example} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\tcolorboxenvironment{example}{colframe=aigblue,colback=aigyellow!30,breakable,before skip=10pt,after skip=10pt} +\newcommand{\mopt}[2][red]{\textcolor{#1}{\ttfamily \meta{#2}}} +\newcommand{\oopt}[2][orange]{\textcolor{#1}{\ttfamily \meta{#2}}} +\newcommand{\popt}[2][magenta]{\textcolor{#1}{\ttfamily \meta{#2}}} +\newcommand{\sopt}[2][green]{\textcolor{#1}{\ttfamily \meta{#2}}} + +%%% Taken from ltxdoc-class +\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}} +\def\cmd@to@cs#1#2{\char\number`#2\relax} +\DeclareRobustCommand\cs[2][-1.6cm]{\hspace{#1}\texttt{\char`\\#2}} + +\title{The \argumentation Package} +\author{Lars Bengel\footnote{Please report any issues at \url{https://github.com/aig-hagen/tikz_argumentation}}\\\small lars.bengel@fernuni-hagen.de} +\date{Version 1.4 [2024/11/03]} \begin{document} \maketitle -\begin{minipage}{.28\textwidth} +\begin{minipage}{.26\textwidth} \centering - \begin{af} - \argument{$a$} - \argument[right=of a1]{$b$} - \argument[below=of a1]{$c$} - \argument[right=of a3]{$d$} + \begin{af}[argumentstyle=gray,namestyle=monospace] + \argument{a} + \argument[right=of a1]{b} + \argument[below=of a1]{c} + \argument[right=of a3]{d} \attack{a1}{a2} \attack{a2}{a3} \attack[bend right]{a3}{a4} + \label{af:example} \end{af} \end{minipage} \begin{minipage}{.5\textwidth} + \begin{small} \begin{verbatim} - \begin{af} - \argument{$a$} - \argument[right=of a1]{$b$} - \argument[below=of a1]{$c$} - \argument[right=of a3]{$d$} + \begin{af}[argumentstyle=gray,namestyle=monospace] + \argument{a} + \argument[right=of a1]{b} + \argument[below=of a1]{c} + \argument[right=of a3]{d} \attack{a1}{a2} \attack{a2}{a3} \attack[bend right]{a3}{a4} + \label{af:example} \end{af} \end{verbatim} + \end{small} \end{minipage} \tableofcontents \newpage +%\sffamily %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Quick Guide}\label{sec:quick} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - \noindent -To create an argumentation framework in your \LaTeX document, you have to import the \argumentation package:\\ +To create an argumentation framework in your \LaTeX-document, you first have to import the \argumentation package in the preamble:\\ -\vspace{-0.3cm} -\verb|\usepackage{argumentation}|\\ +\noindent\cs[0cm]{usepackage\{argumentation\}}\\ -\noindent You can then create a new \texttt{af} environment in which the argumentation framework can then be built:\\ -\vspace{-0.3cm} -\verb|\begin{af}| +\noindent\cs[0cm]{begin\{af\}} -\quad\opt[green]{environment~content} +\quad\sopt{environment~contents} -\verb|\end{af}|\\ +\noindent\cs[0cm]{end\{af\}}\\ -\noindent You may want to wrap the \texttt{af} environment in a \texttt{figure} environment in order to add a caption and reference label. -The easiest way to create an argument in the argumentation framework is:\\ +You can also add a label inside the \texttt{af} environment via \verb|\label{|\sopt{label}\verb|}|. +Anywhere in your document, you can then reference the af with \verb|\ref{|\sopt{label}\verb|}|. -\vspace{-0.3cm} -\verb|\argument{|\opt{name}\verb|}|\\ +Inside the \texttt{af} environment, you can then add an argument as follows:\\ -\noindent -Here, \opt{name} is the name of the argument displayed in the graph and the argument is automatically assigned an \emph{identifier} of the form: $a1$, $a2$, \dots. +\noindent\cs[0cm]{argument\{\mopt{name}\}}\\ + +Here, \mopt{name} is the name of the argument displayed in the graph and the argument is automatically assigned an \emph{identifier} of the form: $a1$, $a2$, \dots. To properly add further arguments, you also need to specify a position. The \argumentation package offers two easy ways of doing that:\\ -\vspace{-0.3cm} -\verb|\argument[|\opt{dir}\verb|=of |\opt{arg\_id}\verb|]{|\opt{name}\verb|}| +\noindent\cs[0cm]{argument[\mopt{dir}=of \mopt{argId}]\{\mopt{name}\}}\\ -\verb|\argument{|\opt{name}\verb|}| \verb|at (|\opt{posX},\opt{posY}\verb|)|\\ +\noindent\cs[0cm]{argument\{\mopt{name}\} at (\popt{posX},\popt{posY})}\\ -\noindent -The first instance is \emph{relative position} where \opt{dir} is the direction of placement relative to the argument with the identifier \opt{arg\_id}, with \opt{dir} typically being one of the values: \textsf{right}, \textsf{left}, \textsf{above}, \textsf{below}. +The first instance is \emph{relative positioning} where \mopt{dir} is the direction of placement relative to the argument with the identifier \mopt{argId}, with \mopt{dir} typically being one of: \textsf{right}, \textsf{left}, \textsf{above}, \textsf{below}. -The second instance is \emph{absolute positioning} where (\opt{posX}, \opt{posY}) is a set of coordinates, for example something like $(2, 0)$, $(0, -2)$ or $(2, 4)$.\\ +The second instance is \emph{absolute positioning} where \texttt{(\popt{posX}, \popt{posY})} is a set of coordinates, for example something like $\texttt{(2, 0)}$, $\texttt{(0, -2)}$ or $\texttt{(-1, 3.5)}$. -\noindent -To create an attack between two arguments, you simply use the command:\\ +The next step is adding attacks. +For that you can simply use the following command:\\ -\vspace{-0.3cm} -\verb|\attack{|\opt{a1}\verb|}{|\opt{a2}\verb|}|\\ +\noindent\cs[0cm]{attack\{\mopt{a1}\}\{\mopt{a2}\}}\\ \noindent -Substitute \opt{a1} and \opt{a2} with the identifier of the two arguments. +Substitute \mopt{a1} and \mopt{a2} with the identifier of the two arguments. Alternatively, you can also directly create bidirectional attacks and self-attacks with the following two commands:\\ -\vspace{-0.3cm} -\verb|\dualattack{|\opt{a1}\verb|}{|\opt{a2}\verb|}| +\noindent\cs[0cm]{dualattack\{\mopt{a1}\}\{\mopt{a2}\}}\\ +\noindent\cs[0cm]{selfattack\{\mopt{a1}\}}\\ -\verb|\selfattack{|\opt{a1}\verb|}|\\ -\noindent To customize the look of the arguments and attacks and for a detailed overview over all options and commands provided by this package, please refer to the following example or to the full documentation in Section~\ref{sec:documentation}. + +\newpage %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newpage\section{Example}\label{sec:example} +\section{Example Usage}\label{sec:example} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\vspace{-0.7cm} +\vspace{-0.5cm} \begin{figure}[ht] \centering - \begin{af} + \begin{af}[namestyle=math] \argument{a} \argument[right=of a1]{b} \argument[right=of a2]{c} - \argument[right=of a3]{d} + \argument[rejected,right=of a3]{d} \argument[right=of a4,incomplete]{e} \argument[below=of a1]{f} \argument[inactive,right=of a6]{g} - \argument[inactive,argin,right=of a7]{h} + \argument[accepted,right=of a7]{h} \argument[right=of a8]{i} \argument[right=of a9]{j} - %\annotation[right]{a5}{$a\lor b$} + \annotation[right,yshift=-0.4cm]{a5}{$a\lor b$} - \afname[left of=a1,yshift=-0.8cm,xshift=-0.2cm]{\textbf{F:}} + \afname{$F_{\ref{af:ex2}}$} at (-1,-1) \selfattack{a1} \dualattack{a1}{a6} @@ -144,96 +166,609 @@ To customize the look of the arguments and attacks and for a detailed overview o \attack[inactive]{a8}{a7} \attack[inactive]{a7}{a2} - \annotatedattack{a3}{a2}{$3$} - \attack[incomplete]{a4}{a5} + \annotatedattack[above]{a3}{a2}{$3$} + \annotatedattack[below,incomplete]{a4}{a5}{$x$} \attack{a5}{a10} \attack{a10}{a9} \attack{a9}{a4} \support{a4}{a3} \support{a9}{a3} + \label{af:ex2} \end{af} - \caption{An exemplary AF created with the \argumentation package.} + \caption{The AF $F_{\ref{af:ex2}}$ created with the \argumentation package.} \label{fig:example} \end{figure} -\vspace{-0.4cm} + \begin{verbatim} - \usepackage{argumentation} - \begin{figure}[ht] +\usepackage[namestyle=math]{argumentation} +... +\begin{document} +... +\begin{figure}[ht] + \centering + \begin{af} + \argument{a} + \argument[right=of a1]{b} + \argument[right=of a2]{c} + \argument[rejected,right=of a3]{d} + \argument[right=of a4,incomplete]{e} + \argument[below=of a1]{f} + \argument[inactive,right=of a6]{g} + \argument[accepted,right=of a7]{h} + \argument[right=of a8]{i} + \argument[right=of a9]{j} + + \annotation[right,yshift=-0.4cm]{a5}{$a\lor b$} + \afname{$F_{\ref{af:ex2}}$} at (-1,-1) + + \selfattack{a1} + \dualattack{a1}{a6} + \dualattack[inactive]{a6}{a7} + + \attack[inactive]{a8}{a7} + \attack[inactive]{a7}{a2} + \attack{a5}{a10} + \attack{a10}{a9} + \attack{a9}{a4} + + \annotatedattack[above]{a3}{a2}{$3$} + \annotatedattack[below,incomplete]{a4}{a5}{$x$} + \support{a4}{a3} + \support{a9}{a3} + \label{af:ex2} + \end{af} + \caption{The AF $F_{\ref{af:ex2}}$ created with the \argumentation package.} + \label{fig:example} +\end{figure} +... +\end{document} +\end{verbatim} + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Documentation for Version 1.4 [2024/11/03]}\label{sec:documentation} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +The \argumentation package provides an easy way for creating argumentation frameworks\footnote{Dung, P. M. (1995). On the acceptability of arguments and its fundamental role in non-monotonic reasoning, logic programming and n-person games. Artificial intelligence.} in \LaTeX-documents. +It builds on the \tikzname package for drawing the argumentation graphs. +The \argumentation package provides simplified syntax while keeping the same customisation options and keeping full compatibility with all \tikzname features. +In addition to that, the \argumentation package provides the ability to label and reference the created argumentation frameworks as well as some other additional features. + +The \argumentation package can be imported via the command\\ + +\noindent\cs{usepackage[\oopt{options}]\{argumentation\}}\\ + +\vspace{-0.2cm} +In the following, we give an overview over the functionality of the \argumentation package. +Most importantly, that includes the \texttt{af} environment to encapsulate the created argumentation frameworks, the command \verb|\argument{ }| to create argument nodes and the \verb|attack{ }{ }| command to create attack edges. +Options to customise the appearance of arguments and attacks are described in Section~\ref{sec:options}. + +\vspace{-0.2cm} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\subsection{The \texttt{af} Environment} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +The \argumentation package provides an environment for creating argumentation frameworks in \LaTeX-documents.\\ + +\noindent\cs{begin\{af\} [\oopt{options}]} + + \hspace{-1cm}\sopt{environment~contents} + +\noindent\cs[-1.6cm]{end\{af\}}\\ + +\vspace{-0.2cm} +The \texttt{af} environment supports referencing. +For that add the command \cs[0cm]{label\{\sopt{label}\}} anywhere inside an \texttt{af} environment. +The AFs are automatically numbered in ascending order of occurrence. +The \sopt{label} allows you to reference the corresponding AF via \cs[0cm]{ref\{\sopt{label}\}} anywhere in the document. + +If you want to create an AF that is excluded from the automatic numbering, the \argumentation package provides the \texttt{af*} version of the environment, which has the same functionality otherwise:\\ + +\noindent\cs{begin\{af*\} [\oopt{options}]} + + \hspace{-1cm}\sopt{environment~contents} + +\noindent\cs[-1.6cm]{end\{af*\}}\\ + +\vspace{-0.2cm} +The \texttt{af} (and \texttt{af*}) environment also accepts the package style options (see Section~\ref{sec:options}). +Locally set style options override defaults and the values set globally with the package import. + +In general, the \texttt{af} environment extends the \texttt{tikzpicture} environment, meaning all \tikzname commands and parameters can be used for the \texttt{af} environment. +The \argumentation package also provides the options \textsf{small} or \textsf{tiny} for the \texttt{af} environment to create smaller AFs. +This is especially useful for two-column layout documents. + + +\begin{figure}[!ht] + \begin{subfigure}{0.48\textwidth} \centering - \begin{af} + \begin{af}[small,namestyle=math] + \label{af:small} \argument{a} \argument[right=of a1]{b} \argument[right=of a2]{c} \argument[right=of a3]{d} - \argument[right=of a4,incomplete]{e} + \argument[right=of a4]{e} \argument[below=of a1]{f} \argument[inactive,right=of a6]{g} \argument[inactive,argin,right=of a7]{h} \argument[right=of a8]{i} \argument[right=of a9]{j} - \afname[left of=a1,yshift=-0.8cm,xshift=-0.2cm]{\textbf{F:}} + \afname[left of=a1,yshift=-0.55cm,xshift=-0.2cm]{\afref{af:small}} \selfattack{a1} - \dualattack{a1}{a6} + \dualattack[]{a1}{a6} \dualattack[inactive]{a6}{a7} - \attack[inactive]{a8}{a7} + \attack[inactive]{a7}{a2} - \annotatedattack{a3}{a2}{$3$} - \attack[incomplete]{a4}{a5} - \attack{a5}{a10} - \attack{a10}{a9} - \attack{a9}{a4} - - \support{a4}{a3} - \support{a9}{a3} + \attack[]{a3}{a2} + + \support[]{a4}{a3} + \support[]{a9}{a3} + + \attack[]{a4}{a5} + \attack[]{a5}{a10} + \attack[]{a10}{a9} + \attack[]{a9}{a4} \end{af} - \caption{An exemplary AF created with the \argumentation package.} - \label{fig:example} - \end{figure} -\end{verbatim} + \caption{An AF created with the \textsf{small} option set.} + \label{fig:example_small} + \end{subfigure} + \hfill + \begin{subfigure}{0.48\textwidth} + \centering + \begin{af}[tiny,namestyle=math] + \label{af:tiny} + \argument{a} + \argument[right=of a1]{b} + \argument[right=of a2]{c} + \argument[right=of a3]{d} + \argument[right=of a4]{e} + \argument[below=of a1]{f} + \argument[inactive,right=of a6]{g} + \argument[inactive,argin,right=of a7]{h} + \argument[right=of a8]{i} + \argument[right=of a9]{j} + + \afname[left of=a1,yshift=-0.4cm,xshift=-0.2cm]{\afref{af:tiny}} + + \selfattack{a1} + \dualattack[]{a1}{a6} + \dualattack[inactive]{a6}{a7} + \attack[inactive]{a8}{a7} + + \attack[inactive]{a7}{a2} + \attack[]{a3}{a2} + + \support[]{a4}{a3} + \support[]{a9}{a3} + + \attack[]{a4}{a5} + \attack[]{a5}{a10} + \attack[]{a10}{a9} + \attack[]{a9}{a4} + \end{af} + \caption{An AF created with the \textsf{tiny} option set.} + \label{fig:example_tiny} + \end{subfigure} + \caption{Argumentation frameworks using the \textsf{small} and \textsf{tiny} option of the \texttt{af} environment.} + \label{fig:mini_afs} +\end{figure} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newpage\section{Documentation for Version 1.2 [2024/06/07]}\label{sec:documentation} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -The \argumentation package provides an easy way for creating argumentation frameworks\footnote{Dung, P. M. (1995). On the acceptability of arguments and its fundamental role in nonmonotonic reasoning, logic programming and n-person games. Artificial intelligence.} in \LaTeX documents. -It builds on the \tikzname package for drawing the graphs and provides simplified syntax while keeping the same customisation options and keeping full compatibility with all \tikzname commands. -The package comes with multiple predefined style options for arguments, attacks and supports. -In the following, we give an overview over the functionality of the \argumentation package. -The \argumentation package can be imported via the command +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\subsection{Creating Arguments}\label{sec:arguments} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +Inside an \texttt{af} (or \texttt{af*}) environment, you can create argument nodes for the argumentation framework with the following command\\ + +\noindent\cs{argument [\oopt{options}] (\popt{id}) \{\mopt{name}\} at (\popt{posX},\popt{posY})} + +\begin{description} + \item[\oopt{options}] (optional) a list of \tikzname style parameters and/or relative positioning information. + \item[\popt{id}] (optional) the identifier of the new argument. Per default, when omitted, arguments will automatically be assigned an identifier of the form: $a1, a2, a3,...$. + \item[\mopt{name}] the displayed name of the argument. + \item[\popt{posX},\popt{posY}] (optional) the coordinates where the argument is placed. Must be omitted if relative positioning is used. +\end{description} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\subsubsection{Positioning}\label{sec:positioning} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +The \argumentation package also provides the ability to use \emph{relative positioning} instead of absolute positioning via coordinates. +For that, it relies on relative placement via the \tikzname-library \textsf{positioning}. +The relative positioning information is provided as an optional parameter via \texttt{[\oopt{options}]} as follows\\ + +\noindent\cs{argument[\mopt{dir}=of \mopt{argId}]\{\mopt{name}\}} + +\begin{description} + \item[\mopt{dir}] The direction of placement relative to the argument \mopt{argId}. Typically one of: \textsf{above}, \textsf{right}, \textsf{left} or \textsf{below}. + \item[\mopt{argId}] The identifier of another argument. + \item[\mopt{name}] The displayed name of the argument. +\end{description} + +Additionally, you can adjust the horizontal/vertical position of an argument by adding \verb|xshift=|\mopt{v} or \verb|yshift=|\mopt{v} inside the \texttt{[...]}. +The value \mopt{v} is hereby the horizontal/vertical offset, e.\,g., \verb|-6.6ex| or \verb|1cm|. + +In the following, we list some useful style options for the \verb|\argument| command, provided by the\argumentation package: + +\vspace{-0.15cm} +\begin{table}[ht] + \centering + \begin{tabular}{ll} + \textsf{inactive} &\quad \text{The argument is displayed with grey outline and text.}\\ + \textsf{incomplete} &\quad \text{The argument is displayed with a dotted outline.}\\ + \textsf{invisible} &\quad \text{The argument node is completely transparent.}\\ + \textsf{accepted} &\quad \text{The argument is displayed with green background color.}\\ + \textsf{rejected} &\quad \text{The argument is displayed with red background color.}\\ + \textsf{undecided} &\quad \text{The argument is displayed with cyan background color.}\\ + \textsf{highlight} &\quad \text{The argument is displayed with yellow background color.}\\ + \end{tabular} + \caption{Some style options for the \cs[0cm]{argument} command (for exact definition see Section~\ref{sec:parameters}).} + \label{tab:argument_style} +\end{table} + +\vspace{-0.4cm} +\begin{example}~ + + \vspace{-0.2cm} + \begin{minipage}{0.3\textwidth} + \centering + \begin{af}[namestyle=math] + \argument{a} + \argument{b} at (1,0) + \argument[below=of a1,accepted](c){c} + \argument(x){d} at (1,-1) + \argument[right=of x,yshift=0.5cm]{e} + \argument[inactive]{f} at (2,-1.5) + \end{af} + \end{minipage}% + \begin{minipage}{0.7\textwidth} + \begin{small} + \begin{verbatim} + \begin{af}[namestyle=math] + \argument{a} + \argument{b} at (1,0) + \argument[below=of a1,accepted](c){c} + \argument(x){d} at (1,-1) + \argument[right=of x,yshift=0.5cm]{e} + \argument[inactive]{f} at (2,-1.5) + \end{af} + \end{verbatim} + \end{small} + \end{minipage} + \vspace{-0.3cm} +\end{example} + + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\subsection{Creating Attacks}\label{sec:attacks} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +To create an directed attack between two argument nodes, you can use the following command. +The parameters \mopt{arg1} and \mopt{arg2} are the identifiers of the two arguments.\\ + +\noindent\cs{attack [\oopt{options}] \{\mopt{argId1}\} \{\mopt{argId2}\}} +\begin{description} + \item[\oopt{options}] (optional) a list of \tikzname style parameters. + \item[\mopt{arg1}] Identifier of the attacking argument. + \item[\mopt{arg2}] Identifier of the attacked argument.\\ +\end{description} + +To simplify creating special types of attacks, like bidirectional attacks or self-attacks, the following two commands are provided.\\ + +\noindent\cs{dualattack [\oopt{options}] \{\mopt{argId1}\} \{\mopt{argId2}\}} +\begin{description} + \item[\oopt{options}] (optional) a list of \tikzname style parameters. + \item[\mopt{arg1}] Identifier of the first argument. + \item[\mopt{arg2}] Identifier of the second argument. +\end{description} + +\noindent\cs{selfattack [\oopt{options}] \{\mopt{argId}\}} +\begin{description} + \item[\oopt{options}] (optional) a list of \tikzname style parameters. + \item[\mopt{arg1}] Identifier of the self-attacking argument. +\end{description} + +For \verb|\selfattack| you might want to specify the position of the attack loop. +For that, you should provide the start and end point of the attack-edge (as a degree from \verb|0| to \verb|360|) via the optional \tikzname-parameters \texttt{in=\oopt{degree1}} and \texttt{out=\oopt{degree2}}. +The default values are \texttt{in=0} and \texttt{out=60}.\\ + +If you want to attach a value to an attack edge, you may use the following command.\\ + +\noindent\cs{annotatedattack [\oopt{options}] \{\mopt{argId1}\} \{\mopt{argId2}\} \{\mopt{value}\}} +\begin{description} + \item[\oopt{options}] Optional \tikzname parameters. Must also include one of the following parameters to specify placement of the annotation relative to the attack arrow: \textsf{above}, \textsf{below}, \textsf{left}, \textsf{right}. + \item[\mopt{arg1}] Identifier of the attacking argument. + \item[\mopt{arg2}] Identifier of the attacked argument. + \item[\mopt{value}] The text that is annotated.\\ +\end{description} + +As an alternative to the standard attack arrow, you can use the following command.\\ + +\noindent\cs{support [\oopt{options}] \{\mopt{argId1}\} \{\mopt{argId2}\}} +\begin{description} + \item[\oopt{options}] (optional) a list of \tikzname style parameters. + \item[\mopt{arg1}] Identifier of the supporting argument. + \item[\mopt{arg2}] Identifier of the supported argument.\\ +\end{description} + +\newpage +Some useful style options for the attacks (and other edges) are listed below: + +\begin{table}[ht] + \centering + \begin{tabular}{ll} + \textsf{inactive} &\quad \text{The attack is displayed in grey.}\\ + \textsf{incomplete} &\quad \text{The attack is displayed with a dotted line.}\\ + \textsf{invisible} &\quad \text{The attack is completely transparent.}\\ + \textsf{selfattack} &\quad \text{Use if source and target of the attack are the same node.}\\ + \textsf{bend~right} &\quad \text{The attack arrow is bent to the right.}\\ + &\quad \text{Can additionally provide the angle, e.\,g., \textsf{bend~right=40}.}\\ + \textsf{bend~left} &\quad \text{The attack arrow is bent to the left. Can also provide an angle.} + \end{tabular} + \caption{Some useful style options for the \cs[0cm]{attack} (and related) commands. For the exact definition see Section~\ref{sec:parameters}.} + \label{tab:attack_style} +\end{table} + +\begin{example}~ + + \begin{minipage}{0.3\textwidth} + \centering + \begin{af}[namestyle=math] + \argument{a} + \argument[right=of a1]{b} + \argument[below=of a1]{c} + \argument[right=of a3]{d} + + \attack{a3}{a1} + \selfattack[incomplete]{a3} + \dualattack{a1}{a2} + \annotatedattack[right]{a2}{a4}{$x$} + \support[bend left]{a4}{a3} + \end{af} + \end{minipage}% + \begin{minipage}{0.7\textwidth} + \begin{verbatim} + \begin{af}[namestyle=math] + ... - \verb|\usepackage{argumentation}| + \attack{a3}{a1} + \selfattack[incomplete]{a3} + \dualattack{a1}{a2} + \annotatedattack[right]{a2}{a4}{$x$} + \support[bend left]{a4}{a3} + \end{af} + \end{verbatim} + \end{minipage} +\end{example} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\subsection{Beamer}\label{sec:beamer} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +If you want to reuse (parts of) previously created argumentation frameworks in some form, the \argumentation package provides some useful commands that can be enabled via the package option $\textsf{beamer}{=}\textsf{true}$. +While primarily intended for the use inside the $\textsf{beamer}$ document class when creating presentations, the commands also work in any other document class. +Each command required the label of some argumentation framework and a list of argument IDs of that framework and then creates a copy of that framework, with some changes depending on the command.\\ + +\noindent\cs{aflabeling \{\mopt{af-label}\} \{\mopt{argument list}\}} \noindent - Alternatively, one can also adjust the appearance by providing some package options via + Applies the style parameter \textsf{accepted} to all arguments in \mopt{argument list}, the parameter \textsf{rejected} to those attacked by arguments in \mopt{argument list} and \textsf{undecided} to all other arguments.\\ - \verb|\usepackage[|\opt{options}\verb|]{argumentation}| +\noindent\cs{afextension \{\mopt{af-label}\} \{\mopt{argument list}\}} -\subsection{Style Options}\label{sec:style} - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item The \argumentation package provides the following options to customize the look of the argumentation frameworks. They can both be set globally (as an option for the \emph{usepackage} command) and also locally for each \texttt{af} environment (see Section~\ref{sec:af}). - \end{list} - \vspace{-0.3cm} - \begin{align*} - \mathsf{argumentstyle} &\quad \text{Customizes the appearance of argument nodes.}\\ - \mathsf{attackstyle} &\quad \text{Customizes the appearance of attack edges.}\\ - \mathsf{supportstyle} &\quad \text{Customizes the appearance of support edges.}\\ - \mathsf{namestyle} &\quad \text{Customizes the font style of the argument names.}\\ - \end{align*} + \noindent + Applies the style parameter \textsf{accepted} to all arguments in \mopt{argument list}.\\ + +\noindent\cs{afreduct \{\mopt{af-label}\} \{\mopt{argument list}\}} + + \noindent + Applies the style parameter \textsf{inactive} to all arguments in \mopt{argument list} and those attacked by them. + All attacks involving at least one such argument also receive the parameter \textsf{inactive}.\\ + +\noindent\cs{afrestriction \{\mopt{af-label}\} \{\mopt{argument list}\}} + + \noindent + Applies the style parameter \textsf{invisible} to all arguments \emph{not} in \mopt{argument list}. + All attacks involving at least one such argument also receive the parameter \textsf{invisible}.\\ + + +See Figure~\ref{fig:beamer} for some examples. + +\begin{figure}[!ht] + %\setafstyle{small} + \setargumentstyle{argument thick} + %\centering + \begin{subfigure}{0.48\textwidth} + \centering + \begin{af*}[namestyle=monospace] + \aflabeling{af:example}{a1} + \end{af*} + \caption{Result of \cs[0cm]{aflabeling\{af:example\}\{a1\}}.} + \end{subfigure} + \begin{subfigure}{0.48\textwidth} + \centering + \begin{af*}[namestyle=monospace] + \afextension{af:example}{a1,a3} + \end{af*} + \caption{Result of \cs[0cm]{afextension\{af:example\}\{a1,a3\}}.} + \end{subfigure} + + \par\bigskip + + \begin{subfigure}{0.48\textwidth} + \centering + \begin{af*}[namestyle=monospace] + \afreduct{af:example}{a2} + \end{af*} + \caption{Result of \cs[0cm]{afreduct\{af:example\}\{a2\}}.} + \end{subfigure} + \begin{subfigure}{0.48\textwidth} + \centering + \begin{af*}[namestyle=monospace] + \afrestriction{af:example}{a3,a4} + \end{af*} + \caption{Result of \cs[0cm]{afrestriction\{af:example\}\{a3,a4\}}.} + \end{subfigure} + \caption{Example usage of the four commands provided by the \textsf{beamer} package option.} + \label{fig:beamer} +\end{figure} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\subsection{Other Commands} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The \argumentation package also provides some additional features. +The following command can be used to create a text annotation next to an argument node in the argumentation framework. +The annotation we be placed above the argument node, to adjust its position you should use \texttt{xshift} and \texttt{yshift}.\\ + +\noindent\cs{annotation [\oopt{options}] \{\mopt{argId}\} \{\mopt{value}\}} +\begin{description} + \item[\oopt{options}] Optional \tikzname style parameters. + \item[\mopt{argId}] Identifier of the argument. + \item[\mopt{value}] The annotation text.\\ +\end{description} + +The command \cs[0cm]{afname} can be used to create a simple text node inside the AF. +Mainly intended to add the name of the AF into the picture, you can generally put any text there. +The command behaves essentially exactly like the \cs[0cm]{argument} command.\\ + +\noindent\cs{afname [\oopt{options}] (\popt{id}) \{\mopt{name}\} at (\popt{posX}, \popt{posY})} +\begin{description} + \item[\oopt{options}] (optional) a list of \tikzname style parameters and/or relative positioning parameters. + \item[\popt{id}] (optional) Identifier of the text node. If omitted the identifier will be \textsf{caption}. + \item[\mopt{text}] Text to be displayed. + \item[\popt{posX},\popt{posY}] (optional) the coordinates for placement. Omit if using relative positioning. +\end{description} + +If you want to define your own style for arguments, attacks or supports, you may use one of the following commands to override the package-wide settings to your liking. +For that you may also reuse some of the pre-defined parameters of the \argumentation package (see Section~\ref{sec:parameters}).\\ + +\noindent\cs{setargumentstyle \{\mopt{style parameters}\}} + +\noindent\cs{setatackstyle \{\mopt{style parameters}\}} + +\noindent\cs{setsupportstyle \{\mopt{style parameters}\}}\\ + +Similarly, you can also use the following command to override the default settings of the \texttt{af} environment, e.\,g., the \texttt{node distance}.\\ + +\noindent\cs{setafstyle \{\mopt{style parameters}\}}\\ + +Finally, when using the $\textsf{argumentstyle}{=}\emph{colored}$ package option, you may use the following command to set the color scheme.\\ - In the following, we list the available options for each of the style parameters.\\ +\noindent\cs{setargumentcolorscheme \{\mopt{outer color}\} \{\mopt{inner color}\}} -\noindent\texttt{argumentstyle=}\opt{option} +\begin{example}~ + + \begin{minipage}{0.22\textwidth} + \centering + \setargumentstyle{argument thick,text=blue} + \setafstyle{node distance=0.75cm} + \begin{af} + \label{af:8} + \argument{a} + \argument[right=of a1]{b} + \argument[below=of a1]{c} + \argument[right=of a3]{d} + + \annotation[yshift=-0.2cm]{a4}{$\top$} + \afname{$F_{\ref{af:8}}$} at (-1,-0.75) - The \textsf{argumentstyle} parameter accepts three options - \begin{align*} - \mathsf{standard} &\quad \text{(default) Standard style for the argument nodes.}\\ - \mathsf{large} &\quad \text{Same node size, but larger font.}\\ - \mathsf{thick} &\quad \text{Same node size, thicker outline.}\\ - \end{align*} + \attack{a1}{a2} + \dualattack{a1}{a3} + \attack{a4}{a3} + \end{af} + \end{minipage}% + \begin{minipage}{0.7\textwidth} + \begin{verbatim} + \setargumentstyle{argument thick,text=blue} + \setafstyle{node distance=0.75cm} + \begin{af}\label{af:8} + ... + + \annotation[yshift=-0.2cm]{a4}{$\top$} + \afname{$F_{\ref{af:8}}$} at (-1,-0.75) + \end{af} + \end{verbatim} + \end{minipage} +\end{example} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\subsubsection{Argumentation Macros}\label{sec:macros} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +To facilitate referencing argumentation frameworks and working with them in general, the \argumentation package provides some additional macros that can be enabled with the package option \textsf{macros=true}. +Most importantly, there is the macro \verb|\afref{|\sopt{label}\verb|}| which works like the \verb|ref| command but adds the reference number directly into the index of the \verb|\AF| symbol. +You may redefine any of the first four commands if you prefer a different naming scheme for AFs. + +\begin{table}[ht] + \centering + \begin{tabular}{lll} + \verb|\AF|&& \AF \\ + \verb|\arguments|&& \arguments\\ + \verb|\attacks|&&\attacks\\ + \verb|\AFcomplete|&&\AFcomplete\\ + \verb|\afref{af:example}|&&\afref{af:example}\\ + \verb|\fullafref{af:example}|&\qquad\qquad\qquad&\fullafref{af:example} + \end{tabular} + \caption{Macros provided by the package option \textsf{macros=true} and their respective output.} + \label{tab:macros} +\end{table} + +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Package Options}\label{sec:options} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +The \argumentation package comes with some package options to customize the appearance of the created argumentation frameworks as well as some additional features. +All style package options can both be set globally when importing the package and also locally for each \texttt{af} environment. +To import the \argumentation package, use the following command in the preamble of your \LaTeX-document:\\ + +\noindent\cs[0cm]{usepackage[\oopt{options}]\{argumentation\}}\\ + +The following package options are currently available: + +\begin{description} + \item[argumentstyle] (default \texttt{standard}) Globally sets the appearance of the argument nodes. + The \argumentation package provides five options: \texttt{standard}, \texttt{large}, \texttt{thick}, \texttt{gray} and \texttt{colored}. + Detailed descriptions of these options can be found below. + + \item[attackstyle] (default \texttt{standard}) Globally sets the appearance of the attack edges. + The package comes with three available options: \texttt{standard}, \texttt{large} and \texttt{modern}. + Detailed descriptions of these options can be found below. + + \item[supportstyle] (default \texttt{standard}) Globally sets the appearance of the support edges. + The package comes with three available options: \texttt{standard}, \texttt{dashed} and \texttt{double}. + Detailed descriptions of these options can be found below. + + \item[namestyle] (default \texttt{none}) Sets the text formatting applied to the argument names in the document. + The package comes with five available options: \texttt{none}, \texttt{math}, \texttt{bold}, \texttt{monospace} and \texttt{monoemph}. + Detailed descriptions of these options can be found below. + + \item[indexing] (default \texttt{numeric}) Enables or disables automatic generation of \tikzname node-IDs for the created arguments. + The available options are: \texttt{none}, \texttt{numeric} and \texttt{alphabetic}. + Under the default numeric indexing the generated argument IDs are of the form $a1, a2, \dots$. + With alphabetic indexing the IDs will simply be letters: $a,b,\dots$. + If \texttt{none} is selected, no IDs will be generated and you are required to provide them for each argument via the parameter \texttt{(\popt{id})} of the \verb|\argument| command. + + \item[macros] Boolean (default \texttt{false}) When enabled provides additional macros for naming and referencing argumentation frameworks (see Table~\ref{tab:macros}). + \item[beamer] Boolean (default \texttt{false}) When enabled, provides the commands for recreating argumentations frameworks described in Section~\ref{sec:beamer}. +\end{description} + +In the following we give an overview of the different options for the style parameters that can be used to customise the created argumentation frameworks. +For the exact definitions of these parameters, refer to Section~\ref{sec:parameters}. + +\newpage +\paragraph{\sffamily argumentstyle=\mopt{option}} +\begin{align*} + \mathsf{standard} &\quad \text{Circular argument node with normal size argument name.}\\ + \mathsf{large} &\quad \text{Larger font of the argument name.}\\ + \mathsf{thick} &\quad \text{Thick black outline and normal size argument name.}\\ + \mathsf{gray} &\quad \text{Thick gray outline, light gray background.}\\ + \mathsf{colored} &\quad \text{Thick blue outline, light blue background.} +\end{align*} \begin{figure}[!h] \begin{subfigure}{0.32\textwidth} @@ -272,19 +807,45 @@ The \argumentation package can be imported via the command \caption{\textsf{argumentstyle}=\textit{thick}} \label{fig:argumentstyle_thick} \end{subfigure} - \caption{The available options for \textsf{argumentstyle}.} + + \par\bigskip + + \begin{subfigure}{0.49\textwidth} + \centering + \begin{af}[argumentstyle=gray] + \argument{a} + \argument[right=of a1]{b} + + \attack[]{a1}{a2} + \end{af} + \caption{\textsf{argumentstyle}=\textit{gray}} + \label{fig:argumentstyle_gray} + \end{subfigure} + \hfill + \begin{subfigure}{0.49\textwidth} + \centering + \begin{af}[argumentstyle=colored] + \argument{a} + \argument[right=of a1]{b} + + \attack[]{a1}{a2} + \end{af} + \caption{\textsf{argumentstyle}=\textit{colored}} + \label{fig:argumentstyle_colored} + \end{subfigure} + + \caption{Available options for \textsf{argumentstyle}.} \label{fig:argumentstyle} \end{figure} -\newpage -\noindent\texttt{attackstyle=}\opt{option} + +\paragraph{\sffamily attackstyle=\mopt{option}} - The \textsf{attackstyle} parameter accepts three options - \begin{align*} - \mathsf{standard} &\quad \text{(default) Standard style for the attack arrow tips.}\\ - \mathsf{large} &\quad \text{Arrow tip is larger and sharper.}\\ - \mathsf{modern} &\quad \text{\tikzname ModernCS arrow tip.}\\ - \end{align*} +\begin{align*} + \mathsf{standard} &\quad \text{Standard 'stealth' \tikzname arrow tip.}\\ + \mathsf{large} &\quad \text{Arrow tip is larger and sharper.}\\ + \mathsf{modern} &\quad \text{\tikzname ModernCS arrow tip.} +\end{align*} \begin{figure}[!h] \begin{subfigure}{0.32\textwidth} @@ -322,18 +883,18 @@ The \argumentation package can be imported via the command \caption{\textsf{attackstyle}=\textit{modern}} \label{fig:attackstyle_thick} \end{subfigure} - \caption{The available options for \textsf{attackstyle}.} + \caption{Available options for \textsf{attackstyle}.} \label{fig:attackstyle} \end{figure} -\noindent\texttt{supportstyle=}\opt{option} + +\paragraph{\sffamily supportstyle=\mopt{option}} - The \textsf{supportstyle} parameter accepts three options - \begin{align*} - \mathsf{standard} &\quad \text{(default) Standard style for the attack arrow tips.}\\ - \mathsf{dashed} &\quad \text{Dashed arrow line, same tip.}\\ - \mathsf{double} &\quad \text{Double arrow line and large flat tip.}\\ - \end{align*} +\begin{align*} + \mathsf{standard} &\quad \text{Same tip as attack arrow, perpendicular mark on arrow line.}\\ + \mathsf{dashed} &\quad \text{Dashed arrow line and same tip as attack arrow.}\\ + \mathsf{double} &\quad \text{Double arrow line and large flat tip.} +\end{align*} \begin{figure}[!h] \begin{subfigure}{0.32\textwidth} @@ -371,29 +932,26 @@ The \argumentation package can be imported via the command \caption{\textsf{supportstyle}=\textit{double}} \label{fig:supportstyle_double} \end{subfigure} - \caption{The available options for \textsf{supportstyle}. Note that for \textit{standard} and \textit{dashed} the arrow tip of the selected \textsf{attackstyle} will be used.} + \caption{Available options for \textsf{supportstyle}. Note that for \textit{standard} and \textit{dashed} the arrow tip of the selected \textsf{attackstyle} will be used.} \label{fig:supportstyle} \end{figure} -\newpage -\noindent\texttt{namestyle=}\opt{option} - - The \textsf{namestyle} parameter offers five different options - \begin{align*} - \mathsf{none} &\quad \text{(default) No effect applied to argument name.}\\ - \mathsf{math} &\quad \text{The argument name is rendered as $math$ text.}\\ - &\quad\quad \text{(name must be given without mathmode).}\\ - \mathsf{italics} &\quad \text{The argument name is rendered in \textit{italics}.}\\ - &\quad\quad \text{(name must be given in mathmode to apply effect).}\\ - \mathsf{bold} &\quad \text{The argument name is rendered in $\boldsymbol{bold}$.}\\ - &\quad\quad \text{(name must be given in mathmode to apply effect).}\\ - \mathsf{monospace} &\quad \text{The argument name is rendered in \texttt{monospace} font.}\\ - &\quad\quad \text{(name must be given in mathmode to apply effect).}\\ - \end{align*} - -\begin{figure}[!h] - \begin{subfigure}{0.3\textwidth} +\paragraph{\sffamily namestyle=\mopt{option}} + +\begin{align*} + \mathsf{none} &\quad \text{No effect applied to argument name.}\\ + \mathsf{math} &\quad \text{The argument name is rendered as $math$ text.}\\ + &\quad\quad \text{(name must be given without mathmode).}\\ + \mathsf{bold} &\quad \text{The argument name is rendered in $\boldsymbol{bold}$.}\\ + &\quad\quad \text{(name must be given without mathmode).}\\ + \mathsf{monospace} &\quad \text{The argument name is rendered in \texttt{monospace} font.}\\ + &\quad\quad \text{(name must be given without mathmode).}\\ + \mathsf{monoemph} &\quad \text{The argument name is rendered as {\ttfamily\emph{name}}.} +\end{align*} + +\begin{figure}[!ht] + \begin{subfigure}{0.32\textwidth} \centering \begin{af}[namestyle=none] \argument{a} @@ -405,7 +963,7 @@ The \argumentation package can be imported via the command \label{fig:namestyle_none} \end{subfigure} \hfill - \begin{subfigure}{0.3\textwidth} + \begin{subfigure}{0.32\textwidth} \centering \begin{af}[namestyle=math] \argument{a} @@ -417,23 +975,11 @@ The \argumentation package can be imported via the command \label{fig:namestyle_math} \end{subfigure} \hfill - \begin{subfigure}{0.3\textwidth} - \centering - \begin{af}[namestyle=italics] - \argument{$a$} - \argument[right=of a1]{$b$} - - \attack[]{a1}{a2} - \end{af} - \caption{\textsf{namestyle}=\textit{italics}} - \label{fig:namestyle_italics} - \end{subfigure} - \par\bigskip - \begin{subfigure}{0.49\textwidth} + \begin{subfigure}{0.32\textwidth} \centering \begin{af}[namestyle=bold] - \argument{$a$} - \argument[right=of a1]{$b$} + \argument{a} + \argument[right=of a1]{b} \attack[]{a1}{a2} \end{af} @@ -441,483 +987,110 @@ The \argumentation package can be imported via the command \label{fig:namestyle_bold} \end{subfigure} \hfill + \par\bigskip \begin{subfigure}{0.49\textwidth} \centering \begin{af}[namestyle=monospace] - \argument{$a$} - \argument[right=of a1]{$b$} + \argument{a} + \argument[right=of a1]{b} \attack[]{a1}{a2} \end{af} \caption{\textsf{namestyle}=\textit{monospace}} \label{fig:namestyle_monospace} \end{subfigure} - \caption{The available options for \textsf{namestyle}. You can of course apply any formatting yourself when using the default \textsf{namestyle}=\textit{none}.} - \label{fig:namestyle} -\end{figure} - -\subsection{The \texttt{af} Environment}\label{sec:af} -The \argumentation package provides an environment for creating abstract argumentation frameworks and many of its extensions in \LaTeX-documents.\\ - -\vspace{-0.2cm} -\noindent -\verb|\begin{af}[|\opt{options}\verb|]| - -\opt[green]{environment~content} - -\noindent -\verb|\end{af}| - -\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item - The above described style options can be set locally for each instance of the \texttt{af} environment by setting the respective parameters in the options of the environment. - Local settings override the defaults and globally set values (See Section~\ref{sec:style} - for examples). - - The \texttt{af} environment extends the \textsf{tikzpicture} environment, meaning all \tikzname commands can be used inside the \texttt{af} environment as well. - Furthermore, all options for the \textsf{tikzpicture} environment can be used for the \texttt{af} environment as well, e.\,g the option \verb|node distance|, which is set to \verb|1cm| per default. - - If you want to create an argumentation framework with limited space available, you can use one of the following predefined options for the \texttt{af} environment. - This is especially useful for two-column layout documents. - \begin{align*} - \mathsf{tiny} &\quad \text{\textsf{node distance} is set to $0.35cm$ and nodes are smaller.}\\ - \mathsf{small} &\quad \text{\textsf{node distance} is set to $0.55cm$ and nodes are smaller.} - %TODO:& argument size as parameter - \end{align*} - - %\begin{example} - % Consider the two AFs in Figure~\ref{fig:mini_afs} created with the \textsf{small} and \textsf{tiny} option respectively. - %\end{example} -\end{list} - -\begin{figure}[ht] - \begin{subfigure}{0.48\textwidth} - \centering - \begin{af}[small] - \argument{a} - \argument[right=of a1]{b} - \argument[right=of a2]{c} - \argument[right=of a3]{d} - \argument[right=of a4]{e} - \argument[below=of a1]{f} - \argument[inactive,right=of a6]{g} - \argument[inactive,argin,right=of a7]{h} - \argument[right=of a8]{i} - \argument[right=of a9]{j} - - \afname[left of=a1,yshift=-0.55cm,xshift=-0.2cm]{\textbf{F:}} - - \selfattack{a1} - \dualattack[]{a1}{a6} - \dualattack[inactive]{a6}{a7} - \attack[inactive]{a8}{a7} - - \attack[inactive]{a7}{a2} - \attack[]{a3}{a2} - - \support[]{a4}{a3} - \support[]{a9}{a3} - - \attack[]{a4}{a5} - \attack[]{a5}{a10} - \attack[]{a10}{a9} - \attack[]{a9}{a4} - \end{af} - \caption{An exemplary AF created with the \textsf{small} option set.} - \label{fig:example_small} - \end{subfigure} \hfill - \begin{subfigure}{0.48\textwidth} + \begin{subfigure}{0.49\textwidth} \centering - \begin{af}[tiny] - \argument{a} - \argument[right=of a1]{b} - \argument[right=of a2]{c} - \argument[right=of a3]{d} - \argument[right=of a4]{e} - \argument[below=of a1]{f} - \argument[inactive,right=of a6]{g} - \argument[inactive,argin,right=of a7]{h} - \argument[right=of a8]{i} - \argument[right=of a9]{j} - - \afname[left of=a1,yshift=-0.4cm,xshift=-0.2cm]{\textbf{F:}} - - \selfattack{a1} - \dualattack[]{a1}{a6} - \dualattack[inactive]{a6}{a7} - \attack[inactive]{a8}{a7} - - \attack[inactive]{a7}{a2} - \attack[]{a3}{a2} - - \support[]{a4}{a3} - \support[]{a9}{a3} - - \attack[]{a4}{a5} - \attack[]{a5}{a10} - \attack[]{a10}{a9} - \attack[]{a9}{a4} - \end{af} - \caption{An exemplary AF created with the \textsf{tiny} option set.} - \label{fig:example_tiny} - \end{subfigure} - \caption{Two AFs with smaller nodes, created by using the \textsf{small} and \textsf{tiny} options of the \texttt{af} environment.} - \label{fig:mini_afs} -\end{figure} - -While the following commands are intended to be used inside the \texttt{af} environment, they can also be used inside the \textsf{tikzpicture} environment. - -\subsection{Creating Arguments} - Arguments can be created with the \verb|\argument| command. - The full command is defined as follows\\ - - \noindent - \verb|\argument[|\opt{options}\verb|](|\opt{id}\verb|){|\opt{name}\verb|}| \verb|at| (\opt{posX}, \opt{posY}) - - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item\opt{options}~ (optional) a list of \tikzname style parameters and/or relative positioning information (see Section~\ref{sec:relpos}). - \item\opt{id}~ (optional) the identifier of the new argument. When omitted, arguments will automatically be assigned an identifier of the form: $a1, a2, a3,...$ - \item\opt{name}~ the displayed name of the argument. - \item\opt{posX}, \opt{posY}~ (optional) the coordinates where the argument is placed. Should be omitted if relative positioning is used. - - \item When creating an argument you only have to provide the \opt{name}, all other parameters are optional. - The \opt{id} of an argument is used for referencing, e.\,g., when creating attacks or for the relative positioning of other arguments. - \end{list} - -\newpage -\begin{example}~ - \begin{verbatim} - \begin{af} - \argument{$a$} - \argument{$b$} at (1, 1) - \argument[right=of a2]{$c$} - \argument(argD){$d$} at (-2, 0) - \argument[above=of argD]{$e$} - \end{af} - \end{verbatim} - - \begin{center} - \begin{af} - \argument{$a$} - \argument{$b$} at (1, 1) - \argument[right=of a2]{$c$} - \argument(argD){$d$} at (-2, 0) - \argument[above=of argD]{$e$} - \end{af} - \end{center} -\end{example} - -\subsubsection{Relative Positioning}\label{sec:relpos} - Placement of argument nodes with the \argumentation package relies on relative placement via the \tikzname-library \textsf{positioning}. - The relative positioning information is provided as an optional parameter as follows\\ - - \noindent - \verb|\argument[|\opt{dir}\verb|=of |\opt{arg\_id}\verb|](|\opt{id}\verb|){|\opt{name}\verb|}| - - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item\opt{dir}~ has to be one of: \emph{right}, \emph{left}, \emph{below} and \emph{above} - \item\opt{arg\_id}~ is the identifier of another argument - \item Additionally, you can adjust the horizontal/vertical position of an argument via the options \verb|xshift=|\opt{v} and \verb|yshift=|\opt{v}. - The value \opt{v} is the horizontal/vertical offset, e.\,g., \verb|5pt|, \verb|-3ex| or \verb|0.2cm|. - \end{list} - - - \begin{example}~ - - \begin{verbatim} - \begin{af} - \argument{a} - \argument[below=of a1]{b} - \argument[right=of a1, yshift=-24pt,xshift=-8pt]{c} - \argument[right=of a3, xshift=-0.5cm]{d} - \argument[right=of a4, yshift=5ex]{e} - \end{af} - \end{verbatim} - - \begin{center} - \begin{af} - \argument{a} - \argument[below=of a1]{b} - \argument[right=of a1, yshift=-24pt,xshift=-8pt]{c} - \argument[right=of a3, xshift=-0.5cm]{d} - \argument[right=of a4, yshift=5ex]{e} - \end{af} - \end{center} - - \end{example} - -%\subsubsection{Absolute Positioning} - -\subsubsection{Argument Identifiers} - When creating an argument, it is automatically assigned an identifier for the sake of simplicity. - You can override this identifier by giving another identifier in parenthesis to the \verb|\argument| command. - Per default, the argument identifiers will be numerical of the form $a1, a2, a3, \dots$ based on their order of creation inside the \texttt{af} environment. - If you preferred alphabetical identifiers, you can set the package option \textsf{indexing}=\emph{alphabetic} and the argument identifiers will instead be $a, b, c, \dots$. - -\subsubsection{Additional Argument Styles} - Furthermore, you can provide optional parameters to adjust the style of the argument node. - For that you can use all \tikzname-style options and additionally the following predefined style parameters: - \begin{align*} - \mathsf{inactive} &\quad \text{The argument is displayed with grey outline and text.}\\ - \mathsf{incomplete} &\quad \text{The argument is displayed with a dotted outline.}\\ - \mathsf{invisible} &\quad \text{The argument node is completely transparent.}\\ - \mathsf{accepted} &\quad \text{The argument is displayed with green background color.}\\ - \mathsf{rejected} &\quad \text{The argument is displayed with red background color.}\\ - \mathsf{undecided} &\quad \text{The argument is displayed with cyan background color.}\\ - \end{align*} - - %Some relevant \tikzname style-parameters are - %\begin{align*} - %\textsf{circle} &\quad \text{the shape of the argument.}\\ - % \textsf{minimum~size=0.75cm} &\quad \text{the minimum size of the circle, to ensure consistent}\\ - % &\quad \text{argument size.}\\ - % \textsf{draw=black} &\quad \text{outline and text color of the argument.}\\ - %\textsf{thick} &\quad \text{the outline of the circle is rendered in \textsf{thick} mode.}\\ - % \textsf{fill=white} &\quad \text{the background color of the argument.}\\ - % \textsf{font=large} &\quad \text{the font size of the argument name.}\\ - %\textsf{text~centered} &\quad \text{positioning of the argument name inside the circle.}\\ - % \textsf{inner~sep=0} &\quad \text{inner margins of the circle, set to \textsf{0} to optimize space.} - %\end{align*} - - -\subsection{Creating Attacks} - Attacks between two arguments can be created with the command\\ - - \noindent - \verb|\attack{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}| - - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item where \opt{arg1} and \opt{arg2} are the identifiers of two previously defined arguments. - \end{list} - - -\subsubsection{Additional Attack Styles} - To customize an attack you can provide additional optional parameters: - \begin{align*} - \mathsf{inactive} &\quad \text{The attack is displayed in grey.}\\ - \mathsf{incomplete} &\quad \text{The attack is displayed with a dotted line.}\\ - \mathsf{invisible} &\quad \text{The attack is completely transparent.}\\ - \mathsf{selfattack} &\quad \text{Use if source and target of the attack are the same node.}\\ - \mathsf{bend~right} &\quad \text{The attack arrow is bent to the right.}\\ - &\quad \text{Can additionally provide the angle, e.\,g., \textsf{bend~right=40}.}\\ - \mathsf{bend~left} &\quad \text{The attack arrow is bent to the left. Can also provide an angle.} - \end{align*} - - Of course, all \tikzname style parameters can be used here as well. - - \begin{example}~ - \begin{verbatim} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - \argument[right=of a2]{c} - \argument[right=of a3]{d} - - \attack{a1}{a2} - \attack[bend right]{a2}{a3} - \attack[bend left=10,inactive]{a3}{a4} - \end{af} - \end{verbatim} - - \begin{center} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - \argument[right=of a2]{c} - \argument[right=of a3]{d} - - \attack{a1}{a2} - \attack[bend right]{a2}{a3} - \attack[bend left=10,inactive]{a3}{a4} - \end{af} - \end{center} - \end{example} - - Additionally, there is a shortcut for creating a symmetric attack between two arguments with - - \noindent - \verb|\dualattack{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}|\\ - - \noindent - and a shortcut for a self-attack for an argument with - - \noindent - \verb|\selfattack{|\opt{arg1}\verb|}|\\ - - \noindent - For both commands, you can use the same optional parameters as for the \verb|\attack| command. - - \begin{example}~ - \begin{verbatim} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - - \selfattack{a2} - \dualattack{a1}{a2} - \end{af} - \end{verbatim} - - \begin{center} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - - \selfattack{a2} - \dualattack{a1}{a2} - \end{af} - \end{center} - \end{example} - - -\subsection{Creating Support Relations} - You can create a support relation between two arguments with the command\\ - - \noindent - \verb|\support{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}| - - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item where \opt{arg1} and \opt{arg2} are the identifiers of two previously defined arguments. - The support arrow use the same tip as the attack arrows, but have a perpendicular mark to distinguish them from attacks. - Supports can be customized in the same way as attacks. - \end{list} - \begin{example}~ - \begin{verbatim} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - \argument[right=of a2]{c} - - \support{a1}{a2} - \support[bend right]{a2}{a3} - \end{af} - \end{verbatim} - - \begin{center} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - \argument[right=of a2]{c} - - \support{a1}{a2} - \support[bend right]{a2}{a3} - \end{af} - \end{center} - \end{example} - -\subsection{Annotated Attacks} - Many extensions of the original abstract argumentation framework rely on attacks with an associated value. - This may, for instance, be probabilities in the case of probabilistic argumentation frameworks or numerical weights in the case of weighted argumentation frameworks. - These annotations can be added manually via \tikzname or via the following command\\ - - \noindent - \verb|\annotatedattack[|\opt{position}\verb|]{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}{|\opt{value}\verb|}| - - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item where \opt{arg1} and \opt{arg2} are the identifiers of two previously defined arguments and \opt{value} is the text or number that should be annotated to the attack. - \opt{position} specifies where the annotation should be placed relative to the attack arrow and should be one of: \textsf{above}, \textsf{below}, \textsf{left}, \textsf{right}. - \end{list} - - \begin{example}~ - \begin{verbatim} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - \argument[right=of a2]{c} - - \annotatedattack[below]{a1}{a2}{$x$} - \annotatedattack[above,bend right]{a2}{a3}{$0.6$} - \end{af} - \end{verbatim} - - \begin{center} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - \argument[right=of a2]{c} - - \annotatedattack[below]{a1}{a2}{$x$} - \annotatedattack[above,bend right]{a2}{a3}{$0.6$} - \end{af} - \end{center} - \end{example} - -\subsection{Further Commands} - If you want to display an name (or some other text) for your argumentation framework in the picture, you can use the \verb|\afname| command. - Just like the \verb|\argument| command it can include an optional identifier and supports both relative and absolute positioning. - Some example usages:\\ - - \vspace{-0.25cm} - \noindent\verb|\afname{|\opt{name}\verb|}| - - \noindent\verb|\afname(|\opt{id}\verb|){|\opt{name}\verb|}| - - \noindent\verb|\afname[|\opt{relPos}\verb|]{|\opt{name}\verb|}| - - \noindent\verb|\afname{|\opt{name}\verb|}| \verb|at (|\opt{posX},\opt{posY}\verb|)| - - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item where \opt{id} is an (optional) identifier for the created node (if omitted, the default identifier will be \textit{cap}) and \opt{name} is the text displayed in the picture. - Additional positioning information, via \textsf{xshift} or \textsf{yshift}, can be provided via the optional parameters. - \end{list} - - \noindent - To create an annotation, e.\,g., an acceptance condition or a weight, next to an argument, the following command can be used.\\ - - \noindent - \verb|\annotation[|\opt{optional}\verb|]{|\opt{arg\_id}\verb|}{|\opt{text}\verb|}| - - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item where \opt{arg\_id} is the identifier of some argument and \opt{text} is the text to be displayed. - Additionally, positioning information, via \textsf{xshift} or \textsf{yshift}, can be provided via the optional parameters. - \end{list} - - \begin{example}~ - \begin{verbatim} - \begin{af} + \begin{af}[namestyle=monoemph] \argument{a} \argument[right=of a1]{b} - \afname{$F:$} at (-1,0) - \annotation[yshift=-0.4cm,xshift=0.4cm]{a2}{$\neg a$} - \support{a1}{a2} - \end{af} - \end{verbatim} - - \begin{center} - \begin{af} - \argument{a} - \argument[right=of a1]{b} - \afname{$F:$} at (-1,0) - \annotation[yshift=-0.4cm,xshift=0.4cm]{a2}{$\neg a$} - - \support{a1}{a2} + \attack[]{a1}{a2} \end{af} - \end{center} - \end{example} - - You can manually override the \textsf{argumentstyle}, \textsf{attackstyle} and \textsf{supportstyle} parameters and set a custom style globally via the following commands respectively.\\ - - \vspace{-0.3cm} - \noindent - \verb|\setargumentstyle{|\opt{style}\verb|}| - - \noindent - \verb|\setattackstyle{|\opt{style}\verb|}| - - \noindent - \verb|\setsupportstyle{|\opt{style}\verb|}| - - \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} - \item - where \opt{style} is a list of \tikzname style parameters. - \end{list} + \caption{\textsf{namestyle}=\textit{monoemph}} + \label{fig:namestyle_monoemph} + \end{subfigure} + \caption{Available options for \textsf{namestyle}. You can of course apply any formatting yourself when using the default \textsf{namestyle}=\textit{none}.} + \label{fig:namestyle} +\end{figure} -%\section{Style Definitions} +\newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{Style Parameter Reference}\label{sec:parameters} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +For reference, the style parameters provided by this package are listed below. +You may use or redefine them at your own discretion. +\begin{table}[ht] + \centering + \ttfamily + \begin{tabular}{l|l} + \toprule + \tikzname-keyword & style parameters \\ + \midrule + \textsf{argument size} & \emph{contains the currently selected argument size}\\ + \textsf{argument} & \emph{contains the currently selected argument style and size}\\ + \textsf{argument standard} & circle,inner sep=0,outer sep=0,draw=black\\ + \textsf{argument large} & circle,inner sep=0,outer sep=0,draw=black,font=\verb|\|large\\ + \textsf{argument thick} & circle,inner sep=0,outer sep=0,draw=black,line width=0.1em\\ + \textsf{argument gray} & argument thick,fill=gray!30,draw=gray!65,text=black!80\\ + \textsf{argument colored} & argument thick,fill=aigblue!40,draw=aigblue!80,text=black!80\\ + \midrule + \textsf{attack} & \emph{contains the currently selected attack style}\\ + \textsf{attack standard} & -\{stealth'\}\\ + \textsf{attack large} & -\{Stealth[scale=1.25]\}\\ + \textsf{attack modern} & -\{To[sharp,length=0.65ex,line width=0.05em]\}\\ + \textsf{selfattack} & loop,min distance=0.4em,in=0,out=60,looseness=4.5\\ + \midrule + \textsf{support} & \emph{contains the currently selected support style}\\ + \textsf{support standard} & attack,postaction=\{decorate,decoration=\{\dots\}\}\\ + \textsf{support dashed} & attack,densely dashed\\ + \textsf{support double} & -\{Classical TikZ Rightarrow\},double\\ + \midrule + \textsf{inactive} & fill=none,draw=gray!50,text=gray!60\\ + \textsf{incomplete} & densely dashed\\ + \textsf{accepted} & fill=green!40\\ + \textsf{rejected} & fill=red!40\\ + \textsf{undecided} & fill=cyan!40\\ + \textsf{highlight} & fill=aigyellow!60\\ + \textsf{invisible} & draw=none,fill=none,opacity=0.0\\ + \midrule + \textsf{standard} & node distance=6.6ex,argument size/.style={minimum size=4.5ex},\\ + & attack width/.style={line width=0.05em}\\ + \textsf{small} & node distance=3.5ex,argument size/.style={minimum size=3.4ex},\\ + & attack width/.style={line width=0.045em}\\ + \textsf{tiny} & node distance=2.3ex,argument size/.style={minimum size=2.6ex,}\\ + & attack width/.style={line width=0.03em},font=\verb|\small|\\ + \bottomrule + \end{tabular} + \caption{Reference list of \tikzname-style parameters provided by the \argumentation package.} + \label{tab:styles} + \end{table} \newpage +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Version History}\label{sec:history} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\subsection*{[v1.4 2024/10/31]} +\begin{itemize} + \item Added functions \verb|\aflabeling|, \verb|\afextension|, \verb|\afreduct| and \verb|\afrestriction| that recreate (parts of) previously created argumentation frameworks. Can be enabled via the package option \textsf{beamer=true}. + \item Added internal storage of arguments and attacks of an argumentation framework to enable further computations. + \item Added environment \verb|af*| for argumentation frameworks that are unlabeled/uncounted. + \item Added command \verb|\setargumentcolorscheme{ }{ }| to change color scheme of the \textsf{colored} argument style. + \item Added command \verb|\setafstyle{ }| to set global style options for the AFs. + \item Added optional parameter (\popt{value}) to \verb|\attack| command to add a label to the attack edge (undocumented for now). + \item Major revision of the documentation. + \item Various minor changes to internal functions, naming scheme and comments. +\end{itemize} +\subsection*{[v1.3 2024/09/25]} +\begin{itemize} + \item Added support for \verb|\label{ }| and \verb|\ref{ }| to \texttt{af} environment. + \item Added commands \verb|\AF|, \verb|\arguments|, \verb|\attacks| and \verb|\AFcomplete| to facilitate consistent naming of AFs. Have to be loaded with the package option \textsf{macros=true}. + \item Added commands \verb|\afref{ }| and \verb|\fullafref{ }| to reference AFs. + \item adjusted scaling of nodes and arrows for larger page sizes. + \item added new style options for arguments. + \item Various minor fixes and changes regarding the \textsf{namestyle} package option. +\end{itemize} \subsection*{[v1.2 2024/06/07]} \begin{itemize} @@ -944,4 +1117,4 @@ While the following commands are intended to be used inside the \texttt{af} envi \item First Version. \end{itemize} -\end{document} +\end{document}
\ No newline at end of file diff --git a/graphics/pgf/contrib/argumentation/argumentation.sty b/graphics/pgf/contrib/argumentation/argumentation.sty index f247cd959a..6633c25a3a 100644 --- a/graphics/pgf/contrib/argumentation/argumentation.sty +++ b/graphics/pgf/contrib/argumentation/argumentation.sty @@ -1,78 +1,133 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{argumentation}[2024/05/03 Argumentation] +\ProvidesPackage{argumentation}[2024/11/03 Argumentation] % Author: Lars Bengel % E-Mail: lars.bengel@fernuni-hagen.de -% Version: 1.1 -% Date: 2023/12/03 +% Version: 1.4 +% Date: 2024/11/03 % License: LaTeX Project Public License 1.3c -%%%%%%%%%%% Package Requirements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\RequirePackage{amsbsy,amsmath} % For proper bold letters in math mode -\RequirePackage{pgfopts} % For managing package options -\RequirePackage{tikz} % For drawing the argumentation frameworks -\usetikzlibrary{positioning} % For relative node positioning -\usetikzlibrary{arrows.meta} % For directed edges / attack arrows -\usetikzlibrary{arrows} % For directed edges / attack arrows -\usetikzlibrary{decorations.markings} % For creating the support edge markings -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%%%%%%%%%% Package Tikz Style Definitions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcounter{argument} -%\newcommand{\argument}{\relax} -\newcommand{\argstyle}[1]{#1} % Defines the font style in which argument names are displayed + +%%%%%%%%%%% Package Requirements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{amsbsy,amsmath} % Proper bold letters in math mode +\RequirePackage{pgfopts} % Managing package options +\RequirePackage{etoolbox} % Internal list handling +\RequirePackage{refcount} % Expandable ref-counter value +\RequirePackage{xspace} % Dynamic spaces after math commands +\RequirePackage{xcolor} % Defining colors +\RequirePackage{tikz} % Drawing the argumentation frameworks +\usetikzlibrary{positioning} % Relative node positioning +\usetikzlibrary{arrows.meta} % Directed edges / attack arrows +\usetikzlibrary{arrows} % Directed edges / attack arrows +\usetikzlibrary{decorations.markings} % Creating the support edge markings + + +%%%%%%%%%%% Package Style Definitions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% Color definitions +\definecolor{aigyellow}{RGB}{210,149,81} % Highlight color +\definecolor{aigblue}{RGB}{0,76,151} % Node color %%% Argument Style Definitions -\tikzset{ % global base styles - argument size/.style={minimum size=0.7cm}, % Standard size of argument nodes - argument/.style={}, % Base style for argument nodes - argument standard/.style={circle,draw=black,inner sep=0,outer sep=0, argument size}, - argument large/.style={circle,draw=black,inner sep=0,outer sep=0, argument size, font=\large}, - argument thick/.style={circle,draw=black,inner sep=0,outer sep=0, argument size, thick}, +\tikzset{ + argument size/.style={}, % Size of argument nodes + argument/.style={}, % Base style for argument nodes + argument standard/.style={circle,draw=black,inner sep=0,outer sep=0}, % Standard argument style + argument large/.style={circle,draw=black,inner sep=0,outer sep=0, font=\large}, % Large argument style + argument thick/.style={circle,draw=black,inner sep=0,outer sep=0, line width=0.1em}, % Thick outline argument style + argument gray/.style={argument thick,fill=gray!30,draw=gray!65,text=black!80}, % Gray argument style + argument colored/.style={argument thick,fill=aigblue!40,draw=aigblue!80}, % Colored argument stlye } %%% Attack/Support Edge Definitions -\tikzset{ % global base styles +\tikzset{ + attack width/.style={}, % Width of attack arrows attack/.style={}, % Base style for attack arrow attack standard/.style={-{stealth'}}, % Standard attack arrow attack large/.style={-{Stealth[scale=1.25]}}, % Larger arrow tip - attack modern/.style={-{To[sharp,length=0.9mm,line width=0.7pt]}}, % Mordern rightarrow style tip - support/.style={}, - support standard/.style = {attack, postaction = {decorate,decoration={markings,mark=at position 0.36 with {\draw[-] (0,-0.1) -- (0.1,0.1);}}}}, % Standard support arrow - support dashed/.style={attack,densely dashed}, - support double/.style={-{Classical TikZ Rightarrow},double}, + attack modern/.style={-{To[sharp,length=0.65ex,line width=0.05em]}}, % Mordern rightarrow style tip + support/.style={}, % Base style for support + support standard/.style = {attack, postaction = {decorate,decoration={markings,mark=at position 0.36 with {\draw[-] (0,-0.1) -- (0.1,0.1);}}}}, % Standard support arrow + support dashed/.style={attack,densely dashed}, % Dashed Support arrow + support double/.style={-{Classical TikZ Rightarrow},double}, % double-line support arrow +} + +%%% Additional Style Parameters +\tikzset{ + selfattack/.style={loop,min distance=0.4em,in=0,out=60,looseness=4.5}, % Self-attack + inactive/.style={fill=none,draw=gray!50,text=gray!60}, % Inactive argument or edge (reduct) + incomplete/.style={densely dashed}, % incomplete argument or edge + accepted/.style={fill=green!40}, % Accepted argument (in) + rejected/.style={fill=red!40}, % Rejected argument (out) + undecided/.style={fill=cyan!40}, % Undecided Argument (undec) + highlight/.style={fill=aigyellow!60}, % Highlighted argument + caption/.style={draw=none}, % Caption or text + invisible/.style={draw=none,fill=none,opacity=0.0}, % Invisible argument or edge + annotation/.style={font=\small}, % Argument annotation + argin/.style={accepted}, + argout/.style={rejected}, + argundec/.style={undecided}, +} + +%%% Style-Options for af environment +\pgfkeys{/tikz/.cd, + af/.style={}, % Base style for af + standard/.style={node distance=6.6ex,argument size/.style={minimum size=4.5ex},attack width/.style={line width=0.05em}}, % Standard size style for af + small/.style={node distance=3.5ex,argument size/.style={minimum size=3.4ex},attack width/.style={line width=0.045em},caption/.append style={font=\small}}, % Small size style for af + tiny/.style={node distance=2.3ex,argument size/.style={minimum size=2.6ex,font=\small},attack width/.style={line width=0.03em},caption/.append style={font=\small}}, % Tiny size style for af +} + + +%%%%%%%%%% Internal Utility Functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\makeatletter +\newif\ifmacros +\newif\ifbeamer +\newif\if@numericidx +\newif\if@alphaidx +\newif\if@insideaf + +%%% Defines the font style in which argument names are displayed +\newcommand{\@arg@style}[1]{#1} + +%%% Auxilliary command for splitting a given pair x,y into two macros +\def\@split@pair#1,#2\relax{% + \def\@attacker{#1}% + \def\@attacked{#2}% } -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\makeatother -%%%%%%%%%% Package Options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%% Package Options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Options for style of the argument node itself \pgfkeys{/tikz/.cd, argumentstyle/.is choice, - argumentstyle/standard/.code={\tikzset{argument/.style={argument standard}}}, - argumentstyle/large/.code={\tikzset{argument/.style={argument large}}}, - argumentstyle/thick/.code={\tikzset{argument/.style={argument thick}}}, + argumentstyle/standard/.code={\tikzset{argument/.style={argument standard,argument size}}}, + argumentstyle/large/.code={\tikzset{argument/.style={argument large,argument size}}}, + argumentstyle/thick/.code={\tikzset{argument/.style={argument thick,argument size}}}, + argumentstyle/gray/.code={\tikzset{argument/.style={argument gray,argument size}}}, + argumentstyle/colored/.code={\tikzset{argument/.style={argument colored,argument size}}}, } \pgfkeys{/argumentation/.cd, .unknown/.code={}, argumentstyle/.is choice, - argumentstyle/standard/.code={\tikzset{argument/.style={argument standard}}}, - argumentstyle/large/.code={\tikzset{argument/.style={argument large}}}, - argumentstyle/thick/.code={\tikzset{argument/.style={argument thick}}}, + argumentstyle/standard/.code={\tikzset{argument/.style={argument standard,argument size}}}, + argumentstyle/large/.code={\tikzset{argument/.style={argument large,argument size}}}, + argumentstyle/thick/.code={\tikzset{argument/.style={argument thick,argument size}}}, + argumentstyle/gray/.code={\tikzset{argument/.style={argument gray,argument size}}}, + argumentstyle/colored/.code={\tikzset{argument/.style={argument colored,argument size}}}, argumentstyle=standard, } %%% Options for the style of the attack edges \pgfkeys{/tikz/.cd, attackstyle/.is choice, - attackstyle/standard/.code={\tikzset{attack/.style={attack standard}}}, - attackstyle/large/.code={\tikzset{attack/.style={attack large}}}, - attackstyle/modern/.code={\tikzset{attack/.style={attack modern}}}, + attackstyle/standard/.code={\tikzset{attack/.style={attack width,attack standard}}}, + attackstyle/large/.code={\tikzset{attack/.style={attack width,attack large}}}, + attackstyle/modern/.code={\tikzset{attack/.style={attack width,attack modern}}}, attackstyle=standard, } \pgfkeys{/argumentation/.cd, attackstyle/.is choice, - attackstyle/standard/.code={\tikzset{attack/.style={attack standard}}}, - attackstyle/large/.code={\tikzset{attack/.style={attack large}}}, - attackstyle/modern/.code={\tikzset{attack/.style={attack modern}}}, + attackstyle/standard/.code={\tikzset{attack/.style={attack width,attack standard}}}, + attackstyle/large/.code={\tikzset{attack/.style={attack width,attack large}}}, + attackstyle/modern/.code={\tikzset{attack/.style={attack width,attack modern}}}, attackstyle=standard, } @@ -93,150 +148,430 @@ } %%% Options for the automatic text formatting for the argument names +\makeatletter \pgfkeys{/tikz/.cd, namestyle/.is choice, - namestyle/none/.code={\renewcommand{\argstyle}[1]{##1}}, - namestyle/math/.code={\renewcommand{\argstyle}[1]{\ensuremath{##1}}}, - namestyle/italics/.code={\renewcommand{\argstyle}[1]{\ensuremath{\mathit{\text{##1}}}}}, - namestyle/bold/.code={\renewcommand{\argstyle}[1]{\ensuremath{\boldsymbol{\text{##1}}}}}, - namestyle/monospace/.code={\renewcommand{\argstyle}[1]{\ensuremath{\mathtt{\text{##1}}}}}, + namestyle/none/.code={\renewcommand{\@arg@style}[1]{##1}}, + namestyle/math/.code={\renewcommand{\@arg@style}[1]{\ensuremath{##1}}}, + namestyle/bold/.code={\renewcommand{\@arg@style}[1]{\ensuremath{\boldsymbol{##1}}}}, + namestyle/monospace/.code={\renewcommand{\@arg@style}[1]{{\ttfamily##1}}}, + namestyle/monoemph/.code={\renewcommand{\@arg@style}[1]{{\ttfamily\itshape##1}}}, namestyle=none, } \pgfkeys{/argumentation/.cd, namestyle/.is choice, - namestyle/none/.code={\renewcommand{\argstyle}[1]{##1}}, - namestyle/math/.code={\renewcommand{\argstyle}[1]{\ensuremath{##1}}}, - namestyle/italics/.code={\renewcommand{\argstyle}[1]{\ensuremath{\mathit{##1}}}}, - namestyle/bold/.code={\renewcommand{\argstyle}[1]{\ensuremath{\boldsymbol{\text{##1}}}}}, - namestyle/monospace/.code={\renewcommand{\argstyle}[1]{\ensuremath{\mathtt{##1}}}}, + namestyle/none/.code={\renewcommand{\@arg@style}[1]{##1}}, + namestyle/math/.code={\renewcommand{\@arg@style}[1]{\ensuremath{##1}}}, + namestyle/bold/.code={\renewcommand{\@arg@style}[1]{\ensuremath{\boldsymbol{##1}}}}, + namestyle/monospace/.code={\renewcommand{\@arg@style}[1]{{\ttfamily##1}}}, + namestyle/monoemph/.code={\renewcommand{\@arg@style}[1]{{\ttfamily\itshape##1}}}, namestyle=none, } -%%% Options for automatic indexing (and naming) of argument nodes -\NewDocumentCommand { \argument } {} {\relax} + +%%% Option for automatic indexing of arguments \pgfkeys{/argumentation/.cd, indexing/.is choice, - indexing/none/.code={ - \RenewDocumentCommand { \argument } {O{} r() m dat d()} { - \IfNoValueTF {##5}{% - \node[argument size,argument,##1](##2) {\argstyle{##3}}; - }{% - \node[argument size,argument,##1](##2) at (##5) {\argstyle{##3}}; - } - } - }, - indexing/numeric/.code={ - \RenewDocumentCommand { \argument } {O{} d() m dat d()} { - \stepcounter{argument} - \IfNoValueTF {##2}{% - \IfNoValueTF {##5}{% - \node[argument size,argument,##1](a\arabic{argument}) {\argstyle{##3}}; - }{% - \node[argument size,argument,##1](a\arabic{argument}) at (##5) {\argstyle{##3}}; - } - }{% - \IfNoValueTF {##5}{% - \node[argument size,argument,##1](##2) {\argstyle{##3}}; - }{% - \node[argument size,argument,##1](##2) at (##5) {\argstyle{##3}}; - } - } - } - }, - indexing/alphabetic/.code={ - \RenewDocumentCommand { \argument } {O{} d() m dat d()} { - \stepcounter{argument} - \IfNoValueTF {##2}{% - \IfNoValueTF {##5}{% - \node[argument size,argument,##1](\alph{argument}) {\argstyle{##3}}; - }{% - \node[argument size,argument,##1](\alph{argument}) at (##5) {\argstyle{##3}}; - } - }{% - \IfNoValueTF {##5}{% - \node[argument size,argument,##1](##2) {\argstyle{##3}}; - }{% - \node[argument size,argument,##1](##2) at (##5) {\argstyle{##3}}; - } - } - } - }, + indexing/numeric/.code={\@numericidxtrue}, + indexing/alphabetic/.code={\@alphaidxtrue}, + indexing/none/.code={\@numericidxfalse\@alphaidxfalse}, indexing/.default=numeric, indexing=numeric, } +\makeatother + +%%% Option for enabling additional macros +\pgfkeys{/argumentation/.cd, + macros/.is choice, + macros/true/.code={\macrostrue}, + macros/false/.code={\macrosfalse}, + macros/.default=true, + macros=false, +} + +%%% Option for enabling beamer functionality +\pgfkeys{/argumentation/.cd, + beamer/.is choice, + beamer/true/.code={\beamertrue}, + beamer/false/.code={\beamerfalse}, + beamer/.default=true, + beamer=false, +} \ProcessPgfPackageOptions{/argumentation} -%%%%%%%%%%%%%%% AF Environment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% Additional AF Style Parameters -\tikzset{ % global predefined tikz-styles - selfattack/.style={loop,min distance=2mm,in=0,out=60,looseness=5}, % Standard style for self-attacks - inactive/.style={draw=black!30,text=black!40}, % Make a node or edge inactive, i.e., greyed out - incomplete/.style={densely dashed}, % Style for displaying incomplete nodes or attacks - accepted/.style={fill=green}, % Color an argument that is labelled in - rejected/.style={fill=red}, % Color an argument that is labelled out - undecided/.style={fill=cyan}, % Color an argument that is labelled undecided - caption/.style={draw=none}, % Style for displaying AF name in Figure - invisible/.style={draw=none,text=black!0}, % Make a node or edge invisible - annotation/.style={font=\small}, % text annotation style - argin/.style={accepted}, - argout/.style={rejected}, - argundec/.style={undecided}, + +%%%%%%%%%%%%%%% Arguments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\makeatletter +% Internal counter for argument IDs +\newcounter{@argument} + +%%% Command for creating arguments +% #1 TikZ parameters (optional) +% #2 unique argument ID (optional) +% #3 argument display name +% #4 ignored +% #5 absolute positioning values (optional) +\NewDocumentCommand { \argument } {O{} d() m dat d()} {% + \stepcounter{@argument} + \IfNoValueTF {#2}{% + \if@alphaidx + \edef\@argid{\alph{@argument}} + \else\if@numericidx + \edef\@argid{a\arabic{@argument}} + \else + \PackageError{argumentation}{Missing argument ID}{Must either provide argument ID inside () or activate auto-indexing} + \fi\fi + }{% + \edef\@argid{#2} + } + \ifbeamer + \if@insideaf + \@make@argument{#1}{\@argid}{#3}{#4}{#5}{\arabic{af}} + \csname @af@\arabic{af}@arg@\@argid\endcsname{} + \else + \@create@argument{#1}{}{\@argid}{#3}{#5} + \fi + \else + \@create@argument{#1}{}{\@argid}{#3}{#5} + \fi } -%%% Options for af environment -\pgfkeys{/tikz/.cd, - small/.style = {node distance=0.55cm,argument size/.style={minimum size=0.55cm},caption/.append style={font=\small}}, - tiny/.style = {node distance=0.35cm,argument size/.style={minimum size=0.4cm,font=\small},caption/.append style={font=\small}}, +%%% Auxilliary command for creating arguments +% #1 TikZ parameters (optional) +% #2 TikZ parameters (optional) +% #3 unique argument ID (optional) +% #4 argument display name +% #5 absolute positioning value (optional) +\NewDocumentCommand { \@create@argument } {mmmmm} {% + \IfNoValueTF {#5}{% + \node[argument size,argument,#1,#2](#3) {\@arg@style{#4}}; + }{% + \node[argument size,argument,#1,#2](#3) at (#5) {\@arg@style{#4}}; + } } -%%% Initializing the af environment +\ifbeamer +%%% Auxilliary command for creating unique argument macros +% #1 TikZ parameters +% #2 unique argument ID +% #3 argument display name +% #4 ignored +% #5 absolute positioning values +% #6 unique AF ID +\NewDocumentCommand { \@make@argument } {mmmmmm} {% + %\typeout{CREATED NEW MACRO @af@#6@arg#2} + \expandafter\listxadd\csname @arguments@#6\endcsname{#2} + \expandafter\global\expandafter\edef\csname @af@#6@arg@#2\endcsname##1{% + %\typeout{RECALLING MACRO @af@#6@arg#2} + \@create@argument{#1}{##1}{#2}{#3}{#5} + } +} +\fi +\makeatother + + +%%%%%%%%%%%%%%% Attacks & Support %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\makeatletter +%%% Command for creating attacks +% #1 TikZ parameters (optional) +% #2 attacking argument ID +% #3 attacked argument ID +% #4 annotation text (optional) +\NewDocumentCommand { \attack } {O{} m m d()} {% + \ifbeamer + \if@insideaf + \@make@attack{#1}{#2}{#3}{#4}{\arabic{af}} + \csname @af@\arabic{af}@att@#2#3\endcsname{} + \else + \@create@attack{#1}{}{#2}{#3}{#4} + \fi + \else + \@create@attack{#1}{}{#2}{#3}{#4} + \fi +} + +%%% Internal command for creating the attack in TikZ +% #1 TikZ parameters (optional) +% #2 TikZ parameters (optional) +% #3 attacking argument ID +% #4 attacked argument ID +% #5 annotation text +\NewDocumentCommand { \@create@attack } {mmmmm} {% + \IfNoValueTF{#5}{% + \path(#3) edge [attack,#1,#2] (#4); + }{% + \path(#3) edge [attack,#1,#2] node[annotation](p_#3_#4){#5} (#4); + } +} + +\ifbeamer +%%% Auxilliary command for creating unique attack macros +% #1 TikZ parameters +% #2 attacking argument ID +% #3 attacked argument ID +% #4 annotation text +% #5 unique AF ID +\NewDocumentCommand { \@make@attack } {mmmmm} {% + \expandafter\listgadd\csname @attacks@#5\endcsname{#2,#3} + \expandafter\global\expandafter\edef\csname @af@#5@att@#2#3\endcsname##1{ + \@create@attack{#1}{##1}{#2}{#3}{#4} + } +} +\fi + +%%% Self-attack edge +% #1 TikZ parameters (optional) +% #2 argument ID +\NewDocumentCommand { \selfattack } {O{} m} {% + \attack[selfattack,#1]{#2}{#2} +} + +%%% Symmetric attack edges between two arguments +% #1 TikZ parameters (optional) +% #2 first argument ID +% #3 second argument ID +\NewDocumentCommand { \dualattack } {O{} m m} {% + \attack[bend right,#1]{#2}{#3} + \attack[bend right,#1]{#3}{#2} +} + +%%% Create attack edge with value (DEPRECATED as of v1.4) +% #1 TikZ parameters (optional) +% #2 attacking argument ID +% #3 attacked argument ID +% #4 annotation text +\NewDocumentCommand{ \annotatedattack } {O{}mmm} {% + \attack[#1]{#2}{#3}(#4) +} + +%%% Support edge +% #1 TikZ parameters (optional) +% #2 supporting argument ID +% #3 supported argument ID +\NewDocumentCommand { \support } {O{} m m} {% + \path(#2) edge [support=0.35,#1] (#3); +} +\makeatother + + +%%%%%%%%%%%%%%% AF Environment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcounter{af} -\newenvironment{af}[1][]{ - \refstepcounter{af} - \setcounter{argument}{0} + +%%% Uncounted version of the environment +\makeatletter +\NewDocumentEnvironment {af*} {O{}} {% + \setcounter{@argument}{0} \pgfkeys{/argumentation/.cd, #1} - \tikzpicture[#1] + \tikzpicture[standard,af,#1] }{% \endtikzpicture } -%%%%%%%%%%%%%%%% Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% Standard version of af environment +\NewDocumentEnvironment {af} {O{}} {% + \refstepcounter{af} + \ifbeamer + \global\expandafter\def\csname @arguments@\arabic{af}\endcsname{} + \global\expandafter\def\csname @attacks@\arabic{af}\endcsname{} + \fi + \@insideaftrue + \begin{af*}[#1] +}{% + \end{af*} + \@insideaffalse +} +\makeatother -% Creates a node displaying the name of the AF -\NewDocumentCommand { \afname } { O{} D(){caption} m dat d()} { + +%%%%%%%%%%%%%%%% Additional Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% Definitions for referencing +\ifmacros + \providecommand{\AF}{\ensuremath{F}\xspace} % AF abbreviation + \providecommand{\arguments}{\ensuremath{A}\xspace} % Set of arguments + \providecommand{\attacks}{\ensuremath{R}\xspace} % Set of attacks + \providecommand{\AFcomplete}{\ensuremath{\AF = (\arguments, \attacks)}\xspace} % Full AF + \newcommand{\afref}[1]{\ensuremath{\AF_{\ref{#1}}}\xspace} % Reference an AF + \newcommand{\fullafref}[1]{\ensuremath{\afref{#1} = (\arguments_{\ref{#1}}, \attacks_{\ref{#1}})}\xspace} % Full AF with reference +\fi + +%%% Creates a node displaying the name of the AF +\NewDocumentCommand { \afname } { O{} D(){caption} m dat d()} {% \IfNoValueTF {#5}{% \node[caption,#1](#2){#3}; }{% \node[caption,#1](#2) at (#5) {#3}; } - } -\newcommand{\annotation}[3][]{\node[annotation,above of=#2,#1](an_#2){#3};} +%%% Create a text annotation next to another node +\NewDocumentCommand { \annotation } {O{} m m} {% + \node[annotation,above of=#2,#1](an_#2){#3}; +} -% Creates an attack edge -\newcommand{\attack}[3][]{\path(#2) edge [attack,#1] (#3);} +%%% Commands for setting custom tikz-style parameters +\newcommand{\setafstyle}[1]{\tikzset{af/.style={#1}}} +\newcommand{\setargumentcolorscheme}[2]{\tikzset{argument colored/.style={argument thick,fill=#2,draw=#1}}} +\newcommand{\setargumentstyle}[1]{\tikzset{argument/.style={argument size,#1}}} +\newcommand{\setattackstyle}[1]{\tikzset{attack/.style={attack width,#1}}} +\newcommand{\setsupportstyle}[1]{\tikzset{support/.style={#1}}} +\newcommand{\setannotationstyle}[1]{\tikzset{annotation/.style={#1}}} -% Creates a self-attack -\newcommand{\selfattack}[2][]{\path(#2) edge [attack,selfattack,#1] (#2);} -% Creates two symmetric attack edges between two arguments -\newcommand{\dualattack}[3][]{\path(#2) edge [attack, bend right,#1] (#3);\path(#3) edge [attack, bend right,#1] (#2);} +%%%%%%%%%%%% Beamer Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ifbeamer +\makeatletter +%%% Prints an extension of an AF for the given list of accepted arguments +% #1 unique ID of an AF +% #2 a comma-separated list of argument IDs +\NewDocumentCommand { \afextension } {mm} {% + \@prepare@af{#1} + % Collect accepted arguments in list + \forcsvlist{\listeadd\@accepted@arguments}{#2} -% Creates a weighted attack -\newcommand{\annotatedattack}[4][]{\path(#2) edge [attack,#1] node[annotation](p_#2_#3){#4} (#3);} + % render the af with the given information + \@render@af{\@afid}{accepted}{}{}{}{} +} -% Creates a support edge between two arguments -\newcommand{\support}[3][]{\path(#2) edge [support=0.35,#1] (#3);} +%%% Prints a labeling of an AF for the given list of accepted arguments +% #1 unique ID of an AF +% #2 a comma-separated list of argument IDs +\NewDocumentCommand { \aflabeling } {mm} {% + \@prepare@af{#1} + % Collect accepted arguments in list + \forcsvlist{\listeadd\@accepted@arguments}{#2} -%%% Commands for setting custom tikz-style parameters -\newcommand{\setargumentstyle}[1]{\tikzset{argument/.style={#1}}} -\newcommand{\setattackstyle}[1]{\tikzset{attack/.style={#1}}} -\newcommand{\setsupportstyle}[1]{\tikzset{support/.style={#1}}} -\newcommand{\setannotationstyle}[1]{\tikzset{annotation/.style={#1}}} + % Collect rejected arguments in list + \renewcommand*{\do}[1]{ + \expandafter\@split@pair##1\relax + \xifinlist{\@attacker}{\@accepted@arguments}{% + \listeadd\@rejected@arguments{\@attacked} + }{} + } + \dolistcsloop{@attacks@\@afid} -%\newcommand{\setloopstyle}[1]{\tikzset{selfattack/.style={#1}}} -%\newcommand{\adjustargumentstyle}[1]{\tikzset{argument/.append style={#1}}} -%\newcommand{\adjustattackstyle}[1]{\tikzset{attack/.append style={#1}}} + % Collect undecided arguments in list + \renewcommand*{\do}[1]{ + \xifinlist{##1}{\@accepted@arguments}{}{ + \xifinlist{##1}{\@rejected@arguments}{}{ + \listadd\@undecided@arguments{##1} + } + } + } + \dolistcsloop{@arguments@\@afid} + % render the af with the given information + \@render@af{\@afid}{accepted}{rejected}{undecided}{}{} +} + +%%% Prints the reduct of an AF wrt. the given list of arguments +% #1 unique ID of an AF +% #2 a comma-separated list of argument IDs +\NewDocumentCommand { \afreduct } {mm} {% + \@prepare@af{#1} + \forcsvlist{\listeadd\@accepted@arguments}{#2} + \forcsvlist{\listeadd\@inactive@arguments}{#2} + + \renewcommand*{\do}[1]{ + \expandafter\@split@pair##1\relax + \xifinlist{\@attacker}{\@accepted@arguments}{% + \listeadd\@rejected@arguments{\@attacked} + \listeadd\@inactive@arguments{\@attacked} + }{} + } + \dolistcsloop{@attacks@\@afid} + + \@render@af{\@afid}{inactive}{inactive}{}{inactive}{} +} + +%%% Prints an AF restricted to the given list of arguments +% #1 unique ID of an AF +% #2 a comma-separated list of argument IDs +\NewDocumentCommand { \afrestriction } {mm} {% + \@prepare@af{#1} + \forcsvlist{\listeadd\@accepted@arguments}{#2} + + \renewcommand*{\do}[1]{% + \ifinlist{##1}{\@accepted@arguments}{}{ + \listeadd\@inactive@arguments{##1} + } + } + \dolistcsloop{@arguments@\@afid} + + \@render@af{\@afid}{}{}{}{invisible}{} +} + +%%% Prepares recreation of an AF. Parses AF label to letter ID and defines lists to partition arguments +% #1 unique ID of the AF to recreate +\NewDocumentCommand { \@prepare@af } {m} {% + \edef\@afid{\getrefnumber{#1}} + \def\@accepted@arguments{} + \def\@rejected@arguments{} + \def\@undecided@arguments{} + \def\@inactive@arguments{} +} + +%%% name of innermost af environment +\def\@afenvname{af*} + +%%% Prepares recreation of AF by making sure we are inside an af environment +% #1 unique ID of the AF to recreate +% #2-#6 style parameters (see \@render@afdo) +\NewDocumentCommand { \@render@af } {mmmmmm} {% + \ifx\@currenvir\@afenvname + \@render@afdo{#1}{#2}{#3}{#4}{#5}{#6} + \else + \begin{af*} + \@render@afdo{#1}{#2}{#3}{#4}{#5}{#6} + \end{af*} + \fi +} + +%%% Recreates an AF +%% Utilises lists defined in \@prepare@af +% #1 unique ID of the AF to recreate +% #2 style of accepted arguments +% #3 style of rejected arguments +% #4 style of undecided arguments +% #5 style of inactive arguments/attacks +% #6 style of normal attacks +\NewDocumentCommand { \@render@afdo } {mmmmmm} {% + % handle arguments for rendering + \renewcommand*{\do}[1]{% + \ifinlist{##1}{\@accepted@arguments}{ + \csname @af@#1@arg@##1\endcsname{#2} + }{% + \ifinlist{##1}{\@rejected@arguments}{% + \csname @af@#1@arg@##1\endcsname{#3} + }{% + \ifinlist{##1}{\@undecided@arguments}{% + \csname @af@#1@arg@##1\endcsname{#4} + }{% + \ifinlist{##1}{\@inactive@arguments}{% + \csname @af@#1@arg@##1\endcsname{#5} + }{% + \csname @af@#1@arg@##1\endcsname{} + } + } + } + } + } + \dolistcsloop{@arguments@#1} + + % handle attack rendering + \renewcommand*{\do}[1]{% + \expandafter\@split@pair##1\relax + \xifinlist{\@attacker}{\@inactive@arguments}{% + \csname @af@#1@att@\@attacker\@attacked\endcsname{#5,fill=none} + }{% + \xifinlist{\@attacked}{\@inactive@arguments}{% + \csname @af@#1@att@\@attacker\@attacked\endcsname{#5,fill=none} + }{% + \csname @af@#1@att@\@attacker\@attacked\endcsname{#6} + } + } + } + \dolistcsloop{@attacks@#1} +} +\makeatother +\fi
\ No newline at end of file diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex index 0806a20b78..19a5cd01f3 100644 --- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex +++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex @@ -5,6 +5,38 @@ full list of changes. \begin{itemize} \item + Version 1.7.0 (2024-08-03) + + There are no big changes here, but the change to the resistor code + (maybe one of the most used by the package) well deserves a minor + version bump. A couple of new components, and several minor fixes. + + \begin{itemize} + \tightlist + \item + New component: new kind of current tap (suggested by + \href{https://github.com/circuitikz/circuitikz/issues/807}{EEpchi + and Dr4UX on GitHub}) + \item + New arrow tip \texttt{Jack\ Tap} to help drawing jack connectors + (suggested by + \href{https://github.com/circuitikz/circuitikz/issues/806}{Anisio + Rogerio Braga}) + \item + Change the drawing of the thermocouple (suggested by + \href{https://github.com/circuitikz/circuitikz/issues/811}{Dr4UX on + GitHub}) + \item + Change and enhancement to the drawing of the American resistors + (triggered by + \href{https://github.com/circuitikz/circuitikz/issues/814}{Dr4UX on + GitHub}), fixing a long-standing small asymmetry that nobody noticed + \item + Minor adjustment for joins in \texttt{viscoe} component + \item + Minor additions (\texttt{rectjoinfill}) and fixes in documentation + \end{itemize} +\item Version 1.6.9 (2024-05-25) Several new components and a bug fix for a nasty long-standing bug @@ -495,7 +527,7 @@ full list of changes. Robustify some shapes: do not let arrows option pass to the inner drawing (see \href{https://tex.stackexchange.com/a/632084/38080}{here} and - \href{https://matrix.to/\#/!NuxCISwYQJuyWwNsEI:matrix.org/$vQO6luq1F66LJ79dERmaqKI46qMBcjStqYCPi725uZE?via=matrix.org&via=2krueger.de&via=im.f3l.de}{here}) + \href{https://matrix.to/\#/!NuxCISwYQJuyWwNsEI:matrix.org/$vQO6luq1F66LJ79dERmaqKI46qMBcjStqYCPi725uZE?via=matrix.org\&via=2krueger.de\&via=im.f3l.de}{here}) \item Add warning about global draw options in the manual \item diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf Binary files differindex cc6865c72f..032692e01f 100644 --- a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf +++ b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf Binary files differindex 9f3d2b57e0..023c265d6e 100644 --- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf +++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex index ac116af09e..e0fa8032b1 100644 --- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex +++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex @@ -2200,6 +2200,83 @@ For the \texttt{photoresistor} and the two ``flavors'' of the light-dependent re \end{tikzpicture} \end{LTXexample} +\begingroup % protect changes to resistors +\newcommand\showjoin[1]{% +\begin{tikzpicture}[scale=4, transform shape] + \clip (0.2,-0.05) rectangle (0.6,0.3); + \draw[ultra thick] (0,0) to[R, resistors/thickness=#1] ++(2,0); +\end{tikzpicture}% +} +\newcommand{\splat}{\begin{center}\ttfamily\scriptsize\begin{tabular}{cccc} + \showjoin{1}&\showjoin{2}&\showjoin{3}&\showjoin{4}\\ + thickness=1 & thickness=2 & thickness=3 & thickness=4 \\ + \end{tabular}\end{center}% +} +\newcommand{\rdivider}[1]{\begin{tikzpicture} + \ctikzset{resistors/thickness=#1} + \draw (0,0) node[ground]{} to[V] ++(0,2) to[R] ++(2,0) + to[R] ++(0,-2) to[short,-*] (0,0); +\end{tikzpicture}\qquad} +\newcommand{\divsplat}[1]{#1\par + \begin{center} + \rdivider{1}\rdivider{2}\rdivider{3}\rdivider{4} +\end{center}} + +\paragraph{Details of American (``zig-zag'') resistors.\label{sec:zigzag-details}} American (zig-zag) resistors have a little joining problem\footnote{Noticed by \href{https://github.com/circuitikz/circuitikz/issues/811}{user Dr4UX on GitHub} and later \href{https://github.com/circuitikz/circuitikz/discussions/814}{discussed here}.} with the leading wires if the thickness is greater than two. In the following drawing you can see the problem when the thickness grows from 1 to 4. + +\splat + +Since \texttt{v1.7.0}, one possibility to correct the problem is to change the type of joining of the zig-zag line, using the key \texttt{resistors/zigzag join}, which is a command that by default is void. For example, the following effect is obtained by using + +\begin{lstlisting}[numbers=none] +\ctikzset{resistors/zigzag hook/.code={\pgfsetroundcap}} +\end{lstlisting} +{\ctikzset{resistors/zigzag hook/.code={\pgfsetroundcap}} +\splat} + +or you can even go full rounded + +\begin{lstlisting}[numbers=none] +\ctikzset{resistors/zigzag hook/.code={\pgfsetroundcap\pgfsetroundjoin}} +\end{lstlisting} +{\ctikzset{resistors/zigzag hook/.code={\pgfsetroundcap\pgfsetroundjoin}} +\splat} + +Another possibility is to add a little horizontal ``stub'' to the shape, with the key \texttt{resistors/zigzag stub} (default \texttt{0}), which will add a first part which is a continuation of the wire: +\begin{lstlisting}[numbers=none] +\ctikzset{resistors/zigzag stub=0.05}% this is relative to the resistor's length +\end{lstlisting} +{\ctikzset{resistors/zigzag stub=0.05} +\splat} + +\dots or you can just combine all of them as you prefer. With the standard join/cap options, the look of the resistors for thickness from 1 to 4 is shown here: + +\ctikzset{american} +\divsplat{Standard drawing of American resistors} +\divsplat{With a 5\% stub: \ctikzset{resistors/zigzag stub=0.05}} +\divsplat{With a 20\% stub: \ctikzset{resistors/zigzag stub=0.2}} + + +\bigskip +Finally, here is the detailed shape with thickness 2 (red=0, blue=0.05, green=0.2), magnified six times: + +\vspace*{2cm}% this vspace fences are needed because the transform canvas wreak havoc with the bbox +\begin{tikzpicture}[transform canvas={scale=6}] + \ctikzset{resistors/zigzag stub=0} + \draw[red] (0,0.2) to [resistor, resistors/thickness=4] ++(2,0); + \ctikzset{resistors/zigzag stub=0.05} + \draw[blue] (0,0.1) to [resistor, resistors/thickness=4] ++(2,0); + \ctikzset{resistors/zigzag stub=0.2} + \draw[green] (0,0) to [resistor, resistors/thickness=4] ++(2,0); + % \draw [very thin](1,0.5) -- (1,-0.5); + % \draw [very thin](0,0) -- ++(2,0); + % \draw [very thin](0,0.1) -- ++(2,0); + % \draw [very thin](0,0.2) -- ++(2,0); +\end{tikzpicture} +\vspace*{2cm} + +\endgroup % changes to resistors stops here + \subsection{Capacitors and inductors: dynamical bipoles} @@ -2852,9 +2929,9 @@ Notice that the size of the double-circle sources (and of the triple-circle one) \end{LTXexample} \paragraph{Waveform symbols.} -Internal symbols of sinusoidal, triangular and square sources are drawn with the same line thickness as the component by default. You can modify this by setting the key \texttt{sources/symbols/thickness} for independent sources and the corresponding \texttt{csource/...} for dependent ones. The value used here is relative to the component (i.e. the circle) value. +Internal symbols of sinusoidal, triangular and square sources are drawn with the same line thickness as the component by default. You can modify this by setting the key \texttt{sources/symbol/thickness} for independent sources and the corresponding \texttt{csource/...} for dependent ones. The value used here is relative to the component (i.e. the circle) value. -Normally the symbol is oriented in the same direction as the line, and rotate rigidly with the component; you can change this orientation using the key \texttt{sources/symbols/rotate} or \texttt{csource/...}. The default value is \texttt{90} which correspond to the ``line'' direction (remember, path components are defined as horizontal ones). +Normally the symbol is oriented in the same direction as the line, and rotate rigidly with the component; you can change this orientation using the key \texttt{sources/symbol/rotate} or \texttt{csource/...}. The default value is \texttt{90} which correspond to the ``line'' direction (remember, path components are defined as horizontal ones). If instead of an angle value you use \texttt{auto}, the symbol will be rotated so that the waveform is always vertical, similar to what happens in instruments: \begin{LTXexample}[varwidth=true] @@ -3019,12 +3096,44 @@ Sometimes it is better to use a shape for instruments which is very different fr \footnotetext{Suggested by \texttt{@nobrl} on GitHub} \circuitdescbip{iloop}{Current loop (symbolic)}{}(left/135/0.2, right/45/0.2, center/-90/0.3, i/30/0.4) \circuitdescbip{iloop2}{Current loop (real)}{}(left/135/0.2, right/-45/0.2, center/-90/0.3, i+/135/0.4, i-/45/0.4) + \circuitdescbip{currtap}{Current tap (probe)\footnotemark}{}(tap/-90/0.2) + \footnotetext{Suggested by \href{https://github.com/circuitikz/circuitikz/issues/807}{user EEpchi on GitHub}.} \end{groupdesc} \subsubsection{Instruments customizations}\label{sec:tweak-instruments} You can change the scale of all the instruments (including the current loops) by setting the key \texttt{instruments/scale} to something different from the default \texttt{1.0}. +\paragraph{Current probes.} +You can change the inner dot in several way, by changing the following keys under the \verb!\ctikzset! key \texttt{bipoles/currtap}: +\begin{center} + \begin{tabular}{>{\ttfamily}l>{\ttfamily}lp{0.7\linewidth}} + \toprule + parameter & default & description \\ + \midrule + thickness & default & Set the thickness of the line (\texttt{default}: do not change the class thickness) \\ + color & default & stroke color: \texttt{default} is the same as the component \\ + dash & default & dash pattern: none means solid line, default means keep the global pattern\footnotemark \\ + fill & default & fill the inner dot; \texttt{default} means use the wire color, \texttt{none} do not fill, other keys must be a valid color \\ + dot size& 0.5 & relative size of the inner dot \\ + \bottomrule + \end{tabular} + \footnotetext{Follows the syntax of the pattern sequence \texttt{\textbackslash pgfsetdash} --- see \TikZ{} manual for details; phase is always zero. Basically you pass pairs of dash-length -- blank-length dimensions, see the examples.} +\end{center} + +\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily] +\begin{circuitikz} + \draw (0,2) to[currtap, bipoles/currtap/fill=none, *-] + ++(2,0) to[currtap, bipoles/currtap/.cd, + fill=yellow, color=red, thickness=3, + dash={{1.14pt}{2pt}}] ++(2,0); + \draw (0,0) to[currtap=I, *-, name=ct] ++(2,0) + to[currtap, -*, name=ct2, + bipoles/currtap/dot size=0.3] ++(2,0); + \draw (ct.tap) -- ++(0,-1) (ct2.tap) -- ++(0,-1); +\end{circuitikz} +\end{LTXexample} + \paragraph{Oscilloscope waveform.} You can change the waveform shown in the oscilloscope ``screen''\footnote{Suggested by \href{https://tex.stackexchange.com/q/595062/38080}{Mario Tafur on TeX.SX}}. To change it, you just set the key \texttt{bipoles/oscope/waveform} to one of the available shape. You have available the shapes in the following list (the default is \texttt{ramps}): \begin{LTXexample}[pos=t, basicstyle=\small\ttfamily] @@ -3478,9 +3587,9 @@ While the horizontal line will be drawn with the current path values, you can ch \end{circuitikz} \end{LTXexample} -\subsection{Arrows}\label{sec:arrows} +\subsection{Arrows (fake and real)}\label{sec:arrows} -These are pseudo-arrows used in lot of places in the packages (for transistors, flows, currents, and so on). The first three arrows are magnified by a factor~3 in the boxes below; for the \texttt{trarrow}, the anchor \texttt{tip} is exactly on the tip and \texttt{btip} is slightly receded. +The main arrow shapes in \Circuitikz{} are really shapes, used as pseudo-arrows in lot of places in the packages (for transistors, flows, currents, and so on). The first three arrows are magnified by a factor~3 in the boxes below; for the \texttt{trarrow}, the anchor \texttt{tip} is exactly on the tip and \texttt{btip} is slightly receded. \begin{groupdesc} \circuitdesc[3]{currarrow}{Arrow for current and voltage}{}(center/0/0.2) @@ -3540,6 +3649,30 @@ The arrows are the ones set with the keys \texttt{tunable start arrow} and \text Notice also the need to force a transparency group if you want a semitransparent arrow. +\subsubsection{Arrow tips}\label{sec:arrow-tips} + +In addition to the pseudo-arrows, \Circuitikz{} also adds a couple of ``real'' arrow tips. +The package automatically loads the \texttt{arrows.meta} \TikZ{} library but \emph{not} the deprecated \texttt{arrows} library; in the first versions of the package it used quite a lot the \texttt{latex'} tip, which is not available anymore. To maintain the backward compatibility, the `latexslim` tip has been added, and used by default in several components. This is an old-style arrow tip, with no customization possible. + +The other tip is \texttt{Jack Tap}\footnote{Added after a suggestion from \href{https://github.com/circuitikz/circuitikz/issues/806}{Anisio Rogerio Braga} on GitHub}, which is mainly used to build jack connectors (see section~\ref{sec:jacks}). This is a new-style arrow tip, and accepts the parameter \texttt{length} (default \texttt{0.3 cm}), \texttt{width} (default \texttt{0.15 cm}), and the boolean \texttt{swap}. + + +\begin{LTXexample}[varwidth=true] +\begin{circuitikz} + \draw (0,.25) (0,0) edge[-latexslim] ++(1,0) + ++(0, -0.5) edge[-{Jack Tap[swap]}] ++(1,0) + ++(0, -0.5) edge[-Jack Tap] ++(1,0) + ++(0, -0.5) edge[-{Jack Tap[fill=cyan]}] ++(1,0) + ++(0, -0.5) edge[-{Jack Tap[width=.3cm,fill]}]++(1,0) + ++(0, -0.5) edge[-{Jack Tap[width=.3cm,line join=round, + line cap=round]}, thick] ++(1,0) + ++(0, -0.5) edge[^-^f] ++(1,0) + ++(0, -0.5) edge[vf-v] ++(1,0); +\end{circuitikz} +\end{LTXexample} +You can also have a filled version, by adding the key \texttt{fill} (without arguments\footnote{This usage of the \texttt{fill} key in arrow tips will be added to \TikZ{} in version \texttt{3.1.11}, see \href{https://github.com/pgf-tikz/pgf/pull/1352}{this PR by Henri Menke}; \Circuitikz{} will add it to older versions.}) or \texttt{fill=color} if you want a color different from the stroke ones, and they accept the \texttt{line join} and \texttt{line cap} as most of the standard \TikZ{} arrows. +As you can see, the normal and swapped \texttt{Jack Tap} tips have the shorthands \texttt{v} and \verb|^| (and \texttt{vf} and \verb|^f| for their filled counterparts). Notice that the tips are automatically reversed when they are at the \emph{start} of the path. + \subsection{Terminal shapes}\label{sec:terminals} These are the so-called ``bipole nodes'' shapes, or poles (see section~\ref{sec:bipole-nodes}). These nodes are always filled; the ``open'' versions (starting with an \texttt{o}) are by default filled with the color specified by the key \texttt{open nodes fill} (by default \texttt{white}), but you can override locally it with the \texttt{fill} parameter. @@ -3553,6 +3686,12 @@ These are the so-called ``bipole nodes'' shapes, or poles (see section~\ref{sec: \circuitdesc{osquarepole}{Open square-shape terminal}{} \end{groupdesc} +This is not a pole, but it's used to "fill" nasty corners (look closer, and see ~\ref{sec:line-joins}). + +\begin{groupdesc} + \circuitdesc{rectjoinfill}{Filling square with line width size}{} +\end{groupdesc} + Since version 0.9.0, ``bipole nodes'' shapes have all the standard geographical anchors, so you can do things like these: \begin{LTXexample}[varwidth=true] @@ -3672,6 +3811,33 @@ You can use the \texttt{plug center} anchor to add the IEC ``multiplier'': \end{circuitikz} \end{LTXexample} +\subsubsection{Jack connectors}\label{sec:jacks} + +There are \emph{lots} of different jack connectors symbols --- see the \href{https://github.com/circuitikz/circuitikz/issues/806}{discussion here} for examples. So instead of creating a monster component, it has been decided to add elements to simplify the drawing of such connectors. The first (and for now only) such element is the \texttt{Jack Tap} arrow tip (see section~\ref{sec:arrow-tips}) with its shorthands \texttt{v} and \verb|^|. + +For example, and audio jack can be drawn like this: + +\begin{LTXexample}[pos=t, varwidth=true] +% drawing based on one by Anisio Rogerio Braga +% https://github.com/circuitikz/circuitikz/issues/806 +\newcommand\dx{1.5}\newcommand\dy{1} +\begin{circuitikz} + \draw[-v] (0,\dy/3*4) to[short, o-] ++(\dx,0); + \draw[-Triangle] (0,\dy) node[ocirc]{} -| ++(\dx/3,\dy/3); + \draw[-Triangle] (0,\dy/3*2) node[ocirc]{} -| ++(\dx/3,-\dy/3); + \draw[-^] (0,\dy/3) to[short, o-] ++(2*\dx/3,0); + \draw (0,0.0) to[short, o-] ++(1.75*\dx,0) rectangle ++(0.2,4*\dy/3); +\end{circuitikz}\qquad\qquad +%---% audio jack with an inserted plug +\begin{circuitikz} + \draw[-v] (0,\dy/3*4) to[short, o-] ++(\dx,0.2); + \draw[-Triangle] (0,\dy) node[ocirc]{} -| ++(\dx/3,\dy/3); + \draw[-Triangle] (0,\dy/3*2) node[ocirc]{} -| ++(\dx/3,-\dy/3); + \draw[-^] (0,\dy/3) to[short, o-] ++(2*\dx/3,-0.2); + \draw (0,0.0) to[short, o-] ++(1.75*\dx,0) rectangle ++(0.2,4*\dy/3); +\end{circuitikz} +\end{LTXexample} + \subsection{Block diagram components} \noindent Contributed by Stefan Erhardt. @@ -6596,7 +6762,7 @@ with the parameter \texttt{number inputs} : \end{circuitikz} \end{LTXexample} -You can suppress the drawing of the logic ports input leads by using the boolean key \texttt{logic ports draw input leads} (default \texttt{true}) or, locally, with the style \texttt{no inputs leads} (that can be reverted with \texttt{input leads}), like in the following example. The anchors do not change and you have to take responsibility to make the connection to the ``border''-anchors. +You can suppress the drawing of the logic ports input leads by using the boolean key \texttt{logic ports draw input leads} (default \texttt{true}) or, locally, with the style \texttt{no input leads} (that can be reverted with \texttt{input leads}), like in the following example. The anchors do not change and you have to take responsibility to make the connection to the ``border''-anchors. \begin{LTXexample}[varwidth=true] \begin{circuitikz} @@ -7436,9 +7602,9 @@ External pins' length is controlled by the key \texttt{multipoles/external pins like in chips. In addition, like in logic ports, you can suppress the drawing of the leads by using the boolean key \texttt{logic ports draw input leads} (default \texttt{true}) or, locally, -with the style \texttt{no inputs leads} (that can be reverted with +with the style \texttt{no input leads} (that can be reverted with \texttt{input leads}). -The main difference between setting \texttt{external pins width} to \texttt{0} or using \texttt{no inputs lead} is that in the first case the normal pin anchors and the border anchors will coincide, and in the second case they will not move and stay where they should have been if the leads were drawn. +The main difference between setting \texttt{external pins width} to \texttt{0} or using \texttt{no input lead} is that in the first case the normal pin anchors and the border anchors will coincide, and in the second case they will not move and stay where they should have been if the leads were drawn. You can draw only selected pins and leave out the rest by setting the keys \texttt{multipoles/draw only \emph{side} pins} and the corresponding style @@ -7840,7 +8006,7 @@ You can, if you want, avoid printing the numbers of the pin with \texttt{hide nu \end{LTXexample} -Also, you can suppress the drawing of the pins, by using the style \texttt{no inputs leads} (that can be reverted with \texttt{input leads}). The main difference between setting \texttt{external pins width} to \texttt{0} or using \texttt{no inputs lead} is that in the first case the normal pin anchors and the border anchors will coincide, and in the second case they will not move and stay where they should have been if the leads were drawn. +Also, you can suppress the drawing of the pins, by using the style \texttt{no input leads} (that can be reverted with \texttt{input leads}). The main difference between setting \texttt{external pins width} to \texttt{0} or using \texttt{no input lead} is that in the first case the normal pin anchors and the border anchors will coincide, and in the second case they will not move and stay where they should have been if the leads were drawn. For special use you can suppress the orientation mark with the key \texttt{no topmark} (default \texttt{topmark}). diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty index afa91d4b2b..4f5ce00a0f 100644 --- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty +++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty @@ -16,8 +16,8 @@ \providecommand\DeclareRelease[3]{} \providecommand\DeclareCurrentRelease[2]{} -\def\pgfcircversion{1.6.9} -\def\pgfcircversiondate{2024/05/25} +\def\pgfcircversion{1.7.0} +\def\pgfcircversiondate{2024/08/03} \DeclareRelease{0.4}{2012/12/20}{circuitikz-0.4-body.tex} \DeclareRelease{v0.4}{2012/12/20}{circuitikz-0.4-body.tex} diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex index 943745bf7a..cca735bf1e 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex @@ -266,6 +266,58 @@ % %>>> +%% check loaded TikZ/pgf version %<<<` +% +% parse the release date, thanks to Skillmon +% https://github.com/pgf-tikz/pgf/issues/1348#issuecomment-2231681032 +% date can be yyyy-mm-dd or (older TikZ) yyyy/mm/dd +\begingroup + \pgfutil@protected\def\parsedate#1% + {% + \afterassignment\parsedate@month + \pgf@circ@count@a=#1\relax + } + \pgfutil@protected\def\parsedate@month#1% + {% + \afterassignment\parsedate@day + \pgf@circ@count@b=% + } + \pgfutil@protected\def\parsedate@day#1% + {% + \afterassignment\parsedate@cleanup + \pgf@circ@count@c=% + } + \def\parsedate@cleanup#1\relax{}% + \parsedate{\pgfrevisiondate}% + \xdef\ctikz@@pgfyear{\the\pgf@circ@count@a}% + \xdef\ctikz@@pgfmonth{\the\pgf@circ@count@b}% + \xdef\ctikz@@pgfday{\the\pgf@circ@count@c}% +\endgroup +% The following code thanks to Skillmon: +% https://tex.stackexchange.com/a/722570/38080 +% modified by romano to check the date +\def\ctikz@@ifpgfafter@auxi#1#2% + {% + \ifnum#1 + \ctikz@@ifpgfafter@auxii{#2}% + \fi + } +\def\ctikz@@ifpgfafter@auxii#1\fi#2\ctikz@@ifpgfafter#3{\fi#1} +\def\ctikz@@ifpgfafter#1-#2-#3#% + {% + \ctikz@@ifpgfafter@auxi{\ctikz@@pgfyear>#1}\pgfutil@firstoftwo + \ctikz@@ifpgfafter@auxi{\ctikz@@pgfyear<#1}\pgfutil@secondoftwo + \ctikz@@ifpgfafter@auxi{\ctikz@@pgfmonth>#2}\pgfutil@firstoftwo + \ctikz@@ifpgfafter@auxi{\ctikz@@pgfmonth<#2}\pgfutil@secondoftwo + \ctikz@@ifpgfafter@auxi{\ctikz@@pgfday<#3}\pgfutil@secondoftwo + \pgfutil@gobble\ctikz@@ifpgfafter\pgfutil@firstoftwo + } +% +% usage \ctikz@@ifpgfafter 2023-01-16{true}{false} +% ^^^ no spaces here, braces needed. +% +%>>> + %% arrow tips macros and utilities %<<<1 % the default arrow is latexslim, which has been ported over old arrows library (deprecated) @@ -298,9 +350,70 @@ \pgfpathclose \pgfusepathqfill } - \pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim} - +%% Jack Tap, see +%% https://github.com/circuitikz/circuitikz/issues/806 +\pgfdeclarearrow{name=Jack Tap, + parameters = {% + \the\pgfarrowlength,% + \the\pgfarrowwidth,% + \ifpgfarrowswap s\fi% + \ifpgfarrowopen o\fi% + \ifpgfarrowroundjoin j\fi + \ifpgfarrowroundcap c\fi% + }, + setup code = { + \pgfarrowssettipend{.5\pgfarrowlength} + \pgfarrowssetlineend{-.6\pgfarrowlength} + \pgfarrowssetvisualbackend{-.6\pgfarrowlength} + \pgfarrowssetbackend{-.6\pgfarrowlength} + % hull + \pgfarrowshullpoint{.5\pgfarrowlength}{0pt} + \pgfarrowshullpoint{0pt}{\pgfarrowwidth} + \pgfarrowshullpoint{-.6\pgfarrowlength}{0pt} + % Saves: Only the length: + \pgfarrowssavethe\pgfarrowlength + \pgfarrowssavethe\pgfarrowwidth + }, + drawing code = { + \pgfsetdash{}{+0pt} + \pgfarrowlinewidth=\pgflinewidth + \ifpgfarrowroundjoin\pgfsetroundjoin\else\pgfsetmiterjoin\fi + \ifpgfarrowroundcap\pgfsetroundcap\else\pgfsetbuttcap\fi + \pgfpathmoveto{\pgfqpoint{-.6\pgfarrowlength}{0pt}} + \pgfpathlineto{\pgfqpoint{-.5\pgfarrowlength}{0pt}} + \pgfpathlineto{\pgfqpoint{0pt}{\pgfarrowwidth}} + \pgfpathlineto{\pgfqpoint{.5\pgfarrowlength}{0pt}} + \ifpgfarrowopen + \pgfusepathqstroke + \else + \pgfpathclose + \ifdim\pgfarrowlinewidth>0pt\pgfusepathqfillstroke\else\pgfusepathqfill\fi + \fi + }, + defaults = {length = 0.3cm, width=0.15cm, open}, + % cache=false, % breaks everything +} +% the new "fill without arg" will be in TikZ 3.1.11. Apply it here if we have an +% older version +\ctikz@@ifpgfafter 2023-01-16{\relax}{% + % thanks @muzimuzhi https://github.com/pgf-tikz/pgf/issues/1348#issuecomment-2229075269 + % undo the fill/.value required key + \expandafter\let\csname pgfk@/pgf/arrow keys/fill/.@def\endcsname\@undefined + \pgfkeys{/pgf/arrow keys/fill/.code={% + \def\pgf@temp{#1}% + \ifx\pgf@temp\pgf@nonetext% + \pgfarrowsaddtooptions{\pgfarrowopentrue}% + \else\ifx\pgf@temp\pgfkeysnovalue@text% + \pgfarrowsaddtooptions{\pgfarrowopenfalse}% + \else + \pgfarrowsaddtooptions{\pgfarrowopenfalse\def\pgf@arrows@fill@color{#1}}% + \fi\fi + }}% +} +\tikzset{v/.tip={Jack Tap[swap]}, ^/.tip={Jack Tap}, + vf/.tip={Jack Tap[swap,fill]}, ^f/.tip={Jack Tap[fill]}} +% % select the arrows using available defaults. \def\pgfcirc@arrow@default{default} % choose the arrows to use. Use #2 and #3 if the key is equal to "default" @@ -466,7 +579,30 @@ \fi \fi } - +% similar o the above, use the fill parameter to set fill or draw +% for a subset of the shape +\def\pgf@circ@subset@fill@or@draw#1{% + % You *must* be sure that this is called inside a \pgfscope! + \edef\@@none{none}\edef\@@default{default} + \edef\@@tmp{\ctikzvalof{#1/fill}} + \ifx\@@tmp\@@none + \pgfusepath{draw} + \else + \ifx\@@tmp\@@default\else + \pgfsetfillcolor{\@@tmp} + \fi + \pgfusepath{draw, fill} + \fi +} +% ...and for the thickness +\def\pgf@circ@subset@thickness#1{% + % You *must* be sure that this is called inside a \pgfscope! + \edef\@@default{default} + \edef\@@tmp{\ctikzvalof{#1/thickness}} + \ifx\@@tmp\@@default\else + \pgfsetlinewidth{\@@tmp\pgflinewidth}% + \fi +} % set the text color (via \color) if the color is not default or none % needed in some strange case (like bodydiode' dots) \def\pgf@circ@maybe@color#1{% @@ -557,6 +693,7 @@ % #7 - macros drawing the bipole % \long\def\pgfcircdeclarebipolescaled#1#2#3#4#5#6#7{ + % \typeout{Declaring bipole:\space #4,} \pgfdeclareshape{#4shape}{ \savedmacro{\ctikzclass}{\edef\ctikzclass{#1}} \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} @@ -602,97 +739,33 @@ \pgf@y=.5\pgf@y } \anchor{center}{\pgfpointorigin} - \anchor{n}{ - \northeast - \pgf@x=0cm - } - \anchor{north east}{ - \northeast - } - \anchor{north west}{ - \northeast - \pgf@x=-\pgf@x - } - \anchor{ne}{ - \northeast - } - \anchor{nw}{ - \northeast - \pgf@x=-\pgf@x - } - \anchor{e}{ - \northeast - \pgf@y=0cm - } - \anchor{s}{ - \southwest - \pgf@x=0cm - } - \anchor{south east}{ - \southwest - \pgf@x=-\pgf@x - } - \anchor{south west}{ - \southwest - } - \anchor{se}{ - \southwest - \pgf@x=-\pgf@x - } - \anchor{sw}{ - \southwest - } - \anchor{w}{ - \southwest - \pgf@y=0cm - } - \anchor{north}{ - \northeast - \pgf@x=0cm - } - \anchor{east}{ - \northeast - \pgf@y=0cm - } - \anchor{south}{ - \southwest - \pgf@x=0cm - } - \anchor{west}{ - \southwest - \pgf@y=0cm - } - \anchor{right}{ - \northeast - \pgf@y=0cm - } - \anchor{above}{ - \northeast - \pgf@x=0cm - } - \anchor{left}{ - \southwest - \pgf@y=0cm - } - \anchor{below}{ - \southwest - \pgf@x=0cm - } - \anchor{a}{ - \northeast - \pgf@y=0cm - } - \anchor{b}{ - \southwest - \pgf@y=0cm - } + \anchor{n}{\northeast\pgf@x=0cm } + \anchor{north east}{\northeast} + \anchor{north west}{\northeast\pgf@x=-\pgf@x} + \anchor{ne}{\northeast} + \anchor{nw}{\northeast\pgf@x=-\pgf@x} + \anchor{e}{\northeast\pgf@y=0cm } + \anchor{s}{\southwest\pgf@x=0cm } + \anchor{south east}{\southwest\pgf@x=-\pgf@x} + \anchor{south west}{\southwest} + \anchor{se}{\southwest\pgf@x=-\pgf@x} + \anchor{sw}{\southwest} + \anchor{w}{\southwest\pgf@y=0cm } + \anchor{north}{\northeast\pgf@x=0cm } + \anchor{east}{\northeast\pgf@y=0cm } + \anchor{south}{\southwest\pgf@x=0cm } + \anchor{west}{\southwest\pgf@y=0cm } + \anchor{right}{\northeast\pgf@y=0cm } + \anchor{above}{\northeast\pgf@x=0cm } + \anchor{left}{\southwest\pgf@y=0cm } + \anchor{below}{\southwest\pgf@x=0cm } + \anchor{a}{\northeast\pgf@y=0cm } + \anchor{b}{\southwest\pgf@y=0cm } \savedanchor{\textanchor}{% \pgf@y=\ht\pgfnodeparttextbox \pgf@x=-.5\wd\pgfnodeparttextbox } - \anchor{text}{ - \textanchor - } + \anchor{text}{ \textanchor } \anchorborder{% \ifpgf@circuit@bipole@inverted \pgf@circ@res@left=-\pgf@x @@ -711,7 +784,6 @@ #2% \pgf@circ@draw@component{ \pgf@circ@setcolor - \northeast \pgf@circ@res@up = \pgf@y \pgf@circ@res@zero = 0cm diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex index 626ed28812..b30e741458 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex @@ -632,13 +632,21 @@ \pgfusepath{draw} \endpgfscope }% - %% Zig-zag resistors +% see https://github.com/circuitikz/circuitikz/discussions/814 +\ctikzset{resistors/zigzag stub/.initial=0} +\ctikzset{resistors/zigzag hook/.code={}} \def\pgf@circ@zigzag#1{% + \pgf@circ@res@temp=\ctikzvalof{resistors/zigzag stub}\pgf@circ@res@step + \advance \pgf@circ@res@step by -2\pgf@circ@res@temp \divide \pgf@circ@res@step by \numexpr4*\zigs\relax \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} + \ifdim\pgf@circ@res@temp>0pt + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp -\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} + \fi \pgf@circ@res@other = \pgf@circ@res@left + \advance\pgf@circ@res@other by \pgf@circ@res@temp \pgf@circ@count@a=\zigs\relax % first half zig \advance\pgf@circ@res@other by \pgf@circ@res@step @@ -655,11 +663,14 @@ \advance\pgf@circ@res@other by 2\pgf@circ@res@step \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}} \advance\pgf@circ@res@other by \pgf@circ@res@step - \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} + \ifdim\pgf@circ@res@temp>0pt + \pgfpathlineto{\pgfpoint{\pgf@circ@res@other+\pgf@circ@res@temp+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} + \fi \pgfsetbeveljoin + \pgfkeys{/tikz/circuitikz/resistors/zigzag hook} \pgfusepath{draw} } - %% Resistor \pgfcircdeclarebipolescaled{resistors} { @@ -672,7 +683,7 @@ { \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgftransformationadjustments - \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth} + \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen} \pgf@circ@zigzag{1} } @@ -692,7 +703,7 @@ { \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgftransformationadjustments - \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth} + \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen} \pgf@circ@zigzag{.5} \pgfscope @@ -731,7 +742,7 @@ { \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgftransformationadjustments - \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth} + \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen} \pgf@circ@zigzag{1} \pgfscope @@ -761,7 +772,7 @@ {% \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgftransformationadjustments - \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth} + \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen} \pgf@circ@zigzag{.5} \pgfscope @@ -810,7 +821,7 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right/\@@intscale+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}} \pgftransformationadjustments - \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/ldresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth} + \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/ldresistor/width}*\scaledRlen} \pgf@circ@zigzag{\@@hscale} }% @@ -6031,6 +6042,13 @@ \ctikzset{bipoles/qpprobe/voltage/additional shift/.initial=.5} \ctikzset{bipoles/iloop/width/.initial=.40} \ctikzset{bipoles/iloop/height/.initial=.60} +% currtap see https://github.com/circuitikz/circuitikz/issues/807 +\ctikzset{bipoles/currtap/height/.initial=0.4} +\ctikzset{bipoles/currtap/dot size/.initial=0.5} +\ctikzset{bipoles/currtap/fill/.initial=default} +\ctikzset{bipoles/currtap/dash/.initial=none} +\ctikzset{bipoles/currtap/color/.initial=default} +\ctikzset{bipoles/currtap/thickness/.initial=default} \ctikzset{bipoles/oscope/height/.initial=.60} \ctikzset{bipoles/oscope/width/.initial=.60} @@ -6607,6 +6625,28 @@ \pgfusepath{draw} \endpgfscope } +%% currtap +\pgfcircdeclarebipolescaled{instruments} +{ + \savedmacro{\@@dotsize}{\def\@@dotsize{\ctikzvalof{bipoles/currtap/dot size}}} + \anchor{tap}{\northeast\pgf@x=0pt\pgf@y=\@@dotsize\pgf@y\pgf@y=-\pgf@y} +} +{\ctikzvalof{bipoles/currtap/height}} +{currtap} +{\ctikzvalof{bipoles/currtap/height}} +{\ctikzvalof{bipoles/currtap/height}} +{ + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@left}{0pt}} + \pgfpatharc{180}{0}{0.95\pgf@circ@res@right} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfusepath{draw} + \pgf@circ@subset@color@dash{bipoles/currtap} + \pgf@circ@subset@thickness{bipoles/currtap} + \pgfusepath{draw} + \pgfpathcircle{\pgfpoint{0pt}{0pt}}{\@@dotsize*\pgf@circ@res@up} + \pgf@circ@subset@fill@or@draw{bipoles/currtap} +} % %>>> % Path definitions for Instruments%<<< @@ -6619,8 +6659,8 @@ \pgfcirc@activate@bipole@simple{l}{rmeterwa} \pgfcirc@activate@bipole@simple{l}{smeter} \pgfcirc@activate@bipole@simple{l}{iloop} -% \pgfcirc@activate@bipole@simple{l}{iloop2} that was wrong \pgfcirc@activate@bipole{l}{ilooptwo}{iloop2}{iloop2} +\pgfcirc@activate@bipole@simple{l}{currtap} \pgfcirc@activate@bipole@simple{l}{qvprobe} \pgfcirc@activate@bipole@simple{l}{qiprobe} \pgfcirc@activate@bipole@simple{l}{qpprobe} @@ -6774,16 +6814,22 @@ % spring into the damper \pgfscope - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfscope + \pgftransformationadjustments \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{.95\pgf@circ@res@left}{\pgf@circ@res@zero}} \pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}} + \pgfsetbuttcap + \pgfsetbeveljoin \pgfusepath{stroke} \endpgfscope + \endpgfscope % damper box \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} @@ -7171,18 +7217,18 @@ {\ctikzvalof{bipoles/thermocouple/height}} {\ctikzvalof{bipoles/thermocouple/width}} { + \pgfsetrectcap \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}} - \pgfusepath{draw} - \pgfsetlinewidth{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} \pgfusepath{draw} + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfsetroundcap + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}} + \pgfusepath{draw} } %% fuse \pgfcircdeclarebipolescaled{misc} diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex index e3665b8862..cb95f54ef3 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex @@ -231,13 +231,15 @@ \compattikzset{#2/.style={\comnpatname #1, #3={##1}}}% } % create a bipole -\def\pgfcirc@activate@bipole#1#2#3#4{% path name, base node name, style name +\def\pgfcirc@activate@bipole#1#2#3#4{% type of label, path name, base node name, style name + % \typeout{Activate bipole:\space #4,} \expandafter\def\csname pgf@circ@#2@path\endcsname##1{\pgf@circ@bipole@path{#3}{##1}}% \pgfcirc@path@to@style{#1}{#2}{#4}{}% no options here, let's see } \def\pgfcirc@activate@bipole@simple#1#2{\pgfcirc@activate@bipole{#1}{#2}{#2}{#2}} % create a bipole with options -\def\pgfcirc@activate@bipole@opt#1#2#3#4#5{% path name, base node name, style name +\def\pgfcirc@activate@bipole@opt#1#2#3#4#5{% type of label, path name, base node name, style name, options + % \typeout{Activate bipole:\space #4,} \expandafter\def\csname pgf@circ@#2@path\endcsname##1{\pgf@circ@bipole@path{#3}{##1}}% \pgfcirc@path@to@style{#1}{#2}{#4}{#5}% no options here, let's see } diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex index 4e4861071f..f85b8ab58b 100644 --- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex +++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex @@ -16,8 +16,8 @@ \startmodule[circuitikz] \usemodule[tikz] -\def\pgfcircversion{1.6.9} -\def\pgfcircversiondate{2024/05/25} +\def\pgfcircversion{1.7.0} +\def\pgfcircversiondate{2024/08/03} \writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion} diff --git a/graphics/pgf/contrib/fancyqr/README.md b/graphics/pgf/contrib/fancyqr/README.md index 63432f93e0..ed09e369ce 100644 --- a/graphics/pgf/contrib/fancyqr/README.md +++ b/graphics/pgf/contrib/fancyqr/README.md @@ -5,7 +5,7 @@ [<img src="https://github.com/EagleoutIce/fancyqr/blob/gh-pages/preview-1.png?raw=true" width="600"/>](qr-example.tex) A simple package to create fancy qr-codes with the help of the [`qrcode`][qrcode]-package. -You may use `\fancyqr` just like the normal `\qrcode` (`\fancyqr[<qr-options>]{<url>}`). See the [documentation](https://media.githubusercontent.com/media/EagleoutIce/fancyqr/gh-pages/build/fancyqr-doc.pdf). +You may use `\fancyqr` just like the normal `\qrcode` (`\fancyqr[<qr-options>]{<url>}`). See the [documentation](https://media.githubusercontent.com/media/EagleoutIce/fancyqr/gh-pages/build/fancyqr-doc.pdf). If you just want to create a simple qr-code, please refer to the [minimal example](qr-minimal.tex). *fancyqr* is actively developed by *Florian Sihler* (contact me at: <florian.sihler@uni-ulm.de>) under the [GPLv3 License](LICENSE). I am very happy about every contribution (see [CONTRIBUTING.md](CONTRIBUTING.md)). You can find it on CTAN (<https://www.ctan.org/pkg/fancyqr>). @@ -13,22 +13,28 @@ If you do want to hide a center square (e.g., because you want to embed an image At the moment, there are six other styles (`flat`, `frame`, `blobs`, `glitch`, and `dots`) that you can load (locally) by using `\FancyQrLoad{<name>}`. The default style is named `default` and can be 'reset' by `\FancyQrLoad{default}` or `\FancyQrLoadDefault`. There are the following extra qr-options (you can set all of them with `\fancyqrset{<keys>}`): -| Option | Type | Default | Explanation | -| ----------------- | ------- | :------: | ---------------------------------------------------------- | -| `image` | LaTeX | | Automatically center an image.[^1] | -| `image padding` | number | | Additionally hide blocks (x & y) around the image. | -| `image x padding` | number | `0` | Additionally hide blocks (x) around the image. | -| `image y padding` | number | `0` | Additionally hide blocks (y) around the image. | -| `gradient` | boolean | true | Toggle the color gradient | -| `color` | color | | Disables the `gradient` and sets the qr color accordingly. | -| `l color` | color | `purple` | Set the top left gradient color. | -| `left color` | color | | Alias for `l color`. | -| `r color` | color | `teal` | Set the bottom right gradient color. | -| `right color` | color | | Alias for `r color`. | -| `gradient angle` | angle | `135` | Change the gradient angle. | -| `random color` | colors | | Allow to set a random color pool to pick from. | -| `width` | length | | Alias for [`qrcode`'s][qrcode] `height` option. | -| `size` | length | | Alias for [`qrcode`'s][qrcode] `height` option. | + +| Option | Type | Default | Explanation | +| ----------------- | ----------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `classic` | boolean | `false` | Use the classic qr-code style (black with flat rectangles, this loads the `flat` style). | +| `color` | color | | Disables the `gradient` and sets the qr color accordingly. | +| `gradient angle` | angle | `135` | Change the gradient angle. | +| `gradient` | boolean | true | Toggle the color gradient | +| `image` | LaTeX | | Automatically center an image (you have to care for the size and maybe adjust the `version` and `level` to keep the qr-code readable).[^1] | +| `image padding` | number | | Additionally hide blocks (x & y) around the image. | +| `image x padding` | number | `0` | Additionally hide blocks (x) around the image. | +| `image y padding` | number | `0` | Additionally hide blocks (y) around the image. | +| `l color` | color | `purple` | Set the top left gradient color. | +| `left color` | color | | Alias for `l color`. | +| `level` | L/M/Q/H | `M` | [`qrcode`][qrcode] option affecting error correction (low, medium, quartile, high). | +| `padding` | flag | | [`qrcode`][qrcode] option adding sufficient additional space around the qr-code. | +| `r color` | color | `teal` | Set the bottom right gradient color. | +| `random color` | colors | | Allow to set a random color pool to pick from. | +| `right color` | color | | Alias for `r color`. | +| `size` | length | | Alias for [`qrcode`'s][qrcode] `height` option. | +| `tight` | flag | | [`qrcode`][qrcode] option adding no additional space around the qr-code. | +| `version` | [0..40] ∈ ℕ | `0` | [`qrcode`][qrcode] option affecting the size (tries to be as small as possible). | +| `width` | length | | Alias for [`qrcode`'s][qrcode] `height` option. | The defaults are set like this: diff --git a/graphics/pgf/contrib/fancyqr/fancyqr-doc.pdf b/graphics/pgf/contrib/fancyqr/fancyqr-doc.pdf Binary files differindex c96c62abbc..cccceaca24 100644 --- a/graphics/pgf/contrib/fancyqr/fancyqr-doc.pdf +++ b/graphics/pgf/contrib/fancyqr/fancyqr-doc.pdf diff --git a/graphics/pgf/contrib/fancyqr/fancyqr-doc.tex b/graphics/pgf/contrib/fancyqr/fancyqr-doc.tex index 1f3b00ba2d..52338832c5 100644 --- a/graphics/pgf/contrib/fancyqr/fancyqr-doc.tex +++ b/graphics/pgf/contrib/fancyqr/fancyqr-doc.tex @@ -18,6 +18,7 @@ \usepackage{fancyqr} \usepackage{xcolor} \usepackage[tex]{listings} +\usepackage{amssymb} \lstdefinelanguage{ltx}{ language={[LaTeX]TeX}, @@ -34,14 +35,13 @@ \texorpdfstring{Florian Sihler\medskip\\* \fancyqr{https://github.com/EagleoutIce/fancyqr} }{Florian Sihler}} -\date{Version v2.0 \textendash{} 2024/04/13} - +\date{Version v2.1 \textendash{} 2024/10/05} \begin{document} \maketitle - \texttt{fancyqr} is a simple package to create fancy qr codes with the help of the \textit{\href{https://www.ctan.org/pkg/qrcode}{qrcode}}-package. + \texttt{fancyqr} is a simple package to create fancy qr-codes with the help of the \textit{\href{https://www.ctan.org/pkg/qrcode}{qrcode}}-package. You can use the |\fancyqr|-macro just like the normal |\qrcode|.\footnote{\ltx{\\fancyqr[<qr-options>]\{<url>\}}} If you do want to hide a center square (e.g, because you want to embed an image) you can use |\FancyQrDoNotPrintSquare{<x>}{<y>}| to hide a rectangle with radius x and y set from the center. If you choose this option, the default |\FancyQrRoundCut| that rounds cut corners can be changed with |\FancyQrHardCut|. @@ -66,20 +66,25 @@ \toprule \multicolumn{1}{l}{Option} & Type & \multicolumn{1}{c}{Default} & Explanation \\ \midrule - image & \LaTeX & & Automatically center an image.\footnote{The package will automatically calculate the required \ltx{\\FancyQrDoNotPrintSquare} (you have to make sure that the qr code still has enough information to be readable). Therefore, the image will not scale with the qr code.} \\ + classic & boolean & false & Use the classic qr-code style (black with flat rectangles, this loads the |flat| style). \\ + color & color & & Disables the |gradient| and sets the color accordingly. \\ + gradient & boolean & true & Toggle the color gradient \\ + gradient angle & angle & 135 & Change the gradient angle. \\ + image & \LaTeX & & Automatically center an image (you have to care for the size and maybe adjust the |version| and |level| to keep the qr-code readable).\footnote{The package will automatically calculate the required \ltx{\\FancyQrDoNotPrintSquare} (you have to make sure that the qr-code still has enough information to be readable). Therefore, the image will not scale with the qr-code.} \\ image padding & number & & Additionally hide blocks (x \& y) around the image. \\ image x padding & number & 0 & Additionally hide blocks (x) around the image. \\ image y padding & number & 0 & Additionally hide blocks (y) around the image. \\ - gradient & boolean & true & Toggle the color gradient \\ - color & color & & Disables the |gradient| and sets the color accordingly. \\ l color & color & purple & Set the top left gradient color. \\ left color & color & & Alias for |l color|. \\ + level & L/M/Q/H & M & |qrcode| option affecting error correction (low, medium, quartile, high). \\ + padding & flag & & |qrcode| option adding sufficient additional space around the qr-code. \\ r color & color & teal & Set the bottom right gradient color. \\ - right color & color & & Alias for |r color|. \\ - gradient angle & angle & 135 & Change the gradient angle. \\ random color & colors & & Allow to set a random color pool to pick from. \\ - width & length & & Alias for |qrcode|'s |height| option. \\ + right color & color & & Alias for |r color|. \\ size & length & & Alias for |qrcode|'s |height| option. \\ + tight & flag & & |qrcode| option adding no additional space around the qr-code. \\ + version & \([0..40] \in \mathbb{N}\) & 0 & |qrcode| option affecting the size (tries to be as small as possible). \\ + width & length & & Alias for |qrcode|'s |height| option. \\ \bottomrule \end{tabular} \caption{Overview of special qr-options.} diff --git a/graphics/pgf/contrib/fancyqr/fancyqr-style-blobs.code b/graphics/pgf/contrib/fancyqr/fancyqr-style-blobs.code index bfc7e776ec..9746c52376 100644 --- a/graphics/pgf/contrib/fancyqr/fancyqr-style-blobs.code +++ b/graphics/pgf/contrib/fancyqr/fancyqr-style-blobs.code @@ -3,11 +3,11 @@ \@tempcnta=\z@ \roundjoin \roundcap -\moveto(0,0) +\moveto(.5,.5) \loop \advance\@tempcnta by 30 -\edef\rad{\fpeval{.2*\qr@modulesize+.115*\qr@modulesize*abs(rand())}}% fixed rand for both -\lineto(\fpeval{cos(\@tempcnta)*\rad},\fpeval{sin(\@tempcnta)*\rad}) +\edef\rad{\fpeval{.1*\qr@modulesize+.13*\qr@modulesize*abs(rand())}}% fixed rand for both +\lineto(\fpeval{cos(\@tempcnta)*\rad+.5},\fpeval{sin(\@tempcnta)*\rad+.5}) \ifnum\@tempcnta<360\relax \repeat \fillpath diff --git a/graphics/pgf/contrib/fancyqr/fancyqr-style-dots.code b/graphics/pgf/contrib/fancyqr/fancyqr-style-dots.code index f7fd55e139..ced7e7a720 100644 --- a/graphics/pgf/contrib/fancyqr/fancyqr-style-dots.code +++ b/graphics/pgf/contrib/fancyqr/fancyqr-style-dots.code @@ -1,4 +1,4 @@ -\def\fancyqr@dots@circle{\put(.5,.5){\circle*{\@ne}}} +\def\fancyqr@dots@circle{\put(.5,.5){\circle*{\@ne}}}% % . \newpattern0000{\fancyqr@dots@circle}% % | | - - diff --git a/graphics/pgf/contrib/fancyqr/fancyqr-style-swift.code b/graphics/pgf/contrib/fancyqr/fancyqr-style-swift.code deleted file mode 100644 index 529213f04f..0000000000 --- a/graphics/pgf/contrib/fancyqr/fancyqr-style-swift.code +++ /dev/null @@ -1,2 +0,0 @@ -\PackageWarning{fancyqr}{Currently, swift is not supported :/} -\FancyQrLoadDefault
\ No newline at end of file diff --git a/graphics/pgf/contrib/fancyqr/fancyqr.sty b/graphics/pgf/contrib/fancyqr/fancyqr.sty index bb2b9f3ebb..200fa7f371 100644 --- a/graphics/pgf/contrib/fancyqr/fancyqr.sty +++ b/graphics/pgf/contrib/fancyqr/fancyqr.sty @@ -2,7 +2,7 @@ % Licensed under GNU General Public License version 3 % https://opensource.org/licenses/gpl-3.0.html \def\filename{fancyqr} -\ProvidesPackage{\filename}[2024/04/13 version v2.0 Fancy QR-Codes] +\ProvidesPackage{\filename}[2024/10/05 version v2.1 Fancy QR-Codes] \RequirePackage{pict2e, xfp, qrcode} % element @@ -32,18 +32,21 @@ \def\GetPattern{% \ifcsname qcc\@up\@left\@right\@down\endcsname \csname qcc\@up\@left\@right\@down\endcsname -\else\rule\qr@modulesize\z@\fi} +\fi} % backwards compatibility \def\fancyqr@clap#1{\hb@xt@\z@{\hss#1\hss}} -\newdimen\fancyqr@edge@compensate -\fancyqr@edge@compensate=.15\p@ +\newdimen\fancyqr@edge@compensate \fancyqr@edge@compensate=.15\p@ % is larger to be compensated by overlaps \def\qrm{\dimexpr\qr@modulesize+\fancyqr@edge@compensate\relax} \long\def\qr@newpattern#1#2#3#4#5{% -\expandafter\def\csname qcc#1#2#3#4\endcsname{\parbox[b][\qr@modulesize]\qr@modulesize{\kern-\fancyqr@edge@compensate\relax\smash{\fancyqr@clap{\picture(\@ne,\@ne)#5\endpicture}}}% -}} +\expandafter\def\csname qcc#1#2#3#4\endcsname{% scaling happens implicitly by the unitlength + \put(\the\j,\the\numexpr\@max@y-\the\i){% + \advance\unitlength by\fancyqr@edge@compensate\relax + #5% + }}% +} % [#3][#2] % [#4][#1] @@ -97,11 +100,13 @@ \def\@fancy@qr@default@name{default} \def\FancyQrLoad#1{% +\protected@edef\fancyqr@loaded@style{#1}% \def\fancyqr@rounded@rect@close{\fillpath}% -\let\@tmp\newpattern\let\newpattern\qr@newpattern\@bsphack\def\@@tmp{#1}\ifx\@@tmp\@fancy@qr@default@name\FancyQrLoadDefault\else +\let\@tmp\newpattern\let\newpattern\qr@newpattern\@bsphack\def\@@tmp{#1}% +\ifx\@@tmp\@fancy@qr@default@name\FancyQrLoadDefault\else \expandafter\edef\csname pingu@lib@#1@atcode\endcsname{\the\catcode`\@}% \catcode`\@=11\relax -\input{fancyqr-style-#1.code} +\input{fancyqr-style-#1.code}% \catcode`\@=\csname pingu@lib@#1@atcode\endcsname \fi\@esphack\let\newpattern\@tmp\let\@tmp\relax} @@ -145,57 +150,63 @@ \def\fancy@qr@printmatrix#1{% \def\qr@white{0}\def\qr@black{1}% \protected@edef\fancyqr@currprint{#1}% - \let\qr@black@fixed\qr@black - \let\qr@white@fixed\qr@white - \let\qr@black@format\qr@black - \let\qr@white@format\qr@white + \let\qr@black@fixed\qr@black \let\qr@white@fixed\qr@white + \let\qr@black@format\qr@black \let\qr@white@format\qr@white %Set module size - \qr@modulesize=\qr@desiredheight + \qr@modulesize=\qr@desiredheight\relax \divide\qr@modulesize by \qr@size\relax - \unitlength=\dimexpr\qr@modulesize+\fancyqr@edge@compensate\relax % initialize unitlength once + \unitlength=\dimexpr\qr@modulesize\relax % will be re-set in placement \if@fancyqr@image@% image is in \fancyqr@imgbox \edef\@x{\fpeval{ceil((.5\wd\fancyqr@imgbox)/\qr@modulesize)+\fancyqr@img@padding@x}}% \edef\@y{\fpeval{ceil((.5\ht\fancyqr@imgbox+.5\dp\fancyqr@imgbox)/\qr@modulesize)+\fancyqr@img@padding@y}}% \FancyQrDoNotPrintSquare\@x\@y \fi \qr@minipagewidth=\qr@desiredheight - \ifqr@tight \advance\qr@minipagewidth by -\qr@modulesize \else \advance\qr@minipagewidth by 7\qr@modulesize \fi - \minipage\qr@minipagewidth% - \hfuzz=\qr@modulesize - \baselineskip=\qr@modulesize - \lineskiplimit=\z@ \lineskip=\z@ \parskip=\z@ - \ifqr@tight\else\rule\z@{4\qr@modulesize}\par\fi% %Blank space at top. + \ifqr@tight\else \advance\qr@minipagewidth by 8\qr@modulesize\relax \fi + \begingroup \edef\@max@x{\qr@numberofrowsinmatrix\fancyqr@currprint}\edef\@half@max@x{\the\numexpr\@max@x/2}% \edef\@max@y{\qr@numberofcolsinmatrix\fancyqr@currprint}\edef\@half@max@y{\the\numexpr\@max@y/2}% + % redefine the border to be white! + \qr@for \i=\@ne to \@max@y by \@ne{% + % redefine the limits to be white! + \qr@storetomatrix\fancyqr@currprint{\the\numexpr\z@}{\the\i}{\qr@white}% + \qr@storetomatrix\fancyqr@currprint{\the\numexpr\@max@x+\@ne}{\the\i}{\qr@white}% + }% + \qr@for \i=\@ne to \@max@x by \@ne{% + \qr@storetomatrix\fancyqr@currprint{\the\i}{\the\numexpr\z@}{\qr@white}% + \qr@storetomatrix\fancyqr@currprint{\the\i}{\the\numexpr\@max@y+\@ne}{\qr@white}% + }% \edef\@do@x@min{\the\numexpr\@half@max@x-\fancy@qr@donotprint@center@x-\@ne}% \edef\@do@x@max{\the\numexpr\@half@max@x+\fancy@qr@donotprint@center@x+\@ne}% \edef\@do@y@min{\the\numexpr\@half@max@y-\fancy@qr@donotprint@center@y-\@ne}% \edef\@do@y@max{\the\numexpr\@half@max@y+\fancy@qr@donotprint@center@y+\@ne}% - \qr@for \i=\@ne to \@max@y by \@ne{% - \ifqr@tight\else\rule{4\qr@modulesize}\z@\fi% %Blank space at left. - \qr@for \j=\@ne to \@max@x by \@ne{% + \edef\@tmp@tight{\ifqr@tight\z@\else-4\fi}% + \picture(\qr@minipagewidth,\qr@minipagewidth)(\the\numexpr\@ne+\@tmp@tight,\@tmp@tight) + \qr@for \i=\@ne to \@max@y by \@ne{\qr@for \j=\@ne to \@max@x by \@ne{% \qr@fancy@updateif\i\j \iffancy@qr@do@print@ - \edef\@mid{\qr@matrixentry\fancyqr@currprint{\the\i}{\the\j}}% - \ifnum\@mid=\qr@white - \rule\qr@modulesize\z@ - \else% if not white, get its pattern - \iffancy@qr@roundcut@\qr@fancy@clear@surround\fancyqr@currprint{\the\i}{\the\j}\fi - \edef\@up{\qr@matrixentry\fancyqr@currprint{\the\numexpr\the\i-1}{\the\j}}% - \edef\@left{\qr@matrixentry\fancyqr@currprint{\the\i}{\the\numexpr\the\j-1}}% - \edef\@right{\qr@matrixentry\fancyqr@currprint{\the\i}{\the\numexpr\the\j+1}}% - \edef\@down{\qr@matrixentry\fancyqr@currprint{\the\numexpr\the\i+1}{\the\j}}% - \FancyQrColor{\GetPattern}% - \fi\else \rule\qr@modulesize\z@\fi - }\par}% - \ifqr@tight\else\rule\z@{4\qr@modulesize}\par\fi - \endminipage - \if@fancyqr@image@\nobreak - \llap{\parbox\qr@minipagewidth{\centering\usebox\fancyqr@imgbox}% - % if half the width is odd, offset by half a module width, done by centering - \edef\@halfcheck{\fpeval{round(\fancy@qr@donotprint@center@x/2)}}% - \ifodd\@halfcheck \kern.5\qr@modulesize\fi - }\fi + \edef\@mid{\qr@matrixentry\fancyqr@currprint{\the\i}{\the\j}}% + \ifnum\@mid=\qr@black\relax + \iffancy@qr@roundcut@\qr@fancy@clear@surround\fancyqr@currprint{\the\i}{\the\j}\fi + \edef\@up{\qr@matrixentry\fancyqr@currprint{\the\numexpr\the\i-\@ne}{\the\j}}% + \edef\@left{\qr@matrixentry\fancyqr@currprint{\the\i}{\the\numexpr\the\j-\@ne}}% + \edef\@right{\qr@matrixentry\fancyqr@currprint{\the\i}{\the\numexpr\the\j+\@ne}}% + \edef\@down{\qr@matrixentry\fancyqr@currprint{\the\numexpr\the\i+\@ne}{\the\j}}% + \FancyQrColor{\GetPattern}% + \fi\fi + }}% + \if@fancyqr@image@ + % floating point mid + \put(\fpeval{.5*\@max@x+.5},\fpeval{.5*\@max@y}){% + \edef\@halfcheck{\fpeval{round(\fancy@qr@donotprint@center@x/2)}}% + \raisebox{-.5\height}{\clap{% TODO: remove this offset + \ifodd\@halfcheck \else\kern\qr@modulesize\fi + \usebox\fancyqr@imgbox + }}% + }% + \fi + \endpicture + \endgroup }% \def\fancy@qr@setup#1{% @@ -263,6 +274,15 @@ \define@key{fancyqr}{random color}{\@fancyqr@randomcolor@true\def\@fancyqr@random@colors{#1}} \define@key{fancyqr}{width}{\setkeys{qr}{height=#1}} \define@key{fancyqr}{size}{\setkeys{qr}{height=#1}} +% \fancyqr@loaded@style +\def\fancyqr@flat@style{flat} +\define@boolkey{fancyqr}[@fancyqr@]{classic}[true]{} % if@fancyqr@classic +\def\fancyqr@classic{% +\ifx\fancyqr@loaded@style\fancyqr@flat@style\else\FancyQrLoad{\fancyqr@flat@style}\fi +\setkeys{fancyqr}{% + gradient=false,color=black,l color=black,r color=black% +}% +} \def\fancyqrset#1{\setkeys{qr,fancyqr}{#1}} \fancyqrset{image padding=0,gradient=true,gradient angle=135,r color=teal,l color=purple} @@ -275,12 +295,10 @@ \newcommand\@@fancyqr[1][]{\begingroup\@fancyqr@init \ifqr@starinvoked\qr@hyperlinkfalse\fi \setkeys{qr,fancyqr}{#1}% +\if@fancyqr@classic\fancyqr@classic\fi% \if@fancyqr@randomcolor@% \ifcsname pgfmathdeclarerandomlist\endcsname\else \PackageError{fancyqr}{Random colors requested but pgfmath not loaded}{Please load pgfmath if you want this}\fi \pgfmathdeclarerandomlist{@@fancyqr@@randomcol}{\@fancyqr@random@colors}\let\FancyQrColor\@@fancyqr@color@random\else\if@fancyqr@gradient\let\FancyQrColor\@@fancyqr@color@gradient\fi\fi \bgroup\qr@verbatimcatcodes\qr@setescapedspecials\qrcode@in} \endinput - -% TODO: NEGATIVE PATTERNS IF MIDDLE IS 0 -% => make rounded negative corners diff --git a/graphics/pgf/contrib/fancyqr/qr-example.tex b/graphics/pgf/contrib/fancyqr/qr-example.tex index e0518297eb..fe32ae73c9 100644 --- a/graphics/pgf/contrib/fancyqr/qr-example.tex +++ b/graphics/pgf/contrib/fancyqr/qr-example.tex @@ -3,6 +3,7 @@ % https://opensource.org/licenses/gpl-3.0.html \documentclass{article} +\usepackage[T1]{fontenc} \usepackage{fontawesome} \usepackage{fancyqr} @@ -13,13 +14,18 @@ % to showcase scalebox \usepackage{graphicx} +% for the coding font +\usepackage{FiraMono} + \usepackage[active,tightpage]{preview} % for presentation \setlength\PreviewBorder{15pt} -\fancyqrset{size=3.25cm,level=H,padding} +\fancyqrset{size=3.25cm, level=H, padding} +\errorcontextlines=9999 \begin{document} \preview +\begin{center} % \FancyQrDoNotPrintSquare{8}{9} % \FancyQrHardCut \mbox{\FancyQrLoad{blobs}% @@ -28,6 +34,8 @@ \fancyqr{https://github.com/EagleoutIce/fancyqr}% \FancyQrLoad{dots}% \fancyqr[image={\textsf{\textbf{\textcolor{gray}{fancy}qr}}}, random color={@Red}{@Pink}{@Purple}{@DeepPurple}{@Indigo}{@Blue}{@Cyan}{@Teal}{@Green}{@Amber}{@Orange}{@DeepOrange}{@Brown}]{https://github.com/EagleoutIce/fancyqr}% -}% +}\\[4mm] +\texttt{\textbackslash \textbf{fancyqr}\{\textcolor{@Grey}{https://github.com/EagleoutIce/fancyqr}\}} +\end{center} \endpreview \end{document}
\ No newline at end of file diff --git a/graphics/pgf/contrib/fancyqr/qr-minimal.tex b/graphics/pgf/contrib/fancyqr/qr-minimal.tex new file mode 100644 index 0000000000..b912709808 --- /dev/null +++ b/graphics/pgf/contrib/fancyqr/qr-minimal.tex @@ -0,0 +1,12 @@ +\documentclass{article} + +\usepackage{fancyqr} + +\usepackage[active,tightpage]{preview} +\setlength\PreviewBorder{0pt} + +\begin{document} +\preview +\fancyqr[classic,padding]{https://github.com/EagleoutIce/fancyqr} +\endpreview +\end{document} diff --git a/graphics/pgf/contrib/lie-hasse/README b/graphics/pgf/contrib/lie-hasse/README index e63a82cc60..1bd63c4cba 100644 --- a/graphics/pgf/contrib/lie-hasse/README +++ b/graphics/pgf/contrib/lie-hasse/README @@ -2,9 +2,9 @@ ___________________________________ Lie Hasse - v1.0 + v1.01 - 3 February 2020 + 9 July 2024 ___________________________________ Authors : Ben McKay diff --git a/graphics/pgf/contrib/lie-hasse/lie-hasse.pdf b/graphics/pgf/contrib/lie-hasse/lie-hasse.pdf Binary files differindex 5be5791e7f..ed444cc7d1 100644 --- a/graphics/pgf/contrib/lie-hasse/lie-hasse.pdf +++ b/graphics/pgf/contrib/lie-hasse/lie-hasse.pdf diff --git a/graphics/pgf/contrib/lie-hasse/lie-hasse.sty b/graphics/pgf/contrib/lie-hasse/lie-hasse.sty index d1050d8839..6d727c841c 100644 --- a/graphics/pgf/contrib/lie-hasse/lie-hasse.sty +++ b/graphics/pgf/contrib/lie-hasse/lie-hasse.sty @@ -1,24 +1,20 @@ -% The Lie Hasse package. +% The Lie Hasse package. +% Version 1.01 % -% Version 1.0 % +% This package draws Hasse diagrams of root system posets of simple +% Lie algebraS, in LaTeX documents, using the TikZ package. % -% This package draws Hasse diagrams of root system posets of simple -% Lie algebraS, in LaTeX documents, using the TikZ package. +% Benjamin McKay +% b.mckay@ucc.ie % -% Benjamin McKay -% b.mckay@ucc.ie -% -% Released under the LaTeX Project Public License v1.3c or later, see +% Released under the LaTeX Project Public License v1.3c or later, see % http://www.latex-project.org/lppl.txt -% -% -% -% \NeedsTeXFormat{LaTeX2e}[1994/06/01] -\ProvidesPackage{lie-hasse}[2020/02/02 Lie Hasse] +\ProvidesPackage{lie-hasse}[2024/07/09 Lie Hasse] \RequirePackage[rgb]{xcolor} \RequirePackage{dynkin-diagrams} +\RequirePackage[outline]{contour} \usetikzlibrary{ positioning, fadings, @@ -26,7 +22,7 @@ %%% %%% Application programming interface: %%% - +\NewDocumentCommand\edgeQuote{m}{\contour{white}{\(#1\)}} \newif\iflie@hasse@threeD \lie@hasse@threeDtrue \xdef\lie@hasse@three@D@shift{.3}% @@ -40,14 +36,27 @@ \lie@hasse@show@heightfalse \newif\iflie@hasse@attach@dynkin@diagram \lie@hasse@attach@dynkin@diagramfalse - +\newif\iflie@hasse@show@levi +\lie@hasse@show@levitrue +\newif\iflie@hasse@show@unipotent@radical +\lie@hasse@show@unipotent@radicaltrue \pgfkeys{ /Lie Hasse diagram/.is family, /Lie Hasse diagram, - attach Dynkin diagram/.is if = lie@hasse@attach@dynkin@diagram, + attach Dynkin diagram/.is if + = lie@hasse@attach@dynkin@diagram, attach Dynkin diagram/.default = false, - edge/.style={ultra thick}, - edge quotes/.style={/Dynkin diagram/text style,auto,inner sep=2pt}, + edge/.style = { + ultra thick + }, + edge length/.estore in + = \lie@hasse@edge@length, + edge length = 1cm, + edge quotes/.style={ + /Dynkin diagram/text style, + auto, + inner sep=2pt + }, compact edge/.style={}, noncompact edge/.style={opacity=0}, compact root/.code={\dynkinDrawSolidRootMark{#1}}, @@ -67,7 +76,13 @@ show widths/.default = false, show height/.is if = lie@hasse@show@height, show height/.default = false, - z shift/.estore in = \lie@hasse@three@D@shift, + show Levi/.is if = lie@hasse@show@levi, + show Levi/.default = true, + show unipotent radical/.is if + = lie@hasse@show@unipotent@radical, + show unipotent radical/.default = true, + z shift/.estore in + = \lie@hasse@three@D@shift, z shift/.default = .3, top/.style={black!20,opacity=.4}, left/.style={black!20,opacity=.9}, @@ -90,13 +105,17 @@ \dynkin@integer@rank% }% {% - % Turn Satake codes into Dynkin diagram expressions in \dynkin@string. + % Turn Satake codes into Dynkin diagram + % expressions in \dynkin@string. \dynkin@grok@Satake@codes% }% - % Expand out any digits in \dynkin@string into multiples of the various root marks. + % Expand out any digits in \dynkin@string + % into multiples of the various root marks. \expand@Dynkin@Roots@Digits% - % Assign to \dynkin@roots the input string \dynkin@string with all . symbols removed, - % so we only get the symbols representing the marks for the various roots. + % Assign to \dynkin@roots the input string + % \dynkin@string with all . symbols removed, + % so we only get the symbols representing + % the marks for the various roots. \StrDel{\dynkin@string}{.}[\temp]% \xdef\dynkin@roots{\temp}% \StrLen{\dynkin@roots}[\temp]% @@ -115,58 +134,33 @@ {% \pgfkeys{/Lie Hasse diagram/for all roots={#1}{#2}}% }% +\newif\iflie@hasse@B +\newcount\dynkin@rank@plus@one% \NewDocumentCommand\hasse{O{}mm}% {% \ifdefined\filldraw% - \IfStrEq{#1}{}% - {% + \ifx#1\empty\relax% \studyHasseDiagramOfRootSystem{#2}{#3}% - }% - {% + \else% \studyHasseDiagramOfRootSystem[#1]{#2}{#3}% - }% + \fi% \label@item@count 0\relax% \expandafter\forcsvlist% - \expandafter\add@label% + \expandafter\lie@hasse@add@label% \expandafter{\dynkin@label@list}% \ifnum\dynkin@rank=1% \dynkin{A}{1}% \else% + \global\dynkin@rank@plus@one\the\dynkin@rank\relax% + \global\advance\dynkin@rank@plus@one by 1\relax% \add@compact@simple@roots@to@compact@roots{}% \IfStrEqCase{#2}% {%% {A}{\hasse@A}% - {B}{\hasse@BC}% - {C}{\hasse@BC*}% + {B}{\global\lie@hasse@Btrue\hasse@BC}% + {C}{\global\lie@hasse@Bfalse\hasse@BC}% {D}{\hasse@D}% - {E}% - {% - \ifnum\dynkin@rank=6% - \hasse@E@six% - \else% - \ifnum\dynkin@rank=7% - \hasse@E@seven% - \else% - \ifnum\dynkin@rank=8% - \hasse@E@eight% - \else - \ifnum\dynkin@rank>8% - \ClassError% - {Lie Hasse}% - {Rank of E series Hasse diagram: #3{}% - exceeds 8; not defined yet}% - {}% - \fi% - \ifnum\dynkin@rank<6% - \ClassError% - {Lie Hasse}% - {Rank of E series Hasse diagram: #3{} less than 6}% - {}% - \fi% - \fi% - \fi% - \fi% - }% + {E}{\hasse@E@series}% {F}% {% \ifnum\dynkin@rank=4% @@ -194,10 +188,11 @@ {Lie Hasse}% {Lie algebra series #2{} not A,B,C,D,E,F or G}% {}]% + \forAllPositiveRoots{\draw@lie@hasse@root}% \draw@simple@root@labels% \fi% \lie@hasse@write@widths{}% - \forAllPositiveRootsInHasseDiagram{\doRootThing}% + \forAllPositiveRoots{\doRootThing}% \iflie@hasse@attach@dynkin@diagram% \attachDynkin% \fi% @@ -205,13 +200,42 @@ \begin{tikzpicture}\hasse[#1]{#2}{#3}\end{tikzpicture}% \fi% }% +\NewDocumentCommand\hasse@E@series{}% +{% + \ifnum\dynkin@rank=6% + \hasse@E@six% + \else% + \ifnum\dynkin@rank=7% + \hasse@E@seven% + \else% + \ifnum\dynkin@rank=8% + \hasse@E@eight% + \else% + \ifnum\dynkin@rank>8% + \ClassError% + {Lie Hasse}% + {Rank of E series Hasse diagram: \the\dynkin@rank{}% + exceeds 8; not defined yet}% + {}% + \fi% + \ifnum\dynkin@rank<6% + \ClassError% + {Lie Hasse}% + {Rank of E series Hasse diagram: \the\dynkin@rank{}% + less than 6; not define yet}% + {}% + \fi% + \fi% + \fi% + \fi% +}% \NewDocumentCommand\drawRootAsDynkinSum{mm}% {% \rootSum{#1}{#2}{\rs}% \node at (#1;#2) {% \dynkin[% - labels=\rs,% + expand labels=\rs,% /Lie Hasse diagram/embedded Dynkin diagram]% {\dynkin@series}{\the\dynkin@rank}% };% @@ -239,25 +263,38 @@ }% \fi% }% - -\NewDocumentCommand\backwardsGtwo{}% +\NewDocumentCommand\hasseAttachGtwo{}% {% - \dynkin[label,backwards,x shift in edge lengths=-1]{G}{\dynkin@roots}% + \dynkin[vertical shift=0,% + edge length=\lie@hasse@edge@length,% +% label,% +% backwards,% +% x shift in edge lengths=-1 +]{G}{\dynkin@roots}% }% - \newcount\lie@hasse@E@shift% \NewDocumentCommand\attachDynkin{}% {% \IfStrEqCase{\dynkin@series}{% - {A}{\dynkin{A}{\dynkin@roots}}% - {B}{\dynkin{B}{\dynkin@roots}}% - {C}{\dynkin{C}{\dynkin@roots}}% - {D}{\dynkin[y shift in edge lengths=-1.5,label]% - {D}{\dynkin@roots}}% + {A}{\dynkin[vertical shift=0,% + edge length=\lie@hasse@edge@length]% + {A}{\dynkin@roots}}% + {B}{\dynkin[vertical shift=0,% + edge length=\lie@hasse@edge@length]% + {B}{\dynkin@roots}}% + {C}{\dynkin[vertical shift=0,% + edge length=\lie@hasse@edge@length]% + {C}{\dynkin@roots}}% + {D}{\dynkin[vertical shift=0,% + edge length=\lie@hasse@edge@length,% + y shift in edge lengths=-1.5,label]% + {D}{\dynkin@roots}}% {E}% {%% \ifnum\dynkin@rank=6% \dynkin[% + vertical shift=0,% + edge length=\lie@hasse@edge@length,% upsidedown,% labels*={1,...,6},% y shift in edge lengths=.5]% @@ -266,6 +303,8 @@ \lie@hasse@E@shift\the\dynkin@rank\relax% \advance\lie@hasse@E@shift by -2\relax% \dynkin[% + vertical shift=0,% + edge length=\lie@hasse@edge@length,% backwards,% upsidedown,% label,% @@ -274,16 +313,17 @@ {E}{\dynkin@roots}% \fi% }%% - {F}{\dynkin{F}{\dynkin@roots}}% - {G}{\backwardsGtwo{}}% + {F}{\dynkin[vertical shift=0,% + edge length=\lie@hasse@edge@length]% + {F}{\dynkin@roots}}% + {G}{\hasseAttachGtwo}% }% [\ClassError% {Lie Hasse}% - {Lie algebra series \dynkin@series{} not A,B,C,D,E,F or G when attaching Dynkin diagram}% + {Lie algebra series \dynkin@series{} % + not A,B,C,D,E,F or G when attaching Dynkin diagram}% {}]% }% - - \newif\iflie@hasse@multiple@diagrams \newcommand\doHasseDiagram[1]%% {% @@ -291,8 +331,7 @@ \ % \fi% \begin{tikzpicture}% - [show background rectangle,% - baseline=(current bounding box.east)]]% + [show background rectangle,baseline=(current bounding box.east)]% \hasse#1% \iflie@hasse@show@height% \rootSystemHeight{\lie@hasse@height}% @@ -327,33 +366,25 @@ }% \begin{center}% \expandafter\forscsvlist% - \expandafter\doHasseDiagram% - \expandafter{#1}% + \expandafter\doHasseDiagram\expandafter{#1}% \end{center}% }% - - %%% %%% Package internals: %%% - - \pgfdeclarelayer{Dynkin middle} \pgfdeclarelayer{Dynkin above} \pgfsetlayers{background,Dynkin behind,Dynkin middle,Dynkin above,main} - - \newcommand*\label@list@at[1]{\csname FOOBAR-#1\endcsname} \newcommand*\defn@label@list@entry[1]{\expandafter\def\csname FOOBAR-#1\endcsname} \def\add@to@label@list#1#2{\global\defn@label@list@entry{#1}{#2}}% \newcount\label@item@count% \label@item@count 0\relax% -\newcommand\add@label[1]% +\newcommand\lie@hasse@add@label[1]% {% - \advance\label@item@count by 1\relax% + \global\advance\label@item@count by 1\relax% \global\add@to@label@list{\the\label@item@count}{#1}% }% - \xdef\lie@hasse@compact@roots{}% \NewDocumentCommand\if@compact@root{mmm}% {% @@ -369,9 +400,8 @@ \dynkinOrder{\dynkin@series}{\the\dynkin@rank}.Carter::#1->\dynkin@ordering.% {\current@simple@root}% \StrChar{\dynkin@roots}{\current@simple@root}[\lie@hasse@root@marker]% -\IfStrEq{*}{\lie@hasse@root@marker}{#2}{#3}% +\IfStrEq{x}{\lie@hasse@root@marker}{#3}{#2}% }% - \NewDocumentCommand\add@compact@root{m}% {% \if@compact@root{#1}% @@ -382,53 +412,65 @@ \xdef\lie@hasse@compact@roots{\temp@lie@hasse@compact@roots{ }(#1)}% }% }% - \newcount\lie@hasse@sr% -\newcount\drpo% \NewDocumentCommand\add@compact@simple@roots@to@compact@roots{}% {% -\lie@hasse@sr 1\relax% -\drpo\the\dynkin@rank\relax% -\advance\drpo by 1\relax% -\loop% - \if@compact@simple@root{\the\lie@hasse@sr}% - {%% - \add@compact@root{1;\the\lie@hasse@sr}% - }%% - {%% - }%% - \advance\lie@hasse@sr by 1\relax% -\ifnum\lie@hasse@sr<\the\drpo% -\repeat% + \lie@hasse@sr 1\relax% + \loop% + \if@compact@simple@root{\the\lie@hasse@sr}% + {%% + \add@compact@root{1;\the\lie@hasse@sr}% + }%% + {%% + }%% + \advance\lie@hasse@sr by 1\relax% + \ifnum\lie@hasse@sr<\the\dynkin@rank@plus@one% + \repeat% }% - -\newcount\drmo% \newcount\lie@hasse@root@count% \newcount\lie@hasse@root@count@b% \newcount\max@lie@hasse@root@count% \newcount\lie@hasse@reorder - \NewDocumentCommand\lie@hasse@fix@order{mm}% {% \dynkinOrder{\dynkin@series}{\dynkin@rank}.Carter::{#1}->\dynkin@ordering.{#2}% }% - \NewDocumentCommand\draw@one@simple@root@label{mm}% %% \draw@one@simple@root@label{r}{s}, draw at Carter number r %% the root with text s. {% - \node[below,% - label=% - {% - [below,% - lie@hasse@color,% - /Lie Hasse diagram/edge quotes]% - \(\pgfkeys{/Dynkin diagram/label macro=#2}\)% - }% - ]% - at% - (1;#1)% - {};% + \if@compact@simple@root{#1}% + {% + \iflie@hasse@show@levi% + \global\lie@hasse@ok@roottrue% + \else% + \global\lie@hasse@ok@rootfalse% + \fi% + }% + {% + \iflie@hasse@show@unipotent@radical% + \global\lie@hasse@ok@roottrue% + \else% + \global\lie@hasse@ok@rootfalse% + \fi% + }% + \iflie@hasse@ok@root% + \node[% + below,% + label=% + {% + [% + below,% + lie@hasse@color,% + /Lie Hasse diagram/edge quotes% + ]% + \(\pgfkeys{/Dynkin diagram/label macro={\edgeQuote{#2}}}\)% + }% + ]% + at% + (1;#1)% + {};% + \fi% }% \NewDocumentCommand\draw@simple@root@labels{}% {% @@ -471,27 +513,56 @@ \pgfmathsetmacro{\lie@hasse@huenum}{#1/\the\dynkin@rank}% \global\definecolor{lie@hasse@color}{hsb}{\lie@hasse@huenum,1,.6}% }% -\NewDocumentCommand\draw@lie@hasse@root{m}% +\NewDocumentCommand\draw@lie@hasse@root{mm}% {% -\if@compact@root{#1}% -{%% -\pgfkeys{/Lie Hasse diagram/compact root=#1}% -}%% -{%% -\pgfkeys{/Lie Hasse diagram/noncompact root=#1}% -}%% + \if@compact@root{#1;#2}% + {%% + \iflie@hasse@show@levi% + \pgfkeys{/Lie Hasse diagram/compact root={#1;#2}}% + \fi% + }%% + {%% + \iflie@hasse@show@unipotent@radical% + \pgfkeys{/Lie Hasse diagram/noncompact root={#1;#2}}% + \fi% + }%% }% -\xdef\lie@hasse@grade@a{} -\xdef\lie@hasse@grade@b{} -\xdef\lie@hasse@index@a{} -\xdef\lie@hasse@index@b{} \newcount\root@gpo% \xdef\label@text{}% +\newif\iflie@hasse@is@levi +\newif\iflie@hasse@ok@root \NewDocumentCommand\draw@lie@hasse@edge{O{}mmmm}% %[edge label options]{from grade}{from index}{to index}{simple root} {% \root@gpo #2\relax% \advance\root@gpo by 1\relax% + \if@compact@root{#2;#3}% + {% + \if@compact@simple@root{#5}% + {% + \global\lie@hasse@is@levitrue% + \add@compact@root{\the\root@gpo;#4}% + }% + {% + \global\lie@hasse@is@levifalse% + }% + }% + {% + \global\lie@hasse@is@levifalse% + }% + \iflie@hasse@is@levi% + \iflie@hasse@show@levi% + \global\lie@hasse@ok@roottrue% + \else% + \global\lie@hasse@ok@rootfalse% + \fi% + \else% + \iflie@hasse@show@unipotent@radical% + \global\lie@hasse@ok@roottrue% + \else% + \global\lie@hasse@ok@rootfalse% + \fi% + \fi% \set@lie@hasse@color{#5}% \lie@hasse@fix@order{#5}{\lie@hasse@root@count@b}% \IfStrEq{\dynkin@label@list}{}% @@ -505,31 +576,33 @@ }% }% \if@compact@simple@root{#5}% - {%%% Compact - \draw[% - lie@hasse@color,% - /Lie Hasse diagram/edge,% - /Lie Hasse diagram/compact edge]% - (#2;#3) --% - node[lie@hasse@color,/Lie Hasse diagram/edge quotes,#1]% - {\(\pgfkeys{/Dynkin diagram/label macro=\label@text}\)}% - (\the\root@gpo;#4);% - \IfSubStr{\lie@hasse@compact@roots}{#2;#3}% - {%% adding to a compact - \add@compact@root{\the\root@gpo;#4}% - }%% - {%% - }%% + {%%% Compact simple root, i.e. edge + \iflie@hasse@ok@root% + \draw[% + lie@hasse@color,% + /Lie Hasse diagram/edge,% + /Lie Hasse diagram/compact edge]% + (#2;#3)--% + node[lie@hasse@color,/Lie Hasse diagram/edge quotes,#1]% + {\(\pgfkeys{/Dynkin diagram/label macro={\edgeQuote{\label@text}}}\)}% + (\the\root@gpo;#4);% + \fi% + \iflie@hasse@is@levi% + \fi% }%%% {%%% Noncompact - \draw[% - lie@hasse@color,% - /Lie Hasse diagram/edge,% - /Lie Hasse diagram/noncompact edge]% - (#2;#3) --% + \iflie@hasse@ok@root% + \draw + [% + lie@hasse@color,% + /Lie Hasse diagram/edge,% + /Lie Hasse diagram/noncompact edge% + ]% + (#2;#3)--% node[lie@hasse@color,/Lie Hasse diagram/edge quotes,#1]% - {\(\pgfkeys{/Dynkin diagram/label macro=\label@text}\)}% + {\(\pgfkeys{/Dynkin diagram/label macro={\edgeQuote{\label@text}}}\)}% (\the\root@gpo;#4);% + \fi% }%%% }% \newcount\A@series@grade% @@ -555,8 +628,8 @@ \coordinate (\the\A@series@grade;\the\A@series@j) at - ({.5*\the\A@series@x*\dynkin@edge@length}, - {.25*\the\A@series@y*\dynkin@edge@length}) + ({.5*\the\A@series@x*\lie@hasse@edge@length}, + {.25*\the\A@series@y*\lie@hasse@edge@length}) {};% \advance\A@series@j by 1\relax% \advance\A@series@x by 2\relax% @@ -569,59 +642,35 @@ \ifnum\A@series@grade<\the\max@A@series@grade% \repeat% }% -\newcount\A@series@grade% -\newcount\max@A@series@grade% -\NewDocumentCommand\draw@A@roots{}% -{% - \A@series@grade 1\relax% - \max@A@series@grade \the\dynkin@rank\relax% - \advance\max@A@series@grade by 1\relax% - \loop% - \max@A@series@j\the\dynkin@rank\relax% - \advance\max@A@series@j by -\the\A@series@grade\relax% - \advance\max@A@series@j by 2\relax% - \A@series@j 1\relax% - {% - \loop% - \draw@lie@hasse@root% - {\the\A@series@grade;\the\A@series@j}% - \advance\A@series@j by 1\relax% - \ifnum\A@series@j<\the\max@A@series@j% - \repeat% - }% - \advance\A@series@grade by 1\relax% - \ifnum\A@series@grade<\the\max@A@series@grade% - \repeat% -}% \newcount\maxA@i% \newcount\maxA@j% \newcount\A@lbl% -\newcount\A@i% -\newcount\A@j% -\newcount\A@ipo% +\newcount\lie@hasse@i% +\newcount\lie@hasse@j% +\newcount\lie@hasse@ipo% \newcount\A@rj% \newcount\A@rjmo% \NewDocumentCommand\draw@A@edges{}% {% \maxA@i\the\dynkin@rank\relax% - \A@i 1\relax% + \lie@hasse@i 1\relax% \loop% \maxA@j \the\dynkin@rank\relax% - \advance\maxA@j by -\the\A@i\relax% + \advance\maxA@j by -\the\lie@hasse@i\relax% \advance\maxA@j by 1\relax% \ifnum\maxA@j>-1% - \A@j 1\relax% + \lie@hasse@j 1\relax% {% \loop% - \A@lbl\the\A@i\relax% - \advance\A@lbl by \the\A@j\relax% - \A@ipo \A@i\relax% - \advance\A@ipo by 1\relax% + \A@lbl\the\lie@hasse@i\relax% + \advance\A@lbl by \the\lie@hasse@j\relax% + \lie@hasse@ipo \lie@hasse@i\relax% + \advance\lie@hasse@ipo by 1\relax% \draw@lie@hasse@edge[left]% - {\the\A@i}{\the\A@j}% - {\the\A@j}{\the\A@lbl}% + {\the\lie@hasse@i}{\the\lie@hasse@j}% + {\the\lie@hasse@j}{\the\A@lbl}% \A@rj\the\maxA@j\relax% - \advance\A@rj by -\the\A@j\relax% + \advance\A@rj by -\the\lie@hasse@j\relax% \advance\A@rj by 1\relax% \A@rjmo\the\A@rj\relax% \advance\A@rjmo by -1\relax% @@ -629,15 +678,15 @@ \advance\A@lbl by \the\dynkin@rank% \advance\A@lbl by 1% \draw@lie@hasse@edge[right]% - {\the\A@i}{\the\A@rj}% + {\the\lie@hasse@i}{\the\A@rj}% {\the\A@rjmo}{\the\A@lbl}% - \advance\A@j by 1\relax% - \ifnum\A@j<\the\maxA@j% + \advance\lie@hasse@j by 1\relax% + \ifnum\lie@hasse@j<\the\maxA@j% \repeat% }% \fi% - \advance\A@i by 1\relax% - \ifnum\A@i<\the\maxA@i% + \advance\lie@hasse@i by 1\relax% + \ifnum\lie@hasse@i<\the\maxA@i% \repeat% }% %% \hasse@A@width@at@grade{g}{\w} sets the counter \w to @@ -653,7 +702,6 @@ {% \place@A@roots% \draw@A@edges% - \draw@A@roots% }% %% \hasse@BC@width@at@grade{g}{\w} sets the counter \w to %% the value of the width (number of roots) at grade g of @@ -666,138 +714,116 @@ \global\advance#2 by 1\relax% \global\divide#2 by 2\relax% }% -\newcount\tdrmt% -\newcount\tdrmo% +\newcount\twice@dynkin@rank@minus@one% \newcount\max@BC@r% \newcount\BC@r% \newcount\BC@series@x% \newcount\BC@series@y% \NewDocumentCommand\place@BC@roots{}% {% -\drmo \the\dynkin@rank\relax% -\advance\drmo by -1\relax% -\tdrmt \the\drmo\relax% -\advance\tdrmt by \the\drmo\relax% -\tdrmo \the\tdrmt\relax% -\advance\tdrmo 1\relax% -\max@BC@r \the\dynkin@rank\relax% -\advance\max@BC@r by 1\relax% -\BC@r 1\relax% -\loop% - \BC@series@x \the\BC@r\relax% - \advance\BC@series@x by -1\relax% - \advance\BC@series@x by \the\BC@series@x\relax% - \BC@series@y 1\relax% - {%% + \twice@dynkin@rank@minus@one \the\dynkin@rank\relax% + \advance\twice@dynkin@rank@minus@one by \the\dynkin@rank\relax% + \advance\twice@dynkin@rank@minus@one by -1\relax% + \max@BC@r \the\dynkin@rank\relax% + \advance\max@BC@r by 1\relax% + \BC@r 1\relax% \loop% - \coordinate - (\the\BC@series@y;\the\BC@r) - at - ({.5*\the\BC@series@x*\dynkin@edge@length}, - {.5*(\the\BC@series@y-1)*\dynkin@edge@length}) - {};% - \advance\BC@series@y by 1\relax% - \advance\BC@series@x by 1\relax% - \ifnum\BC@series@x<\the\tdrmo\repeat% - }%% - \advance\BC@r by 1\relax% - \ifnum\BC@r<\the\max@BC@r% -\repeat% + \BC@series@x \the\BC@r\relax% + \advance\BC@series@x by -1\relax% + \advance\BC@series@x by \the\BC@series@x\relax% + \BC@series@y 1\relax% + {%% + \loop% + \coordinate + (\the\BC@series@y;\the\BC@r) + at + ({.5*\the\BC@series@x*\lie@hasse@edge@length}, + {.5*(\the\BC@series@y-1)*\lie@hasse@edge@length}) + {};% + \advance\BC@series@y by 1\relax% + \advance\BC@series@x by 1\relax% + \ifnum\BC@series@x<\the\twice@dynkin@rank@minus@one\repeat% + }%% + \advance\BC@r by 1\relax% + \ifnum\BC@r<\the\max@BC@r% + \repeat% +}% +\newcount\BC@height% +\newcount\BC@g% +\NewDocumentCommand\draw@BC@edges{}% +{% + \rootSystemHeight{\BC@height}% + \ifnum\BC@height>1% + \BC@g 1\relax% + \loop% + \draw@BC@edges@at@grade{\the\BC@g}% + \global\advance\BC@g by 1\relax% + \ifnum\BC@g<\BC@height% + \repeat% + \fi% }% -\newcount\max@BC@i% \newcount\BC@i% -\newcount\BC@series@x% -\newcount\BC@series@y% +\newcount\BC@width% +\newcount\BC@width@plus@one% +\NewDocumentCommand\draw@BC@edges@at@grade{m}% +{% + \rootSystemWidthAtGrade{#1}{\BC@width}% + \BC@width@plus@one \BC@width\relax% + \advance \BC@width@plus@one by 1\relax% + \BC@i 1\relax% + {% + \loop% + \draw@BC@edges@at@root{#1}{\the\BC@i}% + \global\advance\BC@i by 1\relax% + \ifnum\BC@i<\BC@width@plus@one\repeat% + }% +}% +\newcount\BC@height% \newcount\BC@ii% -\newcount\BC@series@yy% -\newcount\BC@series@yy% -\newcount\lbl% +\newif\ifBC@draw% +\newcount\lie@hasse@lbl% \newcount\temp@lbl% -\NewDocumentCommand\draw@BC@edges{s}% -{% -\tdrmo \the\dynkin@rank\relax% -\advance\tdrmo by \the\dynkin@rank\relax% -\advance\tdrmo by -1\relax% -\max@BC@i \the\dynkin@rank\relax% -\advance\max@BC@i by 1\relax% -\BC@i 1\relax% -\loop% - \BC@series@x \the\BC@i\relax% - \advance\BC@series@x by \the\BC@i\relax% - \advance\BC@series@x by -2\relax% - \BC@series@y 1\relax% - {%% - \loop% - \ifnum\BC@i>1% - % draw an edge upward to the left - \BC@ii \the\BC@i\relax% - \advance\BC@ii by -1\relax% - \BC@series@yy \the\BC@series@y\relax% - \advance\BC@series@yy by 1\relax% - \draw@lie@hasse@edge[right]% - {\the\BC@series@y}{\the\BC@i}% - {\the\BC@ii}% - {\the\BC@ii}% +\NewDocumentCommand\draw@BC@edges@at@root{mm}% +{% + \ifnum#2>1% + % draw an edge upward to the left + \BC@ii #2\relax% + \advance\BC@ii by -1\relax% + \draw@lie@hasse@edge[right]% + {#1}{#2}% + {\the\BC@ii} + {\the\BC@ii}% + \fi% + \BC@drawtrue% + \ifodd#1 + \ifnum#2=\the\BC@width% + \global\BC@drawfalse% \fi% - \ifnum\BC@series@y>1% - % draw an edge downward to the left - \BC@series@yy \the\BC@series@y\relax% - \advance\BC@series@yy by -1\relax% - \lbl \the\BC@i\relax% - \advance\lbl by \the\BC@series@y\relax% - \advance\lbl by -1\relax% - \ifnum\dynkin@rank<\the\lbl% - \temp@lbl \the\lbl\relax% - \lbl \the\dynkin@rank\relax% - \advance\lbl by \the\dynkin@rank% - \advance\lbl by -\the\temp@lbl% + \fi% + \ifBC@draw% + % draw an edge upward to the right + \lie@hasse@lbl #2\relax% + \advance\lie@hasse@lbl by #1\relax% + \ifnum\dynkin@rank<\the\lie@hasse@lbl% + \temp@lbl \the\lie@hasse@lbl\relax% + \lie@hasse@lbl \the\dynkin@rank\relax% + \advance\lie@hasse@lbl by \the\dynkin@rank% + \advance\lie@hasse@lbl by -\the\temp@lbl% %% For the B series: - \IfBooleanF{#1}{\global\advance\lbl by 1\relax}% - \draw@lie@hasse@edge[left]% - {\the\BC@series@yy}{\the\BC@i}% - {\the\BC@i}% - {\the\lbl}% - \else% - \draw@lie@hasse@edge[left]% - {\the\BC@series@yy}{\the\BC@i}% - {\the\BC@i}% - {\the\lbl}% + \iflie@hasse@B% + \global\advance\lie@hasse@lbl by 1\relax% \fi% + \draw@lie@hasse@edge[left]% + {#1}{#2}% + {#2}% + {\the\lie@hasse@lbl}% + \else% + \draw@lie@hasse@edge[left]% + {#1}{#2}% + {#2}% + {\the\lie@hasse@lbl}% \fi% - \advance\BC@series@y by 1\relax% - \advance\BC@series@x by 1\relax% - \ifnum\BC@series@x<\the\tdrmo\repeat% - }%% - \advance\BC@i by 1\relax% - \ifnum\BC@i<\the\max@BC@i% -\repeat% -}% -\newcount\tdrpt% -\newcount\BC@r% -\newcount\BC@series@y% -\newcount\maxy% -\NewDocumentCommand\draw@BC@roots{}% -{% -\tdrpt \the\dynkin@rank\relax% -\advance\tdrpt by \the\dynkin@rank\relax% -\advance\tdrpt by 2\relax% -\max@BC@r \the\dynkin@rank\relax% -\advance\max@BC@r by 1\relax% -\BC@r 1\relax% -\loop% - \BC@series@y 1\relax% - \maxy \tdrpt\relax% - \advance\maxy -\the\BC@r\relax% - \advance\maxy -\the\BC@r\relax% - {%% - \loop% - \draw@lie@hasse@root{\the\BC@series@y;\the\BC@r}% - \advance\BC@series@y by 1\relax% - \ifnum\BC@series@y<\the\maxy\repeat% - }%% - \advance\BC@r by 1\relax% - \ifnum\BC@r<\the\max@BC@r% -\repeat% + \fi% }% \NewDocumentCommand\hasse@BC{s}% star for C: {% @@ -809,7 +835,6 @@ {% \draw@BC@edges% }% - \draw@BC@roots% }% \NewDocumentCommand\hasse@D{}% {% @@ -818,51 +843,45 @@ \iflie@hasse@threeD% \draw@D@hasse@three@D% \fi% - \draw@D@roots% }% -\newcount\drmt% \NewDocumentCommand\draw@D@hasse@three@D{}% {% - \drmo \the\dynkin@rank\relax% - \advance\drmo by -1\relax% - \drmt \the\dynkin@rank\relax% - \advance\drmt by -2\relax% \begin{pgfonlayer}{Dynkin middle}% \fill[/Lie Hasse diagram/left] - (\the\drmt;1) -- - (\the\drmo;1) -- + (\the\dynkin@rank@minus@two;1) -- + (\the\dynkin@rank@minus@one;1) -- (\the\dynkin@rank;1) -- - (\the\drmo;2) -- + (\the\dynkin@rank@minus@one;2) -- cycle;% \fill[/Lie Hasse diagram/top] - (\the\drmt;1) -- - (1;\the\drmt) -- - (2;\the\drmo) -- - (\the\drmo;2) -- + (\the\dynkin@rank@minus@two;1) -- + (1;\the\dynkin@rank@minus@two) -- + (2;\the\dynkin@rank@minus@one) -- + (\the\dynkin@rank@minus@one;2) -- cycle;% \fill[/Lie Hasse diagram/top] - (\the\drmo;2) -- + (\the\dynkin@rank@minus@one;2) -- (\the\dynkin@rank;1) -- - (3;\the\drmo) -- - (2;\the\drmo) -- + (3;\the\dynkin@rank@minus@one) -- + (2;\the\dynkin@rank@minus@one) -- cycle;% \fill[/Lie Hasse diagram/top] - (\the\drmo;1) -- + (\the\dynkin@rank@minus@one;1) -- (\the\dynkin@rank;1) -- - (3;\the\drmo) -- - (2;\the\drmt) -- + (3;\the\dynkin@rank@minus@one) -- + (2;\the\dynkin@rank@minus@two) -- cycle;% \fill[/Lie Hasse diagram/top] - (\the\drmt;1) -- - (\the\drmo;1) -- - (2;\the\drmt) -- - (1;\the\drmt) -- + (\the\dynkin@rank@minus@two;1) -- + (\the\dynkin@rank@minus@one;1) -- + (2;\the\dynkin@rank@minus@two) -- + (1;\the\dynkin@rank@minus@two) -- cycle;% \fill[/Lie Hasse diagram/left] - (1;\the\drmt) -- - (2;\the\drmt) -- - (3;\the\drmo) -- - (2;\the\drmo) -- + (1;\the\dynkin@rank@minus@two) -- + (2;\the\dynkin@rank@minus@two) -- + (3;\the\dynkin@rank@minus@one) -- + (2;\the\dynkin@rank@minus@one) -- cycle;% \end{pgfonlayer}% }% @@ -883,9 +902,7 @@ \newcount\D@g% \newcount\maxD@grd% \newcount\D@grd% -\newcount\maxxD% -\newcount\iD% -\newcount\xxD% +\newcount\lie@hasse@D@x% \newcount\sum@D% \NewDocumentCommand\place@D@roots{}% {% @@ -918,37 +935,34 @@ \repeat% }% }% -\newcount\drpo% \NewDocumentCommand\place@D@root@at{mm}% {% - \xxD #1\relax% - \advance\xxD by #2\relax% - \advance\xxD by #2\relax% - \advance\xxD by -3\relax% - \drpo \the\dynkin@rank\relax% - \advance\drpo by 1\relax% + \lie@hasse@D@x #1\relax% + \advance\lie@hasse@D@x by #2\relax% + \advance\lie@hasse@D@x by #2\relax% + \advance\lie@hasse@D@x by -3\relax% \sum@D #1\relax% \advance\sum@D by #2\relax% \ifnum\sum@D=\the\dynkin@rank% \global\def\D@root@x% - {\the\xxD-\lie@hasse@three@D@shift}% + {\the\lie@hasse@D@x-\lie@hasse@three@D@shift}% \else% - \ifnum\sum@D=\the\drpo% + \ifnum\sum@D=\the\dynkin@rank@plus@one% \ifnum#1<\the\dynkin@rank% \global\def\D@root@x% - {\the\xxD-2+\lie@hasse@three@D@shift}% + {\the\lie@hasse@D@x-2+\lie@hasse@three@D@shift}% \else% - \global\def\D@root@x{\the\xxD}% + \global\def\D@root@x{\the\lie@hasse@D@x}% \fi% \else% \ifnum\sum@D<\the\dynkin@rank% - \global\def\D@root@x{\the\xxD}% + \global\def\D@root@x{\the\lie@hasse@D@x}% \else% % if \sum@D exceeds rank+1 \ifnum#1<\the\dynkin@rank% - \global\def\D@root@x{\the\xxD-2}% + \global\def\D@root@x{\the\lie@hasse@D@x-2}% \else% - \global\def\D@root@x{\the\xxD}% + \global\def\D@root@x{\the\lie@hasse@D@x}% \fi% \fi% \fi% @@ -956,7 +970,7 @@ \coordinate (#1;#2) at - ({(\D@root@x)*\dynkin@edge@length/2},{(#1-1)*\dynkin@edge@length/2}) + ({(\D@root@x)*\lie@hasse@edge@length/2},{(#1-1)*\lie@hasse@edge@length/2}) {};% }% \NewDocumentCommand\draw@D@edges{}% @@ -983,7 +997,8 @@ \D@r 1\relax% {% \loop% - \draw@D@edges@at{#1}{\the\D@r}{\the\max@D@roots}% +%%% \draw@D@edges@at{#1}{\the\D@r}{\the\max@D@roots}% + \draw@D@edges@at{#1}{\the\D@r}% \advance\D@r by 1\relax% \ifnum\D@r<\the\max@D@roots@plus@one% \repeat% @@ -1000,10 +1015,6 @@ \newcount\hasse@D@label% \NewDocumentCommand\draw@D@edges@at{mm}% {% - \drmo\the\dynkin@rank\relax% - \advance\drmo by -1\relax% - \drpo \the\dynkin@rank\relax% - \advance\drpo by 1\relax% \hasse@D@gpo#1\relax% \advance\hasse@D@gpo by 1\relax% \hasse@D@gpi#1\relax% @@ -1035,7 +1046,7 @@ \xdef\hasse@D@layer{Dynkin above}% \else% % below or middle. - \ifnum\hasse@D@gpi=\the\drpo% + \ifnum\hasse@D@gpi=\the\dynkin@rank@plus@one% \xdef\hasse@D@layer{Dynkin behind}% \fi% \fi% @@ -1045,7 +1056,7 @@ \fi% \fi% \ifnum\dynkin@rank>#1% - \ifnum\hasse@D@gpi<\the\drpo% + \ifnum\hasse@D@gpi<\the\dynkin@rank@plus@one% \else% \global\advance\hasse@D@label -1\relax% \fi% @@ -1069,7 +1080,7 @@ \fi% \fi% \ifnum#1=1% - \ifnum\drmo=#2% + \ifnum\dynkin@rank@minus@one=#2% \global\hasse@Dfalse\relax% \else% \xdef\hasse@D@LR{right}% @@ -1080,13 +1091,13 @@ \ifnum\hasse@D@label>\the\dynkin@rank% \hasse@D@label -\hasse@D@label\relax% \advance\hasse@D@label \the\dynkin@rank\relax% - \advance\hasse@D@label \the\drmo\relax% + \advance\hasse@D@label \the\dynkin@rank@minus@one\relax% \fi% - \ifnum\drmo<#1% + \ifnum\dynkin@rank@minus@one<#1% \else% \ifnum#2=1% \else% - \ifnum\hasse@D@gpi<\the\drpo% + \ifnum\hasse@D@gpi<\the\dynkin@rank@plus@one% \else% \advance\hasse@D@label 1\relax% \fi% @@ -1099,11 +1110,11 @@ \global\advance\hasse@D@target by 1\relax% \fi% \else% - \ifnum\drmo=#1% + \ifnum\dynkin@rank@minus@one=#1% \global\advance\hasse@D@target by -1\relax% \fi% \fi% - \ifnum\hasse@D@gpi=\the\drpo% + \ifnum\hasse@D@gpi=\the\dynkin@rank@plus@one% \ifnum#2>1% \xdef\hasse@D@layer{Dynkin behind}% \xdef\hasse@D@LR{right}% @@ -1112,7 +1123,7 @@ \ifnum\hasse@D@gpi=\the\dynkin@rank% \xdef\hasse@D@layer{Dynkin above}% \else% - \ifnum\hasse@D@gpi=\the\drmo% + \ifnum\hasse@D@gpi=\the\dynkin@rank@minus@one% \xdef\hasse@D@layer{Dynkin above}% \else% \xdef\hasse@D@layer{Dynkin middle}% @@ -1129,7 +1140,7 @@ \end{pgfonlayer}% \fi% % % Draw any other edges. - \ifnum\hasse@D@gpi=\the\drmo% + \ifnum\hasse@D@gpi=\the\dynkin@rank@minus@one% \hasse@D@target#2\relax% \advance\hasse@D@target by 1\relax% \begin{pgfonlayer}{Dynkin behind} @@ -1142,38 +1153,7 @@ }% \newcount\maxD@grd% \newcount\D@grd% -\newcount\maxxD% \newcount\sum@D% -\NewDocumentCommand\draw@D@roots{}% -{% - \drmo \the\dynkin@rank\relax% - \advance\drmo by -1\relax% - \maxD@grd \the\dynkin@rank\relax% - \advance\maxD@grd by \the\dynkin@rank\relax% - \advance\maxD@grd by -2\relax% - \D@grd 1\relax% - \loop% - % Construct the roots at grade \D@grd. - \draw@D@roots@at@grade{\D@grd}% - \advance\D@grd by 1\relax% - \ifnum\D@grd<\the\maxD@grd% - \repeat% -}% -\NewDocumentCommand\draw@D@roots@at@grade{m}% -{% - \hasse@D@width@at@grade{#1}{\max@D@roots}% - \max@D@roots@plus@one \the\max@D@roots\relax% - \advance\max@D@roots@plus@one 1\relax% - \D@r 1\relax% - {% - \loop% - \draw@lie@hasse@root{\the\D@grd;\the\D@r}% - \advance\D@r by 1\relax% - \ifnum\D@r<\the\max@D@roots@plus@one% - \repeat% - }% -}% -%}% \newcount\lie@hasse@grade@no \newcount\lie@hasse@root@no \def\lie@hasse@XX{} @@ -1205,14 +1185,14 @@ \coordinate (\the\lie@hasse@grade@no;\the\lie@hasse@root@no) at - ({\lie@hasse@XX*\dynkin@edge@length/2}, - {(\the\lie@hasse@grade@no-1)*\dynkin@edge@length/2}) {};% + ({\lie@hasse@XX*\lie@hasse@edge@length/2}, + {(\the\lie@hasse@grade@no-1)*\lie@hasse@edge@length/2}) {};% \global\advance\lie@hasse@root@no by 1% }% \NewDocumentCommand\lie@hasse@place@root@list{m}% {% \global\lie@hasse@root@no 1\relax% - \expandafter\forcsvlist\expandafter{\lie@hasse@place@root}{#1}% + \expandafter\forcsvlist\expandafter\lie@hasse@place@root{#1}% \global\advance\lie@hasse@grade@no by 1% }% \NewDocumentCommand\lie@hasse@place@roots{m}% @@ -1224,26 +1204,6 @@ }% \expandafter\docsvlist\expandafter{#1}% }% -\NewDocumentCommand\lie@hasse@draw@root{m}% -{% - \draw@lie@hasse@root{\the\lie@hasse@grade@no;\the\lie@hasse@root@no}% - \global\advance\lie@hasse@root@no by 1% -}% -\NewDocumentCommand\lie@hasse@root@draw@list{m}% -{% - \global\lie@hasse@root@no 1\relax% - \expandafter\forcsvlist\expandafter{\lie@hasse@draw@root}{#1}% - \global\advance\lie@hasse@grade@no by 1% -}% -\NewDocumentCommand\lie@hasse@draw@roots{m}% -{% - \global\lie@hasse@grade@no 1\relax% - \renewcommand*{\do}[1]% - {% - \lie@hasse@root@draw@list{##1}% - }% - \expandafter\docsvlist\expandafter{#1}% -}% \newcount\lie@hasse@grade@no@plus@one% \newcount\lie@hasse@edge@count% \def\lie@hasse@edge@go{% @@ -1256,7 +1216,8 @@ {% \global\advance\lie@hasse@edge@count by 1\relax% \begin{pgfonlayer}{Dynkin above}% - \lie@hasse@finish@edge#1!% +%%? \lie@hasse@finish@edge#1!% + \lie@hasse@finish@edge#1\relax% \end{pgfonlayer}% }% \def\lie@hasse@process@edge@behind#1!% @@ -1289,13 +1250,12 @@ \NewDocumentCommand\lie@hasse@process@edge@lists{m}% {% \global\lie@hasse@grade@no 1\relax% - \expandafter\forcsvlist\expandafter{\lie@hasse@process@edge@list}{#1}% + \expandafter\forcsvlist\expandafter\lie@hasse@process@edge@list{#1}% }% \NewDocumentCommand\hasse@X{mm}% {% \lie@hasse@place@roots{#1}% \lie@hasse@process@edge@lists{#2}% - \lie@hasse@draw@roots{#1}% }% \NewDocumentCommand\hasse@E@six@width@at@grade{mm}% {% @@ -1323,7 +1283,11 @@ #2 1% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% }% -% In the following code, edges are described by grade: in grade g, the expression i+r<j. means an edge from g;i to (g+1);j labelled by root r, with a label on the left; use > instead of < to get the right. Use a star in front to get this edge on the higher layer. +% In the following code, edges are described by grade: +% in grade g, the expression i+r<j. means an edge from +% g;i to (g+1);j labelled by root r, with a label on +% the left; use > instead of < to get the right. Use a +% star in front to get this edge on the higher layer. \NewDocumentCommand\hasse@E@six{}% {% \hasse@X% @@ -1353,13 +1317,45 @@ }%%% \iflie@hasse@threeD% \begin{pgfonlayer}{Dynkin middle}% -\fill[/Lie Hasse diagram/top] (2;1) -- (5;3) -- (2;5) -- (1;5) -- (2;4) -- (1;3) -- (2;2) -- (1;2) -- cycle;% -\fill[/Lie Hasse diagram/top] (2;3) -- (4;1) -- (6;2) -- (4;5) -- cycle;% -\fill[/Lie Hasse diagram/right] (1;3) -- (2;3) -- (4;5) -- (3;5) -- cycle;% -\fill[/Lie Hasse diagram/left] (3;1) -- (4;1) -- (2;3) -- (1;3) -- cycle;% -\fill[/Lie Hasse diagram/left] (4;3) -- (5;1) -- (6;1) -- (5;2) -- cycle;% -\fill[/Lie Hasse diagram/right] (4;3) -- (5;2) -- (6;3) -- (5;4) -- cycle;% -\fill[/Lie Hasse diagram/top] (5;2) -- (7;1) -- (9;1) -- (7;3) -- cycle;% + \fill[/Lie Hasse diagram/top] + (2;1) -- + (5;3) -- + (2;5) -- + (1;5) -- + (2;4) -- + (1;3) -- + (2;2) -- + (1;2) -- cycle;% + \fill[/Lie Hasse diagram/top] + (2;3) -- + (4;1) -- + (6;2) -- + (4;5) -- cycle;% + \fill[/Lie Hasse diagram/right] + (1;3) -- + (2;3) -- + (4;5) -- + (3;5) -- cycle;% + \fill[/Lie Hasse diagram/left] + (3;1) -- + (4;1) -- + (2;3) -- + (1;3) -- cycle;% + \fill[/Lie Hasse diagram/left] + (4;3) -- + (5;1) -- + (6;1) -- + (5;2) -- cycle;% + \fill[/Lie Hasse diagram/right] + (4;3) -- + (5;2) -- + (6;3) -- + (5;4) -- cycle;% + \fill[/Lie Hasse diagram/top] + (5;2) -- + (7;1) -- + (9;1) -- + (7;3) -- cycle;% \end{pgfonlayer}% \fi% }% @@ -1399,7 +1395,6 @@ #2 1% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% }% - \NewDocumentCommand\hasse@E@seven{}% {% \hasse@X% @@ -1457,20 +1452,64 @@ }%%% \iflie@hasse@threeD% \begin{pgfonlayer}{Dynkin middle}% -\fill[/Lie Hasse diagram/top] (2;1) -- (6;3) -- (2;6) -- (1;6) -- (2;5) -- (1;4) -- (2;3) -- (1;3) -- - (2;2) -- (1;2) -- cycle;% -\fill[/Lie Hasse diagram/top] (5;1) -- (7;3) -- (4;6) -- (2;4) -- cycle;% -\fill[/Lie Hasse diagram/top] (7;1) -- (9;3) -- (7;5) -- (5;4) -- cycle;% -\fill[/Lie Hasse diagram/top] (9;1) -- (12;1) -- (13;1) -- (14;1) -- (11;3) -- (7;2) -- cycle;% -\fill[/Lie Hasse diagram/right] (1;4) -- (2;4) -- (4;6) -- (3;6) -- cycle;% -\fill[/Lie Hasse diagram/left] (4;1) -- (5;1) -- (2;4) -- (1;4) -- cycle;% -\fill[/Lie Hasse diagram/left] (4;4) -- (6;1) -- (8;1) -- (7;2) -- (6;2) -- (5;4) -- cycle;% -\fill[/Lie Hasse diagram/right] (4;4) -- (5;4) -- (6;5) -- (5;6) -- cycle;% -\fill[/Lie Hasse diagram/right] (6;2) -- (7;2) -- (9;4) -- (8;4) -- cycle;% + \fill[/Lie Hasse diagram/top] + (2;1) -- + (6;3) -- + (2;6) -- + (1;6) -- + (2;5) -- + (1;4) -- + (2;3) -- + (1;3) -- + (2;2) -- + (1;2) -- cycle;% + \fill[/Lie Hasse diagram/top] + (5;1) -- + (7;3) -- + (4;6) -- + (2;4) -- cycle;% + \fill[/Lie Hasse diagram/top] + (7;1) -- + (9;3) -- + (7;5) -- + (5;4) -- cycle;% + \fill[/Lie Hasse diagram/top] + (9;1) -- + (12;1) -- + (13;1) -- + (14;1) -- + (11;3) -- + (7;2) -- cycle;% + \fill[/Lie Hasse diagram/right] + (1;4) -- + (2;4) -- + (4;6) -- + (3;6) -- cycle;% + \fill[/Lie Hasse diagram/left] + (4;1) -- + (5;1) -- + (2;4) -- + (1;4) -- cycle;% + \fill[/Lie Hasse diagram/left] + (4;4) -- + (6;1) -- + (8;1) -- + (7;2) -- + (6;2) -- + (5;4) -- cycle;% + \fill[/Lie Hasse diagram/right] + (4;4) -- + (5;4) -- + (6;5) -- + (5;6) -- cycle;% + \fill[/Lie Hasse diagram/right] + (6;2) -- + (7;2) -- + (9;4) -- + (8;4) -- cycle;% \end{pgfonlayer}% \fi% }% - \NewDocumentCommand\hasse@E@eight@width@at@grade{mm}% {% \ifnum#1=1% @@ -1527,7 +1566,6 @@ #2 1% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% }% - \NewDocumentCommand\hasse@E@eight{}% {% \hasse@X{% @@ -1754,11 +1792,11 @@ {{0,2,4,6},{1,3,5},{2,3:1,4},{2:1,3,4:1},{1:1,3:1,5:1},{2:1,4:1},{1:1,3:1},{2:1},{2:2},{2:3},{2:4}}% {% grades: {% 1 -1+2<1,*2+3<2,*3+4<3,*2+1>1,*3+2>2,4+3>3}, +1+2<1,*2+3>2,*3+4>3,*2+1<1,*3+2<2,4+3>3}, {% 2 -*1+3<1,*2+4<3,*2+3<2,*2+1<1,3+2>3}, +*1+3<1,*2+4>3,*2+1<1,*2+3>2,3+2>3}, {% 3 -*1+3<1,1+4<2,*2+4<3,*2+1<1,3+1>2,*3+3>3}, +*1+3<1,1+4>2,*2+4>3,*2+1<1,3+1>2,*3+3>3}, {% 4 *1+2<1,*1+4<2,2+3<2,*3+1>2,*3+4>3}, {% 5 @@ -2026,8 +2064,8 @@ }% \global\root@sum@resetfalse% }% -\xdef\my@root@sum{}% -\xdef\my@fixed@root@sum{}% +\xdef\lie@hasse@root@sum{}% +\xdef\lie@hasse@fixed@root@sum{}% \NewDocumentCommand\rootSum{oommm}% {% \IfValueT{#1}% @@ -2053,15 +2091,15 @@ \fi% \IfStrEqCase{\dynkin@series}% {% - {A}{\hasse@A@root@sum{#3}{#4}{\my@root@sum}}% - {B}{\hasse@B@root@sum{#3}{#4}{\my@root@sum}}% - {C}{\hasse@C@root@sum{#3}{#4}{\my@root@sum}}% - {D}{\hasse@D@root@sum{#3}{#4}{\my@root@sum}}% - {E}{\xdef\my@root@sum{\exceptional@root@sum{#3;#4}}}% - {F}{\xdef\my@root@sum{\exceptional@root@sum{#3;#4}}}% - {G}{\xdef\my@root@sum{\exceptional@root@sum{#3;#4}}}% + {A}{\hasse@A@root@sum{#3}{#4}{\lie@hasse@root@sum}}% + {B}{\hasse@B@root@sum{#3}{#4}{\lie@hasse@root@sum}}% + {C}{\hasse@C@root@sum{#3}{#4}{\lie@hasse@root@sum}}% + {D}{\hasse@D@root@sum{#3}{#4}{\lie@hasse@root@sum}}% + {E}{\xdef\lie@hasse@root@sum{\exceptional@root@sum{#3;#4}}}% + {F}{\xdef\lie@hasse@root@sum{\exceptional@root@sum{#3;#4}}}% + {G}{\xdef\lie@hasse@root@sum{\exceptional@root@sum{#3;#4}}}% }% - \StrSubstitute{\my@root@sum}{.}{,}[#5]% + \StrSubstitute{\lie@hasse@root@sum}{.}{,}[#5]% }% %% \rootSystemHeight[G][2]{\h} sets the counter \h to the height of the poset %% of the root system G2. \rootSystemHeight{\h} uses the current root system. @@ -2451,7 +2489,7 @@ 4;1=3.1,% 5;1=3.2}% }% -\NewDocumentCommand\forAllPositiveRootsInHasseDiagram{m}% +\NewDocumentCommand\forAllPositiveRoots{m}% {% \rootSystemHeight{\lie@hasse@height}% \foreach \root@grady in {1,...,\the\lie@hasse@height}% diff --git a/graphics/pgf/contrib/lie-hasse/lie-hasse.tex b/graphics/pgf/contrib/lie-hasse/lie-hasse.tex index 82643fee14..762639c603 100644 --- a/graphics/pgf/contrib/lie-hasse/lie-hasse.tex +++ b/graphics/pgf/contrib/lie-hasse/lie-hasse.tex @@ -1,5 +1,5 @@ \documentclass{amsart} -\title[The Lie Hasse package]{The Lie Hasse package \\ Version 1.0} +\title[The Lie Hasse package]{The Lie Hasse package \\ Version 1.01} %% My name: \makeatletter \DeclareRobustCommand{\scotsMc}{\scotsMcx{c}} @@ -19,8 +19,7 @@ \author{\authorsname} \address{School of Mathematical Sciences, University College Cork, Cork, Ireland} \email{b.mckay@ucc.ie} -\date{3 February 2020} -\usepackage{etex} +\date{9 July 2024} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenx} \usepackage{etoolbox} @@ -87,7 +86,7 @@ root radius=.02cm, edge length=.5cm, edge quotes/.style={opacity=0}% - ]{E}{8}% + ]E8% \end{tikzpicture}% \end{center}% \begin{center} @@ -106,26 +105,26 @@ This package draws the Hasse diagram of the poset of the positive simple roots o \begin{document} The Hasse diagram of \(F_4\) is \begin{center} -\hasse[edge length=1cm]{F}{4} +\hasse F4 \end{center} \end{document} \end{Verbatim} \end{tcolorbox} \par\noindent{}The Hasse diagram of \(F_4\) is \begin{center} -\hasse[edge length=1cm]{F}{4} +\hasse[edge length=1cm]F4 \end{center} Each edge is labelled with the simple root by which vertices differ. \begin{tcblisting}{title={Inside a \TikZ statement}} -\(B_4\) has Dynkin diagram \tikz \dynkin[edge length=.35cm]{B}{4};, Hasse diagram +\(B_4\) has Dynkin diagram \tikz \dynkin{B}{4};, Hasse diagram \begin{center} -\hasse[edge length=1cm]{B}{4} +\hasse[edge length=1cm]B4 \end{center} \end{tcblisting} \begin{tcblisting}{title={Inside a Dynkin diagram environment, diagrams fit together}} The Hasse diagram of \(B_4\) is \begin{dynkinDiagram}[vertical shift=0,edge length=1cm]{B}{4} -\hasse{B}{4} +\hasse[edge length=1cm]B4 \end{dynkinDiagram} \end{tcblisting} We shut off the default vertical shift of the Dynkin diagram, so that it starts at the origin. @@ -133,35 +132,26 @@ There is an option to \verb!\hasse! for this: \begin{tcblisting}{title={Attaching the Dynkin diagram}} The Hasse diagram of \(B_4\) is \begin{center} -\hasse[attach Dynkin diagram=true]{B}{4} +\hasse[attach Dynkin diagram=true]B4 \end{center} \end{tcblisting} Unfortunately, attaching a Dynkin diagram looks terrible for \(D\) or \(E\) series, so a Dynkin diagram appears below. \begin{tcblisting}{title={Attaching the Dynkin diagram}} The Hasse diagram of \(D_5\) is \begin{center} -\hasse[attach Dynkin diagram=true]{D}{5} +\hasse[attach Dynkin diagram=true]D5 \end{center} \end{tcblisting} \begin{tcblisting}{title={Inside a \TikZ environment}} \begin{tikzpicture} -\hasse{A}{4} +\hasse A4 \draw (4;1) circle (5pt); \draw[red] (2;3) circle (5pt); \end{tikzpicture} \end{tcblisting} In this example, we see that the roots of the Hasse diagram are \TikZ{} nodes labelled \(g;i\) for grade \(g\) (i.e. \(g\) units up the page) and index \(i\) (i.e. \(i^{\text{th}}\) root of grade \(g\) drawn on the page, starting from the left). -\section{Inherited options} -The Lie Hasse package inherits options from the Dynkin diagrams package: the edge lengths are set with -\begin{Verbatim} -\tikzset{/Dynkin diagram/edge lengths=1.2cm} -\end{Verbatim} -and similarly the ordering of roots with -\begin{Verbatim} -\tikzset{/Dynkin diagram/ordering=Bourbaki} -\end{Verbatim} - +\newpage \section{Prettier} The package includes a more elaborate \verb!\hasseDiagrams! command, taking a list of semicolon separated Dynkin diagram identfiers. \begin{tcolorbox}[title={With some global options to make prettier diagrams}] @@ -198,11 +188,20 @@ The package includes a more elaborate \verb!\hasseDiagrams! command, taking a li \endgroup Global options: \begin{verbatim} - edge/.style={ultra thick}, - edge quotes/.style={/Dynkin diagram/text style,auto,inner sep=2pt}, +\tikzset{/Lie Hasse, + edge/.style={ultra thick}, + edge quotes/.style={ + /Dynkin diagram/text style, + auto, + inner sep=2pt}, \end{verbatim} allow to change the edges, and to change the way that labels are printed, and how close labels are to the edges. - +To give even greater control, the user can define a command \verb!\edgeQuote! of one argument, which is applied to the label placed on every edge of the Hasse diagram. +The default is +\begin{verbatim} +\NewDocumentCommand\edgeQuote{m}{\contour{white}{#1}} +\end{verbatim} +which ensures that every label, which is black text by default, has a slight white outline to make it easier to read against a coloured background. \section{Root order} @@ -222,6 +221,10 @@ We can use this like: \hasseDiagrams{[ordering=Carter]E6;[ordering=Dynkin]E6} \hasseDiagrams{[ordering=Kac]E6} \endgroup +The Lie Hasse package inherits the ordering of roots from the Dynkin diagrams package, so we can set it with +\begin{Verbatim} +\tikzset{/Dynkin diagram/ordering=Bourbaki} +\end{Verbatim} \section{Graph height and width} The \emph{height} of a Hasse diagram is the number of grades. @@ -238,7 +241,7 @@ to store the height of \(G_2\) in a counter called \verb!\h!, and \end{Verbatim} to store the width of \(G_2\) at grade \(3\) in a counter called \verb!\w!. -Once you use \verb!\dynkin{G}{2}! or \verb!\hasse{G}{2}! or the other commands, like +Once you use \verb!\dynkin G2! or \verb!\hasse G2! or the other commands, like \begin{Verbatim} \rootSystemHeight[G][2]{\h} \end{Verbatim} @@ -260,7 +263,8 @@ The \verb!show height! option: \hasseDiagrams{G2} \end{Verbatim} \tikzset{/Lie Hasse diagram,show name=true,show height=true} -\hasseDiagrams{G2} +\hasse G2 + The \verb!show widths! option: \begin{Verbatim} \tikzset{/Lie Hasse diagram/show widths=true} @@ -293,11 +297,11 @@ Here is the Dynkin diagram of \(E_8\), indicating the order of the roots in Cart Here is the same Dynkin diagram, except showing, at each simple root, the coefficient of that simple root in the highest root. \begin{Verbatim} \rootSum[E][8]{29}{1}{\rs} -\dynkin[labels=\rs,ordering=Carter,edge length=.35cm]{E}{8} +\dynkin[expand labels=\rs,ordering=Carter,edge length=.35cm]{E}{8} \end{Verbatim} \rootSum[E][8]{29}{1}{\rs} \begin{center} -\dynkin[labels=\rs,ordering=Carter,edge length=.35cm]{E}{8} +\dynkin[expand labels=\rs,ordering=Carter,edge length=.35cm]{E}{8} \end{center} The option \verb!for all roots! allows execution of code once on every root. @@ -312,7 +316,7 @@ The option \verb!for all roots! allows execution of code once on every root. root radius=.05cm }, for all roots/.code 2 args={\drawRootAsDynkinSum{#1}{#2}}} -\hasseDiagrams{D5} +\hasse D5 \end{Verbatim} \begingroup \tikzset{/Lie Hasse diagram, @@ -341,23 +345,23 @@ A simple example: \end{Verbatim} \newcommand{\foo}[2]% {% - \node[below,scale=.75] at (#1;#2) {\(#1,#2\)};% + \node[below,scale=.5] at (#1;#2) {\(#1,#2\)};% }% Inside a \TikZ{} or \verb!dynkinDiagram! environment: \begin{Verbatim} \tikzset{/Lie Hasse diagram/edge quotes/.style={opacity=0}, /Dynkin diagram/edge length=1.5cm} \begin{tikzpicture} - \hasse{D}{6}% - \forAllPositiveRootsInHasseDiagram{\foo}% + \hasse D6% + \forAllPositiveRoots{\foo}% \end{tikzpicture} \end{Verbatim} \begingroup \tikzset{/Lie Hasse diagram/edge quotes/.style={opacity=0}, /Dynkin diagram/edge length=1.5cm} \begin{tikzpicture} - \hasse{D}{6}% - \forAllPositiveRootsInHasseDiagram{\foo}% + \hasse D6% + \forAllPositiveRoots{\foo}% \end{tikzpicture} If you put this into the \verb!for all roots! option, it executes on its own: @@ -378,19 +382,19 @@ Opposite sides of any square have the same edge label, by commutativity of addit Hence we don't need to see every edge perfectly. The three dimensional effect is the default: \begin{Verbatim} -\hasse{D}{4}\hasse{E}{6} +\hasse D4\hasse E6 \end{Verbatim} \begin{center} -\hasse{D}{4}\hasse{E}{6} +\hasse D4\hasse E6 \end{center} We can turn it off: \begin{Verbatim} -\hasse[three D=false]{D}{4} -\hasse[three D=false]{E}{6} +\hasse[three D=false] D4 +\hasse[three D=false] E6 \end{Verbatim} \begin{center} -\hasse[three D=false]{D}{4} -\hasse[three D=false]{E}{6} +\hasse[three D=false] D4 +\hasse[three D=false] E6 \end{center} or globally with \verb!\tikzset{/Lie Hasse diagram/three D=false}!. @@ -430,9 +434,9 @@ You can change these: \section{Label the simple roots} Ringel \cite{Ringel:2013} labels his edges like \begin{Verbatim} -\hasseDiagrams{[labels={f,e,d,c,u,b,a}]E7} +\hasse[labels={f,e,d,c,u,b,a}]E7 \end{Verbatim} -\hasseDiagrams{[labels={f,e,d,c,u,b,a}]E7} +\hasse[labels={f,e,d,c,u,b,a}]E7 \section{Parabolic subgroups} This package offers nothing over Ringel's original pictures, except that the user can pick some simple roots whose associated edges are drawn differently. @@ -440,47 +444,48 @@ The chosen simple roots are called \emph{compact}, following terminology from th We let the reader explore the notation for parabolic subgroups in the Dynkin diagrams package, and use this to declare various roots compact. \begin{Verbatim} \tikzset{/Lie Hasse diagram,attach Dynkin diagram=true,three D=false} -\hasseDiagrams{D{**x*x*x*}} +\hasse D{**x*x*x*} \end{Verbatim} \begingroup \tikzset{/Lie Hasse diagram,attach Dynkin diagram=true,three D=false} -\hasseDiagrams{D{**x*x*x*}} +\hasse D{**x*x*x*} \endgroup + Our motivation comes from trying to identify the invariant vector subbundles of the tangent bundle of a rational homogeneous variety \cite{MathOverflow:123801}. Such diagrams are often unreadable if we don't turn off the three dimensional graphics. By default, noncompact root edges are not drawn. \begingroup \tikzset{/Lie Hasse diagram,attach Dynkin diagram=true,show name=false,three D=false} \begin{Verbatim} -\hasseDiagrams{E{*xx*x*}} +\hasse E{*xx*x*} \end{Verbatim} -\hasseDiagrams{E{*xx*x*}} +\hasse E{*xx*x*} \begin{Verbatim} -\hasseDiagrams{A{x*x*}} +\hasse A{x*x*} \end{Verbatim} -\hasseDiagrams{A{x*x*}} +\hasse A{x*x*} \begin{Verbatim} -\hasseDiagrams{[parabolic=113]B8} +\hasse[parabolic=113]B8 \end{Verbatim} -\hasseDiagrams{[parabolic=113]B8} +\hasse[parabolic=113]B8 \begin{Verbatim} -\hasseDiagrams{C{**xx*x**}} +\hasse C{**xx*x**} \end{Verbatim} -\hasseDiagrams{C{**xx*x**}} +\hasse C{**xx*x**} \newpage \begin{Verbatim} -\hasseDiagrams{E{*x*x*x**}} +\hasse E{*x*x*x**} \end{Verbatim} -\hasseDiagrams{E{*x*x*x**}} +\hasse E{*x*x*x**} \newpage \begin{Verbatim} -\hasseDiagrams{F{**xx}} +\hasse F{**xx} \end{Verbatim} -\hasseDiagrams{F{**xx}} +\hasse F{**xx} \begin{Verbatim} -\hasseDiagrams{G{*x}} +\hasse G{*x} \end{Verbatim} -\hasseDiagrams{G{*x}} +\hasse G{*x} \endgroup \section{Examples} diff --git a/graphics/pgf/contrib/outilsgeomtikz/doc/OutilsGeomTikz-doc.pdf b/graphics/pgf/contrib/outilsgeomtikz/doc/OutilsGeomTikz-doc.pdf Binary files differindex bf929693ef..aa999d601b 100644 --- a/graphics/pgf/contrib/outilsgeomtikz/doc/OutilsGeomTikz-doc.pdf +++ b/graphics/pgf/contrib/outilsgeomtikz/doc/OutilsGeomTikz-doc.pdf diff --git a/graphics/pgf/contrib/outilsgeomtikz/doc/OutilsGeomTikz-doc.tex b/graphics/pgf/contrib/outilsgeomtikz/doc/OutilsGeomTikz-doc.tex index b05a67fe68..f3c60c9d00 100644 --- a/graphics/pgf/contrib/outilsgeomtikz/doc/OutilsGeomTikz-doc.tex +++ b/graphics/pgf/contrib/outilsgeomtikz/doc/OutilsGeomTikz-doc.tex @@ -1,13 +1,16 @@ % !TeX TXS-program:compile = txs:///arara -% arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} -% arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') +% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} +% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') \documentclass[french,a4paper,11pt]{article} \usepackage[margin=2cm,includefoot]{geometry} -\def\TPversion{0.1.5} -\def\TPdate{13 décembre 2023} +\def\TPversion{0.1.6} +\def\TPdate{29 août 2024} +\usepackage{amssymb} \usepackage[table,svgnames]{xcolor} -\usepackage[bold-style=ISO,math-style=french]{concmath-otf} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +%\usepackage[bold-style=ISO,math-style=french]{concmath-otf} %\usepackage[bold-style=ISO,math-style=french]{unicode-math} %\setmainfont{TeX Gyre Schola} %\setmathfont{TeX Gyre Schola Math} @@ -91,8 +94,8 @@ \newcommand\affichegrille[4]{% \draw[xstep=1,ystep=1,lightgray] (#1,#3) grid (#2,#4) ; - \foreach \x in {#1,\inteval{1+#1},...,#2} \draw[lightgray] (\x,#4)--++(0,3pt) node[font=\scriptsize,above] {$\x$} ; - \foreach \y in {#3,\inteval{1+#3},...,#4} \draw[lightgray] (#1,\y)--++(-3pt,0) node[font=\scriptsize,left] {$\y$} ; + \foreach \x in {#1,\inteval{1+#1},...,#2} {\draw[lightgray] (\x,#4)--++(0,3pt) node[font=\scriptsize,above] {$\x$} ;} + \foreach \y in {#3,\inteval{1+#3},...,#4} {\draw[lightgray] (#1,\y)--++(-3pt,0) node[font=\scriptsize,left] {$\y$} ;} } \newcommand\pointsutiles[1]{% \foreach \point in {#1} {\draw[thick,fill=red] \point circle[radius=3pt] ;} @@ -170,7 +173,7 @@ \vfill -\hfill\textit{Merci à Arnaud pour ses retours et idées !!} +\hfill\textit{Merci à Arnaud et Cyril pour leurs retours et idées !!} \vfill @@ -197,7 +200,9 @@ \part{Historique} -\verb|v0.1.4 : |Modification de la graduation intérieure pour les rapporteurs 180° +\verb|v0.1.6 : |Correction d'un bug avec une compilation en \textsf{pdflatex} + Améliorations pour les rotations des labels + +\verb|v0.1.5 : |Modification de la graduation intérieure pour les rapporteurs 180° \verb|v0.1.4 : |Possibilité de positionner certains outils avec deux points (angle calculé automatiquement) @@ -288,10 +293,8 @@ Les différents outils disponibles ont \textit{grosso-modo} le même mode de fon \item pour certains outils, des dimensions minimales sont requises pour un aspect acceptable ; \item les options personnalisables sont (sauf exceptions) : \begin{itemize} - \item la \textit{taille} ; - \item l'\textit{échelle} globale ou l'\textit{échelle} des éventuels labels ; - \item les \textit{couleurs} ; - \item le \textit{fond} (couleur et opacité) ; + \item la \textit{taille}, l'\textit{échelle} globale ou l'\textit{échelle} des éventuels labels ; + \item les \textit{couleurs}, le \textit{fond} (couleur et opacité) ; \item la position (\textit{placement} et/ou \textit{rotation}) ; \item un \textit{placement automatique} avec la données de 2 points. \end{itemize} @@ -326,7 +329,7 @@ Les outils disponibles sont à insérer dans un environnement \TikZ, et pour le \tkzCompas[clés]{pointe}{mine} \end{PresentationCode} -\subsection{Utilisation d'unités} +\subsection{Utilisation d'unités et/ou de rotations} \begin{tipblock} Les outils ont été créés avec unité de base de 1~cm, afin que les graduations soient \textit{en taille réelle}. @@ -338,6 +341,10 @@ Il est toutefois possible de modifier les unités de l'environnement \TikZ, dans \smallskip Ce choix est donc à \textit{réserver} dans l'optique de faire des petits schémas pour illustrer des positions d'outils. + +\smallskip + +Du fait des rotations effectuées par le code pour correctement placer les objets et les graduations, il est conseillé (même si cela devrait fonctionner) de ne pas trop spécifier de rotation globale pour l'environnement \texttt{tikzpicture}\ldots \end{tipblock} \pagebreak @@ -430,6 +437,7 @@ Quelques \Cle{clés} de personnalisation sont disponibles : \item \Cle{CouleurFond} pour la couleur du fond de la règle ;\hfill~(défaut : \Cle{black}) \item \Cle{Opacite} pour régler l'opacité du fond de la règle ;\hfill~(défaut : \Cle{0.5}) \item le booléen \Cle{AfficheValeurs} pour afficher les valeurs des graduations ;\hfill~(défaut : \Cle{true}) + \item \Cle{EchelleValeurs} pour l'échelle (relative) des valeurs ;\hfill~(défaut : \Cle{0.8}) \item \Cle{PosVal} pour spécifier la position (haut, milieu, etc) des valeurs, parmi \Cle{h/m/b/hb}. \hfill~(défaut : \Cle{m}) @@ -501,6 +509,7 @@ Quelques \Cle{clés} de personnalisation sont disponibles : \item \Cle{CouleurFond} pour la couleur du fond de la règle-repère ;\hfill~(défaut : \Cle{black}) \item \Cle{Opacite} pour régler l'opacité du fond de la règle-repère ;\hfill~(défaut : \Cle{0.5}) \item le booléen \Cle{AfficheValeurs} pour afficher les valeurs des graduations ;\hfill~(défaut : \Cle{true}) + \item \Cle{EchelleValeurs} pour l'échelle (relative) des valeurs ;\hfill~(défaut : \Cle{0.8}) \item le booléen \Cle{Retourne} pour \textit{inverser la position des graduations}. \hfill~(défaut : \Cle{false}) @@ -564,6 +573,7 @@ Quelques \Cle{clés} de personnalisation sont disponibles : \item \Cle{Origine} pour le placer l'équerre (au niveau du coin) ;\hfill~(défaut : \Cle{\{(0,0)\}}) \item \Cle{Rotation} pour pivoter l'équerre (au niveau du coin) ;\hfill~(défaut : \Cle{0}) \item \Cle{Echelle} pour l'échelle globale de l'équerre ;\hfill~(défaut : \Cle{1}) + \item \Cle{EchelleValeurs} pour l'échelle (relative) des valeurs ;\hfill~(défaut : \Cle{0.8}) \item \Cle{Couleur} pour la couleur des éléments de l'équerre ;\hfill~(défaut : \Cle{black}) \item le booléen \Cle{Fond} pour afficher une couleur de fond pour l'équerre ;\hfill~(défaut : \Cle{false}) \item \Cle{CouleurFond} pour la couleur du fond de l'équerre ;\hfill~(défaut : \Cle{black}) @@ -749,7 +759,8 @@ Quelques \Cle{clés} de personnalisation sont disponibles : \item le booléen \Cle{Fond} pour afficher une couleur de fond pour la réquerre ;\hfill~(défaut : \Cle{false}) \item \Cle{CouleurFond} pour la couleur du fond de la réquerre ;\hfill~(défaut : \Cle{black}) \item \Cle{Opacite} pour régler l'opacité du fond de la réquerre ;\hfill~(défaut : \Cle{0.5}) - \item le booléen \Cle{AfficheValeurs} pour afficher les valeurs des graduations.\hfill~(défaut : \Cle{true}) + \item le booléen \Cle{AfficheValeurs} pour afficher les valeurs des graduations ;\hfill~(défaut : \Cle{true}) + \item \Cle{EchelleValeurs} pour l'échelle (relative) des valeurs.\hfill~(défaut : \Cle{0.8}) \end{itemize} À noter que pour la clé \Cle{Rotation}, il est possible de préciser un deuxième point, et dans ce cas la clé sera précisée sous la forme \Cle{Rotation=auto/pt}. Dans \textbf{ce cas}, les points \textit{support} \textbf{devront} avoir été déclarés au préalable ! diff --git a/graphics/pgf/contrib/outilsgeomtikz/tex/OutilsGeomTikz.sty b/graphics/pgf/contrib/outilsgeomtikz/tex/OutilsGeomTikz.sty index bb79723d21..5f6cd30410 100644 --- a/graphics/pgf/contrib/outilsgeomtikz/tex/OutilsGeomTikz.sty +++ b/graphics/pgf/contrib/outilsgeomtikz/tex/OutilsGeomTikz.sty @@ -2,7 +2,8 @@ % licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{OutilsGeomTikz}[2023/12/13 v0.1.5 Outils geometriques en TikZ] +\ProvidesPackage{OutilsGeomTikz}[2024/08/29 v0.1.6 Outils geometriques en TikZ] +% 0.1.6 Correction de bugs avec pdflatex + amélioration de la gestion des rotations/échelles des labels (tks Cyril I. ^^) % 0.1.5 Modification de la graduation intérieure pour les rapporteurs 180° % 0.1.4 Possibilité de positionner les outils avec deux points (angle calculé automatiquement) % 0.1.3 Ajout du pourcenteur @@ -60,7 +61,8 @@ Origine=\xdef\REGLposOrigin{#1},% Rotation=\def\REGLangle{#1},% Opacite=\def\REGLopac{#1},% - PosVal=\def\REGLposval{#1} + PosVal=\def\REGLposval{#1},% + EchelleValeurs=\def\REGLechlabel{#1} } \setKVdefault[RegleGeom]{% @@ -74,7 +76,8 @@ AfficheValeurs=true,% Fond=false,% Opacite=0.5,% - PosVal=m + PosVal=m,% + EchelleValeurs=0.8 } \NewDocumentCommand{\tkzRegle}{ O{} }{% @@ -88,7 +91,7 @@ }{}% \xdef\REGLlongueur{\fpeval{max(3,\REGLlongueur)}}%valeurs mini \xdef\REGLlargeur{\fpeval{max(1.5,\REGLlargeur)}} - \begin{scope}[shift={(\REGLposOrigin)},rotate=\REGLangle,scale=\REGLechelle] + \begin{scope}[shift={(\REGLposOrigin)},rotate=\REGLangle,scale=\REGLechelle,transform shape] \ifboolKV[RegleGeom]{Fond} {% \begin{scope} @@ -104,13 +107,13 @@ \ifboolKV[RegleGeom]{AfficheValeurs}% {% \IfSubStr{\REGLposval}{h} - {\foreach \i in {0,1,...,\REGLlongueur} \draw[\REGLcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLangle,scale={0.8*\REGLechelle},font=\small,below] {$\i$} ;} + {\foreach \i in {0,1,...,\REGLlongueur} {\draw[\REGLcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLechlabel},font=\small,below] {$\i$} ;}} {} \IfSubStr{\REGLposval}{m} - {\foreach \i in {0,1,...,\REGLlongueur} \draw[\REGLcouleur] (\i,{-0.5*\REGLlargeur}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLangle,scale={0.8*\REGLechelle},font=\small] {$\i$} ;} + {\foreach \i in {0,1,...,\REGLlongueur} {\draw[\REGLcouleur] (\i,{-0.5*\REGLlargeur}) node[inner sep=1pt,outer sep=1pt,scale={\REGLechlabel},font=\small] {$\i$} ;}} {} \IfSubStr{\REGLposval}{b} - {\foreach \i in {0,1,...,\REGLlongueur} \draw[\REGLcouleur] (\i,{-\REGLlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLangle,scale={0.8*\REGLechelle},font=\small,above] {\rotatebox{180}{$\fpeval{trunc(\REGLlongueur)-\i}$}} ;} + {\foreach \i in {0,1,...,\REGLlongueur} {\draw[\REGLcouleur] (\i,{-\REGLlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLechlabel},font=\small,above] {\rotatebox{180}{$\fpeval{trunc(\REGLlongueur)-\i}$}} ;}} {} }% {}% @@ -126,7 +129,8 @@ CouleurFond=\def\REGLREPcouleurfond{#1},% Origine=\def\REGLREPposOrigin{#1},% Rotation=\def\REGLREPangle{#1},% - Opacite=\def\REGLREPopac{#1} + Opacite=\def\REGLREPopac{#1},% + EchelleValeurs=\def\REGLREPechlabel{#1} } \setKVdefault[RegleRepereGeom]{% @@ -140,7 +144,8 @@ AfficheValeurs=true,% Fond=false,% Opacite=0.5,% - Retourne=false + Retourne=false,% + EchelleValeurs=0.8 } \NewDocumentCommand{\tkzRegleRepere}{ O{} }{% @@ -154,7 +159,7 @@ \pgfmathanglebetweenpoints{\pgfpointanchor{\REGLREPposOrigin}{center}}{\pgfpointanchor{\tmppointdeux}{center}}% \edef\REGLREPangle{\pgfmathresult}% }{}% - \begin{scope}[shift={(\REGLREPposOrigin)},rotate=\REGLREPangle,scale=\REGLREPechelle] + \begin{scope}[shift={(\REGLREPposOrigin)},rotate=\REGLREPangle,scale=\REGLREPechelle,transform shape] %bases de la règle-repère \ifboolKV[RegleRepereGeom]{Fond}% {\draw[draw=none,fill=\REGLREPcouleurfond!10!white,fill opacity=\REGLREPopac,rounded corners] (-0.5,0) rectangle++ ({\REGLREPlongueur+1},{-\REGLREPlargeur}) ;}% @@ -175,12 +180,12 @@ {% \ifboolKV[RegleRepereGeom]{Retourne}% {% - {\foreach \i in {0,1,...,\REGLREPlongueur} \draw[\REGLREPcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLREPangle,scale={0.8*\REGLREPechelle},font=\small,below] {$\fpeval{-trunc(0.5*\REGLREPlongueur)+\i}$} ;} - {\foreach \i in {0,1,...,\REGLREPlongueur} \draw[\REGLREPcouleur] (\i,{-\REGLREPlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLREPangle,scale={0.8*\REGLREPechelle},font=\small,above] {\rotatebox{180}{$\inteval{\REGLREPlongueur-\i}$}} ;} + {\foreach \i in {0,1,...,\REGLREPlongueur} {\draw[\REGLREPcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLREPechlabel},font=\small,below] {$\fpeval{-trunc(0.5*\REGLREPlongueur)+\i}$} ;}} + {\foreach \i in {0,1,...,\REGLREPlongueur} {\draw[\REGLREPcouleur] (\i,{-\REGLREPlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLREPechlabel},font=\small,above] {\rotatebox{180}{$\inteval{\REGLREPlongueur-\i}$}} ;}} }% {% - {\foreach \i in {0,1,...,\REGLREPlongueur} \draw[\REGLREPcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLREPangle,scale={0.8*\REGLREPechelle},font=\small,below] {$\i$} ;} - {\foreach \i in {0,1,...,\REGLREPlongueur} \draw[\REGLREPcouleur] (\i,{-\REGLREPlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,rotate=\REGLREPangle,scale={0.8*\REGLREPechelle},font=\small,above] {\rotatebox{180}{$\fpeval{trunc(0.5*\REGLREPlongueur)-\i}$}} ;} + {\foreach \i in {0,1,...,\REGLREPlongueur} {\draw[\REGLREPcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLREPechlabel},font=\small,below] {$\i$} ;}} + {\foreach \i in {0,1,...,\REGLREPlongueur} {\draw[\REGLREPcouleur] (\i,{-\REGLREPlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLREPechlabel},font=\small,above] {\rotatebox{180}{$\fpeval{trunc(0.5*\REGLREPlongueur)-\i}$}} ;}} }% } {}% @@ -196,7 +201,8 @@ CouleurFond=\def\REQcouleurfond{#1},% Origine=\def\REQposOrigin{#1},% Rotation=\def\REQangle{#1},% - Opacite=\def\REQopac{#1} + Opacite=\def\REQopac{#1},% + EchelleValeurs=\def\REQechlabel{#1} } \setKVdefault[RequerreGeom]{% @@ -209,7 +215,8 @@ Rotation=0,% AfficheValeurs=true,% Fond=false,% - Opacite=0.5 + Opacite=0.5,% + EchelleValeurs=0.8 } \NewDocumentCommand{\tkzRequerre}{ O{} }{% @@ -223,7 +230,7 @@ \pgfmathanglebetweenpoints{\pgfpointanchor{\REQposOrigin}{center}}{\pgfpointanchor{\tmppointdeux}{center}}% \edef\REQangle{\pgfmathresult}% }{}% - \begin{scope}[shift={(\REQposOrigin)},rotate=\REQangle,scale=\REQechelle] + \begin{scope}[shift={(\REQposOrigin)},rotate=\REQangle,scale=\REQechelle,transform shape] \ifboolKV[RequerreGeom]{Fond} { \fill[draw=none,rounded corners,fill=\REQcouleurfond!10!white,fill opacity=\REQopac] ({-\REQlongueur*0.5},0) rectangle ({\REQlongueur*0.5},{-\REQlargeur}) ; @@ -243,10 +250,10 @@ \end{scope} \ifboolKV[RequerreGeom]{AfficheValeurs}% {% - \draw[\REQcouleur] (0,-0.5) node[inner sep=1pt,outer sep=1pt,rotate=\REQangle,scale={0.8*\REQechelle},font=\small,below] {$0$} ; + \draw[\REQcouleur] (0,-0.5) node[inner sep=1pt,outer sep=1pt,scale={\REQechlabel},font=\small,below] {$0$} ; \foreach \i in {1,2,...,\fpeval{0.5*\REQlongueur-0.5}}{% - \draw[\REQcouleur] (\i,-0.5) node[inner sep=1pt,outer sep=1pt,rotate=\REQangle,scale={0.8*\REQechelle},font=\small,below] {$\i$} ; - \draw[\REQcouleur] (-\i,-0.5) node[inner sep=1pt,outer sep=1pt,rotate=\REQangle,scale={0.8*\REQechelle},font=\small,below] {$-\i$} ;} + \draw[\REQcouleur] (\i,-0.5) node[inner sep=1pt,outer sep=1pt,scale={\REQechlabel},font=\small,below] {$\i$} ; + \draw[\REQcouleur] (-\i,-0.5) node[inner sep=1pt,outer sep=1pt,scale={\REQechlabel},font=\small,below] {$-\i$} ;} }% {}% \end{scope} @@ -260,7 +267,8 @@ CouleurFond=\def\EQcouleurfond{#1},% Origine=\def\EQposOrigin{#1},% Rotation=\def\EQangle{#1},% - Opacite=\def\EQopac{#1} + Opacite=\def\EQopac{#1},% + EchelleValeurs=\def\EQechlabel{#1} } \setKVdefault[EquerreGeom]{% @@ -273,7 +281,8 @@ AfficheValeurs=true,% Fond=false,% Opacite=0.5,% - PetitCote=false + PetitCote=false,% + EchelleValeurs=0.8 } \NewDocumentCommand{\tkzEquerre}{ O{} }{% @@ -293,7 +302,7 @@ \edef\EQangle{\fpeval{\pgfmathresult-90}}% }% }{}% - \begin{scope}[shift={(\EQposOrigin)},rotate=\EQangle,scale=\EQechelle] + \begin{scope}[shift={(\EQposOrigin)},rotate=\EQangle,scale=\EQechelle,transform shape] \ifboolKV[EquerreGeom]{Fond} {% \begin{scope} %diff extérieur-intérieur @@ -318,10 +327,12 @@ \foreach \y in {0,1,...,\fpeval{0.925*\EQlongueur}} {\draw[\EQcouleur] (0,\y)--(0.4,\y) ;} \ifboolKV[EquerreGeom]{AfficheValeurs}% {% - \foreach \i in {1,2,...,\fpeval{0.9*\EQlongueur-1}} - \draw[\EQcouleur] (0.4,\i) node[inner sep=1pt,outer sep=1pt,rotate=\EQangle,scale={0.8*\EQechelle},font=\small,right] {\rotatebox{90}{$\i$}} ; - \foreach \i in {1,2,...,\fpeval{0.9*\EQlargeur-0.5}} - \draw[\EQcouleur] (\i,0.4) node[inner sep=1pt,outer sep=1pt,rotate=\EQangle,scale={0.8*\EQechelle},font=\small,above] {\rotatebox{180}{$\i$}} ; + \foreach \i in {1,2,...,\fpeval{0.9*\EQlongueur-1}}{% + \draw[\EQcouleur] (0.4,\i) node[inner sep=1pt,outer sep=1pt,scale={\EQechlabel},font=\small,right] {\rotatebox{90}{$\i$}} ; + }% + \foreach \i in {1,2,...,\fpeval{0.9*\EQlargeur-0.5}}{% + \draw[\EQcouleur] (\i,0.4) node[inner sep=1pt,outer sep=1pt,scale={\EQechlabel},font=\small,above] {\rotatebox{180}{$\i$}} ; + }% }% {}% \end{scope} @@ -336,7 +347,8 @@ CouleurFond=\def\RAPPcouleurfond{#1},% Origine=\def\RAPPposOrigin{#1},% Rotation=\def\RAPPangle{#1},% - Opacite=\def\RAPPopac{#1} + Opacite=\def\RAPPopac{#1},% + EchelleValeurs=\def\RAPPechlabel{#1} } \setKVdefault[RapporteurGeom]{% @@ -350,13 +362,14 @@ Fond=false,% Opacite=0.5,% Complet=false,% - GraduationsInt=false + GraduationsInt=false,% + EchelleValeurs=0.8 } \NewDocumentCommand{\tkzRapporteur}{ O{} }{% \useKVdefault[RapporteurGeom]% \setKV[RapporteurGeom]{#1}% - \begin{scope}[shift={(\RAPPposOrigin)},rotate=\RAPPangle,scale=\RAPPechelle,every node/.style={rotate=\RAPPangle}] + \begin{scope}[shift={(\RAPPposOrigin)},rotate=\RAPPangle,scale=\RAPPechelle,transform shape] \ifboolKV[RapporteurGeom]{Complet} { %fond @@ -382,27 +395,27 @@ %valeurs si booléen \ifboolKV[RapporteurGeom]{AfficheAngles} {% - \draw[\RAPPcouleur] (0:2.75) node[rotate=90,scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$0$} ; - \draw[\RAPPcouleur] (180:3.25) node[rotate=90,scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\pm 180$} ; - \draw[\RAPPcouleur] (180:2.75) node[rotate=90,scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\pm \pi$} ; + \draw[\RAPPcouleur] (0:2.75) node[rotate=90,scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$0$} ; + \draw[\RAPPcouleur] (180:3.25) node[rotate=90,scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\pm 180$} ; + \draw[\RAPPcouleur] (180:2.75) node[rotate=90,scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\pm \pi$} ; \foreach \i in {0,10,...,170} - {\draw[\RAPPcouleur] (\i:3.25) node[rotate={\i-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\i$} ;} - \draw[\RAPPcouleur] (30:2.75) node[rotate={30-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{6}$} ; - \draw[\RAPPcouleur] (45:2.75) node[rotate={45-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{4}$} ; - \draw[\RAPPcouleur] (60:2.75) node[rotate={60-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{3}$} ; - \draw[\RAPPcouleur] (90:2.75) node[rotate={90-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{2}$} ; - \draw[\RAPPcouleur] (120:2.75) node[rotate={120-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{2\pi}{3}$} ; - \draw[\RAPPcouleur] (135:2.75) node[rotate={135-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{3\pi}{4}$} ; - \draw[\RAPPcouleur] (150:2.75) node[rotate={150-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{5\pi}{6}$} ; + {\draw[\RAPPcouleur] (\i:3.25) node[rotate={\i-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\i$} ;} + \draw[\RAPPcouleur] (30:2.75) node[rotate={30-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{6}$} ; + \draw[\RAPPcouleur] (45:2.75) node[rotate={45-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{4}$} ; + \draw[\RAPPcouleur] (60:2.75) node[rotate={60-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{3}$} ; + \draw[\RAPPcouleur] (90:2.75) node[rotate={90-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{2}$} ; + \draw[\RAPPcouleur] (120:2.75) node[rotate={120-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{2\pi}{3}$} ; + \draw[\RAPPcouleur] (135:2.75) node[rotate={135-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{3\pi}{4}$} ; + \draw[\RAPPcouleur] (150:2.75) node[rotate={150-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{5\pi}{6}$} ; \foreach \i in {10,20,...,170} - {\draw[\RAPPcouleur] ({-\i}:3.25) node[rotate={270-\i},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$-\i$} ;} - \draw[\RAPPcouleur] (-30:2.75) node[rotate={270-30},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{6}$} ; - \draw[\RAPPcouleur] (-45:2.75) node[rotate={270-45},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{4}$} ; - \draw[\RAPPcouleur] (-60:2.75) node[rotate={270-60},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{3}$} ; - \draw[\RAPPcouleur] (-90:2.75) node[rotate={270-90},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{2}$} ; - \draw[\RAPPcouleur] (-120:2.75) node[rotate={270-120},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-2\pi}{3}$} ; - \draw[\RAPPcouleur] (-135:2.75) node[rotate={270-135},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-3\pi}{4}$} ; - \draw[\RAPPcouleur] (-150:2.75) node[rotate={270-150},scale=\fpeval{0.8*\RAPPechelle*\RAPPechangle},font=\tiny] {$\nicefrac{-5\pi}{6}$} ; + {\draw[\RAPPcouleur] ({-\i}:3.25) node[rotate={270-\i},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$-\i$} ;} + \draw[\RAPPcouleur] (-30:2.75) node[rotate={270-30},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{6}$} ; + \draw[\RAPPcouleur] (-45:2.75) node[rotate={270-45},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{4}$} ; + \draw[\RAPPcouleur] (-60:2.75) node[rotate={270-60},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{3}$} ; + \draw[\RAPPcouleur] (-90:2.75) node[rotate={270-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{2}$} ; + \draw[\RAPPcouleur] (-120:2.75) node[rotate={270-120},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-2\pi}{3}$} ; + \draw[\RAPPcouleur] (-135:2.75) node[rotate={270-135},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-3\pi}{4}$} ; + \draw[\RAPPcouleur] (-150:2.75) node[rotate={270-150},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-5\pi}{6}$} ; }{} } { @@ -440,9 +453,9 @@ \ifboolKV[RapporteurGeom]{AfficheAngles} {% \foreach \i in {0,10,...,180} - {\draw[\RAPPcouleur] (\i:3.2) node[rotate={\i-90},scale=\fpeval{\RAPPechelle*\RAPPechangle},font=\tiny] {\i} ;} + {\draw[\RAPPcouleur] (\i:3.2) node[rotate={\i-90},scale=\fpeval{\RAPPechangle},font=\tiny] {\i} ;} \foreach \i in {0,10,...,180} - {\draw[\RAPPcouleur] (\i:2.7) node[rotate={\i-90},scale=\fpeval{\RAPPechelle*\RAPPechangle},font=\tiny] {\inteval{180-\i}} ;} + {\draw[\RAPPcouleur] (\i:2.7) node[rotate={\i-90},scale=\fpeval{\RAPPechangle},font=\tiny] {\inteval{180-\i}} ;} }{} } \end{scope} @@ -455,7 +468,8 @@ CouleurFond=\def\POURCcouleurfond{#1},% Origine=\def\POURCposOrigin{#1},% Rotation=\def\POURCangle{#1},% - Opacite=\def\POURCopac{#1} + Opacite=\def\POURCopac{#1},% + EchelleValeurs=\def\POURCechlabel{#1} } \setKVdefault[Pourcenteur]{% @@ -468,13 +482,14 @@ AfficheValeurs=true,% Fond=false,% Opacite=0.5,% - Decoration=true + Decoration=true,% + EchelleValeurs=0.8 } \NewDocumentCommand{\tkzPourcenteur}{ O{} }{% \useKVdefault[Pourcenteur]% \setKV[Pourcenteur]{#1}% - \begin{scope}[shift={(\POURCposOrigin)},rotate=\POURCangle,scale=\POURCechelle,every node/.style={rotate=\POURCangle}] + \begin{scope}[shift={(\POURCposOrigin)},rotate=\POURCangle,scale=\POURCechelle,transform shape] \ifboolKV[Pourcenteur]{Fond} {% \fill[draw=none,fill=\POURCcouleurfond!10!white,fill opacity=\POURCopac] (0,0) circle[radius=3] ; @@ -483,7 +498,7 @@ \draw[\POURCcouleur,semithick] (0,0) circle[radius=3] ; \draw[\POURCcouleur,semithick] ({-0.15*3},0)--({0.15*3},0) (0,{-0.15*3})--(0,{0.15*3}) ; \foreach \pct in {0,1,...,199} - {\draw[\POURCcouleur,thin] ({0.5*\pct*3.6}:{3})--({0.5*\pct*3.6}:{3-0.2}) ;} + {\draw[\POURCcouleur,thin] ({0.5*\pct*3.6}:{3})--({0.5*\pct*3.6}:{3-0.2}) ;} \foreach \pct in {0,10,...,90}{% \draw[\POURCcouleur,thin] ({(\pct+1)*3.6}:{3})--({(\pct+1)*3.6}:{3-0.35}) ; \filldraw[\POURCcouleur] ({(\pct+1)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; @@ -505,14 +520,14 @@ \foreach \pct in {5,10,15,20,30,35,40,45,55,60,65,70,80,85,90,95}{% \draw[\POURCcouleur,semithick] ({\pct*3.6}:{3})--({\pct*3.6}:{3-0.5}) ; \ifboolKV[Pourcenteur]{AfficheValeurs} - {\draw ({-\pct*3.6+90}:{3-0.6}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{0.8*\POURCechelle*\POURCechangle},font=\tiny] {\pct\,\%} ;}{} + {\draw ({-\pct*3.6+90}:{3-0.6}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{\POURCechlabel*\POURCechangle},font=\tiny] {\pct\,\%} ;}{} } \foreach \pct in {0,25,50,75}{% \draw[\POURCcouleur,semithick] ({\pct*3.6}:{3})--({\pct*3.6}:{3-0.5}) ; \ifboolKV[Pourcenteur]{AfficheValeurs} {% - \draw ({-\pct*3.6+90}:{3-0.61}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{0.8*\POURCechelle*\POURCechangle},font=\scriptsize\bfseries] {\pct\,\%} ; - \draw ({-\pct*3.6+90}:{2+0.15}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{0.8*\POURCechelle*\POURCechangle},font=\tiny\bfseries] {\pct\,\%} ; + \draw ({-\pct*3.6+90}:{3-0.61}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{\POURCechlabel*\POURCechangle},font=\scriptsize\bfseries] {\pct\,\%} ; + \draw ({-\pct*3.6+90}:{2+0.15}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{\POURCechlabel*\POURCechangle},font=\tiny\bfseries] {\pct\,\%} ; }{}% } \draw[\POURCcouleur,semithick] (0,1)--(0,2) (1.6,0)--(2,0) (0,-1.6)--(0,-2) (-1.6,0)--(-2,0) ; @@ -533,7 +548,7 @@ CouleurFond=\def\RAPPEQcouleurfond{#1},% Origine=\def\RAPPEQposOrigin{#1},% Rotation=\def\RAPPEQangle{#1},% - Opacite=\def\RAPPEQopac{#1} + Opacite=\def\RAPPEQopac{#1},% } \setKVdefault[RapporteurEquerreGeom]{% @@ -561,7 +576,7 @@ \pgfmathanglebetweenpoints{\pgfpointanchor{\RAPPEQposOrigin}{center}}{\pgfpointanchor{\tmppointdeux}{center}}% \edef\RAPPEQangle{\pgfmathresult}% }{}% - \begin{scope}[shift={(\RAPPEQposOrigin)},rotate=\RAPPEQangle,scale=\RAPPEQechelle,every node/.style={rotate=\RAPPEQangle}] + \begin{scope}[shift={(\RAPPEQposOrigin)},rotate=\RAPPEQangle,scale=\RAPPEQechelle,transform shape] %fond \ifboolKV[RapporteurEquerreGeom]{Fond} {% @@ -591,16 +606,16 @@ \ifboolKV[RapporteurEquerreGeom]{AfficheAngles} {% \foreach \i in {10,20,...,170} - {\draw[\RAPPEQcouleur] ({-\i}:{0.6125*\RAPPEQlargeur}) node[rotate={90-\i},scale=\fpeval{\RAPPEQlargeur/8*\RAPPEQechelle*\RAPPEQechangle},font=\tiny] {\i} ;} + {\draw[\RAPPEQcouleur] ({-\i}:{0.6125*\RAPPEQlargeur}) node[rotate={90-\i},scale=\fpeval{\RAPPEQlargeur/8*\RAPPEQechangle},font=\tiny] {\i} ;} %angles "extérieurs" \foreach \i in {10,20,...,170} - {\draw[\RAPPEQcouleur] ({-\i}:{0.6375*\RAPPEQlargeur}) node[rotate={90-\i},scale=\fpeval{\RAPPEQlargeur/8*\RAPPEQechelle*\RAPPEQechangle},font=\tiny] {\inteval{180-\i}} ;} + {\draw[\RAPPEQcouleur] ({-\i}:{0.6375*\RAPPEQlargeur}) node[rotate={90-\i},scale=\fpeval{\RAPPEQlargeur/8*\RAPPEQechangle},font=\tiny] {\inteval{180-\i}} ;} }% {}% \ifboolKV[RapporteurEquerreGeom]{AfficheValeurs} {% \foreach \i in {-1,0,1} - {\draw[\RAPPEQcouleur] ({\i},-0.375) node[scale=\fpeval{\RAPPEQechelle*\RAPPEQechangle},font=\tiny] {$\i$} ;} + {\draw[\RAPPEQcouleur] ({\i},-0.375) node[scale=\fpeval{\RAPPEQechangle},font=\tiny] {$\i$} ;} }% {}% %tracés intérieurs diff --git a/graphics/pgf/contrib/pgf-periodictable/README b/graphics/pgf/contrib/pgf-periodictable/README index b1a6ef2279..bfdfafd70a 100644 --- a/graphics/pgf/contrib/pgf-periodictable/README +++ b/graphics/pgf/contrib/pgf-periodictable/README @@ -1,4 +1,4 @@ -This is pgf-PeriodicTable, version 2.1.1 (2024/07/07). +This is pgf-PeriodicTable, version 2.1.4 (2024/09/08). The purpose of this package is to provide the Periodic Table of Elements in a simple way. It relies on pgf/TikZ to offer a full or partial periodic table with @@ -22,6 +22,21 @@ ____________________________________________________________ Major changes: +*** v2.1.4 (08/09/2024) *** +Fixed wrong box width on extra legend of Country of Discovery. +Fixed minor issues in pgfPTbuildcell macros. +Added the prefix 'pgfPT' to the built-in back color schemes. They are now 'pgfPTdefault', 'pgfPTSoft', 'pgfPTJmol', +'pgfPTCPK', 'pgfPTRasmol', 'pgfPTRasmolNew', 'pgfPTWikipedia', 'pgfPTMNM', 'pgfPTPS', 'pgfPTRadio' and 'pgfPTBlocks'. +Fixed some typos in the manual. + +*** v2.1.3 (07/08/2024) *** +The engine's detection mechanism (pdfLaTeX, LuaLaTeX or XeTeX) has been changed to prevent erroneous detection when the packages 'hyperref' or 'bookmark' are loaded and the document is compiled with LuaLaTeX - in this case, pgf-PeriodicTable disturbs the selection of the document font. +Fixed an issue with the Chemical Symbol color when a non-rgb color is used, such as cyan or yellow , which are defined in the xcolor package using the cmyk model (when loaded without options). + +*** v2.1.2 (01/08/2024) *** +Fixed incorrect Spanish translations of some element names. +Minor code improvements to eliminate runtime warnings («LaTeX Font Warning: Font shape `TU/TeXGyreHeros(0)/l/n' undefined» or «Missing character: There is no m (U+006D) in font nullfont!» ... ) + *** v2.1.1 (07/07/2024) *** New keys: - group numbers (to display group numbers in arabic numerals, Roman numerals or both) diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_DiscY.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_DiscY.tex index 66e67fc3c7..9a18c1f8dd 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_DiscY.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_DiscY.tex @@ -1,23 +1,23 @@ %\vfill% -\subsubsection{\texorpdfstring{\ding{224} The discovery year}{The discovery year}}\vspace{6pt}% +\subsubsection{\texorpdfstring{\ding{224} The year of discovery}{The year of discovery}}\vspace{6pt}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % DiscY color \pgfPTMoption{4}{DiscY color}{black}{% -Sets the discovery year color. +Sets the color of the discovery year. } \\ [5pt]\pgfPTMmacrobox{pgfPT}[Z list={1,...,36},cell style=pgfPTdisc,DiscY color=red]% \\ [10pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[Z list={1,...,36},cell style=pgfPTdisc,DiscY color=red]}}% \\ [5pt]\pgfPTendoption% % DiscY font \pgfPTMoption{4}{DiscY font}{\string\tiny\string\bfseries}{% -Sets the discovery year font. +Sets the font of the discovery year. } \\ [5pt]\pgfPTMmacrobox{pgfPT}[Z list={1,...,36},cell style=pgfPTdisc,DiscY font=\string\fontfamily{pbk}\string\selectfont\string\tiny\string\bfseries]% \\ [10pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[Z list={1,...,36},cell style=pgfPTdisc,DiscY font=\fontfamily{pbk}\selectfont\tiny\bfseries]}}% \\ [5pt]\pgfPTendoption% % DiscY BC scale \pgfPTMoption{4}{DiscY BC scale}{1}{% -Sets the font factor scaling for the Before Christ (BC) acronym in the discovery year. +Sets the font factor scaling for the Before Christ (BC) acronym in the year of discovery. } \\ [5pt]\pgfPTMmacrobox{pgfPT}[Z list={1,...,36},cell style=pgfPTdisc,DiscY BC scale=.8]% \\ [10pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[Z list={1,...,36},cell style=pgfPTdisc,DiscY BC scale=.8]}}% diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_Examples.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_Examples.tex index b9b76f64d1..4b9211dc54 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_Examples.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_Examples.tex @@ -71,7 +71,7 @@ The following examples could be used for students or for any other purposes. \def\grupo[#1][#2] #3{% \begin{tikzpicture}[inner xsep=0pt] \node[below left,text width=1.75cm,text centered] (figura) at (0,0) % -{\scalebox{.5}{\pgfPT[show title=false,show label LaAc=true,show legend=false,back color scheme=MNM,% +{\scalebox{.5}{\pgfPT[show title=false,show label LaAc=true,show legend=false,back color scheme=pgfPTMNM,% font=Roboto-TLF,CS font=\fontfamily{RobotoSlab-TLF}\bfseries\large,eDist color=blue!70!black,% DiscC font=\fontsize{4}{4}\selectfont,DiscY font=\fontsize{4}{4}\selectfont\bfseries,% name font=\fontseries{l}\fontsize{6pt}{6pt}\selectfont,name color=red!50!black,% diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_OtherCont.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_OtherCont.tex index c90a4cae94..6b57de7bb0 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_OtherCont.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_OtherCont.tex @@ -7,7 +7,7 @@ For all the \textit{other contents} available for the cells of the periodic tabl \begin{itemlist} %\item\red{\textbf{name}}:\hspace{.5ex}element name \item\red{\textbf{R}}:\hspace{.5ex}atomic radius -\item\red{\textbf{Rcov}}:\hspace{.5ex}covalente radius +\item\red{\textbf{Rcov}}:\hspace{.5ex}covalent radius \item\red{\textbf{Rion}}:\hspace{.5ex}ionic radius \item\red{\textbf{Ei}}:\hspace{.5ex}first ionization energy \item\red{\textbf{eneg}}:\hspace{.5ex}electronegativity (Pauling) @@ -29,7 +29,7 @@ For all the \textit{other contents} available for the cells of the periodic tabl \item\red{\textbf{lsb}}:\hspace{.5ex}lattice constant -- b \item\red{\textbf{lsc}}:\hspace{.5ex}lattice constant -- c \item\red{\textbf{lsca}}:\hspace{.5ex}lattice c/a ratio -\item\red{\textbf{DiscC}}:\hspace{.5ex}discover country +\item\red{\textbf{DiscC}}:\hspace{.5ex}country of discovery \item\red{\textbf{spectra}}:\hspace{.5ex}visible range spectral lines \end{itemlist} \end{minipage} diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_commands.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_commands.tex index 9e1ba55405..cbc7cbc2fa 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_commands.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_commands.tex @@ -33,8 +33,8 @@ \\ [0pt]\pgfPTMline% \newpage% This command can also be used with options -- as described in section \hyperlink{OPTIONS}{Options for \textbackslash pgfPT: creating a Periodic Table} -- to modify, for instance, the font of the Periodic Table or the colors of the cells: -\\ [10pt]\pgfPTMmacrobox{pgfPT}[font=pnc,back color scheme=MNM]% -\\ [10pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[font=pnc,back color scheme=MNM]}}% +\\ [10pt]\pgfPTMmacrobox{pgfPT}[font=pnc,back color scheme=pgfPTMNM]% +\\ [10pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[font=pnc,back color scheme=pgfPTMNM]}}% \\ [0pt]\pgfPTMline% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \\ [-32pt]\ % @@ -87,7 +87,7 @@ It is possible to locally override the \textit{global style} defined: \\ [-32pt]\ % \def\tmpSection{\bs{pgfPTresetcell}}% \subsection*{}{\normalfont\large\bfseries\raisebox{1.25pt}{\color{black}$\mathbf{\blacktriangleright}$}\ Utilization of \tmpSection}% -\label{command:pgfPTresetcell}\addcontentsline{toc}{subsection}{\texorpdfstring{\tmpSection{}}{\textbackslash pgfPTbuildcellstyle}}% +\label{command:pgfPTresetcell}\addcontentsline{toc}{subsection}{\texorpdfstring{\tmpSection{}}{\textbackslash pgfPTresetcell}}% \index{COMMANDS@\textbf{COMMANDS}!\textbackslash pgfPTresetcell}% \\ [4pt]The \pgfPTMmacro{pgfPTresetcell}[] resets the cell to its default layout. \\ [-32pt]\ % @@ -154,16 +154,16 @@ It is possible to locally override the \textit{global style} defined: There are a few \textit{color schemes} predefined: \index{BUILT-IN@\textbf{BUILT-IN}!color schemes}% \begin{itembar} -\item\textbf{default}, the default built-in color scheme, which is loaded if no value is passed to the \red{back color scheme} key. -\item\textbf{Soft}, a soft color pattern for cells, differentiating metals, non metals, semimetals, lanthanides and actinides. -\item\textbf{Jmol}, a color scheme based upon \href{http://www.jmol.org/}{Jmol: an open-source Java viewer for chemical structures in 3D}. -\item\textbf{CPK}, a color scheme that is based upon the colors of the popular plastic spacefilling models which were developed by Corey, Pauling and later improved by Kultun. -\item\textbf{Rasmol} and \textbf{RasmolNew}, two color schemes based upon the computer program \href{http://www.rasmol.org/}{RasMol}. -\item\textbf{Wikipedia}, a color scheme built on the Periodic Table of Elements available at \href{https://en.wikipedia.org/wiki/Periodic_table#Classification_of_elements}{Wikipedia}. -\item\textbf{MNM}, a color pattern which distinguishes between \textbf{M}etals, semimetals and \textbf{N}on \textbf{M}etals. -\item\textbf{PS}, a color scheme depicting the \textbf{P}hysical \textbf{S}tate at room temperature. -\item\textbf{Radio}, a two color color scheme showing the radioactivity of the elements. -\item\textbf{Blocks}, a four colored color scheme showing the \textit{s}, \textit{p}, \textit{d} and \textit{f} blocks of the Periodic Table. +\item\textbf{pgfPTdefault}, the default built-in color scheme, which is loaded if no value is passed to the \red{back color scheme} key. +\item\textbf{pgfPTSoft}, a soft color pattern for cells, differentiating metals, non metals, semimetals, lanthanides and actinides. +\item\textbf{pgfPTJmol}, a color scheme based upon \href{http://www.jmol.org/}{Jmol: an open-source Java viewer for chemical structures in 3D}. +\item\textbf{pgfPTCPK}, a color scheme that is based upon the colors of the popular plastic spacefilling models which were developed by Corey, Pauling and later improved by Kultun. +\item\textbf{pgfPTRasmol} and \textbf{pgfPTRasmolNew}, two color schemes based upon the computer program \href{http://www.rasmol.org/}{RasMol}. +\item\textbf{pgfPTWikipedia}, a color scheme built on the Periodic Table of Elements available at \href{https://en.wikipedia.org/wiki/Periodic_table#Classification_of_elements}{Wikipedia}. +\item\textbf{pgfPTMNM}, a color pattern which distinguishes between \textbf{M}etals, semimetals and \textbf{N}on \textbf{M}etals. +\item\textbf{pgfPTPS}, a color scheme depicting the \textbf{P}hysical \textbf{S}tate at room temperature. +\item\textbf{pgfPTRadio}, a two color color scheme showing the radioactivity of the elements. +\item\textbf{pgfPTBlocks}, a four colored color scheme showing the \textit{s}, \textit{p}, \textit{d} and \textit{f} blocks of the Periodic Table. \end{itembar} \vspace{5pt} Writing a color scheme can be painstaking work, so a \textit{script} is provided for that: diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_generallayout.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_generallayout.tex index 6658536639..3c32e1a95c 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_generallayout.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_generallayout.tex @@ -151,27 +151,27 @@ any \textbf{user defined} name via \pgfPTMmacro{pgfPTnewZlist}[]\{name\}\{list\} % back color scheme \label{option_back color scheme}% \vfill -\pgfPTMoption{4}{back color scheme}{default}% +\pgfPTMoption{4}{back color scheme}{pgfPTdefault}% {Sets a \blue{named} back color scheme for the Periodic Table.}% -\\ [5pt]\pgfPTMmacrobox{pgfPT}[back color scheme=Soft]% -\\ [5pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[back color scheme=Soft]}}% +\\ [5pt]\pgfPTMmacrobox{pgfPT}[back color scheme=pgfPTSoft]% +\\ [5pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[back color scheme=pgfPTSoft]}}% \newpage% \pgfPTMoptiontxt{% The possible \lblue{name} is one of the following: \begin{itembar} \item\textbf{built-in}: \begin{itemize} -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{Soft}, a soft color scheme that distinguishes metal, non metals, silicon and germanium, lanthanoids and actinoids. -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{Jmol}, is the color scheme used in the computer software \href{http://jmol.sourceforge.net/}{Jmol}: an open-source Java viewer for chemical structures in 3D. -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{CPK}, is the color scheme of the popular color convention for distinguishing atoms of different chemical +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTSoft}, a soft color scheme that distinguishes metals, non metals, silicon and germanium, lanthanoids and actinoids. +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTJmol}, is the color scheme used in the computer software \href{http://jmol.sourceforge.net/}{Jmol}: an open-source Java viewer for chemical structures in 3D. +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTCPK}, is the color scheme of the popular color convention for distinguishing atoms of different chemical elements in molecular models. The scheme is named after the CPK molecular models designed by chemists Robert Corey and Linus Pauling, and improved by Walter Koltun. -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{Rasmol}, is the color scheme used in the computer software \href{http://www.rasmol.org/}{RasMol}, a program for molecular graphics visualization originally developed by Roger Sayle. -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{RasmolNew}, is a color scheme used in RasMol with revision of CPK colors made by C. Chigbo (RasMol 2.7.3). -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{Wikipedia}, is the color scheme based on the \href{https://en.wikipedia.org/wiki/Periodic_table\#Classification_of_elements}{Wikipedia Periodic Table of Elements}. -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{MNM}, is designed to show \textbf{M}etals and \textbf{N}on \textbf{M}etals in two different colors, showing also the semi-metals in a third color. -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{PS}, is designed to show the \textbf{P}hysical \textbf{S}tate of the elements at normal temperature and pressure (NTP) in different colors. -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{Radio}, is designed to show the \textbf{R}adioactive elements in one color and the non radioactive elements in another color. -\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{Blocks}, for showing the elements in each block of the Periodic Table with the same color. +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTRasmol}, is the color scheme used in the computer software \href{http://www.rasmol.org/}{RasMol}, a program for molecular graphics visualization originally developed by Roger Sayle. +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTRasmolNew}, is a color scheme used in RasMol with revision of CPK colors made by C. Chigbo (RasMol 2.7.3). +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTWikipedia}, is the color scheme based on the \href{https://en.wikipedia.org/wiki/Periodic_table\#Classification_of_elements}{Wikipedia Periodic Table of Elements}. +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTMNM}, is designed to show \textbf{M}etals and \textbf{N}on \textbf{M}etals in two different colors, showing also the semi-metals in a third color. +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTPS}, is designed to show the \textbf{P}hysical \textbf{S}tate of the elements at normal temperature and pressure (NTP) in different colors. +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTRadio}, is designed to show the \textbf{R}adioactive elements in one color and the non radioactive elements in another color. +\item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{pgfPTBlocks}, for showing the elements in each block of the Periodic Table with the same color. \item[\raisebox{1pt}{\scriptsize$\vartriangleright\,$}]\sq{solid}, to show the background of each cell of the Periodic Table with the same color specified by the key \sq{\red{back color}}. \end{itemize} \item any \textbf{user defined} name via \bs{pgfPTnewColorScheme}\lb\red{name}\rb\lb\red{color list}\rb% @@ -201,7 +201,7 @@ elements in molecular models. The scheme is named after the CPK molecular models \newpage\vspace{-34pt}\ % \foreach \csName/\x in {Soft/0,Jmol/1,CPK/0,Rasmol/1,RasmolNew/0,Wikipedia/1,MNM/0,PS/1,Radio/0,Blocks/1}{% \pgfPTMstyletxt{4}{cs\csName}{no value}% -{A style equivalent to \red{back color scheme=\csName}}% +{A style equivalent to \red{back color scheme=pgfPT\csName}}% \\ [5pt]\pgfPTMmacrobox{pgfPT}[cs\csName]% \\ [10pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[cs\csName]}}% \\ [0pt]\pgfPTendstyle% @@ -262,7 +262,7 @@ elements in molecular models. The scheme is named after the CPK molecular models \vfill \label{option_languages}% \pgfPTMoption[\pgfPTchangedinversion{2.1.0}]{4}{languages}{\{\}}% -{Sets a language list to use in the Periodic Table. It is a comma separated list of language flags: \sq{pt}, \sq{en}, \sq{fr}, \sq{de}, \sq{it}, \sq{es} or \sq{br}. If a user language has been loaded, the corresponding ISO 639-1 code can also be used as a language flag. \textit{This key overrides the default language, that is, the language loaded at package inclusion}.\\ \ }% +{Sets a language list to use in the Periodic Table. It is a comma separated list of language flags: \sq{pt}, \sq{en}, \sq{fr}, \sq{de}, \sq{it}, \sq{es} or \sq{br}. If a user language has been loaded, the corresponding ISO 639-1 code can also be used as a language flag. \textit{This key locally overrides the default language, that is, the language loaded at package inclusion}.\\ \ }% \\ [5pt]\pgfPTMmacrobox{pgfPT}[Z list={1,...,36},languages=pt]% \\ [10pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[Z list={1,...,36},languages=pt]}}% \\ [10pt]\pgfPTMmacrobox{pgfPT}[Z list={1,...,36},cell style=pgfPT2lang,languages={en,fr}]% diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_libCS.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_libCS.tex index 5e8ffea167..e973146b7f 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_libCS.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_libCS.tex @@ -232,7 +232,7 @@ P6=*[RGB:62;82;126],P7=*[RGB:101;117;153]}\rb% \label{command:pgfPTCScombine}\addcontentsline{toc}{subsubsection}{\texorpdfstring{\tmpSectionIII{}}{\textbackslash pgfPTCScombine}}% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!colorschemes@\textbf{\red{Color Schemes Library}}!\tmpSectionIII}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\\ [10pt]This command \textbf{combines two named Color Schemes} and merges the result in a new Color Scheme with \red{name of the new color scheme}. +\\ [10pt]This command \textbf{combines two named Color Schemes} and merges the result into a new Color Scheme with \red{name of the new color scheme}. \\ For example \bs{pgfPTCScombine}\lb\red{myCSA,myCSB,myCSC}\rb\ adds the color scheme \red{myCSA} to the color scheme \red{myCSB} and their sum will be available as the color scheme \red{myCSC}. \\ [3pt]\blue{\textbf{NOTE}}: if the Color Schemes have different sizes (\ie, different number of colors), the last color from the color scheme that ends first will be used until the other color scheme also ends. \\ [3pt]The optional parameters \lp\red{prop1:prop2,mode}\rp\ are for controlling how the two Color Schemes are combined: @@ -292,24 +292,24 @@ P6=*[RGB:62;82;126],P7=*[RGB:101;117;153]}\rb% }{% \scalebox{.425}{\pgfPT[back color scheme=mix,show title=false]}% }% ----- -\vfill\pgfPTCScombine[add]{Soft,group,mix}% +\vfill\pgfPTCScombine[add]{pgfPTSoft,group,mix}% \textit{Built-in color schemes can also be mixed}: \\ [10pt]\pgfPTMlibexample{% -\bs{pgfPTCScombine}\lp\red{add}\rp\lb\red{Soft,group,mix}\rb% +\bs{pgfPTCScombine}\lp\red{add}\rp\lb\red{pgfPTSoft,group,mix}\rb% \\ \pgfPTMmacro{pgfPT}[back color scheme=mix,show title=false]% }{% \scalebox{.425}{\pgfPT[back color scheme=mix,show title=false]}% }% ----- -\newpage\pgfPTCScombine[add,3:1]{Soft,PS,mix}% +\newpage\pgfPTCScombine[add,3:1]{pgfPTSoft,pgfPTPS,mix}% \pgfPTMlibexample{% -\bs{pgfPTCScombine}\lp\red{add,3:1}\rp\lb\red{Soft,PS,mix}\rb% +\bs{pgfPTCScombine}\lp\red{add,3:1}\rp\lb\red{pgfPTSoft,pgfPTPS,mix}\rb% \\ \pgfPTMmacro{pgfPT}[back color scheme=mix,show title=false]% }{% \scalebox{.425}{\pgfPT[back color scheme=mix,show title=false]}% }% ----- -\\ [4pt]\pgfPTCScombine{Radio,Wikipedia,mix}% +\\ [4pt]\pgfPTCScombine{pgfPTRadio,pgfPTWikipedia,mix}% \pgfPTMlibexample{% -\bs{pgfPTCScombine}\lp\red{add}\rp\lb\red{Radio,Wikipedia,mix}\rb% +\bs{pgfPTCScombine}\lp\red{add}\rp\lb\red{pgfPTRadio,pgfPTWikipedia,mix}\rb% \\ \pgfPTMmacro{pgfPT}[back color scheme=mix,show title=false]% }{% \scalebox{.425}{\pgfPT[back color scheme=mix,show title=false]}% @@ -322,7 +322,7 @@ P6=*[RGB:62;82;126],P7=*[RGB:101;117;153]}\rb% \index{LIBRARIES@\textbf{\cyan{LIBRARIES}}!colorschemes@\textbf{\red{Color Schemes Library}}!\tmpSectionIV}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \\ [10pt]This command \textbf{writes the provided Color Schemes to a file} for later use without loading this library. It has a mandatory argument, the \red{list of the color schemes names} to be written and an optional argument, the \red{filename}. If no \red{filename} is provided the first name on the \red{list of the color schemes names} is used. -\\ For example, \bs{pgfPTCSwrite}\lp\red{myGroupColors}\rp\lb\red{myGroupGradGreenToRed,myGroupGreens, myGroupGradYellowToRed}\rb, \dcyan{\textit{will create (or overwrite), in the current working directory, a file with name} \texttt{\large myGroupColors.tex} \textit{with the follwing contents}}: +\\ For example, \bs{pgfPTCSwrite}\lp\red{myGroupColors}\rp\lb\red{myGroupGradGreenToRed,myGroupGreens, myGroupGradYellowToRed}\rb, \dcyan{\textit{will create (or overwrite), in the current working directory, a file with name} \texttt{\large myGroupColors.tex} \textit{with the following contents}}: \mymfbox{\textsf{% \textbackslash pgfPTnewColorScheme\{myGroupGradGreenToRed\}\{0/1/0,\myldots% \\ \textbackslash pgfPTnewColorScheme\{myGroupGreens\}\{0/1/.1,\myldots% diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_name.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_name.tex index 78f8178826..0fcc955dd2 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_name.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_name.tex @@ -11,7 +11,7 @@ Sets the color of the element name. \\ [5pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[Z list={1,...,36},name color=red]}}% \\ [0pt]\pgfPTendoption% % name font -\pgfPTMoption{4}{name font}{\string\fontseries\{l\}\string\selectfont\string\tiny}{% +\pgfPTMoption{4}{name font}{\string\tiny}{% \string\fontseries\{l\}\string\selectfont (removed @v2.1.2) Sets the font of the element name. } \\ [5pt]\pgfPTMmacrobox{pgfPT}[Z list={1,...,36},name font=\string\itshape\string\tiny]% diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_variations.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_variations.tex index 04a606adfd..019fcf8e2b 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_variations.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgf-PeriodicTableManual_variations.tex @@ -21,7 +21,7 @@ {Sets the color used in the filling of the \textit{arrows} for the atomic radius variations. \\ [10pt]\tikz{\node[text width=\linewidth-.6666em,fill=orange!5!white,draw=orange,rounded corners=2pt] {\textbf{\orange{NOTE}}:\\ The color provided to \red{varR color} could be any defined color via the command \texttt{\normalsize\textbackslash definecolor} or by \textit{mixing} colors, using, for instance, the syntax \texttt{\normalsize color1!value!color2}, as explained in the \href{https://ctan.org/pkg/xcolor}{xcolor} package documentation.};} }% -\\ [5pt]\pgfPTMmacrobox{pgfPT}[show periodic variations,cell style=pgfPTR,varR color=teal,R color=purple]% +\\ [5pt]\pgfPTMmacrobox{pgfPT}[show periodic variations,cell style=pgfPTR,varR color=purple!50!white,R color=purple]% \\ [5pt]\makebox[\linewidth][c]{\scalebox{.6}{\pgfPT[show periodic variations,cell style=pgfPTR,varR color=purple!50!white, R color=purple]}}% \\ [5pt]\pgfPTendoption% % varR font diff --git a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgfPTmanual.macros.tex b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgfPTmanual.macros.tex index ddaee71477..0783999e80 100644 --- a/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgfPTmanual.macros.tex +++ b/graphics/pgf/contrib/pgf-periodictable/manualfiles/pgfPTmanual.macros.tex @@ -1,5 +1,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Definitions for pgf-PeriodicTable Manual +% Hugo Gomes @ 09/09/2024 v2.1.4 +% Hugo Gomes @ 07/08/2024 v2.1.3 +% Hugo Gomes @ 01/08/2024 v2.1.2 % Hugo Gomes @ 07/07/2024 v2.1.1 % Hugo Gomes @ 03/04/2024 v2.1.0a % Hugo Gomes @ 14/02/2024 v2.1.0 @@ -7,7 +10,7 @@ % Hugo Gomes @ 20/02/2023 v2.0.0 % Hugo Gomes @ 08/11/2022 v1.0.1 % Hugo Gomes @ 10/10/2022 v1.0.0 -\def\pgfPTversion{2.1.1}% +\def\pgfPTversion{2.1.4}% \def\pgfPTnewinversion#1{new in v#1}% \def\pgfPTchangedinversion#1{changed in v#1}% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -22,31 +25,6 @@ \setcounter{secnumdepth}{1}% \setcounter{tocdepth}{4} % -\makeatletter% -\global\renewcommand\thesection{}% -\renewcommand\thesubsection{\@arabic\c@subsection}% -\renewcommand\section{\@startsection{section}{1}{\z@}% - {-3.5ex \@plus -1ex \@minus -.2ex}% - {2.3ex \@plus.2ex}% - {\hskip-1.4395em\normalfont\Large\bfseries}}% -\renewcommand*\l@section[2]{% - \ifnum \c@tocdepth >\z@% - \addpenalty\@secpenalty% - \addvspace{1.0em \@plus\p@}% - \setlength\@tempdima{0em}% - \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}{1.5em}{1.5em}}% -\renewcommand*\l@subsubsection{\@dottedtocline{3}{3.0em}{2.4em}}% -\renewcommand*\l@paragraph{\@dottedtocline{4}{4.25em}{1.35em}}% -\makeatother% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \pgfdeclarelayer{back}% \pgfsetlayers{back,main}% diff --git a/graphics/pgf/contrib/pgf-periodictable/pgf-PeriodicTable.sty b/graphics/pgf/contrib/pgf-periodictable/pgf-PeriodicTable.sty index d3e8d4cbe1..41e135194f 100644 --- a/graphics/pgf/contrib/pgf-periodictable/pgf-PeriodicTable.sty +++ b/graphics/pgf/contrib/pgf-periodictable/pgf-PeriodicTable.sty @@ -1,4 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Hugo Gomes @ 09/09/2024 v2.1.4 +% Hugo Gomes @ 07/08/2024 v2.1.3 +% Hugo Gomes @ 01/08/2024 v2.1.2 % Hugo Gomes @ 07/07/2024 v2.1.1 % Hugo Gomes @ 03/04/2024 v2.1.0a % Hugo Gomes @ 14/02/2024 v2.1.0 @@ -8,7 +11,7 @@ % Hugo Gomes @ 10/10/2022 v1.0.0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e}% -\ProvidesPackage{pgf-PeriodicTable}[07/07/2024 pgf-PeriodicTable v2.1.1]%% +\ProvidesPackage{pgf-PeriodicTable}[08/09/2024 pgf-PeriodicTable v2.1.4]%% \RequirePackage{tikz}% \usetikzlibrary{fadings}% \tikzfading[name=aumentax, left color=transparent!80, right color=transparent!1]% @@ -17,11 +20,19 @@ \tikzfading[name=diminuiy, bottom color=transparent!80, top color=transparent!1]% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % check the engine and load font packages -\ifx\pdfliteral\undefined\relax% XeLaTeX or LuaLaTeX -\RequirePackage{fontspec}[2020/02/03]\edef\pgfPT@fontspec{1}% -\else% pdfLaTeX -\RequirePackage[T1]{fontenc}\edef\pgfPT@fontspec{0}% -\fi% +% changed in v2.1.3 +% pdfLaTeX -------------------------------------------------- +\ifx\pdftexversion\undefined\else% +\RequirePackage[T1]{fontenc}\edef\pgfPT@fontspec{0}\edef\pgfPT@engine{0}% +\fi% ----------------------------------------------------------- +% LuaLaTeX -------------------------------------------------- +\ifx\directlua\undefined\else% +\RequirePackage{fontspec}[2020/02/03]\edef\pgfPT@fontspec{1}\edef\pgfPT@engine{1}% +\fi% ----------------------------------------------------------- +% XeLaTeX --------------------------------------------------- +\ifx\XeTeXrevision\undefined\else% +\RequirePackage{fontspec}[2020/02/03]\edef\pgfPT@fontspec{1}\edef\pgfPT@engine{2}% +\fi% ----------------------------------------------------------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ifs to user language and list of user translations available \newif\ifpgfPT@user@lang\pgfPT@user@langfalse% @@ -2436,7 +2447,7 @@ d unit,d precision,E precision,ls unit,ls precision,T precision,Cp precision,kT \tikz{% \node[text width=\pgfPT@boxwd,text centered,inner sep=0pt] (exFlag) at (0,0) {\includegraphics[height=\pgfPT@boxht]{flags/\pgfPT@country@flag.pdf}};% \global\pgfPT@countc=0% - \node[below right,text width=3.75*\pgfPTcellwd,inner xsep=0pt] at ([xshift=.025*\pgfPTcellwd]exFlag.north east) {% + \node[below right,text width=2.2*\pgfPTcellwd,inner xsep=0pt] at ([xshift=.025*\pgfPTcellwd]exFlag.north east) {% \@for\pgfPT@tmp:=\pgfPTlanguages\do{% \ifnum\pgfPT@countc=0\relax% \pgfPT@box@zerodepth{\csname pgfPT@country@name@\pgfPT@tmp\endcsname}% @@ -3007,7 +3018,9 @@ rectangle \fi% \pgfPT@element@count=118 \fi\fi% min=1 & max 118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\@pgfPT@resetlayers% Restoring pgf layers to those used in the document +% corrected in v2.1.2: \@pgfPT@resetlayers -> \pgfsetlayers{\@pgfPT@resetlayers} +% ... Warning: Missing character: There is no m (U+006D) in font nullfont! ... +\pgfsetlayers{\@pgfPT@resetlayers}% Restoring pgf layers to those used in the document \fontseries{\seriesdefault}\fontshape{\shapedefault}\fontfamily{\familydefault}\selectfont% Restoring the font settings to normal mode in the document }% end tikz }% @@ -3082,15 +3095,14 @@ rectangle % renders text via pdfliteral: ------------- % #1 outline width width #2 txt #3 #4 #5 rgb stroke color #6 #7 #8 rgb fill color ----------- % #9 txt render mode (0 - fill 1 - stroke 2 - fill then stroke --------- -\ifx\pdfliteral\undefined\relax% -\ifx\pdfextension\undefined\relax% XeLaTeX -\def\pgfPT@lt[#1](#2)(#3,#4,#5)(#6,#7,#8)(#9){\special{pdf:literal direct #1 w #3 #4 #5 RG #6 #7 #8 rg #9 Tr}#2\special{pdf:literal direct 0 0 0 rg 1 w 0 Tr}}% -\else% LuaLaTeX -\protected\def\pdfliteral{\pdfextension literal} +% changed in v2.1.3 +\ifcase\pgfPT@engine\relax% pdfLaTeX \def\pgfPT@lt[#1](#2)(#3,#4,#5)(#6,#7,#8)(#9){\pdfliteral direct {#1 w #3 #4 #5 RG #6 #7 #8 rg #9 Tr}{#2}\pdfliteral direct {0 0 0 rg 1 w 0 Tr}}% -\fi% -\else% pdfLaTeX +\or% LuaLaTeX +\protected\def\pdfliteral{\pdfextension literal}% \def\pgfPT@lt[#1](#2)(#3,#4,#5)(#6,#7,#8)(#9){\pdfliteral direct {#1 w #3 #4 #5 RG #6 #7 #8 rg #9 Tr}{#2}\pdfliteral direct {0 0 0 rg 1 w 0 Tr}}% +\or% XeLaTeX +\def\pgfPT@lt[#1](#2)(#3,#4,#5)(#6,#7,#8)(#9){\special{pdf:literal direct #1 w #3 #4 #5 RG #6 #7 #8 rg #9 Tr}#2\special{pdf:literal direct 0 0 0 rg 1 w 0 Tr}}% \fi% % END !! \pgfPT@lt -------------------------------------------------------------------------------- % @@ -3101,9 +3113,10 @@ rectangle % auxiliary macros to set the rgb components of one color --------------------------------------- % with use of \extractcolorspecs from xcolor package --------------------------------------------- % each component is stored in \pgfPT@r, g or b & s or f ------------------------------------- -\def\pgfPT@extract@rgb@stroke#1{\extractcolorspecs{#1}{\pgfPTcolmodel}{\pgfPTcolinfo}\expandafter\pgfPT@set@rgb@stroke\pgfPTcolinfo\relax}% +% v3.1.3: added conversion of the color to rgb :: \colorlet{#1}[rgb]{#1} +\def\pgfPT@extract@rgb@stroke#1{\colorlet{#1}[rgb]{#1}\extractcolorspecs{#1}{\pgfPTcolmodel}{\pgfPTcolinfo}\expandafter\pgfPT@set@rgb@stroke\pgfPTcolinfo\relax}% \def\pgfPT@set@rgb@stroke#1,#2,#3\relax{\def\pgfPT@rs{#1}\def\pgfPT@gs{#2}\def\pgfPT@bs{#3}}% -\def\pgfPT@extract@rgb@fill#1{\extractcolorspecs{#1}{\pgfPTcolmodel}{\pgfPTcolinfo}\expandafter\pgfPT@set@rgb@fill\pgfPTcolinfo\relax}% +\def\pgfPT@extract@rgb@fill#1{\colorlet{#1}[rgb]{#1}\extractcolorspecs{#1}{\pgfPTcolmodel}{\pgfPTcolinfo}\expandafter\pgfPT@set@rgb@fill\pgfPTcolinfo\relax}% \def\pgfPT@set@rgb@fill#1,#2,#3\relax{\def\pgfPT@rf{#1}\def\pgfPT@gf{#2}\def\pgfPT@bf{#3}}% % END !! \pgfPT@color macros ------------------------------------------------------------------ % diff --git a/graphics/pgf/contrib/pgf-periodictable/pgf-PeriodicTableManual.pdf b/graphics/pgf/contrib/pgf-periodictable/pgf-PeriodicTableManual.pdf Binary files differindex c588490c48..9eff3db20b 100644 --- a/graphics/pgf/contrib/pgf-periodictable/pgf-PeriodicTableManual.pdf +++ b/graphics/pgf/contrib/pgf-periodictable/pgf-PeriodicTableManual.pdf diff --git a/graphics/pgf/contrib/pgf-periodictable/pgfPT.backcolors.keys.tex b/graphics/pgf/contrib/pgf-periodictable/pgfPT.backcolors.keys.tex index 076f588ca0..b9e45c2b5e 100644 --- a/graphics/pgf/contrib/pgf-periodictable/pgfPT.backcolors.keys.tex +++ b/graphics/pgf/contrib/pgf-periodictable/pgfPT.backcolors.keys.tex @@ -6,24 +6,25 @@ % % defining PGF keys: the colors of the cells of the periodic table to be drawn ----------------- % list names available to use in key 'back color scheme', e.g. ---------------------------------- -% back color scheme=CPK or back color scheme=Wikipedia ------------------------------ +% v2.1.4 -> add prefix pgfPT to the built-in names +% back color scheme=pgfPTCPK or back color scheme=pgfPTWikipedia ------------------ % if back color scheme=solid the back color key is used to fill the cells ------------------- -\def\pgfPT@backColorsScheme@default{.769/.812/.961,.678/.733/.925,.871/.89/.875,.922/.886/.71,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741}% -\def\pgfPT@backColorsScheme@Soft{.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.945/.941/.918,.973/.945/.78,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.973/.945/.78,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.843/.839/.659,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918}% -\def\pgfPT@backColorsScheme@Jmol{1/1/1,.851/1/1,.8/.502/1,.761/1/0,1/.71/.71,.565/.565/.565,.188/.314/.973,1/.051/.051,.565/.878/.314,.702/.89/.961,.671/.361/.949,.541/1/0,.749/.651/.651,.941/.784/.627,1/.502/0,1/1/.188,.122/.941/.122,.502/.82/.89,.561/.251/.831,.239/1/0,.902/.902/.902,.749/.761/.78,.651/.651/.671,.541/.6/.78,.612/.478/.78,.878/.4/.2,.941/.565/.627,.314/.816/.314,.784/.502/.2,.49/.502/.69,.761/.561/.561,.4/.561/.561,.741/.502/.89,1/.631/0,.651/.161/.161,.361/.722/.82,.439/.18/.69,0/1/0,.58/1/1,.58/.878/.878,.451/.761/.788,.329/.71/.71,.231/.62/.62,.141/.561/.561,.039/.49/.549,0/.412/.522,.753/.753/.753,1/.851/.561,.651/.459/.451,.4/.502/.502,.62/.388/.71,.831/.478/0,.58/0/.58,.259/.62/.69,.341/.09/.561,0/.788/0,.439/.831/1,1/1/.78,.851/1/.78,.78/1/.78,.639/1/.78,.561/1/.78,.38/1/.78,.271/1/.78,.188/1/.78,.122/1/.78,0/1/.612,0/.902/.459,0/.831/.322,0/.749/.22,0/.671/.141,.302/.761/1,.302/.651/1,.129/.58/.839,.149/.49/.671,.149/.4/.588,.09/.329/.529,.816/.816/.878,1/.82/.137,.722/.722/.816,.651/.329/.302,.341/.349/.38,.62/.31/.71,.671/.361/0,.459/.31/.271,.259/.51/.588,.259/0/.4,0/.49/0,.439/.671/.98,0/.729/1,0/.631/1,0/.561/1,0/.502/1,0/.42/1,.329/.361/.949,.471/.361/.89,.541/.31/.89,.631/.212/.831,.702/.122/.831,.702/.122/.729,.702/.051/.651,.741/.051/.529,.78/0/.4,.8/0/.349,.82/0/.31,.851/0/.271,.878/0/.22,.902/0/.18,.922/0/.149,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1}% -\def\pgfPT@backColorsScheme@CPK{1/1/1,0/1/1,.467/0/1,0/.467/0,1/.667/.467,.133/.133/.133,.133/.2/1,1/.133/0,.122/.941/.122,0/1/1,.467/0/1,0/.467/0,.867/.467/1,.867/.467/1,1/.6/0,1/.898/.133,.122/.941/.122,0/1/1,.467/0/1,0/.467/0,1/.667/.467,.6/.6/.6,1/.667/.467,1/.667/.467,1/.667/.467,.867/.467/0,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.6/.133/0,0/1/1,.467/0/1,0/.467/0,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.4/0/.733,0/1/1,.467/0/1,0/.467/0,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.467/0/1,0/.467/0,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1}% -\def\pgfPT@backColorsScheme@Rasmol{1/1/1,1/.753/.796,.698/.133/.133,1/.078/.576,0/1/0,.784/.784/.784,.561/.561/1,.941/0/0,.855/.647/.125,1/.078/.576,0/0/1,.133/.545/.133,.502/.502/.565,.855/.647/.125,1/.647/0,1/.784/.196,0/1/0,1/.078/.576,1/.078/.576,.502/.502/.565,1/.078/.576,.502/.502/.565,1/.078/.576,.502/.502/.565,.502/.502/.565,1/.647/0,1/.078/.576,.647/.165/.165,.647/.165/.165,.647/.165/.165,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.647/.165/.165,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.502/.502/.565,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.627/.125/.941,1/.078/.576,1/.078/.576,1/.647/0,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.855/.647/.125,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1}% -\def\pgfPT@backColorsScheme@RasmolNew{1/1/1,1/.753/.796,.698/.129/.129,1/.078/.58,0/1/.004,.827/.827/.827,.529/.808/.902,1/0/0,.855/.647/.129,1/.078/.58,0/0/1,.133/.545/.137,.412/.412/.412,.855/.647/.129,1/.667/0,1/1/0,0/1/.004,1/.078/.576,1/.078/.576,.412/.412/.412,1/.078/.58,.412/.412/.412,1/.078/.58,.412/.412/.412,.412/.412/.412,1/.667/0,1/.078/.58,.502/.157/.157,.502/.157/.157,.502/.157/.157,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.502/.157/.157,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.412/.412/.412,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.627/.125/.945,1/.078/.576,1/.078/.576,1/.667/0,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.855/.647/.129,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576}% -\def\pgfPT@backColorsScheme@Wikipedia{.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,.8/.8/.6,.941/1/.561,.941/1/.561,.941/1/.561,.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,.8/.8/.8,.8/.8/.6,.941/1/.561,.941/1/.561,.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,.8/.8/.8,.8/.8/.6,.8/.8/.6,.941/1/.561,.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,.8/.8/.8,.8/.8/.8,.8/.8/.6,.8/.8/.6,.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,.8/.8/.8,.8/.8/.8,.8/.8/.8,.8/.8/.8,.8/.8/.8,.753/1/1,1/.4/.4,1/.871/.678,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91}% -\def\pgfPT@backColorsScheme@MNM{.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.878/.816/.753,.91/.839/.659,.91/.839/.659,.91/.839/.659,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.878/.816/.753,.91/.839/.659,.91/.839/.659,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.878/.816/.753,.878/.816/.753,.91/.839/.659,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.878/.816/.753,.878/.816/.753,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847}% -\def\pgfPT@backColorsScheme@PS{.553/.706/.89,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.553/.706/.89,.553/.706/.89,.553/.706/.89,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.553/.706/.89,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.714/.867/.91,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.647/.647/.647,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.647/.647/.647,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.714/.867/.91,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647}% -\def\pgfPT@backColorsScheme@Radio{.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.957/.933/0,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.957/.933/0,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0}% -\def\pgfPT@backColorsScheme@Blocks{1/.937/.671,1/.937/.671,1/.937/.671,1/.937/.671,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.98/.667/.541,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.98/.667/.541,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635}% +\def\pgfPT@backColorsScheme@pgfPTdefault{.769/.812/.961,.678/.733/.925,.871/.89/.875,.922/.886/.71,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.631/.6/.435,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.8/.878/.859,.706/.871/.827,.612/.859/.796,.42/.89/.769,.671/.608/.749,.588/.655/.89,.871/.89/.875,.922/.886/.71,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.522/.49/.329,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.62/.604/.522,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741,.78/.788/.741}% +\def\pgfPT@backColorsScheme@pgfPTSoft{.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.945/.941/.918,.973/.945/.78,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.973/.945/.78,.843/.839/.659,.843/.839/.659,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.843/.839/.659,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.827/.824/1,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.843/.839/.659,.843/.839/.659,.945/.941/.918,.945/.941/.918,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.71/.706/1,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918,.945/.941/.918}% +\def\pgfPT@backColorsScheme@pgfPTJmol{1/1/1,.851/1/1,.8/.502/1,.761/1/0,1/.71/.71,.565/.565/.565,.188/.314/.973,1/.051/.051,.565/.878/.314,.702/.89/.961,.671/.361/.949,.541/1/0,.749/.651/.651,.941/.784/.627,1/.502/0,1/1/.188,.122/.941/.122,.502/.82/.89,.561/.251/.831,.239/1/0,.902/.902/.902,.749/.761/.78,.651/.651/.671,.541/.6/.78,.612/.478/.78,.878/.4/.2,.941/.565/.627,.314/.816/.314,.784/.502/.2,.49/.502/.69,.761/.561/.561,.4/.561/.561,.741/.502/.89,1/.631/0,.651/.161/.161,.361/.722/.82,.439/.18/.69,0/1/0,.58/1/1,.58/.878/.878,.451/.761/.788,.329/.71/.71,.231/.62/.62,.141/.561/.561,.039/.49/.549,0/.412/.522,.753/.753/.753,1/.851/.561,.651/.459/.451,.4/.502/.502,.62/.388/.71,.831/.478/0,.58/0/.58,.259/.62/.69,.341/.09/.561,0/.788/0,.439/.831/1,1/1/.78,.851/1/.78,.78/1/.78,.639/1/.78,.561/1/.78,.38/1/.78,.271/1/.78,.188/1/.78,.122/1/.78,0/1/.612,0/.902/.459,0/.831/.322,0/.749/.22,0/.671/.141,.302/.761/1,.302/.651/1,.129/.58/.839,.149/.49/.671,.149/.4/.588,.09/.329/.529,.816/.816/.878,1/.82/.137,.722/.722/.816,.651/.329/.302,.341/.349/.38,.62/.31/.71,.671/.361/0,.459/.31/.271,.259/.51/.588,.259/0/.4,0/.49/0,.439/.671/.98,0/.729/1,0/.631/1,0/.561/1,0/.502/1,0/.42/1,.329/.361/.949,.471/.361/.89,.541/.31/.89,.631/.212/.831,.702/.122/.831,.702/.122/.729,.702/.051/.651,.741/.051/.529,.78/0/.4,.8/0/.349,.82/0/.31,.851/0/.271,.878/0/.22,.902/0/.18,.922/0/.149,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1}% +\def\pgfPT@backColorsScheme@pgfPTCPK{1/1/1,0/1/1,.467/0/1,0/.467/0,1/.667/.467,.133/.133/.133,.133/.2/1,1/.133/0,.122/.941/.122,0/1/1,.467/0/1,0/.467/0,.867/.467/1,.867/.467/1,1/.6/0,1/.898/.133,.122/.941/.122,0/1/1,.467/0/1,0/.467/0,1/.667/.467,.6/.6/.6,1/.667/.467,1/.667/.467,1/.667/.467,.867/.467/0,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.6/.133/0,0/1/1,.467/0/1,0/.467/0,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.4/0/.733,0/1/1,.467/0/1,0/.467/0,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.467/0/1,0/.467/0,1/.667/.467,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,.867/.467/1,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/.667/.467,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1}% +\def\pgfPT@backColorsScheme@pgfPTRasmol{1/1/1,1/.753/.796,.698/.133/.133,1/.078/.576,0/1/0,.784/.784/.784,.561/.561/1,.941/0/0,.855/.647/.125,1/.078/.576,0/0/1,.133/.545/.133,.502/.502/.565,.855/.647/.125,1/.647/0,1/.784/.196,0/1/0,1/.078/.576,1/.078/.576,.502/.502/.565,1/.078/.576,.502/.502/.565,1/.078/.576,.502/.502/.565,.502/.502/.565,1/.647/0,1/.078/.576,.647/.165/.165,.647/.165/.165,.647/.165/.165,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.647/.165/.165,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.502/.502/.565,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.627/.125/.941,1/.078/.576,1/.078/.576,1/.647/0,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.855/.647/.125,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1,1/1/1}% +\def\pgfPT@backColorsScheme@pgfPTRasmolNew{1/1/1,1/.753/.796,.698/.129/.129,1/.078/.58,0/1/.004,.827/.827/.827,.529/.808/.902,1/0/0,.855/.647/.129,1/.078/.58,0/0/1,.133/.545/.137,.412/.412/.412,.855/.647/.129,1/.667/0,1/1/0,0/1/.004,1/.078/.576,1/.078/.576,.412/.412/.412,1/.078/.58,.412/.412/.412,1/.078/.58,.412/.412/.412,.412/.412/.412,1/.667/0,1/.078/.58,.502/.157/.157,.502/.157/.157,.502/.157/.157,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.502/.157/.157,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.412/.412/.412,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.627/.125/.945,1/.078/.576,1/.078/.576,1/.667/0,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,.855/.647/.129,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576,1/.078/.576}% +\def\pgfPT@backColorsScheme@pgfPTWikipedia{.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,.8/.8/.6,.941/1/.561,.941/1/.561,.941/1/.561,.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,.8/.8/.8,.8/.8/.6,.941/1/.561,.941/1/.561,.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,.8/.8/.8,.8/.8/.6,.8/.8/.6,.941/1/.561,.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,.8/.8/.8,.8/.8/.8,.8/.8/.6,.8/.8/.6,.941/1/.561,.753/1/1,1/.4/.4,1/.871/.678,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.749/1,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,.8/.8/.8,.8/.8/.8,.8/.8/.8,.8/.8/.8,.8/.8/.8,.753/1/1,1/.4/.4,1/.871/.678,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.6/.8,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,1/.753/.753,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91,.91/.91/.91}% +\def\pgfPT@backColorsScheme@pgfPTMNM{.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.878/.816/.753,.91/.839/.659,.91/.839/.659,.91/.839/.659,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.878/.816/.753,.91/.839/.659,.91/.839/.659,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.878/.816/.753,.878/.816/.753,.91/.839/.659,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.878/.816/.753,.878/.816/.753,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.91/.839/.659,.91/.839/.659,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847,.886/.886/.847}% +\def\pgfPT@backColorsScheme@pgfPTPS{.553/.706/.89,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.553/.706/.89,.553/.706/.89,.553/.706/.89,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.553/.706/.89,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.714/.867/.91,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.647/.647/.647,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.647/.647/.647,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.714/.867/.91,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.553/.706/.89,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,1/.878/.718,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647,.647/.647/.647}% +\def\pgfPT@backColorsScheme@pgfPTRadio{.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.957/.933/0,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.957/.933/0,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.761/.839/.604,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0,.957/.933/0}% +\def\pgfPT@backColorsScheme@pgfPTBlocks{1/.937/.671,1/.937/.671,1/.937/.671,1/.937/.671,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.98/.667/.541,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,1/.937/.671,1/.937/.671,.98/.667/.541,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.757/.835/.914,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.98/.667/.541,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635,.718/.871/.635}% % user defined color schemes(s): ----------------------------------------------------------------- % \pgfPTnewcolorscheme[<trailing color (default=1/1/1 e.g. white)>]{name}{list} ----- \def\pgfPTnewColorScheme{\@ifnextchar[\pgfPT@newColorScheme@withoptions{\pgfPT@newColorScheme@noptions}}% \def\pgfPT@newColorScheme@withoptions[#1/#2/#3]#4#5{% -\expandafter\def\csname pgfPT@backColorsScheme@#4\endcsname{#5,#1/#2/#3}% +\expandafter\gdef\csname pgfPT@backColorsScheme@#4\endcsname{#5,#1/#2/#3}% \definecolor{cpgfPTTMP}{rgb}{#1,#2,#3}% \xglobal\colorlet{cpgfPTTMP}{cpgfPTTMP}% }% @@ -36,20 +37,20 @@ \pgfkeys{/pgfPerTable/.cd,% back color scheme/.get=\pgfPTbcs,% back color scheme/.store in=\pgfPTbcs,% -back color scheme/.default=default,% +back color scheme/.default=pgfPTdefault,% back color/.get=\pgfPTbcsolid,% back color/.store in=\pgfPTbcsolid,% back color/.default=white,% -csSoft/.style={back color scheme=Soft},% -csJmol/.style={back color scheme=Jmol},% -csCPK/.style={back color scheme=CPK},% -csRasmol/.style={back color scheme=Rasmol},% -csRasmolNew/.style={back color scheme=RasmolNew},% -csWikipedia/.style={back color scheme=Wikipedia},% -csMNM/.style={back color scheme=MNM},% -csPS/.style={back color scheme=PS},% -csRadio/.style={back color scheme=Radio},% -csBlocks/.style={back color scheme=Blocks},% +csSoft/.style={back color scheme=pgfPTSoft},% +csJmol/.style={back color scheme=pgfPTJmol},% +csCPK/.style={back color scheme=pgfPTCPK},% +csRasmol/.style={back color scheme=pgfPTRasmol},% +csRasmolNew/.style={back color scheme=pgfPTRasmolNew},% +csWikipedia/.style={back color scheme=pgfPTWikipedia},% +csMNM/.style={back color scheme=pgfPTMNM},% +csPS/.style={back color scheme=pgfPTPS},% +csRadio/.style={back color scheme=pgfPTRadio},% +csBlocks/.style={back color scheme=pgfPTBlocks},% csSolid/.style={back color scheme=solid,back color=#1}% }% STYLES -> csSoft,csJmol,csCPK,csRasmol,csRasmolNew,csWikipedia,csMNM,csPS,csRadio,csBlocks,csSolid % setting keys with default values --------------------------------------------------------------- @@ -59,7 +60,7 @@ csSolid/.style={back color scheme=solid,back color=#1}% \def\pgfPTcolorSchemeInfo{% \global\pgfPT@dima=0pt\relax% \foreach \Z in {1,...,118}{\path (-\pgfPTcellwd,-10pt*\Z) rectangle node[midway,font=\tiny\bfseries] {Z=\Z} ++(\pgfPTcellwd,-10pt);}% -\foreach \cs in {default,Soft,Jmol,CPK,Rasmol,RasmolNew,Wikipedia,MNM,PS,Radio,Blocks}{% +\foreach \cs in {pgfPTdefault,pgfPTSoft,pgfPTJmol,pgfPTCPK,pgfPTRasmol,pgfPTRasmolNew,pgfPTWikipedia,pgfPTMNM,pgfPTPS,pgfPTRadio,pgfPTBlocks}{% \node[below right,text width=\pgfPTcellwd,text centered,font=\tiny,inner xsep=0pt] at (\pgfPT@dima,0pt) {\cs};% \path (\pgfPTcellwd+\pgfPT@dima,0pt) rectangle node[midway,font=\tiny\bfseries] {(r,g,b)} ++(2*\pgfPTcellwd,-10pt);% \edef\pgfPT@@colorlist{\csname pgfPT@backColorsScheme@\cs\endcsname}% diff --git a/graphics/pgf/contrib/pgf-periodictable/pgfPT.buildcell.tex b/graphics/pgf/contrib/pgf-periodictable/pgfPT.buildcell.tex index a9a3699c36..7684834830 100644 --- a/graphics/pgf/contrib/pgf-periodictable/pgfPT.buildcell.tex +++ b/graphics/pgf/contrib/pgf-periodictable/pgfPT.buildcell.tex @@ -38,7 +38,9 @@ \newif\ifpgfPT@dot\pgfPT@dotfalse% \newif\ifpgfPT@unnamedcell\pgfPT@unnamedcelltrue% \newdimen\pgfPT@cell@collumnwd\pgfPT@cell@collumnwd=0pt% +\newdimen\pgfPT@cell@collumnwd@unnamedcell\pgfPT@cell@collumnwd@unnamedcell=0pt% \newdimen\pgfPT@cell@lineht\pgfPT@cell@lineht=0pt% +\newdimen\pgfPT@cell@lineht@unnamedcell\pgfPT@cell@lineht@unnamedcell=0pt% \newdimen\pgfPT@tmpx\pgfPT@tmpx=0pt% \newdimen\pgfPT@tmpy\pgfPT@tmpy=0pt% \newdimen\pgfPT@tmpwd\pgfPT@tmpwd=0pt% @@ -47,10 +49,10 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\pgfPTbuildcellstyle#1(#2,#3)[#4]{\pgfPT@unnamedcellfalse\relax% \pgfPTbuildcell(#2,#3)[#4]% -\expandafter\edef\csname pgfPT@cellcontents@#1\endcsname{\pgfPT@cellcontents}% -\expandafter\edef\csname ppfPT@thebuildcellcom@#1\endcsname{\textbackslash pgfPTbuildcell(\detokenize{#2},\detokenize{#3})\%\par[\detokenize{#4}]}% -\expandafter\edef\csname pgfPT@nlinhas@#1\endcsname{#2}% -\expandafter\edef\csname pgfPT@ncolunas@#1\endcsname{#3}% +\expandafter\xdef\csname pgfPT@cellcontents@#1\endcsname{\pgfPT@cellcontents}% +\expandafter\xdef\csname ppfPT@thebuildcellcom@#1\endcsname{\textbackslash pgfPTbuildcell(\detokenize{#2},\detokenize{#3})\%\par[\detokenize{#4}]}% +\expandafter\xdef\csname pgfPT@nlinhas@#1\endcsname{#2}% +\expandafter\xdef\csname pgfPT@ncolunas@#1\endcsname{#3}% \pgfPT@unnamedcelltrue\relax% }% \def\pgfPT@builtincellstyle#1(#2,#3)[#4]{\pgfPT@unnamedcellfalse\relax% @@ -66,7 +68,8 @@ % \pgfPTbuildcell(<lines>,<columns>)[<entries>] % \def\pgfPTbuildcell(#1,#2)[#3]{% -\ifpgfPT@unnamedcell\gdef\ppfPT@thebuildcellcom{\textbackslash pgfPTbuildcell(\detokenize{#1},\detokenize{#2})\%\par[\detokenize{#3}]}\fi% +\ifpgfPT@unnamedcell\gdef\pgfPT@numlinhas@unnamedcell{#1}\gdef\pgfPT@numcolunas@unnamedcell{#2}% +\gdef\ppfPT@thebuildcellcom{\textbackslash pgfPTbuildcell(\detokenize{#1},\detokenize{#2})\%\par[\detokenize{#3}]}\fi% \gdef\pgfPT@numlinhas{#1}\gdef\pgfPT@numcolunas{#2}% \pgfPT@cellcontentssize=0% \xdef\pgfPT@cellcontents{}% vanishes list contents @@ -74,6 +77,10 @@ \pgfmathsetlength{\pgfPT@cell@lineht}{\pgfPTcellht/#1}% \global\pgfPT@cell@lineht=\pgfPT@cell@lineht% \global\pgfPT@cell@collumnwd=\pgfPT@cell@collumnwd% +\ifpgfPT@unnamedcell% +\global\pgfPT@cell@lineht@unnamedcell=\pgfPT@cell@lineht% +\global\pgfPT@cell@collumnwd@unnamedcell=\pgfPT@cell@collumnwd% +\fi% \expandafter\pgfPTg@bblespaces#3\relax% \@for\@tmp:=\pgfPT@listn@spaces\do{\expandafter\pgfPT@buildcellcontents\@tmp\relax}% \ifpgfPT@unnamedcell\global\let\pgfPT@cellcontents@unnamed\pgfPT@cellcontents\relax\fi% @@ -186,7 +193,7 @@ \@for\pgfPT@tmp:=\pgfPT@builtincells@names\do{\edef\pgfPT@tempb{\pgfPT@tmp}\ifx\pgfPT@tempa\pgfPT@tempb\relax\def\pgfPT@builtin{1}\fi}% \ifnum\pgfPT@builtin=1\relax\textit{Built-in style}\else\textit{User style}\fi\ \textbf{#2}\relax% \if\pgfPT@preview@cellcontents\@empty\relax% -\textit{ doesn't exist!}% +\textit{ doesn't exist!} (\pgfPT@preview@cellcontents)% \else% \edef\pgfPT@numlinhas{\csname pgfPT@nlinhas@#2\endcsname}% \edef\pgfPT@numcolunas{\csname pgfPT@ncolunas@#2\endcsname}% @@ -204,6 +211,8 @@ \\ [2pt]The build command:\\ \textcolor{green!70!black}{\footnotesize\ppfPT@thebuildcellcom}\\ % \else\textbf{Using the last cell built}% \edef\pgfPT@preview@cellcontents{\csname pgfPT@cellcontents@unnamed\endcsname}% +\let\pgfPT@numlinhas\pgfPT@numlinhas@unnamedcell\let\pgfPT@numcolunas\pgfPT@numcolunas@unnamedcell% +\let\pgfPT@cell@lineht\pgfPT@cell@lineht@unnamedcell\let\pgfPT@cell@collumnwd\pgfPT@cell@collumnwd@unnamedcell% \\ [2pt]The build command:\\ \textcolor{green!70!black}{\footnotesize\ppfPT@thebuildcellcom}\\ % \fi\fi% \makebox[\linewidth][c]{% @@ -354,7 +363,7 @@ at (-.5*\pgfPT@cell@collumnwd+\pgfPT@cell@collumnwd*\coluna,\pgfPT@cell@lineht) % wd -> \pgfPT@<what>@wd % ht -> \pgfPT@<what>@ht % and turning the if<what> to true -% what -> \@pgfPT@<what>rtue +% what -> \@pgfPT@<what>true \ifdim\pgfPTcellwd=34pt\relax% \xdef\pgfPT@loadcell@scaleX{1}% \else% diff --git a/graphics/pgf/contrib/pgf-periodictable/pgfPT.drawing.keys.tex b/graphics/pgf/contrib/pgf-periodictable/pgfPT.drawing.keys.tex index 8406d1a9a7..140577bcce 100644 --- a/graphics/pgf/contrib/pgf-periodictable/pgfPT.drawing.keys.tex +++ b/graphics/pgf/contrib/pgf-periodictable/pgfPT.drawing.keys.tex @@ -376,7 +376,7 @@ name color/.store in=\pgfPTnamecolor,% name color/.default=black,% name font/.get=\pgfPTnamefont,% name font/.store in=\pgfPTnamefont,% -name font/.default=\fontseries{l}\selectfont\tiny,% +name font/.default=\tiny,% \fontseries{l}\selectfont (removed @ v2.1.2) name align/.get=\pgfPTnamealign,% new v1.0.0 name align/.store in=\pgfPTnamealign,% left|center|right name align/.default=center% diff --git a/graphics/pgf/contrib/pgf-periodictable/pgfPT.names.tex b/graphics/pgf/contrib/pgf-periodictable/pgfPT.names.tex index 2c321dcd34..d4135f61b9 100644 --- a/graphics/pgf/contrib/pgf-periodictable/pgfPT.names.tex +++ b/graphics/pgf/contrib/pgf-periodictable/pgfPT.names.tex @@ -27,7 +27,7 @@ \def\pgfPT@nomes@iii{l\'{i}tio/pt,lithium/en,lithium/fr,Lithium/de,litio/it,litio/es,l\'{i}tio/br,\pgfPT@user@CSname@Li/user}% \def\pgfPT@nomes@iv{ber\'{i}lio/pt,beryllium/en,b\'{e}ryllium/fr,Beryllium/de,berillio/it,berilio/es,ber\'{i}lio/br,\pgfPT@user@CSname@Be/user}% \def\pgfPT@nomes@v{boro/pt,boron/en,bore/fr,Bor/de,boro/it,boro/es,boro/br,\pgfPT@user@CSname@B/user}% -\def\pgfPT@nomes@vi{carbono/pt,carbon/en,carbone/fr,Kohlenstoff/de,carbonio/it,carb\'{o}n/es,carbono/br,\pgfPT@user@CSname@C/user}% +\def\pgfPT@nomes@vi{carbono/pt,carbon/en,carbone/fr,Kohlenstoff/de,carbonio/it,carbono/es,carbono/br,\pgfPT@user@CSname@C/user}% \def\pgfPT@nomes@vii{azoto/pt,nitrogen/en,azote/fr,Stickstoff/de,azoto/it,nitr\'{o}geno/es,nitrog\^{e}nio/br,\pgfPT@user@CSname@N/user}% \def\pgfPT@nomes@viii{oxig\'{e}nio/pt,oxygen/en,oxyg\`{e}ne/fr,Sauerstoff/de,ossigeno/it,ox\'{i}geno/es,oxig\^{e}nio/br,\pgfPT@user@CSname@O/user}% \def\pgfPT@nomes@ix{fl\'{u}or/pt,fluorine/en,fluor/fr,Fluor/de,fluoro/it,fl\'{u}or/es,fl\'{u}or/br,\pgfPT@user@CSname@F/user}% @@ -47,7 +47,7 @@ \def\pgfPT@nomes@xxiii{van\'{a}dio/pt,vanadium/en,vanadium/fr,Vanadium/de,vanadio/it,vanadio/es,van\'{a}dio/br,\pgfPT@user@CSname@V/user}% \def\pgfPT@nomes@xxiv{cr\'{o}mio/pt,chromium/en,chrome/fr,Chrom/de,cromo/it,cromo/es,cr\^{o}mio/br,\pgfPT@user@CSname@Cr/user}% \def\pgfPT@nomes@xxv{mangan\'{e}sio/pt,manganese/en,mangan\`{e}se/fr,Mangan/de,manganese/it,manganeso/es,mangan\^{e}s/br,\pgfPT@user@CSname@Mn/user}% -\def\pgfPT@nomes@xxvi{ferro/pt,iron/en,fer/fr,Eisen/de,ferro/it,planchar/es,ferro/br,\pgfPT@user@CSname@Fe/user}% +\def\pgfPT@nomes@xxvi{ferro/pt,iron/en,fer/fr,Eisen/de,ferro/it,hierro/es,ferro/br,\pgfPT@user@CSname@Fe/user}% \def\pgfPT@nomes@xxvii{cobalto/pt,cobalt/en,cobalt/fr,Kobalt/de,cobalto/it,cobalto/es,cobalto/br,\pgfPT@user@CSname@Co/user}% \def\pgfPT@nomes@xxviii{n\'{i}quel/pt,nickel/en,nickel/fr,Nickel/de,nichel/it,n\'{i}quel/es,n\'{i}quel/br,\pgfPT@user@CSname@Ni/user}% \def\pgfPT@nomes@xxix{cobre/pt,copper/en,cuivre/fr,Kupfer/de,rame/it,cobre/es,cobre/br,\pgfPT@user@CSname@Cu/user}% @@ -82,7 +82,7 @@ \def\pgfPT@nomes@lviii{c\'{e}rio/pt,cerium/en,c\'{e}rium/fr,Cer/de,cerio/it,cerio/es,c\'{e}rio/br,\pgfPT@user@CSname@Ce/user}% \def\pgfPT@nomes@lix{praseod\'{i}mio/pt,praseodymium/en,pras\'{e}odyme/fr,Praseodym/de,praseodimio/it,praseodimio/es,praseod\'{i}mio/br,\pgfPT@user@CSname@Pr/user}% \def\pgfPT@nomes@lx{neod\'{i}mio/pt,neodymium/en,n\'{e}odyme/fr,Neodym/de,neodimio/it,neodimio/es,neod\'{i}mio/br,\pgfPT@user@CSname@Nd/user}% -\def\pgfPT@nomes@lxi{prom\'{e}cio/pt,promethium/en,prom\'{e}thium/fr,Promethium/de,prometeo/it,prometeo/es,prom\'{e}cio/br,\pgfPT@user@CSname@Pm/user}% +\def\pgfPT@nomes@lxi{prom\'{e}cio/pt,promethium/en,prom\'{e}thium/fr,Promethium/de,prometeo/it,prometio/es,prom\'{e}cio/br,\pgfPT@user@CSname@Pm/user}% \def\pgfPT@nomes@lxii{sam\'{a}rio/pt,samarium/en,samarium/fr,Samarium/de,samario/it,samario/es,sam\'{a}rio/br,\pgfPT@user@CSname@Sm/user}% \def\pgfPT@nomes@lxiii{eur\'{o}pio/pt,europium/en,europium/fr,Europium/de,europium/it,europio/es,eur\'{o}pio/br,\pgfPT@user@CSname@Eu/user}% \def\pgfPT@nomes@lxiv{gadol\'{i}nio/pt,gadolinium/en,gadolinium/fr,Gadolinium/de,gadolinio/it,gadolinio/es,gadol\'{i}nio/br,\pgfPT@user@CSname@Gd/user}% @@ -124,20 +124,20 @@ \def\pgfPT@nomes@c{f\'{e}rmio/pt,fermium/en,fermium/fr,Rermium/de,fermium/it,fermio/es,f\'{e}rmio/br,\pgfPT@user@CSname@Fm/user}% \def\pgfPT@nomes@ci{mendel\'{e}vio/pt,mendelevium/en,mendelevium/fr,Mendelevium/de,mendelevio/it,mendelevio/es,mendel\'{e}vio/br,\pgfPT@user@CSname@Md/user}% \def\pgfPT@nomes@cii{nob\'{e}lio/pt,nobelium/en,nobelium/fr,Nobelium/de,nobelium/it,nobelio/es,nob\'{e}lio/br,\pgfPT@user@CSname@No/user}% -\def\pgfPT@nomes@ciii{laur\^{e}ncio/pt,lawrencium/en,lawrencium/fr,Lawrencium/de,laurenzio/it,lawrencium/es,laur\^{e}ncio/br,\pgfPT@user@CSname@Lr/user}% +\def\pgfPT@nomes@ciii{laur\^{e}ncio/pt,lawrencium/en,lawrencium/fr,Lawrencium/de,laurenzio/it,lawrencio/es,laur\^{e}ncio/br,\pgfPT@user@CSname@Lr/user}% \def\pgfPT@nomes@civ{rutherf\'{o}rdio/pt,rutherfordium/en,rutherfordium/fr,Rutherfordium/de,rutherfordium/it,rutherfordio/es,rutherf\'{o}rdio/br,\pgfPT@user@CSname@Rf/user}% -\def\pgfPT@nomes@cv{d\'{u}bnio/pt,dubnium/en,dubnium/fr,Dubnium/de,dubnio/it,dubnium/es,d\'{u}bnio/br,\pgfPT@user@CSname@Db/user}% +\def\pgfPT@nomes@cv{d\'{u}bnio/pt,dubnium/en,dubnium/fr,Dubnium/de,dubnio/it,dubnio/es,d\'{u}bnio/br,\pgfPT@user@CSname@Db/user}% \def\pgfPT@nomes@cvi{seab\'{o}rgio/pt,seaborgium/en,seaborgium/fr,Seaborgium/de,seaborgio/it,seaborgio/es,seab\'{o}rgio/br,\pgfPT@user@CSname@Sg/user}% -\def\pgfPT@nomes@cvii{b\'{o}rio/pt,bohrium/en,bohrium/fr,Bohrium/de,bohrio/it,bohrium/es,b\'{o}hrio/br,\pgfPT@user@CSname@Bh/user}% -\def\pgfPT@nomes@cviii{h\'{a}ssio/pt,hassium/en,hassium/fr,Hassium/de,hassio/it,hassium/es,h\'{a}ssio/br,\pgfPT@user@CSname@Hs/user}% +\def\pgfPT@nomes@cvii{b\'{o}rio/pt,bohrium/en,bohrium/fr,Bohrium/de,bohrio/it,bohrio/es,b\'{o}hrio/br,\pgfPT@user@CSname@Bh/user}% +\def\pgfPT@nomes@cviii{h\'{a}ssio/pt,hassium/en,hassium/fr,Hassium/de,hassio/it,hasio/es,h\'{a}ssio/br,\pgfPT@user@CSname@Hs/user}% \def\pgfPT@nomes@cix{meitn\'{e}rio/pt,meitnerium/en,meitnerium/fr,Meitnerium/de,meitnerio/it,meitnerio/es,meitn\'{e}rio/br,\pgfPT@user@CSname@Mt/user}% -\def\pgfPT@nomes@cx{darmst\'{a}dio/pt,darmstadtium/en,darmstadtium/fr,Darmstadtium/de,darmstadtium/it,darmstadtium/es,darmst\'{a}dtio/br,\pgfPT@user@CSname@Ds/user}% +\def\pgfPT@nomes@cx{darmst\'{a}dio/pt,darmstadtium/en,darmstadtium/fr,Darmstadtium/de,darmstadtium/it,darmstatio/es,darmst\'{a}dtio/br,\pgfPT@user@CSname@Ds/user}% \def\pgfPT@nomes@cxi{roentg\'{e}nio/pt,roentgenium/en,roentgenium/fr,R\"{o}ntgenium/de,roentgenio/it,roentgenio/es,roentg\^{e}nio/br,\pgfPT@user@CSname@Rg/user}% \def\pgfPT@nomes@cxii{copern\'{i}cio/pt,copernicium/en,copernicium/fr,Copernicium/de,copernicium/it,copernicio/es,copern\'{i}cio/br,\pgfPT@user@CSname@Cn/user}% \def\pgfPT@nomes@cxiii{nip\'{o}nio/pt,nihonium/en,nihonium/fr,Nihonium/de,nihonium/it,nihonio/es,nip\^{o}nio/br,\pgfPT@user@CSname@Nh/user}% \def\pgfPT@nomes@cxiv{fler\'{o}vio/pt,flerovium/en,flerovium/fr,Flerovium/de,flerovio/it,flerovio/es,fler\'{o}vio/br,\pgfPT@user@CSname@Fl/user}% \def\pgfPT@nomes@cxv{mosc\'{o}vio/pt,moscovium/en,moscovium/fr,Moscovium/de,moscovium/it,moscovio/es,mosc\'{o}vio/br,\pgfPT@user@CSname@Mc/user}% -\def\pgfPT@nomes@cxvi{liverm\'{o}rio/pt,livermorium/en,livermorium/fr,Livermorium/de,livermorio/it,livermorium/es,liverm\'{o}rio/br,\pgfPT@user@CSname@Lv/user}% +\def\pgfPT@nomes@cxvi{liverm\'{o}rio/pt,livermorium/en,livermorium/fr,Livermorium/de,livermorio/it,livermorio/es,liverm\'{o}rio/br,\pgfPT@user@CSname@Lv/user}% \def\pgfPT@nomes@cxvii{tenesso/pt,tennessine/en,tennessine/fr,Tenness/de,tennessine/it,teneso/es,tenesso/br,\pgfPT@user@CSname@Ts/user}% \def\pgfPT@nomes@cxviii{ogan\'{e}sson/pt,oganesson/en,oganesson/fr,Oganesson/de,oganesson/it,oganes\'{o}n/es,oganess\^{o}nio/br,\pgfPT@user@CSname@Og/user}% \endinput% diff --git a/graphics/pgf/contrib/pgfornament-han/README.md b/graphics/pgf/contrib/pgfornament-han/README.md index 893666ec52..61d023c759 100644 --- a/graphics/pgf/contrib/pgfornament-han/README.md +++ b/graphics/pgf/contrib/pgfornament-han/README.md @@ -1,17 +1,17 @@ -# pgfornament-han 2023/10/29 -A pgfornament library for Chinese traditional motifs and patterns. +# pgfornament-han 2024/10/22 +A pgfornament library for Chinese traditional motifs and patterns. We also provide three beamer themes namely XiaoShan, HeavenlyClouds and TianQing based on these motifs. With some modifications, these themes can also be used to create posters using the `beamerposter` package; sample .tex files are provided. -以 pgfornament 宏包的机制,实现绘制汉风图纹。在此基础上设计了三款beamer主题:「萧山」(XiaoShan)、「神马浮云」(Heavenly Clouds)、「天青」(TianQing)。 +以 pgfornament 宏包的机制,实现绘制汉风图纹。在此基础上设计了三款beamer主题:「萧山」(XiaoShan)、「神马浮云」(HeavenlyClouds)、「天青」(TianQing),并可略加修改应用在海报设计上。详情请参考范例 .tex 文档。 -# Maintainers 宏包维护 +## Maintainers 宏包维护 LianTze Lim 林莲枝 (liantze@gmail.com) -# Contributors 开发人员 +## Contributors 开发人员 Chennan Zhang (23637935@qq.com) drew the motifs using a CAD application, re-drew them in `TikZ`, and granted permission for these to be turned into a library suitable for use with the `pgfornament` package by LianTze Lim. 所有图纹均由张晨南以 CAD 设计、以TikZ绘制,再由林莲枝转为适用 pgfornament 机制的宏包代码。 -# License +## License 许可协议 [LaTeX Project Public License (LPPL 1.3c)](https://www.latex-project.org/lppl/lppl-1-3c/) diff --git a/graphics/pgf/contrib/pgfornament-han/beamerthemeHeavenlyClouds.sty b/graphics/pgf/contrib/pgfornament-han/beamerthemeHeavenlyClouds.sty index 00bc63cd78..afee91585d 100644 --- a/graphics/pgf/contrib/pgfornament-han/beamerthemeHeavenlyClouds.sty +++ b/graphics/pgf/contrib/pgfornament-han/beamerthemeHeavenlyClouds.sty @@ -1,4 +1,4 @@ -% beamerthemeHeavenlyClouds.sty v1.1.1 2023/10/29 +% beamerthemeHeavenlyClouds.sty v1.2 2024/10/15 % by LianTze Lim (liantze@gmail.com) \ProvidesPackage{beamerthemeHeavenlyClouds} @@ -24,6 +24,7 @@ \renewcommand{\CJKrmdefault}{zhfs} \setbeamerfont{frametitle}{shape=\itshape,family=\lishu,series=\bfseries,size=\LARGE} +\setbeamerfont{framesubtitle}{shape=\itshape,family=\lishu,series=\bfseries,size=\normalsize} % \setbeamercolor{frametitle}{fg=茜色} \setbeamerfont{title}{family=\lishu,series=\bfseries,size=\huge} @@ -66,7 +67,8 @@ } \appto{\maketitle}{\end{minipage}} - +\newcommand{\addheight}{\parbox{0pt}{\rule{0pt}{1.3\ccwd}}} +% \setbeamerfont{block title}{series=\addheight} % \setbeamerfont{block title}{series=\centering} % \addtobeamertemplate{block alerted begin}{}{\centering} % \addtobeamertemplate{block example begin}{}{\centering} @@ -95,25 +97,27 @@ }% } +\newlength{\ShenmaMarkerWidth} +\setlength{\ShenmaMarkerWidth}{2.5em} \AddToHook{begindocument/before}{% \newbox{\clouds@shenma} \savebox{\clouds@shenma}{% \usebeamercolor[fg]{headline}% \tikzset{pgfornamentstyle/.style={line width=0pt}}% - \pgfornamenthan[width=2.5em]{78}% + \pgfornamenthan[width=\ShenmaMarkerWidth]{78}% } } \newcommand{\shenmaprogressmarker}{% \renewcommand{\clouds@progressmarker}{% - \clip (-1.3em,4em) rectangle (\paperwidth,0pt); + \clip (-1.3em,\dimexpr\ht\clouds@shenma + 4em\relax) rectangle (\paperwidth,0pt); \node[anchor=south,inner sep=1pt] at (\clouds@progressinheadfoot,1.25em) {\usebox{\clouds@shenma}}; } }% -\AtBeginDocument{% +\AddToHook{begindocument/before}{% \shenmaprogressmarker \newbox{\clouds@title@deco} \savebox{\clouds@title@deco}{% @@ -130,6 +134,9 @@ \parbox{\dimexpr\clouds@frametitle@actualwidth-5em}{\centering\insertframetitle}% \hfill\raisebox{0.5ex}{\usebox{\clouds@title@deco}}% \end{minipage}\par% + % 2024-10-08 add frame subtitle + \smallskip% + {\centering\usebeamerfont{framesubtitle}\mbox{}\insertframesubtitle\par}% } \newbox{\clouds@smallhuiwen} @@ -151,9 +158,8 @@ \begin{tikzpicture}[decoration={markings, mark=between positions 0 and 1 step 2.5em with { \node[transform shape]{\usebox{\clouds@smallhuiwen}}; }} ] \path [postaction={decorate}] (0,0) -- (\paperwidth,0); - \draw[headline.fg!50,line width=0.6pt] (-1.25em,1.25em) -- (\paperwidth,1.25em); + \draw[headline.fg!50,line width=0.2ex] (-1.25em,1.25em) -- (\paperwidth,1.25em); \clouds@progressmarker - % \fill[headline.fg] (\clouds@progressinheadfoot,1.25em) circle (2pt); %<-- TODO \end{tikzpicture} } } @@ -194,13 +200,17 @@ \pgfmathsetmacro{\myx}{rnd * 0.8} \pgfmathsetmacro{\myy}{rnd * 0.8} \pgfmathtruncatemacro{\myorn}{random(0,1) + #1} + \begingroup + \ifodd \myorn \tikzset{pgfornamentstyle/.append style={line width=1pt]}} \fi \node at (\myx * \paperwidth, \myy * \paperheight) {\pgfornamenthan[ color=normal text.bg!\myintensity!white,symmetry=\myflip,scale=\myscale]{\myorn}}; + \endgroup } +\newcommand{\BackgroundOrns}{\randorn{66}\randorn{68}\randorn{66}\randorn{70}\randorn{68}} \setbeamertemplate{background}{% \begin{tikzpicture} \clip (0,0) rectangle (\paperwidth,\paperheight); - \randorn{66}\randorn{68}\randorn{66}\randorn{70}\randorn{68} + \BackgroundOrns% \end{tikzpicture} } diff --git a/graphics/pgf/contrib/pgfornament-han/beamerthemeTianQing.sty b/graphics/pgf/contrib/pgfornament-han/beamerthemeTianQing.sty index 7d4bdfea49..b612979423 100644 --- a/graphics/pgf/contrib/pgfornament-han/beamerthemeTianQing.sty +++ b/graphics/pgf/contrib/pgfornament-han/beamerthemeTianQing.sty @@ -1,4 +1,4 @@ -% beamerthemeXiaoshan.sty v1.01 2023/10/29 +% beamerthemeXiaoshan.sty v1.02 2024/09/19 % by LianTze Lim (liantze@gmail.com) \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamerthemeTianQing} @@ -35,12 +35,20 @@ \setbeamerfont{section name}{family=\kaishu,size=\Large} \setbeamerfont{section title}{family=\kaishu,size=\huge} \setbeamerfont{section in toc}{family=\kaishu,size=\large} +\setbeamerfont{block title}{family=\kaishu\romankai,series=\bfseries} \setbeamercolor{alerted text}{fg=樱桃色} \setbeamercolor{example text}{fg=绿沉} \setbeamercolor{block title}{fg=宝蓝} \setbeamercolor{mini frame}{bg=天青色} +\newlength{\TQTopDecoWidth} +\newlength{\TQBottomDecoWidth} +\setlength{\TQTopDecoWidth}{.5\paperheight} +\setlength{\TQBottomDecoWidth}{.2\paperheight} +\newcommand{\TQTopDecoOpacity}{.2} +\newcommand{\TQBottomDecoOpacity}{.9} + \AddToHook{begindocument/before}{% \newsavebox{\bulletboxone} \savebox{\bulletboxone}{\usebeamercolor[fg]{structure}\tikz\node[line width=0pt,inner sep=0pt,outer sep=0pt]{\pgfornamenthan[height=1ex]{43}};} @@ -55,12 +63,12 @@ \savebox{\topcornermotif}{% \usebeamercolor{deco outline}% \usebeamercolor{top deco}% - \tikzset{pgfornamentstyle/.style={rotate=30,color=top deco.fg,draw=deco outline.fg,opacity=.2,inner sep=0pt,ultra thick}}\pgfornamenthan[width=.5\paperheight]{64}} + \tikzset{pgfornamentstyle/.style={rotate=30,color=top deco.fg,draw=deco outline.fg,opacity=\TQTopDecoOpacity,inner sep=0pt,ultra thick}}\pgfornamenthan[width=\TQTopDecoWidth]{64}} \newsavebox{\bottomcornermotif} \savebox{\bottomcornermotif}{% \usebeamercolor{structure}% - \tikzset{pgfornamentstyle/.style={color=structure.fg,opacity=.9,inner sep=0pt,very thick}}\pgfornamenthan[width=.2\paperheight,symmetry=v]{74}}% + \tikzset{pgfornamentstyle/.style={color=structure.fg,opacity=\TQBottomDecoOpacity,inner sep=0pt,very thick}}\pgfornamenthan[width=\TQBottomDecoWidth,symmetry=v]{74}}% } \setbeamertemplate{itemize item}{\raisebox{.08\ccwd}{\usebox{\bulletboxone}}} @@ -108,7 +116,7 @@ coltitle = alerted text.fg!70!black, colback = alerted text.bg, halign title = flush center, - fonttitle=\kaishu\romankai\bfseries, + fonttitle=\usebeamerfont{block title alerted}, title = #2, #1 } @@ -128,7 +136,7 @@ coltitle = example text.fg!70!black, colback = example text.bg, halign title = flush center, - fonttitle=\kaishu\romankai\bfseries, + fonttitle=\usebeamerfont{block title example}, title = #2, #1 } @@ -150,7 +158,7 @@ coltitle = block title.fg!70!black, colback = block title.bg, halign title = flush center, - fonttitle=\kaishu\romankai\bfseries, + fonttitle=\usebeamerfont{block title}, title = #2, #1 } diff --git a/graphics/pgf/contrib/pgfornament-han/beamerthemeXiaoshan.sty b/graphics/pgf/contrib/pgfornament-han/beamerthemeXiaoshan.sty index 52daf7b8ad..03800a5a50 100644 --- a/graphics/pgf/contrib/pgfornament-han/beamerthemeXiaoshan.sty +++ b/graphics/pgf/contrib/pgfornament-han/beamerthemeXiaoshan.sty @@ -1,4 +1,4 @@ -% beamerthemeXiaoshan.sty v1.1 2023/04/23 +% beamerthemeXiaoshan.sty v1.2 2024/10/19 % by LianTze Lim (liantze@gmail.com) \ProvidesPackage{beamerthemeXiaoshan} @@ -48,8 +48,9 @@ \linespread{1.0}% \inserttitle% \hspace*{2em}\par% -\vspace*{0.5em} } +% Frankly I have no idea if this is the right way to shove in a framesubtitle for metropolis +\apptocmd{\metropolis@frametitlestrut@end}{\ifx\insertframesubtitle\@empty\else\par\usebeamerfont{framesubtitle}\insertframesubtitle\par\vskip1.5ex\fi}{}{} \setbeamertemplate{subtitle}{ \raggedleft% diff --git a/graphics/pgf/contrib/pgfornament-han/heavenlyclouds-sample.pdf b/graphics/pgf/contrib/pgfornament-han/heavenlyclouds-sample.pdf Binary files differdeleted file mode 100644 index e8a3837826..0000000000 --- a/graphics/pgf/contrib/pgfornament-han/heavenlyclouds-sample.pdf +++ /dev/null diff --git a/graphics/pgf/contrib/pgfornament-han/pgfornament-han-doc.pdf b/graphics/pgf/contrib/pgfornament-han/pgfornament-han-doc.pdf Binary files differindex e2abf948f9..45926eaca9 100644 --- a/graphics/pgf/contrib/pgfornament-han/pgfornament-han-doc.pdf +++ b/graphics/pgf/contrib/pgfornament-han/pgfornament-han-doc.pdf diff --git a/graphics/pgf/contrib/pgfornament-han/pgfornament-han-doc.tex b/graphics/pgf/contrib/pgfornament-han/pgfornament-han-doc.tex index a5c6be5f1c..ffb8e95018 100644 --- a/graphics/pgf/contrib/pgfornament-han/pgfornament-han-doc.tex +++ b/graphics/pgf/contrib/pgfornament-han/pgfornament-han-doc.tex @@ -1,10 +1,8 @@ -% !TEX option = --shell-escape -% !TEX program = xelatex \documentclass[fontset=fandol]{ctexart} - \setmainfont{Linux Libertine O} \setsansfont{Linux Biolinum O} +\usepackage{multicol} \usepackage{ragged2e} \usepackage[svgnames]{xcolor} \usepackage{pgfornament-han} @@ -100,10 +98,11 @@ \fancypagestyle{plain}{\pagestyle{fancy}} \usepackage[colorlinks]{hyperref} +\usepackage{cleveref} \title{汉风图纹 \texttt{pgfornament-han}} \author{林莲枝、张晨南} -\date{2023/10/29\\\url{https://github.com/liantze/pgfornament-han}} +\date{2024/10/22\\\url{https://github.com/liantze/pgfornament-han}} \begin{document} @@ -111,7 +110,7 @@ \begin{abstract} 利用 \texttt{pgfornament} 宏包可以在 \LaTeX{} 文件里便捷地画出十分典雅漂亮的、欧式风格的花纹。(详情请自行访问 \url{http://ctan.org/pkg/pgfornament}) - \texttt{pgfornament-han} 宏包的用意,正是为了尝试用 \texttt{pgfornament} 的已有机制,提供一些汉风的传统图纹。所有图纹均由\emph{张晨南}以 CAD 程式定稿、TikZ 绘制,再由\emph{林莲枝}转为适合 \texttt{pgfornament} 机制使用的宏包代码。 + \texttt{pgfornament-han} 宏包的用意,正是为了尝试用 \texttt{pgfornament} 的已有机制,提供一些汉风的传统图纹。所有图纹均由\emph{张晨南}以 CAD 程式定稿、TikZ 绘制,再由\emph{林莲枝}转为适合 \texttt{pgfornament} 机制使用的宏包代码。我们也基于这些图纹尝试设计了一些beamer幻灯片及海报主题,详见附录\ref{app:beamer-xiaoshan}、\ref{app:beamer-heavenlyclouds}、\ref{app:beamer-tianqing}。 \end{abstract} \part{基本用法} @@ -515,9 +514,10 @@ \appendix \setlength{\parindent}{2\ccwd}\justifying \ctexset{section/name={附录}} -\phantomsection\addcontentsline{toc}{part}{附录} +\phantomsection\label{appendix-start}\addcontentsline{toc}{part}{附录} \section{传统中国颜色 \texttt{cncolours.sty}} +\label{app:cncolours} \begingroup @@ -1955,12 +1955,13 @@ \clearpage \section{萧山 Beamer 主题 Xiaoshan Beamer Theme \texttt{beamerthemeXiaoshan.sty}} +\label{app:beamer-xiaoshan} -这个Beamer主题是以 \href{https://ctan.org/pkg/beamertheme-metropolis}{Metropolis} 为基础,用 \texttt{cncolours.sty} 调了一下颜色,加入少许汉风纹样。 +这个Beamer主题是以 \href{https://ctan.org/pkg/beamertheme-metropolis}{Metropolis} 为基础,用 \texttt{cncolours.sty} 调了一下颜色,加入少许汉风纹样。请参考\texttt{xiaoshan-beamer-sample.tex}示范文档。 \bigskip -\begin{tcblisting}{listing side comment,title={使用范例},pdf comment={xiaoshan-sample.pdf}} +\begin{tcblisting}{listing side comment,title={使用范例},pdf comment={samples/xiaoshan-beamer-sample.pdf}} \documentclass[linespread=1.2,aspectratio=1610]{ctexbeamer} \usetheme{Xiaoshan} @@ -1990,15 +1991,45 @@ 可以自行查阅\href{https://ctan.org/pkg/beamertheme-metropolis}{Metropolis}的详细宏包手册,有很多可客制化的机制,包括各种元素的配色。 +这些设置(以及beamer本身自带的设置参数)经过一些适当更改,也可以配合\texttt{beamerposter}宏包制作学术海报。请参考 \texttt{xiaoshan-poster-sample.tex} 示范文档。 + +\begin{tcblisting}{listing side comment,title={海报范例},image comment={width=\hsize}{samples/xiaoshan-poster-sample.pdf}} +\documentclass[t]{ctexbeamer} +\usepackage[size=a4,orientation=portrait, +scale=1.4]{beamerposter} +\usetheme{Xiaoshan} + +\setbeamertemplate{frame numbering}[none] +\setbeamerfont{frametitle}{series=\mdseries\huge} +% ...以及其它适当改动, +% 详见tianqing-poster.tex + +\title{当萧山beamer主题拿来做海报} +\author{作者甲、作者乙、作者丙} +\begin{document} +\begin{frame} +\frametitle{\insertshorttitle} +\framesubtitle{\insertshortauthor} +\begin{block}{萧山城市图景} + \begin{itemize} + \item 长忆萧然山下县,去秋为客日招邀。 + \item ... + \end{itemize} +\end{block} +\end{frame} +\end{document} +\end{tcblisting} + \clearpage \section{神马浮云 Beamer 主题 Heavenly Clouds Beamer Theme \texttt{beamerthemeHeavenlyClouds.sty}} +\label{app:beamer-heavenlyclouds} -这个Beamer主题是我一次病中摸鱼摸出来的,脑洞略大。每一页的背景的云彩纹样,位置、大小、深浅都是随机的,所以如果内容页数比较多,编译时运算可能会比较花时间,请自行斟酌使用此主题。 +这个Beamer主题是我一次病中摸鱼摸出来的,脑洞略大。请参考\texttt{heavenlyclouds-beamer-sample.tex}示范文档。每一页的背景的云彩纹样,位置、大小、深浅都是随机的,所以如果内容页数比较多,编译时运算可能会比较花时间,请自行斟酌使用此主题。 \bigskip -\begin{tcblisting}{listing side comment,title={使用范例},pdf comment={heavenlyclouds-sample.pdf}} +\begin{tcblisting}{listing side comment,title={使用范例},pdf comment={samples/heavenlyclouds-beamer-sample.pdf}} \documentclass[aspectratio=1610,linespread=1.2]{ctexbeamer} \usetheme{HeavenlyClouds} @@ -2063,17 +2094,51 @@ \end{minted} \end{itemize} +这些设置(以及beamer本身自带的设置参数)经过一些适当更改,也可以配合\texttt{beamerposter}宏包制作学术海报。请参考 \texttt{heavenlyclouds-poster-sample.tex} 示范文档。 + +\begin{tcblisting}{listing side comment,title={海报范例},image comment={width=\hsize}{samples/heavenlyclouds-poster-sample.pdf}} +\documentclass[t,linespread=1.3]{ctexbeamer} +\usepackage[size=a4,orientation=portrait, +scale=1.5]{beamerposter} + +\usetheme{HeavenlyClouds} + +\setbeamerfont{frametitle}{size=\Huge} +\setbeamerfont{framesubtitle}{size=\Large} +\setbeamerfont{headline}{size=\small} +\setbeamerfont{footline}{size=\small} +% ...以及其它适当改动, +% 详见heavenlyclouds-poster-sample.tex + +\title{当神马浮云beamer主题拿来做海报} +\author{作者甲、作者乙、作者丙} +\begin{document} +\begin{frame} +\frametitle{\insertshorttitle} +\framesubtitle{\insertshortauthor} +\begin{block}{套马的汉子你威武雄壮} + \begin{itemize} + \item 飞驰的骏马像疾风一样 + \item ... + \end{itemize} +\end{block} +\end{frame} +\end{document} +\end{tcblisting} + \clearpage + \section{天青 Beamer 主题 Tian Qing Beamer Theme \texttt{beamerthemeTianqing.sty}} +\label{app:beamer-tianqing} -几年前看到一个很喜欢的舞台演出,根据个人印象做的一个Beamer主题。本来想取名「青花瓷」的。不过始终没能力重现出来那种感觉啦,眼高手低,惭愧。 +几年前看到一个\href{https://www.bilibili.com/video/BV1my4y1B7Vx/?p=156}{很喜欢的舞台演出},根据个人印象做的一个Beamer主题。本来想取名「青花瓷」的。不过始终没能力重现出来那种感觉啦,眼高手低,惭愧。请参考\texttt{tianqing-beamer-sample.tex}示范文档。 (话说拿这个模板去做科研学术性报告,真的不会被导师丢出来吗。) \bigskip -\begin{tcblisting}{listing side comment,title={使用范例},pdf comment={tianqing-sample.pdf}} +\begin{tcblisting}{listing side comment,title={使用范例},pdf comment={samples/tianqing-beamer-sample.pdf}} \documentclass[aspectratio=1610,linespread=1.2]{ctexbeamer} \usetheme{TianQing} @@ -2102,7 +2167,8 @@ \mintinline{latex}|\setCJKfamilyfont{zhkai}{Xingkai SC}| -一些可以自己更改的颜色: +\begin{multicols}{2} +\noindent 一些可以自己更改的颜色: \begin{minted}{latex} \setbeamercolor{structure}{fg=墨色} \setbeamercolor{section page}{fg=紫檀} @@ -2112,5 +2178,43 @@ \setbeamercolor{example text}{fg=鸦青} \setbeamercolor{block title}{fg=绀青} \end{minted} +\columnbreak +\noindent 其它一些可以自己更改的设置: +\begin{minted}{latex} +\setlength{\TQTopDecoWidth}{0.7\paperwidth} +\setlength{\TQBottomDecoWidth}{0.2\paperwidth} +\renewcommand{\TQTopDecoOpacity}{0.3} +\renewcommand{\TQBottomDecoOpacity}{0.45} +\end{minted} +\end{multicols} + +这些设置(以及beamer本身自带的设置参数)经过一些适当更改,也可以配合\texttt{beamerposter}宏包制作学术海报。请参考 \texttt{tianqing-poster-sample.tex} 示范文档。 + +\begin{tcblisting}{listing side comment,title={海报范例},image comment={width=\hsize}{samples/tianqing-poster-sample.pdf}} + \documentclass[t,linespread=1.2]{ctexbeamer} + \usepackage[size=a4,orientation=portrait, + scale=1.4]{beamerposter} + \usetheme{TianQing} + + \setbeamerfont{block title}{size=\Large} + \setlength{\TQBottomDecoWidth}{0.2\paperwidth} + % ...以及其它适当改动, + % 详见tianqing-poster-sample.tex + + \title{当天青beamer主题拿来做海报} + \author{作者甲、作者乙、作者丙} + \begin{document} + \begin{frame} + \frametitle{\insertshorttitle} + \framesubtitle{\insertshortauthor} + \begin{block}{天青色等烟雨} + \begin{itemize} + \item 炊烟袅袅升起, 隔江千万里。 + \item ... + \end{itemize} + \end{block} + \end{frame} + \end{document} + \end{tcblisting} \end{document} diff --git a/graphics/pgf/contrib/pgfornament-han/samples/Cloud_types_en.pdf b/graphics/pgf/contrib/pgfornament-han/samples/Cloud_types_en.pdf Binary files differnew file mode 100644 index 0000000000..9d7a641dd4 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/Cloud_types_en.pdf diff --git a/graphics/pgf/contrib/pgfornament-han/samples/SiO2.jpg b/graphics/pgf/contrib/pgfornament-han/samples/SiO2.jpg Binary files differnew file mode 100644 index 0000000000..f62d8acf57 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/SiO2.jpg diff --git a/graphics/pgf/contrib/pgfornament-han/samples/hangzhou-arch.jpg b/graphics/pgf/contrib/pgfornament-han/samples/hangzhou-arch.jpg Binary files differnew file mode 100644 index 0000000000..2303d312c1 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/hangzhou-arch.jpg diff --git a/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-beamer-sample.pdf b/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-beamer-sample.pdf Binary files differnew file mode 100644 index 0000000000..6dbaf406ad --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-beamer-sample.pdf diff --git a/graphics/pgf/contrib/pgfornament-han/heavenlyclouds-sample.tex b/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-beamer-sample.tex index d39932feaa..cdfd80c848 100644 --- a/graphics/pgf/contrib/pgfornament-han/heavenlyclouds-sample.tex +++ b/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-beamer-sample.tex @@ -1,10 +1,10 @@ -% !TEX program=xelatex \documentclass[aspectratio=1610,linespread=1.2]{ctexbeamer} \usetheme{HeavenlyClouds} % Mac 或 Linux 上请自己设定 \lishu!! % \providecommand{\lishu}{\CJKfontspec{Libian SC}[BoldFont=Baoli SC,Scale=1.2]} +% \providecommand{\lishu}{\CJKfontspec{鸿雷板书简体-正式版.otf}[Path=fonts/]} \author{林莲枝} \title{神马浮云\\Beamer主题} @@ -15,13 +15,7 @@ % \alttitlecircle %% 试试取消注释,有惊喜 % \simpleprogressmarker %% 神马太过引人注目的话,可以用简单圆点取代。 - -% \setbeamercolor{structure}{fg=绀青} -% \setbeamercolor{headline}{fg=群青} -% \setbeamercolor{page number in head/foot}{fg=藏青} -% \setbeamercolor{normal text}{bg=淡青} -% \setbeamercolor{alerted text}{fg=正黄} -% \setbeamercolor{example text}{fg=绿沉} +% \setlength{\ShenmaMarkerWidth}{4em} % 可以改变神马的大小 \begin{document} diff --git a/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-poster-sample.pdf b/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-poster-sample.pdf Binary files differnew file mode 100644 index 0000000000..595feef6b6 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-poster-sample.pdf diff --git a/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-poster-sample.tex b/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-poster-sample.tex new file mode 100644 index 0000000000..f28769dde4 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/heavenlyclouds-poster-sample.tex @@ -0,0 +1,128 @@ +\documentclass[t,linespread=1.3]{ctexbeamer} + +\usepackage[size=a4,orientation=portrait,scale=1.5]{beamerposter} + +\usetheme{HeavenlyClouds} +% Mac 或 Linux 上请自己设定 \lishu!! +% \providecommand{\lishu}{\CJKfontspec{Libian SC}[BoldFont=Baoli SC,Scale=1.2]} +% \providecommand{\lishu}{\CJKfontspec{鸿雷板书简体-正式版.otf}[Path=fonts/]} +% 如果实在没有,就用楷书蒙混过关一下…… +% \providecommand{\lishu}{\kaishu} +% 当然也可以替换别的仿宋字体,自己喜欢哈自己喜欢 +% \setCJKfamilyfont{zhfs}{ZhuqueFangsong-Regular.ttf}[Path=fonts/] + +\usepackage[style=gb7714-2015]{biblatex} +\addbibresource{sample-refs.bib} +\usepackage{graphicx} +\usepackage{ccicons} + +% 幻灯片->海报需要的一些改动 +\setbeamerfont{frametitle}{size=\Huge} +\setbeamerfont{framesubtitle}{size=\Large} +\setbeamerfont{block title}{size=\large} +\setbeamerfont{headline}{size=\small} +\setbeamerfont{footline}{size=\small} +\AddToHook{begindocument/before}{% + \addtobeamertemplate{frametitle}{\vskip-1.5ex}{} +} + +% 让神马放大一些 +\setlength{\ShenmaMarkerWidth}{3.5em} +% patch for default scaling, make clouds larger +\patchcmd{\randorn}{rnd * 0.4 + 0.1}{rnd * 0.8 + 0.3}{}{} +% patch for default opacity, make clouds more prominent on poster +\patchcmd{\randorn}{rnd * 20 + 65}{rnd * 45 + 40}{}{} +% when in portrait mode, allow clouds to be higher up +\patchcmd{\randorn}{\pgfmathsetmacro{\myy}{rnd * 0.8}}{\pgfmathsetmacro{\myy}{rnd * 0.95}}{}{} +% and further to the right too; probably more important in landscape form +\patchcmd{\randorn}{\pgfmathsetmacro{\myx}{rnd * 0.8}}{\pgfmathsetmacro{\myx}{rnd * 0.95}}{}{} +% let there be more clouds in the background +\renewcommand{\BackgroundOrns}{% + \randorn{66}\randorn{68}\randorn{66}\randorn{70}\randorn{68}% + \randorn{70}\randorn{68}\randorn{70}\randorn{70}% +} + +\title{当神马浮云beamer主题拿来做海报} +\author{作者甲、作者乙、作者丙} + +\begin{document} +\begin{frame}[fragile] +% ……简单又粗暴的,解决footline里神马的位置的方法,嗯。 +\gdef\inserttotalframenumber{10} +\gdef\insertframenumber{3} + + +% ……懒得折腾了,\frametitle挺好看的,就这样吧【躺平ing +\frametitle{\insertshorttitle} +\framesubtitle{\insertshortauthor} + +\begin{block}{此主题脑洞略大} + + \begin{itemize} + \item 背景的云彩纹样,位置、大小、深浅都是随机的。刷一次不喜欢效果的话就再刷一次碰一下运气吧。 + \item 若觉得进度条上的神马太过引人注(侧)目,可以用 \verb|\simpleprogressmarker| 简单圆点取代。(默认是\verb|\shenmaprogressmarker|)。……但是这是海报啊海报,只用圆点可能真的太没存在感了。 + \end{itemize} + +\end{block} + +\begin{columns}[T] +\column{.45\textwidth} + +\begin{exampleblock}{算了我也不知道在写什么,do you?} + Now solve $x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a}$. 对各位同学来说应该挑战不大。 +\end{exampleblock} + +\begin{alertblock}{算了我也不知道在写什么,do you?} + \[ x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a} \] +\end{alertblock} + +\begin{block}{算了我也不知道在写什么,do you?} + \[ x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a} \] +\end{block} + +% 个人觉得这个主题,多栏之间需要有个间隔。但是高度需要自己调整。 +\column{.01\textwidth} +\textcolor{structure!80}{\rule{.1mm}{.27\textheight}} + +\column{.45\textwidth} + +\begin{block}{套马的汉子你威武雄壮} + + \begin{itemize} + \item 飞驰的骏马像疾风一样 + \item 一望无际的原野随你去流浪 + \item 你的心海和大地一样宽广 + \end{itemize} + + \begin{enumerate} + \item 你是我天边最美的云彩 + \item 让我用心把你留下来 + \end{enumerate} +\end{block} + +\begin{proof} + 显而易见,$1+1=2$. +\end{proof} + +\begin{theorem} + 有一件很美好的事情将要发生,它终会发生。 +\end{theorem} + +\end{columns} + +\begin{block}{云的分类} +This is just a sample sentence with a sample citation\cite{BurroughsCrowder2007}. + +\smallskip +\includegraphics[width=.6\textwidth]{Cloud_types_en}\par +Valentin de Bruyn / Coton. This illustration has been created for Coton, the cloud identification guide for mobile. \ccbysa\ 3.0 via Wikimedia Commons. \url{https://commons.wikimedia.org/wiki/File:Cloud_types_en.svg} +\end{block} + +\vfill + +\begin{block}{\refname} +\printbibliography[heading=none] +\end{block} + +\end{frame} +\end{document} diff --git a/graphics/pgf/contrib/pgfornament-han/samples/sample-refs.bib b/graphics/pgf/contrib/pgfornament-han/samples/sample-refs.bib new file mode 100644 index 0000000000..8875337216 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/sample-refs.bib @@ -0,0 +1,35 @@ +@article{ShaoShen2022, + author = {邵松雪 and 沈海云}, + title = {青花瓷选美记}, + journal = {大学化学}, + year = {2022}, + volume = {37}, + number = {9}, + pages = {2110061}, + doi = {10.3866/PKU.DXHX202110061} +} + +@book{BurroughsCrowder2007, + author = {Burroughs, William James and Crowder, Bob}, + year = {2007}, + title = {Weather}, + publisher = {Fog City Press, San Francisco} +}` + +@article{ChenCai2021, + author = {陈力新 and 蔡磊}, + title = {国土空间治理背景下全域控制性详细规划编制探析——以杭州市萧山区进化镇为例}, + journal = {浙江建筑}, + year = {2021}, + volume = {1}, + pages = {1--4,9} +} + +@article{ZhuEtal2021, + author = {朱鸿寅 and 洪玲笑 and 黄胜兰 and 马俊}, + title = {绿色亚运村,生态未来城——杭州亚运村绿色生态城区实践}, + journal = {建筑节能}, + year = {2021}, + number = {6}, + pages= {10--13} +} diff --git a/graphics/pgf/contrib/pgfornament-han/samples/tianqing-beamer-sample.pdf b/graphics/pgf/contrib/pgfornament-han/samples/tianqing-beamer-sample.pdf Binary files differnew file mode 100644 index 0000000000..8af1fcf099 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/tianqing-beamer-sample.pdf diff --git a/graphics/pgf/contrib/pgfornament-han/tianqing-sample.tex b/graphics/pgf/contrib/pgfornament-han/samples/tianqing-beamer-sample.tex index 70c1b3d938..c26c27850b 100644 --- a/graphics/pgf/contrib/pgfornament-han/tianqing-sample.tex +++ b/graphics/pgf/contrib/pgfornament-han/samples/tianqing-beamer-sample.tex @@ -1,4 +1,3 @@ -% !TEX program=xelatex \documentclass[aspectratio=1610,linespread=1.2]{ctexbeamer} \usetheme{TianQing} % 可以把zhkai更改成自己喜欢的美术字体、书法字体等 @@ -12,9 +11,13 @@ % \setbeamercolor{section page deco}{fg=紫檀} % \setbeamercolor{top deco}{fg=老银} % \setbeamercolor{normal text}{bg=铅白} -% \setbeamercolor{alerted text}{fg=玄色} -% \setbeamercolor{example text}{fg=鸦青} -% \setbeamercolor{block title}{fg=绀青} +% \setbeamercolor{alerted text}{fg=栗色} +% \setbeamercolor{example text}{fg=苍青} +% \setbeamercolor{block title}{fg=靛青} +% \setlength{\TQTopDecoWidth}{0.7\paperwidth} +% \setlength{\TQBottomDecoWidth}{0.2\paperwidth} +% \renewcommand{\TQTopDecoOpacity}{0.3} +% \renewcommand{\TQBottomDecoOpacity}{0.45} \begin{document} diff --git a/graphics/pgf/contrib/pgfornament-han/samples/tianqing-poster-sample.pdf b/graphics/pgf/contrib/pgfornament-han/samples/tianqing-poster-sample.pdf Binary files differnew file mode 100644 index 0000000000..8e7dc0c514 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/tianqing-poster-sample.pdf diff --git a/graphics/pgf/contrib/pgfornament-han/samples/tianqing-poster-sample.tex b/graphics/pgf/contrib/pgfornament-han/samples/tianqing-poster-sample.tex new file mode 100644 index 0000000000..0ef1f20b74 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/tianqing-poster-sample.tex @@ -0,0 +1,131 @@ +\documentclass[t,linespread=1.2]{ctexbeamer} + +\usepackage[size=a4,orientation=portrait,scale=1.4]{beamerposter} + +\usetheme{TianQing} +% 可以把zhkai,zhfs更改成自己喜欢的美术字体、书法字体等 +% \setCJKfamilyfont{zhkai}{STXingkai} % Win有 +% \setCJKfamilyfont{zhkai}{Xingkai SC} % Mac有 +% \setCJKfamilyfont{zhkai}{鸿雷板书简体-正式版.otf}[Path=fonts/] % 自行下载 +% \setCJKfamilyfont{zhfs}{ZhuqueFangsong-Regular.ttf}[Path=fonts/] % 自行下载 + +\usepackage[style=gb7714-2015]{biblatex} +\addbibresource{sample-refs.bib} +\usepackage{chemformula} +\usepackage{qrcode} +\usepackage{graphicx} + +% 幻灯片->海报需要的一些改动 +\setbeamerfont{frametitle}{size=\Huge} +\setbeamerfont{framesubtitle}{size=\large} +\setbeamerfont{block title}{size=\Large} +% 。左上角、右下角的装饰可以酌情调整大小……不然右下真的有点太大 +% (或者要故意保留原大小来充版面也不是不可以哈哈哈 +% \setlength{\TQTopDecoWidth}{0.5\paperwidth} +\setlength{\TQBottomDecoWidth}{0.2\paperwidth} +% \renewcommand{\TQTopDecoOpacity}{0.3} +% \renewcommand{\TQBottomDecoOpacity}{0.45} + +\title{当天青beamer主题拿来做海报} +\author{作者甲、作者乙、作者丙} + +\begin{document} + +\begin{frame} + +% ……懒得折腾了,\frametitle挺好看的,就这样吧【躺平ing +\frametitle{\insertshorttitle} +\framesubtitle{\insertshortauthor} + +\begin{block}{天青色等烟雨} + \begin{itemize} + \item 炊烟袅袅升起, 隔江千万里。 + \begin{itemize} + \item 在瓶底书刻隶仿前朝的飘逸 + \begin{itemize} + \item 就当我为遇见你伏笔 + \end{itemize} + \end{itemize} + \end{itemize} + + \begin{enumerate} + \item 本来这个beamer主题样式,想取名“青花瓷”的。不过始终没能力重现出来那种感觉啦,就算了。 + \item 话说拿这个模板去做科研学术性报告,真的不会被导师丢出来吗。 + \end{enumerate} +\end{block} + +\begin{columns}[T] + \column{.47\textwidth} + + \begin{exampleblock}{算了我也不知道在写什么,do you?} + Now solve $x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a}$. 对各位同学来说应该挑战不大。 + \end{exampleblock} + + \begin{alertblock}{算了我也不知道在写什么,do you?} + \[ x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a} \] + \end{alertblock} + + \begin{block}{算了我也不知道在写什么,do you?} + \[ x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a} \] + \end{block} + + \begin{proof} + 显而易见,$1+1=2$. + \end{proof} + + \begin{theorem} + 有一件很美好的事情将要发生,它终会发生。 + \end{theorem} + + \column{.47\textwidth} + + \begin{block}{青花瓷} + \begin{itemize} + \item 炊烟袅袅升起, 隔江千万里。 + \begin{itemize} + \item 在瓶底书刻隶仿前朝的飘逸 + \begin{itemize} + \item 就当我为遇见你伏笔 + \end{itemize} + \end{itemize} + \end{itemize} + + \begin{enumerate} + \item 本来这个beamer主题样式,想取名“青花瓷”的。不过始终没能力重现出来那种感觉啦,就算了。 + \item 话说拿这个模板去做科研学术性报告,真的不会被导师丢出来吗。 + \item \begin{minipage}[t]{.8\hsize}(其实我当初设计这个beamer主题的印象不完全源自原曲,更多是来自这个片段)\end{minipage}\quad + \raisebox{-.5em}{\structure{\qrcode[height=2\ccwd]{https://www.bilibili.com/video/BV1my4y1B7Vx/?p=156}}} + \end{enumerate} + \end{block} + + 有时不用blocks也挺好的。 + \begin{enumerate} + \item 雨纷纷 旧故里草木深 + \item 我听闻 你始终一个人 + \begin{enumerate} + \item 斑驳的城门 盘踞着老树根 + \begin{enumerate} + \item 石板上回荡的是 再等 + \item 石板上回荡的是 再等 + \end{enumerate} + \end{enumerate} + \end{enumerate} +\end{columns} + +\begin{block}{\ch{SiO2}与\ch{Al2O3}受热变化过程 \cite{ShaoShen2022}} + \Large\centering +\ch{!(高岭石)( Al2O3*2 SiO2*2 H2O ) ->[脱水] !(偏高岭石)( Al2O3 * 2 SiO2 ) ->[加热] !(硅铝尖晶石)( 2 Al2O3 * 3 SiO2 ) ->[加热] !(莫来石)( 3 Al2O3 * 2 SiO2 )} +\end{block} + +\begin{block}{二氧化硅结构及存在形态\cite{ShaoShen2022}} +\centering +\includegraphics[width=.8\textwidth]{SiO2}\par +(1) 二氧化硅(SiO2)结构;(2) 结晶二氧化硅;(3) 无定形二氧化硅 +\end{block} + +\begin{block}[width=.9\textwidth]{\refname} +\printbibliography[heading=none] +\end{block} + +\end{frame} +\end{document} diff --git a/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-beamer-sample.pdf b/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-beamer-sample.pdf Binary files differnew file mode 100644 index 0000000000..b00952c2f9 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-beamer-sample.pdf diff --git a/graphics/pgf/contrib/pgfornament-han/xiaoshan-sample.tex b/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-beamer-sample.tex index 366b5a537a..389a2b781c 100644 --- a/graphics/pgf/contrib/pgfornament-han/xiaoshan-sample.tex +++ b/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-beamer-sample.tex @@ -1,4 +1,3 @@ -% !TEX program = xelatex \documentclass[linespread=1.2,aspectratio=1610]{ctexbeamer} \usetheme{Xiaoshan} diff --git a/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-poster-sample.pdf b/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-poster-sample.pdf Binary files differnew file mode 100644 index 0000000000..41bfa11853 --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-poster-sample.pdf diff --git a/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-poster-sample.tex b/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-poster-sample.tex new file mode 100644 index 0000000000..6e4bbbd95c --- /dev/null +++ b/graphics/pgf/contrib/pgfornament-han/samples/xiaoshan-poster-sample.tex @@ -0,0 +1,111 @@ +\documentclass[t]{ctexbeamer} + +\usepackage[size=a4,orientation=portrait,scale=1.4]{beamerposter} + +\usetheme{Xiaoshan} +\setmonofont{Inconsolata} +\usepackage[style=gb7714-2015]{biblatex} +\addbibresource{sample-refs.bib} +\usepackage{graphicx} + +% 幻灯片->海报需要的一些改动 +\linespread{1.2} % metropolis从\documentclass选项设置不到linespread的 +\setbeamertemplate{frame numbering}[none] +\setbeamerfont{frametitle}{series=\mdseries\huge} +% frankly idk why the additional space is needed on the poster +\makeatletter +\setbeamerfont{framesubtitle}{size=\large\hskip0.25\metropolis@frametitle@padding} +\makeatother +\addtobeamertemplate{block begin}{\large}{\normalsize} +\setbeamerfont{block title}{size=\large} +\addtobeamertemplate{block example begin}{\large}{\normalsize} +\setbeamerfont{block title example}{size=\large} +\addtobeamertemplate{block alerted begin}{\large}{\normalsize} +\setbeamerfont{block title alerted}{size=\large} +\setbeamercolor{bibliography entry note}{fg=block body.fg} + +% adjust itemize/enumerate list indents if necessary +\setlength{\leftmargini}{1em} + + +\urlstyle{tt} + +\title{当萧山beamer主题拿来做海报} +\author{作者甲、作者乙、作者丙} + +\begin{document} + +\begin{frame} + +% ……懒得折腾了,\frametitle挺好看的,就这样吧【躺平ing +\frametitle{\insertshorttitle} +\framesubtitle{\insertshortauthor} + +\begin{block}{萧山城市图景} +\begin{itemize} +\item 绿地宋都·杭州世纪中心是杭州目前规划的最高地标建筑,位于钱江世纪城奥体板块核心位置。 +\item 萧山城市规划的一些相关思考\cite{ChenCai2021,ZhuEtal2021} +\item \textbf{《次韵萧山友人》王祎:} +长忆萧然山下县,去秋为客日招邀。 +夕阳玄度飞轮塔,晓雨文通梦笔桥。 +搜检虫鱼穷《尔雅》,咏歌草木续《离骚》。 +旧游回首成凋谢,莫遣音书似路遥。 +\end{itemize} + +\end{block} + +\smallskip + +\begin{columns}[T] +\column{.45\textwidth} + +\begin{exampleblock}{算了我也不知道在写什么,do you?} + Now solve $x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a}$. 对各位同学来说应该挑战不大。 +\end{exampleblock} + +\begin{alertblock}{算了我也不知道在写什么,do you?} + \[ x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a} \] +\end{alertblock} + +\begin{block}{算了我也不知道在写什么,do you?} + \[ x = \frac{-b \pm \sqrt{b^2 -4ac}}{2a} \] +\end{block} + +% 个人觉得这个主题,多栏之间需要有个间隔。但是高度需要自己调整。 +\column{.01\textwidth} +\textcolor{structure!80}{\rule{.1mm}{.22\textheight}} + +\column{.45\textwidth} +\begin{proof} + 显而易见,$1+1=2$. +\end{proof} + +\begin{theorem} + 有一件很美好的事情将要发生,它终会发生。 +\end{theorem} + +\begin{block}{萧山城市图景} +\begin{itemize} +\item 绿地宋都·杭州世纪中心是杭州目前规划的最高地标建筑,位于钱江世纪城奥体板块核心位置。 +\item 萧山城市规划的一些相关思考\cite{ChenCai2021,ZhuEtal2021} +\end{itemize} +\end{block} + +\end{columns} + +\begin{block}{杭州市萧山奥体绿地宋都·杭州世纪中心} +\smallskip +\centering +\includegraphics[width=\textwidth,clip,trim=0pt 2cm 0pt 8cm,]{hangzhou-arch.jpg}\\ +图来自 \url{https://www.sohu.com/a/717899399_220260} +\end{block} + + +\begin{block}{\refname} +\renewcommand*{\bibfont}{\small\linespread{1}\selectfont} +\setlength{\biblabelsep}{0.25em} +\printbibliography[heading=none] +\end{block} + +\end{frame} +\end{document} diff --git a/graphics/pgf/contrib/pgfornament-han/tianqing-sample.pdf b/graphics/pgf/contrib/pgfornament-han/tianqing-sample.pdf Binary files differdeleted file mode 100644 index 174e0865d0..0000000000 --- a/graphics/pgf/contrib/pgfornament-han/tianqing-sample.pdf +++ /dev/null diff --git a/graphics/pgf/contrib/pgfornament-han/xiaoshan-sample.pdf b/graphics/pgf/contrib/pgfornament-han/xiaoshan-sample.pdf Binary files differdeleted file mode 100644 index 938436b852..0000000000 --- a/graphics/pgf/contrib/pgfornament-han/xiaoshan-sample.pdf +++ /dev/null diff --git a/graphics/pgf/contrib/pgfplotsthemebeamer/DEPENDS.txt b/graphics/pgf/contrib/pgfplotsthemebeamer/DEPENDS.txt new file mode 100644 index 0000000000..1c4fa2d593 --- /dev/null +++ b/graphics/pgf/contrib/pgfplotsthemebeamer/DEPENDS.txt @@ -0,0 +1,3 @@ +hard beamer +hard tools +hard pgfplots
\ No newline at end of file diff --git a/graphics/pgf/contrib/pgfplotsthemebeamer/README.md b/graphics/pgf/contrib/pgfplotsthemebeamer/README.md new file mode 100644 index 0000000000..47c815caaf --- /dev/null +++ b/graphics/pgf/contrib/pgfplotsthemebeamer/README.md @@ -0,0 +1,39 @@ +# pgfplotsthemebeamer + +[![License](https://img.shields.io/github/license/samcarter/pgfplotsthemebeamer.svg?color=blue)](http://www.latex-project.org/lppl.txt) +[![GitHub tag](https://img.shields.io/github/tag/samcarter/pgfplotsthemebeamer.svg?label=current%20version&color=blue)](https://github.com/samcarter/pgfplotsthemebeamer/releases/latest) +[![CTAN](https://img.shields.io/ctan/v/pgfplotsthemebeamer.svg?color=blue)](https://ctan.org/pkg/pgfplotsthemebeamer) + +A package for using colours from the current beamer theme in pgfplots diagrams. + +This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt . + +The project repository, including a bug tracker, can be found at https://github.com/samcarter/pgfplotsthemebeamer/issues . + +### Usage + +```latex +\documentclass{beamer} + +\usetheme{moloch}% just as an example for a colour theme +\usepackage{pgfplotsthemebeamer} + +\begin{document} + +\begin{frame}[plain] +\centering +\begin{tikzpicture} + \begin{axis}[ + beamercolors + ] + \addplot {x}; \addplot {x-1}; \addplot {x-2}; + \addplot {x-3}; \addplot {x-4}; \addplot {x-5}; + \addplot {x-6}; \addplot {x-7}; \addplot {x-8}; + \end{axis} +\end{tikzpicture} +\end{frame} + +\end{document} +``` + +For more details, please consult the [package documentation](https://github.com/samcarter/pgfplotsthemebeamer/blob/main/DOCUMENTATION.pdf). diff --git a/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc-settings.sty b/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc-settings.sty new file mode 100644 index 0000000000..cd57229fcf --- /dev/null +++ b/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc-settings.sty @@ -0,0 +1,200 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Personal helper theme for package documentations +% Copyright samcarter +% +% This file may be distributed and/or modified +% under the LaTeX Project Public License 1.3c or later +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Usage: +% ln ~/Life/latex/beamertheme-sam/themesam.sty package-doc-settings.sty +% \usepackage[ +% themecolor=samdblue +% ]{\jobname-settings} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Colours +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{xcolor} +\definecolor{samyellow}{RGB}{246,193,65} +\definecolor{samorange}{RGB}{241,147,45}% pgfplotsthemebeamer +\definecolor{samred}{RGB}{191,26,46}% TikZbricks +\definecolor{sammagenta}{RGB}{170,42,104}% TikZmarmots +\definecolor{samviolet}{RGB}{136,46,114}% TikZlings +\definecolor{samlila}{RGB}{101,67,159}% Rainbow beamer theme +\definecolor{samdblue}{RGB}{0,51,134}% beamer theme +\definecolor{samlblue}{RGB}{22,89,155}% TikZducks +\definecolor{samteal}{RGB}{25,143,157}% Tcolorbox beamer theme +\definecolor{samlgreen}{RGB}{68,170,153}% Jigsaw +\definecolor{samdgreen}{RGB}{78,178,125} +\definecolor{samlgray}{RGB}{160,160,185} +\definecolor{samdgray}{RGB}{60,60,85} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Package options +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{xkeyval} +\DeclareOptionX{themecolor}[samdblue]{\colorlet{themecolor}{#1}} +\DeclareOptionX{listingcolor}[samlblue]{\colorlet{listingcolor}{#1}} +\ExecuteOptionsX{themecolor,listingcolor} +\ProcessOptionsX + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Packages +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\@ifclassloaded{beamer}{}{% + \RequirePackage[english]{babel} + \RequirePackage[paper=a4paper,margin=2.9cm]{geometry} + \RequirePackage{scrlayer-scrpage} + \let\hrulefillx\hrulefill + \RequirePackage[bitstream-charter]{mathdesign} + \let\hrulefill\hrulefillx + \RequirePackage[hang,flushmargin,bottom]{footmisc} + \RequirePackage{footnotehyper} + \makesavenoteenv{tcolorbox} + \RequirePackage[all]{nowidow} + \RequirePackage[colorlinks=true,breaklinks=true,allcolors=themecolor,hyperfootnotes=false]{hyperref} +} +\RequirePackage[T1]{fontenc} +\RequirePackage{xspace} +\RequirePackage{inconsolata}% mono font with bold, but italic is missing +% \RequirePackage[scale=0.85]{cascadia-code} +% \AddToHook{cmd/ttfamily/before}{\fontseries{sl}} +\RequirePackage{iexec} +\usepackage{synthslant}% to fake slented comments in inconsolata + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Listings +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage[ + cachedir=$TMPDIR/minted/ +]{minted} + +% smuggling custom pygmentize style in cache folder +% (a real pygmentise style would need installtion in some python folder) +\begin{filecontents*}[noheader,overwrite]{./sam.pygstyle} +\makeatletter +\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% + \let\PYG@ul=\relax \let\PYG@tc=\relax% + \let\PYG@bc=\relax \let\PYG@ff=\relax} +\def\PYG@tok#1{\csname PYG@tok@#1\endcsname} +\def\PYG@toks#1+{\ifx\relax#1\empty\else% + \PYG@tok{#1}\expandafter\PYG@toks\fi} +\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% + \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} +\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} + +% optional arguments +\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor{black}{##1}}} + +% macros +\expandafter\def\csname PYG@tok@k\endcsname{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}} +% curly brakets +\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}} + +% comments (italics won't work with the inconsolata font) +\expandafter\def\csname PYG@tok@c\endcsname{\def\PYG@tc##1{\textcolor{gray}{\textsynthslant{##1}}}} + +\def\PYGZbs{\char`\\} +\def\PYGZus{\char`\_} +\def\PYGZob{\char`\{} +\def\PYGZcb{\char`\}} +\def\PYGZca{\char`\^} +\def\PYGZam{\char`\&} +\def\PYGZlt{\char`\<} +\def\PYGZgt{\char`\>} +\def\PYGZsh{\char`\#} +\def\PYGZpc{\char`\%} +\def\PYGZdl{\char`\$} +\def\PYGZhy{\char`\-} +\def\PYGZsq{\char`\'} +\def\PYGZdq{\char`\"} +\def\PYGZti{\char`\~} +% for compatibility with earlier versions +\def\PYGZat{@} +\def\PYGZlb{[} +\def\PYGZrb{]} +\makeatother +\end{filecontents*} + +\iexec{mkdir -p $TMPDIR/minted && mv sam.pygstyle $TMPDIR/minted/.} + +\usemintedstyle{sam} +\setminted{ + breaksymbolleft={}, + tabsize=2, + breaklines=true, +} +\newminted[samcode]{latex}{} +\newmintinline[saminline]{latex}{} + +% use non-bold and all coloured for inline code in articles +\ifdefined\insertaspectratio\else + \patchcmd{\minted@inputpyg@inline}{\minted@input}{\color{listingcolor}\renewcommand\textcolor[3][]{##3}\renewcommand\bfseries{}\minted@input}{}{} +\fi + +\RequirePackage[most]{tcolorbox} +\tcbuselibrary{minted} +\tcbset{% + colframe=themecolor, + fonttitle=\bfseries, + sidebyside, + center lower, + righthand width=5.7cm, + bottom=2pt, + top=2pt, + left=3pt, + right=3pt, + sidebyside gap=10pt, + lower separated=false, + listing engine=minted, + minted language=latex, + colback=themecolor!10, + sharp corners, + boxrule=0pt, + before title={\strut} +} + +% avoid page breaks right in front of the tcolorbox +\@ifclassloaded{beamer}{}{ + \tcbuselibrary{hooks} + \tcbset{before pre={\nopagebreak[4]}} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% document settings +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\@ifclassloaded{scrartcl}{% + \KOMAoptions{parskip=half} + \addtokomafont{sectioning}{\color{themecolor}} + \addtokomafont{date}{\normalsize} + \addtokomafont{author}{\normalsize} + \setlength{\footnotemargin}{0.7em} +}{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Custom macros +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\providecommand*{\CTAN}{\textsc{CTAN}\xspace} +\providecommand*{\TikZ}{Ti\emph{k}Z\xspace} +\providecommand*{\miktex}{MiK\TeX\xspace} +\providecommand*{\texlive}{\TeX{}Live\xspace} +\providecommand*{\tikzbrick}{Ti\emph{k}Zbrick\xspace} +\providecommand*{\tikzducks}{Ti\emph{k}Zducks\xspace} +\providecommand*{\tikzlings}{Ti\emph{k}Zlings\xspace} +\providecommand*{\tikzmarmots}{Ti\emph{k}Zmarmots\xspace} +\providecommand*{\ConTeXt}{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc.pdf b/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc.pdf Binary files differnew file mode 100644 index 0000000000..a312a05245 --- /dev/null +++ b/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc.pdf diff --git a/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc.tex b/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc.tex new file mode 100644 index 0000000000..3beb6c99b6 --- /dev/null +++ b/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer-doc.tex @@ -0,0 +1,119 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Documentation for the pgfplotsthemebeamer package +% Using colours from the current beamer theme in pgfplots +% Maintained by samcarter +% +% Project repository and bug tracker: +% https://github.com/samcarter/pgfplotstheme-beamer +% +% Released under the LaTeX Project Public License v1.3c or later +% See http://www.latex-project.org/lppl.txt +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% !TeX program = txs:///arara +% arara: latexmk: { +% arara: --> engine: pdflatex, +% arara: --> options: [ +% arara: --> '-shell-escape', +% arara: --> '-synctex=1', +% arara: --> '-interaction=nonstopmode', +% arara: --> ] +% arara: --> } +\documentclass{scrartcl} + +% meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\title{The pgfplotsthemebeamer package} +\subtitle{Using colours from the current beamer theme in pgfplots} +\author{% + \texorpdfstring{ + \texttt{samcarter}\\ + \url{https://github.com/samcarter/pgfplotsthemebeamer}\\ + \url{https://ctan.org/pkg/pgfplotsthemebeamer} + }{samcarter}} +\date{Version v0.2 \textendash{} 2024/08/02} + +\usepackage[ + themecolor=samorange +]{\jobname-settings} + +% customisation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\prefix}{./include} +\tcbset{ + compilable listing/.style={listing file={\prefix/\jobname-listing-\thetcblistingcount.tex}}, + run pdflatex/.style={run@system@command={cd\space \prefix;\space pdflatex}{\jobname-listing-\thetcblistingcount.tex}},% +} + +\begin{document} +\maketitle + +\section{Introduction} +\label{intro} + +Beamer themes often use carefully composed colour schemes. The \saminline|pgfplotsthemebeamer| package allows to reuse these colours in diagrams created with \saminline|pfgplots|. This ensures a consistent colour scheme throughout the presentation and avoids unsightly colour clashes. + +The package is included in \TeX{}Live +%and MiK\TeX\ +and available from \textsc{CTAN} (\url{https://www.ctan.org/pkg/pgfplotsthemebeamer}). +The development version of this package is located at \url{https://github.com/samcarter/pgfplotsthemebeamer}. If you have any problems, ideas or other feedback, please make constructive use of the issue tracker. + +Copyright \raisebox{0.2em}{\tiny\fontfamily{cmr}\selectfont\textcopyright} \texttt{samcarter}. Permission is granted to copy, distribute and\slash or modify this software under the terms of the LaTeX project public licence, version 1.3c or later \url{http://www.latex-project.org/lppl.txt}. + +\section{Usage} + +The basic usage is fairly simple. After loading the \saminline|pgfplotsthemebeamer| package, plots can use the \saminline|beamercolor| option to use the colours from the current beamer theme in the diagram: +\begin{tcolorbox}[title={Usage}] +\begin{samcode} +\usepackage{pgfplotsthemebeamer} + +\begin{axis}[ + beamercolors +] +... +\end{axis} +\end{samcode} +\end{tcolorbox} +The graphs will be coloured in the beamer colours \saminline|structure|, \saminline|alerted text| and \saminline|example text|. In most beamer themes, these three colours form an easily distinguishable set of colours. + +Users who would like to use the \saminline|beamercolors| scheme for all \saminline|pgfplots| diagrams in the presentation, can load the package with the \saminline|all| option, which will make this colour scheme the default. +\begin{tcolorbox}[title={Usage}] +\begin{samcode} +\usepackage[all]{pgfplotsthemebeamer} +\end{samcode} +\end{tcolorbox} + +\section{Full example} +\begin{tcblisting}{ + listing only, + freeze pdf, + compilable listing, + run pdflatex, + title={Basic example}, + righthand width=0pt +} +\documentclass{beamer} + +\usetheme{moloch}% just as an example for a colour theme +\usepackage{pgfplotsthemebeamer} + +\begin{document} + +\begin{frame}[plain] +\centering +\begin{tikzpicture} + \begin{axis}[ + beamercolors + ] + \addplot {x}; \addplot {x-1}; \addplot {x-2}; \addplot {x-3}; \addplot {x-4}; \addplot {x-5}; \addplot {x-6}; \addplot {x-7}; \addplot {x-8}; + \end{axis} +\end{tikzpicture} +\end{frame} + +\end{document} +\end{tcblisting} +\vfill +\centering +\setlength{\fboxsep}{0pt}% +\fbox{\includegraphics[width=.75\textwidth]{pgfplotsthemebeamer-doc-listing-1.pdf}}% + +\end{document} diff --git a/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer.sty b/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer.sty new file mode 100644 index 0000000000..23006e89c5 --- /dev/null +++ b/graphics/pgf/contrib/pgfplotsthemebeamer/pgfplotsthemebeamer.sty @@ -0,0 +1,37 @@ +% !TeX root = ./testing/test.tex +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% The pgfplotsthemebeamer package +% Using colours from the current beamer theme in pgfplots +% Maintained by samcarter +% +% Project repository and bug tracker: +% https://github.com/samcarter/pgfplotstheme-beamer +% +% Released under the LaTeX Project Public License v1.3c or later +% See http://www.latex-project.org/lppl.txt +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ProvidesPackage{pgfplotsthemebeamer}[2024/08/02 version v0.2 PGFplots colours based the colours of the current beamer theme] + +% error if used with a class other than beamer +\IfClassLoadedF{beamer}{% + \PackageError{pgfplotsthemebeamer}{This pgfplots theme needs to be used in conjunction with the beamer class}{} +} + +% setting up colours +\RequirePackage{pgfplots} +\pgfplotsset{ + beamercolors/.style={ + cycle multi list={ + mark=*\\mark=x\\mark=square*\\mark=o\\mark=+\\mark=square\\\nextlist + structure.fg\\alerted text.fg\\example text.fg\\ + } + } +} + +% making beamercolors default if package is loaded with `all` option +\DeclareOption{all}{ + \pgfplotsset{beamercolors} +} +\ProcessOptions\relax diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf Binary files differindex 160751afc2..a4bda8a742 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf +++ b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.pdf diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex index ae34054bba..41b1e1a8b0 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex +++ b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-en.tex @@ -45,9 +45,9 @@ \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.4} -\def\TPdate{16/04/2024} - +\def\TPversion{0.1.5} +\def\TPdate{31/10/2024} +\usepackage{minted2} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} \NewTCBListing{PresentationCode}{ O{blue} m }{% @@ -453,6 +453,33 @@ In the following example, the \textit{symbols} to print can't be used for the \t \pagebreak +\subsection{Symbols within list(s)} + +List of symbols can be given within list(s), picked randomly. + +\begin{PresentationCode}{} +\begin{filecontents*}[overwrite]{testlist.csv} +A,B,C,A +A,B,B,C +B,A,C,B +C,A,B,C +\end{filecontents*} + +\textbf{Notice : } + +Multiples of 5 : red\\ +Multiples of 3 : green\\ +Multiples of 2 : blue + +\PixlArtTikz[Codes=ABC,Symbols={5§25§35,3§9§21§27,2§4§8§14§16},Symb,Style=\large\sffamily,Unit=0.85]{testlist.csv} +\hspace{5mm} +\PixlArtTikz[Codes=ABC,Symbols={5§25§35,3§9§21§27,2§4§8§14§16},Symb,Style=\large\sffamily,Unit=0.85]{testlist.csv} +\hspace{5mm} +\PixlArtTikz[Codes=ABC,Colors={red,green,blue},Correction,Style=\large\sffamily,Unit=0.85]{testlist.csv} +\end{PresentationCode} + +\pagebreak + \subsection{Starred macro} The starred macro \texttt{\textbackslash PixlArtTikz*} is to be used within an already created environment. It can be useful for adding code after the PixelArt. @@ -881,6 +908,8 @@ In this paragraph, we use the data \texttt{PAsorciere}, which corresponds to the \part{History} +\verb|v0.1.5|~:~~~~Symbols can be given with list(s) + Enhancements of internal code + \verb|v0.1.4|~:~~~~Anamorphic cylinder PixelArts \verb|v0.1.3|~:~~~~Cut PixelArts within several PixelArts diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf Binary files differindex dba701f59d..1aea924967 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf +++ b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.pdf diff --git a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex index 94e9f30b37..6e5027a355 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex +++ b/graphics/pgf/contrib/pixelarttikz/doc/PixelArtTikz-doc-fr.tex @@ -44,9 +44,10 @@ \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.4} -\def\TPdate{16 avril 2024} +\def\TPversion{0.1.5} +\def\TPdate{31 octobre 2024} +\usepackage{minted2} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} \NewTCBListing{PresentationCode}{ O{blue} m }{% @@ -504,6 +505,35 @@ Dans l'exemple suivant, les \textit{symboles} à afficher ne peuvent pas servir \pagebreak +\subsection{Symboles dans une liste} + +À noter qu'il est possible de donner comme symboles des listes dans lesquelles seront choisies aléatoirement les symboles. + +\begin{PresentationCode}{} +%codes à afficher, avec utiliser des symboles "alétaoires" dans une liste + +\begin{filecontents*}[overwrite]{testlist.csv} +A,B,C,A +A,B,B,C +B,A,C,B +C,A,B,C +\end{filecontents*} + +\textbf{Notice : } + +Multiples de 5 : Rouge\\ +Multiples de 3 : Vert\\ +Multiples de 2 : Bleu + +\PixelArtTikz[Codes=ABC,Symboles={5§25§35,3§9§21§27,2§4§8§14§16},Symb,Style=\large\sffamily,Unite=0.85]{testlist.csv} +\hspace{5mm} +\PixelArtTikz[Codes=ABC,Symboles={5§25§35,3§9§21§27,2§4§8§14§16},Symb,Style=\large\sffamily,Unite=0.85]{testlist.csv} +\hspace{5mm} +\PixelArtTikz[Codes=ABC,Couleurs={red,green,blue},Correction,Style=\large\sffamily,Unite=0.85]{testlist.csv} +\end{PresentationCode} + +\pagebreak + \subsection{Commande étoilée} La commande \textit{étoilée} \texttt{\textbackslash PixelArtTikz*} permet d'intégrer le PixelArt dans un environnement créé par l'utilisateur. Cela permet par exemple de pouvoir rajouter du code en parallèle du PixelArt. @@ -1112,6 +1142,8 @@ Il est également possible de créer le tableau \textit{manuellement}, avec une \part{Historique} +\verb|v0.1.5|~:~~~~Symboles sous forme de liste(s) (éléments tirés aléatoirement) + Amélioration du traitement + \verb|v0.1.4|~:~~~~PixelArts avec anamorphose cylindrique \verb|v0.1.3|~:~~~~Possibilité de créer des PixelArts collaboratifs diff --git a/graphics/pgf/contrib/pixelarttikz/doc/base.csv b/graphics/pgf/contrib/pixelarttikz/doc/base.csv index 6f8d88334b..0b9de46575 100644 --- a/graphics/pgf/contrib/pixelarttikz/doc/base.csv +++ b/graphics/pgf/contrib/pixelarttikz/doc/base.csv @@ -1,4 +1,4 @@ - A,B,C,D - A,B,D,C - B,A,D,C - C,A,B,D +A,B,C,D +A,B,D,C +B,A,D,C +C,A,B,D diff --git a/graphics/pgf/contrib/pixelarttikz/doc/testlist.csv b/graphics/pgf/contrib/pixelarttikz/doc/testlist.csv new file mode 100644 index 0000000000..ab1d24e697 --- /dev/null +++ b/graphics/pgf/contrib/pixelarttikz/doc/testlist.csv @@ -0,0 +1,4 @@ +A,B,C,A +A,B,B,C +B,A,C,B +C,A,B,C diff --git a/graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty b/graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty index 711b0e919a..aacfcb1241 100644 --- a/graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty +++ b/graphics/pgf/contrib/pixelarttikz/tex/PixelArtTikz.sty @@ -2,7 +2,8 @@ % licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{PixelArtTikz}[2024/04/16 v0.1.4 PixelArts with csv and TikZ] +\ProvidesPackage{PixelArtTikz}[2024/10/31 v0.1.5 PixelArts with csv and TikZ] +% 0.1.5 Amélioration du code interne + possibilité de créer des grilles avec des symboles choisis dans une liste % 0.1.4 Cylinder anamorphic pixelart % 0.1.3 Split PA into grid % 0.1.2 Mini pixerlart @@ -23,6 +24,7 @@ \RequirePackage{xstring} \RequirePackage{multicol} \RequirePackage{listofitems} +\RequirePackage{ifthen} %librairies tikz %\usetikzlibrary{calc,shapes.geometric} %cvs @@ -33,6 +35,19 @@ \RequirePackage[l3]{csvsimple} \fi +\NewDocumentCommand\TraiteListeSymbPixelArt{ m }{% + \IfSubStr{#1}{§}% + {% + \setsepchar{§}% + \readlist*\lstPAchoices{#1}% + \xdef\lstPAchoicesrand{\fpeval{randint(1,\lstPAchoiceslen)}}% + \lstPAchoices[\lstPAchoicesrand]% + }% + {%c'est normal + #1% + }% +} + %------clés [fr] / keys [en] \defKV[pixelarttkz]{% Codes=\def\PATlettres{#1},% @@ -60,36 +75,43 @@ \IfBooleanTF{#1}{}{\begin{tikzpicture}[x=\PATunit cm,y=\PATunit cm,#3]} \ifboolKV[pixelarttkz]{Correction}% {% + \readlist*\LCPA\PATcouleurs% \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% \StrDel{\l}{ }[\l]% - \setsepchar{,}% - \readlist*\LCPA\PATcouleurs% + %\setsepchar{,}% + %\readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% - \xintifboolexpr{\pixcnt>0}% - {% - \itemtomacro\LCPA[\pixcnt]\pixcol% - \ifboolKV[pixelarttkz]{BordCases}% - {\draw[fill=\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% - {\filldraw[\pixcol] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% - }% - {}% + \ifnum\pixcnt>0% + \ifboolKV[pixelarttkz]{BordCases}% + {\draw[fill={\LCPA[\pixcnt]}] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + {\filldraw[{\LCPA[\pixcnt]}] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + \fi% + %\xintifboolexpr{\pixcnt>0}% + % {% + % %\itemtomacro\LCPA[\pixcnt]\pixcol% + % \ifboolKV[pixelarttkz]{BordCases}% + % {\draw[fill={\LCPA[\pixcnt]}] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + % {\filldraw[{\LCPA[\pixcnt]}] ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) ;}% + % }% + % {}% }% }% }% }% {% \ifboolKV[pixelarttkz]{Symb}{%affichage du pixelart versions chiffres si besoin + \readlist*\LCNA\PATchiffres% \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% \StrDel{\l}{ }[\l]% - \setsepchar{,}% - \readlist*\LCNA\PATchiffres% + %\setsepchar{,}% + %\readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% \itemtomacro\LCNA[\pixpos]\pixchf% - \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% {}% }% @@ -145,11 +167,12 @@ \begin{tikzpicture}[x=\PATunit cm,y=\PATunit cm,#2] \ifboolKV[pixelarttkz]{Correction}% {% + \readlist*\LCPA\PATcouleurs% \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% \StrDel{\l}{ }[\l]% - \setsepchar{,}% - \readlist*\LCPA\PATcouleursù + %\setsepchar{,}% + %\readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -165,16 +188,17 @@ }% {% \ifboolKV[pixelarttkz]{Symb}{%affichage du pixelart versions chiffres si besoin + \readlist*\LCNA\PATchiffres% \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% \StrDel{\l}{ }[\l]% - \setsepchar{,}% - \readlist*\LCNA\PATchiffres% + %\setsepchar{,}% + %\readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% \itemtomacro\LCNA[\pixpos]\pixchf% - \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% {}% }% @@ -226,11 +250,12 @@ \IfBooleanTF{#1}{}{\begin{tikzpicture}[x=\PATunit cm,y=\PATunit cm,#3]} \ifboolKV[pixelarttkzen]{Correction}% {% + \readlist*\LCPA\PATcouleurs% \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% \StrDel{\l}{ }[\l]% - \setsepchar{,}% - \readlist*\LCPA\PATcouleurs% + %\setsepchar{,}% + %\readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -246,16 +271,17 @@ }% {% \ifboolKV[pixelarttkzen]{Symb}{%affichage du pixelart versions chiffres si besoin + \readlist*\LCNA\PATchiffres% \csvloop{file=#4,no head,command={% \foreach \l [count=\n] in \csvline {% \StrDel{\l}{ }[\l]% - \setsepchar{,}% - \readlist*\LCNA\PATchiffres% + %\setsepchar{,}% + %\readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% \itemtomacro\LCNA[\pixpos]\pixchf% - \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% {}% }% @@ -311,11 +337,12 @@ \begin{tikzpicture}[x=\PATunit cm,y=\PATunit cm,#2] \ifboolKV[pixelarttkzen]{Correction}% {% + \readlist*\LCPA\PATcouleurs% \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% \StrDel{\l}{ }[\l]% - \setsepchar{,}% - \readlist*\LCPA\PATcouleurs% + %\setsepchar{,}% + %\readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -331,16 +358,17 @@ }% {% \ifboolKV[pixelarttkzen]{Symb}{%affichage du pixelart versions chiffres si besoin + \readlist*\LCNA\PATchiffres% \csvloop{file=#3,no head,command={% \foreach \l [count=\n] in \csvline {% \StrDel{\l}{ }[\l]% - \setsepchar{,}% - \readlist*\LCNA\PATchiffres% + %\setsepchar{,}% + %\readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% \itemtomacro\LCNA[\pixpos]\pixchf% - \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% {}% }% @@ -476,13 +504,14 @@ \begin{tikzpicture}[x=\PATunit cm,y=\PATunit cm,#2] \ifboolKV[pixelarttkz]{Correction}% {% + \readlist*\LCPA\PATcouleurs% \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% \foreach \l [count=\n] in \csvline {% \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% {% \StrDel{\l}{ }[\l]% \setsepchar{,}% - \readlist*\LCPA\PATcouleurs% + %\readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -500,18 +529,19 @@ }% {% \ifboolKV[pixelarttkz]{Symb}{%affichage du pixelart versions chiffres si besoin + \readlist*\LCNA\PATchiffres% \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% \foreach \l [count=\n] in \csvline {% \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% {% \StrDel{\l}{ }[\l]% \setsepchar{,}% - \readlist*\LCNA\PATchiffres% + %\readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% \itemtomacro\LCNA[\pixpos]\pixchf% - \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% {}% }% @@ -629,13 +659,14 @@ \begin{tikzpicture}[x=\PATunit cm,y=\PATunit cm,#2] \ifboolKV[pixelarttkzen]{Correction}% {% + \readlist*\LCPA\PATcouleurs% \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% \foreach \l [count=\n] in \csvline {% \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% {% \StrDel{\l}{ }[\l]% \setsepchar{,}% - \readlist*\LCPA\PATcouleurs% + %\readlist*\LCPA\PATcouleurs% \StrPosition{\PATlettres}{\l}[\pixcnt]% \xintifboolexpr{\pixcnt>0}% {% @@ -653,18 +684,19 @@ }% {% \ifboolKV[pixelarttkzen]{Symb}{%affichage du pixelart versions chiffres si besoin + \readlist*\LCNA\PATchiffres% \csvloop{file=#3,range=\PAfirstline-\PAlastline,no head,command={% \foreach \l [count=\n] in \csvline {% \xintifboolexpr{ \n >= (\NbColBloc*(\NumBlocCol-1)+1) 'and' \n <= (\NbColBloc*(\NumBlocCol-1)+\NbColBloc)}% {% \StrDel{\l}{ }[\l]% \setsepchar{,}% - \readlist*\LCNA\PATchiffres% + %\readlist*\LCNA\PATchiffres% \StrPosition{\PATlettres}{\l}[\pixpos]% \xintifboolexpr{\pixpos>0}% {% \itemtomacro\LCNA[\pixpos]\pixchf% - \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\pixchf} ;% + \draw ({\n-0.5},{-\thecsvrow+0.5}) rectangle ({\n+0.5},{-\thecsvrow-0.5}) node[inner sep=0,midway,font=\PATtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% {}% }% @@ -909,10 +941,10 @@ \itemtomacro\LCNA[\pixpos]\pixchf% \ifboolKV[PixelArtCylinder]{Swap}% {% - \draw ({0.5*\CylindAng+(\nnnn-1)*\CylindAng}:{-\AAanamcyllarg+(\thecsvrow-0.5)*\CylindSect}) node[rotate={-90+0.5*\CylindAng+(\nnnn-1)*\CylindAng},font=\PATAAtaille] {\pixchf};% + \draw ({0.5*\CylindAng+(\nnnn-1)*\CylindAng}:{-\AAanamcyllarg+(\thecsvrow-0.5)*\CylindSect}) node[rotate={-90+0.5*\CylindAng+(\nnnn-1)*\CylindAng},font=\PATAAtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% {% - \draw ({0.5*\CylindAng+(\nnnn-1)*\CylindAng}:{-\AAanamcylcenter-(\thecsvrow-0.5)*\CylindSect}) node[rotate={-90+0.5*\CylindAng+(\nnnn-1)*\CylindAng},font=\PATAAtaille] {\pixchf};% + \draw ({0.5*\CylindAng+(\nnnn-1)*\CylindAng}:{-\AAanamcylcenter-(\thecsvrow-0.5)*\CylindSect}) node[rotate={-90+0.5*\CylindAng+(\nnnn-1)*\CylindAng},font=\PATAAtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% }% {% @@ -1002,10 +1034,10 @@ \itemtomacro\LCNA[\pixpos]\pixchf% \ifboolKV[PixlArtCylinder]{Swap}% {% - \draw ({0.5*\CylindAng+(\nnnn-1)*\CylindAng}:{-\AAanamcyllarg+(\thecsvrow-0.5)*\CylindSect}) node[rotate={-90+0.5*\CylindAng+(\nnnn-1)*\CylindAng},font=\PATAAtaille] {\pixchf};% + \draw ({0.5*\CylindAng+(\nnnn-1)*\CylindAng}:{-\AAanamcyllarg+(\thecsvrow-0.5)*\CylindSect}) node[rotate={-90+0.5*\CylindAng+(\nnnn-1)*\CylindAng},font=\PATAAtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% {% - \draw ({0.5*\CylindAng+(\nnnn-1)*\CylindAng}:{-\AAanamcylcenter-(\thecsvrow-0.5)*\CylindSect}) node[rotate={-90+0.5*\CylindAng+(\nnnn-1)*\CylindAng},font=\PATAAtaille] {\pixchf};% + \draw ({0.5*\CylindAng+(\nnnn-1)*\CylindAng}:{-\AAanamcylcenter-(\thecsvrow-0.5)*\CylindSect}) node[rotate={-90+0.5*\CylindAng+(\nnnn-1)*\CylindAng},font=\PATAAtaille] {\TraiteListeSymbPixelArt{\pixchf}} ;% }% }% {% diff --git a/graphics/pgf/contrib/pmdraw/README.md b/graphics/pgf/contrib/pmdraw/README.md index dfc3e2924d..24bdba4e67 100644 --- a/graphics/pgf/contrib/pmdraw/README.md +++ b/graphics/pgf/contrib/pmdraw/README.md @@ -1,12 +1,12 @@ pmdraw ====== -*README V1.4 2024-06-02* +*README V1.5 2024-10-07* <!-- *------------------------------* -|6````````````````````````````5| +|4````````````````````````````1| |`````____````____`````````````| |````|MFMF\ /MFMF|````````````| |````|MF|MF\/MF|MF|````````````| @@ -18,7 +18,7 @@ pmdraw |``````````````|MF|````````````| |``````````````|MF|````````````| |``````````````|MF|````````````| -|4````````````````````````````1| +|5````````````````````````````7| *------------------------------* --> diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.pdf b/graphics/pgf/contrib/pmdraw/pmdraw.pdf Binary files differindex 1cc4de9135..20a7cdf339 100644 --- a/graphics/pgf/contrib/pmdraw/pmdraw.pdf +++ b/graphics/pgf/contrib/pmdraw/pmdraw.pdf diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.sty b/graphics/pgf/contrib/pmdraw/pmdraw.sty index 36f506b51f..9819f84893 100644 --- a/graphics/pgf/contrib/pmdraw/pmdraw.sty +++ b/graphics/pgf/contrib/pmdraw/pmdraw.sty @@ -1,8 +1,8 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{pmdraw}[2024-06-02 v1.4 pmdraw] +\ProvidesPackage{pmdraw}[2024-10-07 v1.5 pmdraw] % *------------------------------* -% |7````````````````````````````4| +% |9````````````````````````````5| % |`````____````____`````````````| % |````|MFMF\ /MFMF|````````````| % |````|MF|MF\/MF|MF|````````````| @@ -14,7 +14,7 @@ % |``````````````|MF|````````````| % |``````````````|MF|````````````| % |``````````````|MF|````````````| -% |3````````````````````````````4| +% |3````````````````````````````1| % *------------------------------* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -840,6 +840,98 @@ \pmdraw@reset% Resets user keys and other flags to default values } +\newcommand{\pmdProductTriple}[6][]{% Draws triple product diagram + % #1 Options + % #2 List of top added edges + % #3 List of bottom added edges + % #4 Top diagram as list of bricks + % #5 Middle diagram as list of bricks + % #6 Bottom diagram as list of bricks + \setkeys{pmdraw@diagram}{#1}% Processes options + \ifmmode% If drawing diagram in a maths equation + \,% Add space + \ifnum\pmdraw@ifGrid=1% If displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=-1.0975cm,show grid=true,apply style/.expand once=\pmdraw@tikz]% + \else% If not displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=-1.0975cm,apply style/.expand once=\pmdraw@tikz]% + \fi% + \pmdraw@hookBeforeDiagram% Hook before drawing diagrams + \pmdraw@AedgesLoop% Commences loop for top added edges to be drawn + #2% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dot + \renewcommand{\pmdraw@ifProdDiag}{1}% Flags that diagram is product + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \pmdraw@bricksLoop% Commences loop for each top brick to be drawn + #4% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifProdDiag}{0}% Resets flag that diagram is product + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep-\pmdraw@vertexSep)}]% Shift coordinates to be underneath top diagram + \pmdraw@AedgesLoop% Commences loop for bottom added edges to be drawn + #3% + \pmdEmpty% Terminates loop + \pmdraw@bricksLoop% Commences loop for each middle brick to be drawn + #5% + \pmdEmpty% Terminates loop + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep-\pmdraw@vertexSep)}]% Shift coordinates to be underneath middle diagram + \pmdraw@bricksLoop% Commences loop for each bottom brick to be drawn + #6% + \pmdEmpty% Terminates loop + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \end{scope}% + \end{scope}% + \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots + \pmdraw@hookAfterDiagram% Hook after drawing diagrams + \end{tikzpicture}% + \,% Add space + \else% If drawing diagram in normal text + \raisebox{2cm}{% Raise diagram so bottom row is on text baseline + \ifnum\pmdraw@ifGrid=1% If displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=-1.095cm,show grid=true,apply style/.expand once=\pmdraw@tikz]% + \else% If not displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=-1.095cm,apply style/.expand once=\pmdraw@tikz]% + \fi% + \pmdraw@hookBeforeDiagram% Hook before drawing diagrams + \pmdraw@AedgesLoop% Commences loop for added edges to be drawn + #2% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dot + \renewcommand{\pmdraw@ifProdDiag}{1}% Flags that diagram is product + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \pmdraw@bricksLoop% Commences loop for each brick to be drawn + #4% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifProdDiag}{0}% Resets flag that diagram is product + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep-\pmdraw@vertexSep)}]% Shift coordinates to be underneath top diagram + \pmdraw@AedgesLoop% Commences loop for bottom added edges to be drawn + #3% + \pmdEmpty% Terminates loop + \pmdraw@bricksLoop% Commences loop for each middle brick to be drawn + #5% + \pmdEmpty% Terminates loop + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep-\pmdraw@vertexSep)}]% Shift coordinates to be underneath middle diagram + \pmdraw@bricksLoop% Commences loop for each bottom brick to be drawn + #6% + \pmdEmpty% Terminates loop + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \end{scope}% + \end{scope}% + \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots + \pmdraw@hookAfterDiagram% Hook after drawing diagrams + \end{tikzpicture}% + }% + \fi% + \pmdraw@reset% Resets user keys and other flags to default values +} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % For loop commands % diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.tex b/graphics/pgf/contrib/pmdraw/pmdraw.tex index b4111bcff2..af516b18e6 100644 --- a/graphics/pgf/contrib/pmdraw/pmdraw.tex +++ b/graphics/pgf/contrib/pmdraw/pmdraw.tex @@ -1,7 +1,7 @@ \documentclass{ltxdoc} % *------------------------------* -% |6````````````````````````````2| +% |2````````````````````````````3| % |`````____````____`````````````| % |````|MFMF\ /MFMF|````````````| % |````|MF|MF\/MF|MF|````````````| @@ -13,7 +13,7 @@ % |``````````````|MF|````````````| % |``````````````|MF|````````````| % |``````````````|MF|````````````| -% |3````````````````````````````0| +% |6````````````````````````````2| % *------------------------------* \usepackage{pmdraw} @@ -26,7 +26,7 @@ \hypersetup{colorlinks, linkcolor=blue, urlcolor=blue} \title{The \textsf{pmdraw} package\thanks{This document - corresponds to \textsf{pmdraw}~v1.4, 2024-06-02.}} + corresponds to \textsf{pmdraw}~v1.5, 2024-10-07.}} \author{Matthias Fresacher \\ \texttt{matthias.ypg37@slmail.me}} \maketitle @@ -86,7 +86,7 @@ The following are a list of currently known bugs that will be addressed: The following are a list of known problems or incompatibilities that are not scheduled to be resolved anytime soon: \begin{enumerate} - \item None at the moment + \item Whilst not strictly an incompatibility, when using \texttt{beamer}, frames have to be \texttt{fragile}. \end{enumerate} \section{Usage} @@ -569,6 +569,221 @@ is a list of bricks that correspond to the bottom diagram, with each brick enclo } \end{center} +\DescribeMacro{\pmdProductTriple} +draws three diagrams on top of each other as is the case during multiplication or concatenation of three diagrams and has the syntax +\begin{verbatim} +\pmdProductTriple[<options>]{<ATedges>}{<ABedges>}{<Tbricks>}}{<Mbricks>}{<Bbricks>} +\end{verbatim} +where +\DescribeMacro{diagram/<options>} +the \texttt{<options>} are described in Section~\ref{sec: diagram/options}. + +\DescribeMacro{<ATedges>}\DescribeMacro{<ABedges>} +is a list of edges that are added during the concatenation process. \texttt{<ATedges>} is the list of edges between the top and middle diagrams, whilst \texttt{<ABedges>} is the list of edges between the middle and bottom diagrams. An added edge has two components, namely \texttt{<ATedges>~=~\{<Svertex>\}\{<Tvertex>\}} and \texttt{<ABedges>~=~\{<Svertex>\}\{<Tvertex>\}}, where \texttt{\{<Svertex>\}} is the starting vertex and \texttt{\{<Tvertex>\}} is the terminating vertex of the collection of added edges. Both \texttt{\{<Svertex>\}} and \texttt{\{<Tvertex>\}} are a \( x \)-coordinate and it is assumed that \( \texttt{\{<Svertex>\}} < \texttt{\{<Tvertex>\}} \). + +\DescribeMacro{<Tbricks>} +is a list of bricks that correspond to the top diagram, with each brick enclosed in curly brackets. + +\DescribeMacro{<Mbricks>} +is a list of bricks that correspond to the top diagram, with each brick enclosed in curly brackets. + +\DescribeMacro{<Bbricks>} +is a list of bricks that correspond to the bottom diagram, with each brick enclosed in curly brackets. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdProductTriple{ % Top added edges + {1}{5} + {7}{8} +}{ % Bottom added edges + {1}{5} + {7}{8} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + } +}{ % Middle diagram + % Continued on next page ... +\end{verbatim} + \end{minipage} + \end{minipage} +\end{center} +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} + % ... continued from previous page (note repeated line) +}{ % Middle diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{3} + {3}{2} + {4}{5} + {5}{4} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{1} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {1}{2} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdProductTriple{ % Top added edges + {1}{5} + {7}{8} +}{ % Bottom added edges + {1}{5} + {7}{8} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + } +}{ % Middle diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{3} + {3}{2} + {4}{5} + {5}{4} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{1} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {1}{2} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{center} + \subsection{Brick options} \label{sec: brick/options} The following are all of the keys that are available for bricks. @@ -1321,7 +1536,7 @@ These flags allow for all of the top or bottom vertices to be hidden using the \ \end{center} \DescribeMacro{vertices top uncover}\DescribeMacro{vertices bottom uncover} -allows for all of the top or bottom vertices to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the vertex drawing macros. This uncover will also apply to the labels of that row (top or bottom) of vertices. To only uncover a selected number of vertices, use seperate bricks. The default is~\texttt{1-}. +allows for all of the top or bottom vertices to be uncovered in a \texttt{beamer} presentation\footnote{Make sure to use a \texttt{fragile} frame.} using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the vertex drawing macros. This uncover will also apply to the labels of that row (top or bottom) of vertices. To only uncover a selected number of vertices, use seperate bricks. The default is~\texttt{1-}. \begin{center} \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} \begin{minipage}[c]{0.4\linewidth} @@ -1712,7 +1927,7 @@ This flag allows for all edges to be hidden using the \texttt{phantom} command. \end{center} \DescribeMacro{edges uncover} -allows for all edges to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. The default is~\texttt{1-}. +allows for all edges to be uncovered in a \texttt{beamer} presentation\footnote{Make sure to use a \texttt{fragile} frame.} using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. The default is~\texttt{1-}. \begin{center} \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} \begin{minipage}[c]{0.4\linewidth} @@ -2283,7 +2498,7 @@ This flag allows for the edge to be hidden using the \texttt{phantom} command. S \end{center} \DescribeMacro{uncover} -allows for that edge to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. This uncover is nested inside the \texttt{edges uncover} and hence the limitations of nested uncovers are present here. For example, an individual edge will not uncover until the \texttt{edges uncover} has been uncovered. In such instances only use individual uncovers for each edge. The default is~\texttt{1-}. +allows for that edge to be uncovered in a \texttt{beamer} presentation\footnote{Make sure to use a \texttt{fragile} frame.} using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. This uncover is nested inside the \texttt{edges uncover} and hence the limitations of nested uncovers are present here. For example, an individual edge will not uncover until the \texttt{edges uncover} has been uncovered. In such instances only use individual uncovers for each edge. The default is~\texttt{1-}. \begin{center} \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} \begin{minipage}[c]{0.4\linewidth} @@ -2589,7 +2804,7 @@ This flag allows for the edge to be hidden using the \texttt{phantom} command. S \end{center} \DescribeMacro{uncover} -allows for that edge to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. This uncover is nested inside the \texttt{edges uncover} and hence the limitations of nested uncovers are present here. For example, an individual edge will not uncover until the \texttt{edges uncover} has been uncovered. In such instances only use individual uncovers for each edge. The default is~\texttt{1-}. +allows for that edge to be uncovered in a \texttt{beamer} presentation\footnote{Make sure to use a \texttt{fragile} frame.} using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. This uncover is nested inside the \texttt{edges uncover} and hence the limitations of nested uncovers are present here. For example, an individual edge will not uncover until the \texttt{edges uncover} has been uncovered. In such instances only use individual uncovers for each edge. The default is~\texttt{1-}. \begin{center} \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} \begin{minipage}[c]{0.4\linewidth} @@ -3203,7 +3418,7 @@ And this is default drawing order for a product diagram: For the drawing order of a brick see Section~\ref{sec: order}. -\subsubsection{For product diagrams only} +\subsubsection{For product diagrams only} \label{sec: prod only} The following options can only be used for product diagrams (\verb`\pmdProduct`). @@ -3554,7 +3769,7 @@ This flag allows for the added edges to be hidden using the \texttt{phantom} com \end{center} \DescribeMacro{edges added uncover} -allows for the added edges to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the added edge drawing macros. The default is~\texttt{1-}. +allows for the added edges to be uncovered in a \texttt{beamer} presentation\footnote{Make sure to use a \texttt{fragile} frame.} using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the added edge drawing macros. The default is~\texttt{1-}. \begin{center} \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} \begin{minipage}[c]{0.4\linewidth} @@ -3661,6 +3876,7 @@ The following are some of the aims for the future for this package: \item Create \texttt{shift} key for edges that shifts horizontal position. \item Decouple the uncover of labels from \texttt{vertices top uncover}/\texttt{vertices bottom uncover}. \item Decouple the phantom of labels from \texttt{vertices top phantom}/\texttt{vertices bottom phantom}. + \item For all of the keys in Section~\ref{sec: prod only}, create a top and bottom version to be used in \texttt{pmdProductTriple}. \end{enumerate} \section{Examples} diff --git a/graphics/pgf/contrib/polyomino/README.md b/graphics/pgf/contrib/polyomino/README.md new file mode 100644 index 0000000000..7f3c8023ad --- /dev/null +++ b/graphics/pgf/contrib/polyomino/README.md @@ -0,0 +1,25 @@ +# `polyomino` + +## Polyominoes using Ti*k*Z and LaTeX3 + +Version 1.0 (2024/08/01) + +This package is based on the package [Ti*k*Z](https://ctan.org/pkg/pgf) and can be used to draw polyominoes. It is possible to define custom styles, pics and grids. + +%% README.md +%% Copyright 2024 Matthias Floré +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Matthias Floré. +% +% This work consists of the files polyomino.pdf, polyomino.sty, +% polyomino.tex and README.md.
\ No newline at end of file diff --git a/graphics/pgf/contrib/polyomino/polyomino.pdf b/graphics/pgf/contrib/polyomino/polyomino.pdf Binary files differnew file mode 100644 index 0000000000..597c00c4db --- /dev/null +++ b/graphics/pgf/contrib/polyomino/polyomino.pdf diff --git a/graphics/pgf/contrib/polyomino/polyomino.sty b/graphics/pgf/contrib/polyomino/polyomino.sty new file mode 100644 index 0000000000..7a85590118 --- /dev/null +++ b/graphics/pgf/contrib/polyomino/polyomino.sty @@ -0,0 +1,286 @@ +%% polyomino.sty +%% Copyright 2024 Matthias Floré +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Matthias Floré. +% +% This work consists of the files polyomino.pdf, polyomino.sty, +% polyomino.tex and README.md. +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{tikz} +\ProvidesExplPackage{polyomino}{2024/08/01}{1.0}{Polyominoes using TikZ and LaTeX3} + +%%> \subsection{Variables and variants} + +\bool_new:N \l__polyomino_grid_bool +\bool_new:N \l__polyomino_pic_bool + +\int_new:N \l__polyomino_col_int +\int_new:N \l__polyomino_dir_int +\int_new:N \l__polyomino_max_int +\int_new:N \l__polyomino_row_int +\int_new:N \l__polyomino_x_int +\int_new:N \l__polyomino_y_int + +\seq_new:N \l__polyomino_add_seq +\seq_new:N \l__polyomino_cols_seq + +\tl_new:N \l__polyomino_path_tl +\tl_new:N \l__polyomino_pic_tl + +\cs_generate_variant:Nn \tl_map_inline:nn { en } + +%%> \subsection{Pgfkeys} + +\pgfkeys + { + / polyomino /. is~family , + / polyomino /. search~also = / polyomino / p_2 , + / polyomino , + at /. initial = { ( 0 , 0 ) } , + empty~cell /. initial = . , + grid /. code = \bool_set:Nn \l__polyomino_grid_bool { \cs:w c_#1_bool \cs_end: } , + grid /. default = true , + grid = false , + grid~style /. style = { grid_style /. style = {#1} } , + grid_style /. style = {} , + row~sep /. initial = { , } , + } + +\pgfkeys + {%a separate key family so that the second argument of the key p only accepts keys which apply to a separate polyomino + / polyomino / p_2 /. is~family , + / polyomino / p_2 , + connected /. code = \bool_set_false:N \l__polyomino_pic_bool , + connected /. value~forbidden , + discrete /. code = \bool_set_true:N \l__polyomino_pic_bool , + discrete /. value~forbidden , + p /. style~2~args = { #1__style /. style = {#2} } ,%2 underscores to avoid the same name as for example the key style_style + pic /. code = + { + \bool_set_true:N \l__polyomino_pic_bool + \tl_set:Nn \l__polyomino_pic_tl {#1} + } , + style /. style = { style_style /. style = {#1} } , + style_style /. style = {} , + } + +%%> \subsection{The command \textbackslash polyomino} + +\NewDocumentCommand \polyomino { O {} m } + { + {%note the double braces {{...}} so that the contents is in a group and in particular, \pgfkeys is applied locally + \pgfkeys { / polyomino , #1 } + \int_zero:N \l__polyomino_col_int + \int_set:Nn \l__polyomino_row_int { 1 } + \seq_clear:N \l__polyomino_cols_seq + \tl_map_inline:en {#2} + %it is convenient that this ignores spaces in #2 + %e argument specifier for the case that #2 is given by a command or contains a command + { + \tl_if_eq:neTF {##1} { \pgfkeysvalueof { / polyomino / row~sep } } + { + \seq_put_right:NV \l__polyomino_cols_seq \l__polyomino_col_int + \int_incr:N \l__polyomino_row_int + \int_zero:N \l__polyomino_col_int + } + { + \int_incr:N \l__polyomino_col_int + \tl_clear_new:c { l__polyomino_\int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int _tl } + \tl_if_eq:neF {##1} { \pgfkeysvalueof { / polyomino / empty~cell } } + { \tl_set:cn { l__polyomino_\int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int _tl } {##1} } + \tl_gclear_new:c { g__polyomino_\int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int _tl } + } + } + \seq_put_right:NV \l__polyomino_cols_seq \l__polyomino_col_int + \int_set:Nn \l__polyomino_max_int { \fp_eval:n { max ( \seq_use:Nn \l__polyomino_cols_seq { , } ) } } + \seq_map_indexed_inline:Nn \l__polyomino_cols_seq + { + \tl_clear_new:c { l__polyomino_##1_0_tl } + \int_step_inline:nnn { ##2 + 1 } { \l__polyomino_max_int + 1 } + { \tl_clear_new:c { l__polyomino_##1_####1_tl } } + } + \int_step_inline:nnn { 0 } { \l__polyomino_max_int + 1 } + { + \tl_clear_new:c { l__polyomino_0_##1_tl } + \tl_clear_new:c { l__polyomino_\int_eval:n { \l__polyomino_row_int + 1 }_##1_tl } + } + \pgfkeys + { + / tikz , + shift /. expanded = { \pgfkeysvalueof { / polyomino / at } } , + shift = { ( 0 , \seq_count:N \l__polyomino_cols_seq ) } + } + \seq_map_indexed_inline:Nn \l__polyomino_cols_seq + { + \int_step_inline:nn {##2} + { + \tl_if_empty:cF { l__polyomino_##1_####1_tl } + { + {%note the double braces {{...}} so that \pgfkeys is applied locally + \pgfkeys { / polyomino / p_2 , \cs:w l__polyomino_##1_####1_tl \cs_end: __style } + \bool_if:NTF \l__polyomino_pic_bool + { \pic [ / polyomino / p_2 / style_style ] at ( ####1 - 0.5 , 0.5 - ##1 ) { code = { \l__polyomino_pic_tl } } ; } + { + \seq_clear:N \l__polyomino_add_seq + \tl_if_eq:ccF { l__polyomino_##1_####1_tl } { l__polyomino_##1_\int_eval:n { ####1 - 1 }_tl } + { + \tl_if_empty:cT { g__polyomino_##1_####1_tl } + { + \int_set:Nn \l__polyomino_dir_int { 1 } + \int_set:Nn \l__polyomino_col_int {####1} + \int_set:Nn \l__polyomino_row_int {##1} + \int_set:Nn \l__polyomino_x_int {####1} + \int_set:Nn \l__polyomino_y_int { 1 - ##1 } + \tl_build_begin:N \l__polyomino_path_tl + \fp_do_until:nn { ####1 - 1 = \l__polyomino_x_int && 1 - ##1 = \l__polyomino_y_int } + { + %concerning \tl_build_put_right:Ne \l__polyomino_path_tl, + %for example (0,0)--(0,1)--(0,2) results in a larger file size than (0,0)--(0,2) + \tl_if_eq:ccTF + { l__polyomino_##1_####1_tl } + { + l__polyomino + _\int_eval:n + { \l__polyomino_row_int + \clist_item:nn { 0 , 1 , 0 , -1 } { \l__polyomino_dir_int } } + _\int_eval:n + { \l__polyomino_col_int + \clist_item:nn { 1 , 0 , -1 , 0 } { \l__polyomino_dir_int } } + _tl + } + { + \tl_if_eq:ccTF + { l__polyomino_##1_####1_tl } + { + l__polyomino + _\int_eval:n + { \l__polyomino_row_int + \clist_item:nn { -1 , 1 , 1 , -1 } { \l__polyomino_dir_int } } + _\int_eval:n + { \l__polyomino_col_int + \clist_item:nn { 1 , 1 , -1 , -1 } { \l__polyomino_dir_int } } + _tl + } + { + \tl_build_put_right:Ne \l__polyomino_path_tl + { -- ( \int_use:N \l__polyomino_x_int , \int_use:N \l__polyomino_y_int ) } + \int_add:Nn \l__polyomino_row_int + { \clist_item:nn { -1 , 1 , 1 , -1 } { \l__polyomino_dir_int } } + \int_add:Nn \l__polyomino_col_int + { \clist_item:nn { 1 , 1 , -1 , -1 } { \l__polyomino_dir_int } } + \int_compare:nNnTF { \l__polyomino_dir_int } = { 1 } + { \int_set:Nn \l__polyomino_dir_int { 4 } } + { \int_decr:N \l__polyomino_dir_int } + } + { + \int_add:Nn \l__polyomino_row_int + { \clist_item:nn { 0 , 1 , 0 , -1 } { \l__polyomino_dir_int } } + \int_add:Nn \l__polyomino_col_int + { \clist_item:nn { 1 , 0 , -1 , 0 } { \l__polyomino_dir_int } } + } + \tl_if_empty:cTF + { g__polyomino_\int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int _tl } + { + \seq_put_right:Ne \l__polyomino_add_seq + { \int_use:N \l__polyomino_row_int _\int_use:N \l__polyomino_col_int } + } + { + \bool_set_true:N \l__polyomino_pic_bool + \int_set:Nn \l__polyomino_x_int { ####1 - 1 } + \int_set:Nn \l__polyomino_y_int { 1 - ##1 } + } + } + { + \tl_build_put_right:Ne \l__polyomino_path_tl + { -- ( \int_use:N \l__polyomino_x_int , \int_use:N \l__polyomino_y_int ) } + \int_compare:nNnTF { \l__polyomino_dir_int } = { 4 } + { \int_set:Nn \l__polyomino_dir_int { 1 } } + { \int_incr:N \l__polyomino_dir_int } + } + \bool_if:NF \l__polyomino_pic_bool + { + \int_add:Nn \l__polyomino_x_int { \clist_item:nn { 1 , 0 , -1 , 0 } { \l__polyomino_dir_int } } + \int_add:Nn \l__polyomino_y_int { \clist_item:nn { 0 , -1 , 0 , 1 } { \l__polyomino_dir_int } } + } + } + \tl_build_end:N \l__polyomino_path_tl + \bool_if:NF \l__polyomino_pic_bool + { \fill [ / polyomino / p_2 / style_style ] ( ####1 - 1 , 1 - ##1 ) \l__polyomino_path_tl -- cycle ; } + } + } + \tl_gset:cn { g__polyomino_##1_####1_tl } { c } + \seq_map_inline:Nn \l__polyomino_add_seq + { \tl_gset:cn { g__polyomino_########1_tl } { c } } + } + } + } + } + } + \bool_if:NT \l__polyomino_grid_bool + { + \int_step_inline:nn { \seq_count:N \l__polyomino_cols_seq - 1 } + { + \int_zero:N \l__polyomino_col_int + \int_zero:N \l__polyomino_x_int + \int_set:Nn \l__polyomino_y_int + { \int_min:nn { \seq_item:Nn \l__polyomino_cols_seq {##1} } { \seq_item:Nn \l__polyomino_cols_seq { ##1 + 1 } } } + \int_while_do:nNnn { \l__polyomino_x_int } < { \l__polyomino_y_int } + { + \bool_do_while:nn + { + \tl_if_eq_p:cc + { l__polyomino_##1_\int_use:N \l__polyomino_x_int _tl } + { l__polyomino_\int_eval:n { ##1 + 1 }_\int_use:N \l__polyomino_x_int _tl } + && + ! \tl_if_empty_p:c { g__polyomino_##1_\int_use:N \l__polyomino_x_int _tl } + && + \int_compare_p:nNn { \l__polyomino_x_int } < { \l__polyomino_y_int + 1 } + } + { \int_incr:N \l__polyomino_x_int } + \int_compare:nNnT { \l__polyomino_x_int } > { \l__polyomino_col_int + 1 } + { + \draw [ / polyomino / grid_style ] + ( \int_use:N \l__polyomino_col_int , -##1 ) -- ( \int_use:N \l__polyomino_x_int - 1 , -##1 ) ; + } + \int_set_eq:NN \l__polyomino_col_int \l__polyomino_x_int + } + } + \int_set:Nn \l__polyomino_x_int { \seq_count:N \l__polyomino_cols_seq } + \int_step_inline:nn { \l__polyomino_max_int - 1 } + { + \int_zero:N \l__polyomino_row_int + \int_zero:N \l__polyomino_y_int + \int_while_do:nNnn { \l__polyomino_y_int } < { \l__polyomino_x_int } + { + \bool_do_while:nn + { + \tl_if_eq_p:cc + { l__polyomino_\int_use:N \l__polyomino_y_int _##1_tl } + { l__polyomino_\int_use:N \l__polyomino_y_int _\int_eval:n { ##1 + 1 }_tl } + && + ! \tl_if_empty_p:c { g__polyomino_\int_use:N \l__polyomino_y_int _##1_tl } + && + \int_compare_p:nNn { \l__polyomino_y_int } < { \l__polyomino_x_int + 1 } + && + \int_compare_p:nNn {##1} < { \seq_item:Nn \l__polyomino_cols_seq { \l__polyomino_y_int } + 0 } + } + { \int_incr:N \l__polyomino_y_int } + \int_compare:nNnT { \l__polyomino_y_int } > { \l__polyomino_row_int + 1 } + { + \draw [ / polyomino / grid_style ] + ( ##1 , -\int_use:N \l__polyomino_row_int ) -- ( ##1 , 1 - \int_use:N \l__polyomino_y_int ) ; + } + \int_set_eq:NN \l__polyomino_row_int \l__polyomino_y_int + } + } + } + } + } + +\endinput
\ No newline at end of file diff --git a/graphics/pgf/contrib/polyomino/polyomino.tex b/graphics/pgf/contrib/polyomino/polyomino.tex new file mode 100644 index 0000000000..c512cec895 --- /dev/null +++ b/graphics/pgf/contrib/polyomino/polyomino.tex @@ -0,0 +1,278 @@ +%% polyomino.tex +%% Copyright 2024 Matthias Floré +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3c +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3c or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Matthias Floré. +% +% This work consists of the files polyomino.pdf, polyomino.sty, +% polyomino.tex and README.md. +\documentclass[a4paper,english,dvipsnames]{ltxdoc} +\usepackage[english]{babel} +\usepackage{graphicx} +\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry} +\usepackage{parskip} +\usepackage{iftex} +\ifluatex +\else +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\fi +\usepackage{mathtools} +\usepackage{amssymb} +\allowdisplaybreaks +\usepackage{pdflscape} +\usepackage{polyomino} +\input{pgfmanual-en-macros.tex} +\usepackage{codehigh} +\usepackage{fancyhdr} +\pagestyle{fancy} +\renewcommand{\headrulewidth}{0pt} +\fancyhead{} +\ExplSyntaxOn +\NewExpandableDocumentCommand \repeatnumber {} + { \prg_replicate:nn { \thepage } { * } } +\ExplSyntaxOff +\fancyfoot[C]{\IfRefUndefinedExpandable{Thesourcecode}{}{\begin{tikzpicture}[scale=0.9] +\polyomino[ + grid, + p={*}{style={teal,draw=black}} +]{\repeatnumber} +\end{tikzpicture}}} +\usepackage[nottoc]{tocbibind} +\usepackage{imakeidx} +\makeindex[program=makeindex,columns=2,intoc=true] +\indexsetup{othercode={\thispagestyle{fancy}}} +\AtEndPreamble{\hypersetup{% +linktoc=all, +pdfstartview=FitH, +colorlinks=true, +linkcolor=Mahogany, +citecolor=ForestGreen, +urlcolor=MidnightBlue, +bookmarksnumbered=true, +pdftitle={The polyomino package}, +pdfauthor={Matthias Floré}, +pdfsubject={Manual}, +pdfkeywords={polyomino}}} +\setcounter{tocdepth}{2} +\setcounter{secnumdepth}{2} +\title{The \texttt{polyomino} package\\[12pt]\large Polyominoes using \tikzname{} and \LaTeX3} +\author{Matthias Floré} +\date{Version 1.0 (2024/08/01)}%\\[12pt] +\begin{document} +\maketitle +\thispagestyle{fancy} +\begin{abstract} +\noindent This package is based on the package |tikz| (see \cite{TtTaPGFp}) and can be used to draw polyominoes. It is possible to define custom styles, pics and grids.% This is the manual for version . +\end{abstract} +\tableofcontents +\section{Usage} +The package |polyomino| can be used by putting the following in the preamble. +\begin{codeexample}[code only] +\usepackage{polyomino} +\end{codeexample} +The package |polyomino| loads the package |tikz|. +\section{The command \textbackslash polyomino} +\begin{command}{\polyomino\opt{\oarg{options}}\marg{polyomino specification}} +This command can be placed inside a |tikzpicture| environment. The \meta{polyomino specification} is a token list. Spaces in this list are ignored. With the initial settings, a |,| starts a new row. Otherwise each element in this list corresponds to a cell. An element can consist of multiple characters by surrounding it with braces. The \meta{options} can be given with the keys described in Section \ref{Keys}. +\begin{codeexample}[width=8cm] +\pgfkeys{ + /polyomino, + p={F}{style={blue,draw=black,ultra thick}}, + p={I}{style={brown,draw=black,ultra thick}}, + p={L}{style={cyan,draw=black,ultra thick}}, + p={N}{style={gray,draw=black,ultra thick}}, + p={P}{style={lime,draw=black,ultra thick}}, + p={T}{style={magenta,draw=black,ultra thick}}, + p={U}{style={olive,draw=black,ultra thick}}, + p={V}{style={orange,draw=black,ultra thick}}, + p={W}{style={pink,draw=black,ultra thick}}, + p={X}{style={purple,draw=black,ultra thick}}, + p={Y}{style={red,draw=black,ultra thick}}, + p={Z}{style={teal,draw=black,ultra thick}} +} +\begin{tikzpicture} +\polyomino[ + grid +]{ + UUUVVV, + UXUZZV, + XXXFZV, + IXFFZZ, + ILLFFT, + ILNTTT, + ILNWWT, + ILNNWW, + PPPNYW, + PPYYYY +} +\end{tikzpicture} +\end{codeexample} +The algorithm constructs the border of each polyomino. It does not consider holes determined by empty cells. Although it does detect a cell inside a polyomino which has a different style. This is illustrated in the example below. +\begin{codeexample}[width=10cm] +\begin{tikzpicture}[scale=0.8] +\polyomino[ + p={a}{style={gray,draw=black,thick}} +]{ + aaaaa, + a.a.a, + aaaaa +} +\polyomino[ + at={(0,-4)}, + p={a}{style={gray,draw=black,thick}}, + p={*}{style={white,draw=black,thick}} +]{ + aaaaa, + a*a*a, + aaaaa +} +\end{tikzpicture} +\end{codeexample} +\end{command} +\section{Keys}\label{Keys} +The keys in this Section can be given as \meta{options} to the command |\polyomino|. + +There are two key families: |/polyomino| and |/polyomino/p_2|. The key family |/polyomino| is intended for usage in documents whereas |/polyomino/p_2| is not. In the key family |/polyomino|, also keys from the key family |/polyomino/p_2| will be looked up. The second argument from the key |p| only accepts keys from the key family |/polyomino/p_2|. +\begin{key}{/polyomino/at=\marg{point} (initially (0,0))} +This key defines the bottom left coordinate of the polyomino. +\end{key} +\begin{key}{/polyomino/p\_2/connected} +This key sets the |pic| type (which is activated by the key |pic|) to false. This is the initial setting. +\end{key} +\begin{key}{/polyomino/p\_2/discrete} +This key sets the |pic| type (which is activated by the key |pic|) to true. +\end{key} +\begin{key}{/polyomino/empty cell=\marg{token list} (initially .)} +A cell corresponding to the \meta{token list} in the \meta{polyomino specification} will be left empty. + +A cell corresponding to the empty token list will always be left empty. +\end{key} +\begin{key}{/polyomino/grid=\opt{\meta{boolean}} (default true, initially false)} +If true then a grid is drawn. The grid does not apply to borders of polyominoes. The style of this grid is determined by the key |grid style|. A grid does not apply to a cell with a |pic|. +\end{key} +\begin{stylekey}{/polyomino/grid style=\marg{options} (initially \normalfont empty)} +This key determines the style of the grid. +\begin{codeexample}[width=6.5cm] +\begin{tikzpicture}[rotate=90] +\polyomino[ + grid, + grid style={gray,dash pattern=on 3mm off 4mm on 3mm off 0mm}, + p={L}{style={darkgray,draw=black}}, + p={P}{style={green,draw=black}}, + p={T}{style={violet,draw=black}}, + p={V}{style={yellow,draw=black}} +]{ + LTVVV, + LTTTV, + LTPPV, + LLPPP +} +\end{tikzpicture} +\end{codeexample} +\end{stylekey} +\begin{stylekey}{/polyomino/p\_2/p=\marg{name}\marg{options} (initially \normalfont empty)} +This key determines the style of the polyomino with \meta{name} in the \meta{polyomino specification}. + +The \meta{options} only accept keys from the key family |/polyomino/p_2|. + +In the example below, the polyominoes have the same shape but are differentiated by using different names. +\begin{codeexample}[width=10cm] +\begin{tikzpicture} +\pgfkeys{ + /polyomino, + p={a}{}, + p={b}{}, + style={fill=none,draw} +} +\def\example{ + aa, + ab, + ab, + bb +} +\polyomino{\example} +\polyomino[ + at={(2,0)} +]{\example} +\end{tikzpicture} +\end{codeexample} +\end{stylekey} +\begin{key}{/polyomino/p\_2/pic=\marg{code}} +The \meta{code} defines the |pic| which is used for each cell of the polyomino. + +A grid does not apply to a cell with a |pic|. +\begin{codeexample}[width=7cm] +\begin{tikzpicture} +\polyomino[ + empty cell=*, + grid, + p={a}{style={red,draw=black}}, + p={b}{style={blue,draw=black}}, + p={c}{style={orange,draw=black}}, + p={circle}{pic={\fill[green] (0,0) circle[radius=0.4];}}, + row sep=; +]{ + {} * * b {} c ; + a a b b {circle} c ; + {circle} a a b c c +} +\end{tikzpicture} +\end{codeexample} +\begin{codeexample}[width=5cm] +\begin{tikzpicture} +\polyomino[ + p={circle}{ + pic={\path[pic actions] (0,0) circle[radius=0.45];}, + style={right color=cyan,left color=red,draw,dashed} + }, + p={L}{ + pic={ + \fill[yellow!80!black] (-0.5,-0.5) rectangle +(1,1); + \fill[yellow!50,rounded corners] (-0.4,-0.4) rectangle +(0.8,0.8); + } + }, + p={square}{ + pic={\path[pic actions] (-0.45,-0.45) rectangle +(0.9,0.9);}, + style={fill=magenta,draw,rounded corners} + } +]{ + L {circle} {square} {square} , + L {circle} {circle} {square} , + L L {circle} {circle} +} +\end{tikzpicture} +\end{codeexample} +\end{key} +\begin{key}{/polyomino/row sep=\marg{token list} (initially ,)} +The \meta{token list} in the \meta{polyomino specification} will start a new row. +\end{key} +\begin{stylekey}{/polyomino/p\_2/style=\marg{options} (initially \normalfont empty)} +This key determines the style of the polyomino. +\end{stylekey} +\begin{thebibliography}{9} +\bibitem{TtTaPGFp} +Till Tantau, +\emph{The \tikzname{} and {\upshape\pgfname} Packages}, +Manual for version 3.1.10, +\url{https://ctan.org/pkg/pgf}, +2023. +\end{thebibliography} +\printindex +\newgeometry{left=2.25cm,right=2.25cm,top=2.25cm,bottom=2.25cm} +\pagestyle{plain} +\appendix +\begin{landscape} +\section{The source code}\label{Thesourcecode} +\dochighinput[language=latex/latex3]{polyomino.sty} +\end{landscape} +\end{document}
\ No newline at end of file diff --git a/graphics/pgf/contrib/prooftrees/README b/graphics/pgf/contrib/prooftrees/README deleted file mode 100644 index 687eddf510..0000000000 --- a/graphics/pgf/contrib/prooftrees/README +++ /dev/null @@ -1,39 +0,0 @@ -%% Copyright 2019 Clea F. Rees -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. -% -% This work has the LPPL maintenance status `maintained'. -% -% The Current Maintainer of this work is Clea F. Rees. -% -% This work consists of all files listed in manifest.txt. - -This package supports drawing tableaux (proof trees) of the kind often used in -introductory logic classes, especially those aimed at students without strong -mathemtical backgrounds. Hodges (1991) is one example of a text which uses -this system. When teaching such a system it is especially useful to annotate -the tree with line numbers, justifications and explanations of branch -closures. - -prooftrees provides a single environment, prooftree, and a variety of tools -for annotating, customising and highlighting such trees. A cross-referencing -system is provided for trees which cite line numbers in justifications for -proof lines or branch closures. - -prooftrees is based on Forest and, hence, TikZ. The package requires version -2.1+ of Forest for expected results and will not work with version 1. - -The author is certain that some of her beliefs are false, but sure that her -belief that prooftrees has bugs is not among them. - -Clea F. Rees -ReesC21 <at> cardiff <dot> ac <dot> uk -2019/09/30 - -vim: set nospell: diff --git a/graphics/pgf/contrib/prooftrees/README.md b/graphics/pgf/contrib/prooftrees/README.md new file mode 100644 index 0000000000..dced983574 --- /dev/null +++ b/graphics/pgf/contrib/prooftrees/README.md @@ -0,0 +1,66 @@ +$Id: README.md 10529 2024-10-25 21:19:36Z cfrees $ + +# prooftrees + +A LaTeX package for drawing logical tableaux. + +## Licence + +Copyright 2016-2024 Clea F. Rees + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3c +of this license or (at your option) any later version. +The latest version of this license is in +https://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of LaTeX +version 2008-05-04 or later. + +This work has the LPPL maintenance status `maintained'. + +The Current Maintainer of this work is Clea F. Rees. + +This file may only be distributed together with a copy of the package +prooftrees. You may however distribute the package prooftrees without +such generated files. + +This work consists of all files listed in manifest.txt. + +## Features + +This package supports drawing tableaux (proof trees) of the kind often used in +introductory logic classes, especially those aimed at students without strong +mathemtical backgrounds. Hodges (1991) is one example of a text which uses +this system. When teaching such a system it is especially useful to annotate +the tree with line numbers, justifications and explanations of branch +closures. + +prooftrees provides a single environment - either prooftree or tableau - and a +variety of tools for annotating, customising and highlighting such trees. A +cross-referencing system is provided for trees which cite line numbers in +justifications for proof lines or branch closures. + +prooftrees is based on Forest and, hence, TikZ. The package requires version +2.1+ of Forest for expected results and will not work with version 1. + +Version 0.9 adds out-of-the-box support for externalisation of tableaux using +memoize. + +## Code Repositories + +Code for the package is hosted at + https://codeberg.org/cfr/prooftrees +For convenience, the repository is mirrored at + https://github.com/cfr42/prooftrees + +## Contact Details + +Bug reports, feature requests etc. should be filed at + https://codeberg.org/cfr/prooftrees/issues + + +Clea F. Rees +Version 0.9 +2024-10-25 + +vim: et:tw=80: diff --git a/graphics/pgf/contrib/prooftrees/manifest.txt b/graphics/pgf/contrib/prooftrees/manifest.txt index e6116e22a9..0890ae8ff5 100644 --- a/graphics/pgf/contrib/prooftrees/manifest.txt +++ b/graphics/pgf/contrib/prooftrees/manifest.txt @@ -1,6 +1,13 @@ -Copyright 2023 Clea F. Rees +# Manifest for prooftrees -This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. +Copyright (C) 2016-2024 Clea F. Rees + +This work may be distributed and/or modified under the conditions of the LaTeX +Project Public License, either version 1.3c of this license or (at your option) +any later version. The latest version of this license is in + https://www.latex-project.org/lppl.txt +and version 1.3 or later is part of all distributions of LaTeX version +2008-05-04 or later. This work has the LPPL maintenance status `maintained'. @@ -8,11 +15,40 @@ The Current Maintainer of this work is Clea F. Rees. This work consists of all files listed in manifest.txt. -prooftrees.sty -prooftrees.tex -prooftrees_biber.bib -manifest.txt -README +This file was automatically generated by `l3build manifest`. + +## Source files + + +### Package files + + +* manifest.txt +* README.md +* prooftrees_biber.bib +* prooftrees.sty +* prooftrees.tex + +### Development files + + +* build.lua +* manifest.lua +* tag.lua +* config-mem.lua +* prooftrees-memoize-t1.lvt +* prooftrees-memoize-t1.tlg +* prooftrees-conflicts-t1.lvt +* prooftrees-egs.lvt +* prooftrees-conflicts-t1.tlg +* prooftrees-egs.luatex.tlg +* prooftrees-egs.pdftex.tlg +* prooftrees-egs.xetex.tlg + + +## Derived files + + +### Typeset documentation -Derived files: -prooftrees.pdf +* prooftrees.pdf diff --git a/graphics/pgf/contrib/prooftrees/prooftrees.pdf b/graphics/pgf/contrib/prooftrees/prooftrees.pdf Binary files differindex 6535d91236..8aaabf2ef9 100644 --- a/graphics/pgf/contrib/prooftrees/prooftrees.pdf +++ b/graphics/pgf/contrib/prooftrees/prooftrees.pdf diff --git a/graphics/pgf/contrib/prooftrees/prooftrees.sty b/graphics/pgf/contrib/prooftrees/prooftrees.sty index c28a6c9688..ea15ae2748 100644 --- a/graphics/pgf/contrib/prooftrees/prooftrees.sty +++ b/graphics/pgf/contrib/prooftrees/prooftrees.sty @@ -1,23 +1,26 @@ -%% Copyright 2020 Clea F. Rees -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. -% -% This work has the LPPL maintenance status `maintained'. -% -% The Current Maintainer of this work is Clea F. Rees. -% -% This work consists of all files listed in manifest.txt. +%% Copyright 2016-2024 Clea F. Rees %% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008-05-04 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Clea F. Rees. +%% +%% This file may only be distributed together with a copy of the package +%% prooftrees. +%% +%% This work consists of all files listed in manifest.txt. +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \RequirePackage{svn-prov} -\ProvidesPackageSVN{$Id: prooftrees.sty 9103 2022-04-02 04:28:09Z cfrees $}[v0.8 \revinfo] -\RequirePackage{etoolbox} +\ProvidesPackageSVN{$Id: prooftrees.sty 10522 2024-10-23 16:31:08Z cfrees $}[v0.9 \revinfo] % define \prooftrees@enw to hold the name of the environment % default is to name the environment prooftree, this ensures backwards compatibility \newcommand*\prooftrees@enw{prooftree} @@ -27,7 +30,12 @@ \DeclareOption{tableau}{\renewcommand*\prooftrees@enw{tableau}} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{forest}} % if \prooftree is not yet defined, set the name to prooftree; otherwise, use tableau to avoid conflict with bussproofs (which uses 'prooftree' rather than 'bussproof' as one might expect) -\ifundef\prooftree{\renewcommand*\prooftrees@enw{prooftree}}{\renewcommand*\prooftrees@enw{tableau}} +\ifcsname prooftree\endcsname + \renewcommand*\prooftrees@enw{tableau}% +\else + \renewcommand*\prooftrees@enw{prooftree}% +\fi +% \ifundef\prooftree{\renewcommand*\prooftrees@enw{prooftree}}{\renewcommand*\prooftrees@enw{tableau}} % let users override the default prooftree in case they need to load bussproofs later \ProcessOptions \RequirePackage{forest}[2016/12/04] @@ -457,7 +465,7 @@ }{}, where={% >{O _O< O &&}{grouped}{1}{level}{proof tree rhifo}% - }{% this searches for certain kinds of structural asymmetry in the tree and attempts to move lines appropriately in such cases - the algorithm is intended to be relatively conservative (not in the sense of 'cautious' or 'safe' but in the sense of 'reflection of the overlapping consensus of reasonable users' / 'what would be rationally agreed behind the prooftrees veil of ignorance'; apologies for the inconvenience if you are an unreasonable user) + }{% this searches for certain kinds of structural asymmetry in the tree and attempts to move lines appropriately in such cases - the algorithm is intended to be relatively conservative (not in the sense of 'cautious' or 'safe' but in the sense of 'reflection of the overlapping consensus of reasonable users' / 'what would be rationally agreed behind the prooftrees veil of ignorance'; however, I should have realised I actually had 'the overlapping concensus of reasonable Beamer users' in mind rather than 'the overlapping consensus of reasonable users', so there is now an option to turn it off;apologies if this comment previously misclassified you as 'unreasonable'; apologies for the inconvenience if you are an unreasonable user) not tempboola, for root/.process={Ow1}{level}{% for level={##1}{% @@ -867,9 +875,9 @@ }, }, } -\environbodyname\prooftreebody +% \environbodyname\prooftreebody \bracketset{action character=@} -\NewEnviron{\prooftrees@enw}[1]{% \forest/\endforest from egreg's answer at http://tex.stackexchange.com/a/229608/ +\NewDocumentEnvironment{\prooftrees@enw}{ m +b }{% \forest/\endforest from egreg's answer at http://tex.stackexchange.com/a/229608/ \forest (% stages={% customised definition of stages - we don't use any custom stages, but we do use several custom keylists, where the processing order of these is critical @@ -896,7 +904,26 @@ )% proof tree,% apply the proof tree style, which sets keylists from both forest's defaults and our custom additions #1,% insert user's preamble, empty or otherwise - this allows the user both to override our defaults (e.g. by setting a non-empty proof statement or a custom format for line numbers) and to customise the tree using forest's facilities in the usual way - BUT customisations of the latter kind may or may not be effective, may or may not have undesirable - not to say chaotic - consequences, and may or may not cause compilation failures (structural changes, in particular, should be avoided completely) - [, name=proof statement @\prooftreebody]% - \endforest} + [, name=proof statement @#2]% + \endforest +}{} + +\ExplSyntaxOn +\cs_new_protected_nopar:Npn \__prooftrees_memoize:n #1 +{ + \mmzset{ + auto = { #1 } { memoize }, + } +} +\cs_generate_variant:Nn \__prooftrees_memoize:n { V } +\hook_gput_code:nnn { begindocument / before } { . } +{% paid â memoize bussproofs prooftree ... + \@ifpackageloaded{memoize}{ + \__prooftrees_memoize:V \prooftrees@enw + }{} +} +\ExplSyntaxOff + \endinput %% end prooftrees.sty + diff --git a/graphics/pgf/contrib/prooftrees/prooftrees.tex b/graphics/pgf/contrib/prooftrees/prooftrees.tex index 0b479838f9..2f9250201f 100644 --- a/graphics/pgf/contrib/prooftrees/prooftrees.tex +++ b/graphics/pgf/contrib/prooftrees/prooftrees.tex @@ -1,26 +1,36 @@ -%% Copyright 2023 Clea F. Rees -% -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. -% -% This work has the LPPL maintenance status `maintained'. -% -% The Current Maintainer of this work is Clea F. Rees. -% -% This work consists of all files listed in manifest.txt. +\iffalse +%% Copyright 2016-2024 Clea F. Rees %% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008-05-04 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Clea F. Rees. +%% +%% This file may only be distributed together with a copy of the package +%% prooftrees. +%% +%% This work consists of all files listed in manifest.txt. +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% arara: pdflatex: { synctex: true, shell: false } +% arara: biber +% arara: makeindex +% arara: pdflatex: { synctex: true, shell: false } % arara: pdflatex: { synctex: true, shell: false } % biber --output_format=bibtex --output_resolve prooftrees.bcf to generate .bib for upload % sed -i '/1977/s/DATE/YEAR' -%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\fi \pdfminorversion=7 \RequirePackage{svn-prov} -\ProvidesFileSVN{$Id: prooftrees.tex 9582 2023-06-18 01:00:05Z cfrees $}[v0.8 \revinfo] +\ProvidesFileSVN{$Id: prooftrees.tex 10525 2024-10-24 06:31:34Z cfrees $}[v0.9 \revinfo] \GetFileInfoSVN* \let\prooftreesdocversion\fileversion \let\prooftreesdocbase\filebase @@ -28,8 +38,30 @@ \let\prooftreesdocdate\filedate % BEGIN preamble \documentclass[10pt,british,a4paper,doc2]{ltxdoc} -\usepackage{babel,geometry,pageslts,fancyhdr,enumitem} -\usepackage[utf8]{inputenc} +\usepackage[extract=python]{memoize} +\mmzset{% + prefix={memos/}, + include context in ccmemo, + auto=\cref{multiref}, + auto=\Cref{multiref}, + auto=\labelcref{multiref}, + auto=\cpageref{multiref}, + auto=\labelcpageref{multiref}, + auto=\namecref{ref}, + auto=\nameCref{ref}, + auto=\namecrefs{ref}, + auto=\nameCrefs{ref}, + auto=\lcnamecrefs{ref}, + auto=\lcnamecrefs{ref}, + auto=\crefrange{refrange}, + auto=\cpagerefrange{refrange}, + auto=\Cpagerefrange{refrange}, + mkdir, +} +% \CodelineIndex +% \RecordChanges +% \EnableCrossrefs +\usepackage{babel,geometry,fancyhdr,enumitem} \usepackage{csquotes} \MakeAutoQuote{‘}{’} \MakeAutoQuote*{“}{”} @@ -41,7 +73,7 @@ \bibliography{prooftrees_biber.bib}% generate for upload (gweler uchod) \usepackage{etoolbox,verbatim,parskip,changepage,titling,makeidx} \usepackage[dvipsnames,svgnames,rgb,x11names]{xcolor} -\usepackage{prooftrees} +\usepackage[tableaux]{prooftrees} \usepackage{mathtools,turnstile,pifont} \newcommand*{\fycheck}{\text{\ding{52}}} \newcommand*{\fycross}{\text{\ding{56}}} @@ -60,7 +92,12 @@ }, } \usepackage{tcolorbox} -\tcbuselibrary{listings,xparse,breakable}% if you use skins, you need to disable externalisation for boxes which use the relevant options - gweler nodiadau/tex/tex.se/tcolorbox-coursepacket-exp.tex +\tcbuselibrary{listingsutf8}% if you use skins, you need to disable externalisation for boxes which use the relevant options - gweler nodiadau/tex/tex.se/tcolorbox-coursepacket-exp.tex +%%%%%%%%%%%%%%%% +% Sašo Živanović: https://github.com/sasozivanovic/memoize/issues/31#issuecomment-2424700001 +\csappto{tcb@shield@@externalize}{\ifdefined\memoizefalse\memoizefalse\fi} +\tcbset{shield externalize} +%%%%%%%%%%%%%%%% \usepackage[% loadHyperref=true, createIndexEntries=false, @@ -83,7 +120,7 @@ \raggedleft\PrintDescribeMacro{#1}\par \PrintLabelName[\macrolabelfont]{\macrolabelname}% }% - \expandafter\prooftrees@index{\macrolabelname}{\protect\verb \protect #1}\@esphack\ignorespaces} + \expandafter\prooftrees@index{\macrolabelname}{\protect\ttfamily\protect\string\protect#1}\@esphack\ignorespaces} \renewcommand*\Describe@Env[1]{\endgroup \marginpar{% \raggedleft\PrintDescribeMacro{#1}\par @@ -106,7 +143,7 @@ \renewcommand*\do[1]{\ifcyntafun ##1\else\\##1\fi\cyntafunfalse}% \cyntafuntrue \marginpar{% - \raggedleft\PrintDescribeMacro{ % peid â dileu'r gwagle hwn!! + \raggedleft\PrintDescribeMacro{ % paid â dileu'r gwagle hwn!! \expandafter\docsvlist{#2}% }\par \PrintLabelName[\macrolabelfont]{\csname #1labelname\endcsname}% @@ -184,6 +221,16 @@ commentstyle=\color{doc@commentcolor}, frame=none, } +\lstdefinestyle{lstsrc}{% + style=lstDemoStyleLaTeXCode, + stringstyle=\color{doc@stringcolor}, + keywordstyle=\color{doc@keywordcolor}, + commentstyle=\color{doc@commentcolor}, + texcsstyle=\color{doc@keywordcolor}, + frame=none, + numbers=left, + moretexcs={forestset,linenumberstyle,ifcsname,ProcessOptions,DeclareOption,ProvidesPackageSVN,bracketset,NewDocumentEnvironment,ExplSyntaxOn,mmzset,ExplSyntaxOff,forest,prooftrees@enw,foresteregister,foresteoption,forestregister,forestoption,PackageError,PackageWarning,PassOptionsToPackage,CurrentOption,@ifpackageloaded,endforest,draw}, +} \geometry{headheight=12pt,marginparwidth=45mm,hmarginratio=4:1,vscale=.8,hscale=.7,verbose} \newlength\tewadjust \setlength\tewadjust{\marginparwidth+\marginparsep-\paperwidth+\textwidth+\oddsidemargin+1in} @@ -269,20 +316,83 @@ Version \prooftreesdocversion{} \prooftreesdocinfo \end{center}% } +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ExplSyntaxOn +% \NewDocumentCommand \ivals { +m } +% { +% { +% \clist_if_empty:nF { #1 } +% { +% \normalfont +% \itshape +% < \clist_use:nn { #1 } { >\texttt{,} ~ < } > +% } +% } +% } +\keys_define:nn { prooftrees / doc } +{ + unknown .code:n = { + \cs_if_free:cT { \l_keys_key_str } + { + \tl_gset:cn { \l_keys_key_str } { #1 } + } + }, +} +\NewDocumentCommand \prooftreesdocset { +m } +{ + \keys_set:nn { prooftrees / doc } { #1 } +} +\ExplSyntaxOff +\prooftreesdocset{% + bug={\href{https://codeberg.org/cfr/prooftrees/issues}{\textsc{bugtracker}}}, + codeberg={\href{https://codeberg.org/cfr/prooftrees}{\textsc{codeberg}}}, + github={\href{https://github.com/cfr42/prooftrees}{\textsc{github}}}, + ctan={\href{https://ctan.org/}{\textsc{ctan}}}, +} +% \newcommand*{\lpack}[1]{\textsf{#1}} +\title{\filebase} +\author{Clea F. Rees\thanks{% + Bug tracker: + \href{https://codeberg.org/cfr/prooftrees/issues}{\url{codeberg.org/cfr/prooftrees/issues}} + \textbar{} Code: + \href{https://codeberg.org/cfr/prooftrees}{\url{codeberg.org/cfr/prooftrees}} + \textbar{} Mirror: + \href{https://github.com/cfr42/prooftrees}{\url{github.com/cfr42/prooftrees}}% +}} +% \date{\fileversion~\filedate} +\date{\prooftreesdocdate}% +\title{\prooftreesdocbase}% +\ExplSyntaxOn +\hook_gput_code:nnn {shipout/lastpage} {.} +{ + \property_record:nn {t:lastpage}{abspage,page,pagenum} +} +\cs_new_protected_nopar:Npn \lastpage +{ + \property_ref:nn {t:lastpage}{page} +} +% \NewDocumentCommand \plarg {+m} {{\ttfamily (\ivals{#1})}} +\ExplSyntaxOff +% \NewDocumentCommand \istable{m}{\texttt{= \{}\ivals{#1}\texttt{\}}\par\noindent} +% \NewDocumentCommand \isstring{m}{\texttt{= ''}\meta{#1}\texttt{''}\par\noindent} +% \definecolor{strawberry}{rgb}{1.000,0.000,0.502} +% \definecolor{blueberry}{rgb}{0.000,0.000,1.000} +% \definecolor{moss}{rgb}{0.000,0.502,0.251} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \pagestyle{fancy} \fancyhf{} \fancyhf[lh]{\textit{\leftmark}} \fancyhf[rh]{\textit{\rightmark}} -\fancyhf[cf]{\textit{--- \thepage{} of \lastpageref*{LastPage} ---}} +\fancyhf[cf]{\textit{--- \thepage{} of \lastpage{} ---}} \fancypagestyle{fancyplain}{% \fancyhf{}% \fancyhf[lh]{\textit{\leftmark}}% \renewcommand*\headrulewidth{0pt}% - \fancyhf[cf]{\textit{--- \thepage{} of \lastpageref*{LastPage} ---}}} + \fancyhf[cf]{\textit{--- \thepage{} of \lastpage{} ---}}} \fancypagestyle{plain}{% \fancyhf{}% \renewcommand*\headrulewidth{0pt}% - \fancyhf[cf]{\textit{--- \thepage{} of \lastpageref*{LastPage} ---}}} + \fancyhf[cf]{\textit{--- \thepage{} of \lastpage{} ---}}} \patchcmd{\sectionmark}{\MakeUppercase}{}{\typeout{sectionmark patched OK!}}{\typeout{sectionmark patch failed!}} \patchcmd{\tableofcontents}{\MakeUppercase}{}{\typeout{sectionmark patched OK!}}{\typeout{sectionmark patch failed!}} \patchcmd{\tableofcontents}{\MakeUppercase\contentsname}{}{\typeout{sectionmark patched OK!}}{\typeout{sectionmark patch failed!}} @@ -297,9 +407,6 @@ % END preamble \begin{document} -\title{\prooftreesdocbase}% -\author{Clea F. Rees\texorpdfstring{\thanks{reesc21 <at> cardiff <dot> ac <dot> uk}}{}}% -\date{\prooftreesdocdate}% \newgeometry{headheight=12pt,scale=.8,marginparwidth=0pt,marginparsep=0pt}% \savegeometry{safonol}% \setlength\tewadjust{\marginparwidth+\marginparsep}% @@ -309,8 +416,9 @@ \bigskip \begin{abstract} - \noindent \keyname[pkg]{\pkg{prooftrees}} is a \LaTeXe{} package, based on \keyname[pkg]{\pkg{forest}}, designed to support the typesetting of proof trees in styles sometimes used in teaching introductory logic courses, especially those aimed at students without a strong background in mathematics. + \noindent \keyname[pkg]{\pkg{prooftrees}} is a \LaTeXe{} package, based on \keyname[pkg]{\pkg{forest}}, designed to support the typesetting of logical tableaux --- ‘proof trees’ or ‘truth trees’ --- in styles sometimes used in teaching introductory logic courses, especially those aimed at students without a strong background in mathematics. One textbook which uses proofs of this kind is \textcite{hodges-logic}. + Like \pkg{forest}, \pkg{prooftrees} supports \keyname[pkg]{\pkg{memoize}} out-of-the-box. \end{abstract} \bigskip @@ -318,7 +426,7 @@ \begin{adjustwidth}{-3em}{-5em} \centering \begin{minipage}[t]{.475\linewidth} - \begin{prooftree} + \begin{tableau} { to prove={S \liff \lnot T, T \liff \lnot R \sststile{\mathcal{L}}{} S \liff R}, highlight format={text=WildStrawberry}, @@ -387,10 +495,10 @@ ] ] ] - \end{prooftree}% + \end{tableau}% \end{minipage}\hfill \begin{minipage}[t]{.525\linewidth} - \begin{prooftree} + \begin{tableau} { to prove={(\exists x)((\forall y)(Py \Rightarrow (x = y)) \cdot Px) \sststile{\mathcal{L}_1}{} (\exists x)(\forall y)(Py \Leftrightarrow (x = y))}, line no sep=.35em, @@ -441,7 +549,7 @@ ] ] ] - \end{prooftree}% + \end{tableau}% \end{minipage}% \end{adjustwidth} \end{figure} @@ -512,7 +620,7 @@ The package supports a small number of options which can be configured to custom The code for a \pkg{prooftrees} proof tree is shown in \cref{ptdefaults}, together with the output obtained using the default settings. \begin{codcoeden}*[label=ptdefaults]{\pkg{prooftrees}: default settings} -\begin{prooftree} +\begin{tableau} { to prove={\{P \vee (Q \vee \lnot R), P \lif \lnot R, Q \lif \lnot R\} \sststile{}{} \lnot R} } @@ -528,7 +636,7 @@ The code for a \pkg{prooftrees} proof tree is shown in \cref{ptdefaults}, togeth [\lnot Q, close={:!u,!c}] [\lnot R, close={:not conc,!c}, just={$\lif$ Elim:last premise}]] [\lnot R, close={:not conc,!c}, move by=1, just={$\vee$ Elim:!u}]]]]]] -\end{prooftree} +\end{tableau} \end{codcoeden} More extensive configuration can be achieved by utilising \pkg{forest} \autocite{saso-forest-manual} and/or \TikZ{} \autocite{tantau-tikz-pgf-manual} directly. A sample of supported proof tree styles are shown in \cref{sample}. @@ -537,7 +645,7 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees \thispagestyle{plain}% \begin{coeden}[label=sample, floatplacement={!bp}, grow to left by=3em, grow to right by=3em]{\pkg{prooftrees}: sample output} \centering - \begin{prooftree} + \begin{tableau} { to prove={\{ P \lor (Q \lor \lnot R), P \lif \lnot R, Q \lif \lnot R \} \sststile{}{} \lnot R}, line no sep=.35em, @@ -566,9 +674,9 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees ] ] ] - \end{prooftree}\hfill + \end{tableau}\hfill {\renewcommand*\linenumberstyle[1]{#1)}% - \begin{prooftree} + \begin{tableau} { close with={\ensuremath{\ast}}, just format={text=gray, font=\itshape}, @@ -602,9 +710,9 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees ] ] ] - \end{prooftree}} + \end{tableau}} - \begin{prooftree} + \begin{tableau} { not line numbering, single branches, @@ -636,8 +744,8 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees ] ] ] - \end{prooftree}% - \hfill\begin{prooftree} + \end{tableau}% + \hfill\begin{tableau} { to prove={\{ P \lor (Q \lor \lnot R), P \lif \lnot R, Q \lif \lnot R \} \therefore \lnot R}, close with={\ensuremath{\times}}, @@ -668,9 +776,9 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees ] ] ] - \end{prooftree} + \end{tableau} - \begin{prooftree} + \begin{tableau} { to prove={(\exists x)(Lx \lor Mx) \sststile{}{} (\exists x) Lx \lor (\exists x) Mx}, highlight format={text=blue!50!cyan}, @@ -695,8 +803,8 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees ] ] ] - \end{prooftree}% - \hfill\begin{prooftree} + \end{tableau}% + \hfill\begin{tableau} { for tree={% plain content, @@ -717,7 +825,7 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees ] ] ] - \end{prooftree} + \end{tableau} \end{coeden} % END sec:raisondetre @@ -730,7 +838,7 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees \begin{itemize} \item All derivation rules yield equal numbers of \wff{}s on all branches. \begin{center} - \begin{prooftree} + \begin{tableau} { not line numbering, for tree={plain content}, @@ -740,7 +848,7 @@ The package is \emph{\bfseries not} intended for the typesetting of proof trees [\wff[\wff[\wff]][\wff[\wff, label={[text=Green3]right:{\fycheck}}]]] [\wff[\wff][\wff[\wff, label={[text=red]right:{\fycross}}]]] [\wff[\wff[\wff]][\wff[\phantom{\wff}, label={[text=red]right:{\fycross}}]]] - \end{prooftree} + \end{tableau} \end{center} If $\mathcal{L}$ fails to satisfy this condition, \pkg{prooftrees} is likely to violate the requirements of affected derivation rules by splitting branches ‘mid-inference’. \item No derivation rule yields \wff{}s on more than two branches. @@ -780,17 +888,17 @@ Suppose that we wish to typeset the proof tree for and we would like to typeset the entailment established by our proof at the top of the tree. Then we should begin like this: \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } -\end{prooftree} +\end{tableau} \end{latexcode} That is all the preamble we want, so we move onto consider the \meta{tree specification}. \pkg{forest} uses square brackets to specify trees' structures. To typeset a proof, think of it as consisting of nested trees, trunks upwards, and work from the outside in and the trunks down (\cref{nythod}). \begin{coeden}[label=nythod]{Nested structure of proof tree} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)}, just sep*=3, @@ -900,7 +1008,7 @@ To typeset a proof, think of it as consisting of nested trees, trunks upwards, a ] ] ] -\end{prooftree} +\end{tableau} \end{coeden} Starting with the outermost tree \nyth*{} and the topmost trunk, we replace the \bocsnyth{} with square brackets and enter the first \wff{} inside, adding \verb|just=Pr.| for the justification on the right and \verb|checked=a| so that the line will be marked as discharged with $a$ substituted for $x$. @@ -908,13 +1016,13 @@ We also use \pkg{forest}'s \keyname*[fopttoks]{name} to label the line for ease (Technically, it is the node rather than the line which is named, but, for our purposes, this doesn't matter. \pkg{forest} will create a name if we don't specify one, but it will not necessarily be one we would have chosen for ease of use!) \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } [{(\exists x)((\forall y)(Py \lif x = y) \land Px)}, checked=a, just=Pr., name=pr ] -\end{prooftree} +\end{tableau} \end{latexcode} We can refer to this line later as \verb|pr|. @@ -923,7 +1031,7 @@ Its \bocsnyth{} goes inside that for \nyth[1], so the square brackets containing Again, we add the justification with \keyname[foptautotoks]{just}, but we use \verb|subs=a| rather than \verb|checked=a| as we want to mark substitution of $a$ for $x$ without discharging the line. Again, we use \keyname*[fopttoks]{name} so that we can refer to the line later as \verb|neg conc|. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -931,7 +1039,7 @@ Again, we use \keyname*[fopttoks]{name} so that we can refer to the line later a [{\lnot (\exists x)(\forall y)(Py \liff x = y)}, subs=a, just=Conc.~neg., name=neg conc ] ] -\end{prooftree} +\end{tableau} \end{latexcode} Turning to tree \nyth*{}, we again note that its \bocsnyth{} is nested within the previous two, so the square brackets for its \wff{} need to be nested within those for the previous \wff{}s. @@ -941,7 +1049,7 @@ This justification also refers to an earlier line in the proof. We could write this as \verb|just=1 $\exists\elim$|, but instead we use the name we assigned earlier with the referencing feature provided by \pkg{prooftrees}. To do this, we put the reference, \verb|pr| \emph{after} the rest of the justification, separating the two parts by a colon i.e.~\verb|$\exists\elim$:pr| and allow \pkg{prooftrees} to figure out the correct number. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -951,7 +1059,7 @@ To do this, we put the reference, \verb|pr| \emph{after} the rest of the justifi ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} Continuing in the same way, we surround each of the \wff{}s for \nyth*{}, \nyth*{}, \nyth*{} and \nyth*{} within square brackets nested within those surrounding the previous \wff{} since each of the trees is nested within the previous one. @@ -961,7 +1069,7 @@ For example, in the next line we add, we specify the justification as \verb|just \verb|!u| refers to the current line's parent line --- in this case, \verb|{(\forall y)(Py \lif a = y) \land Pa}, checked, just=$\exists\elim$:pr|. \verb|!uu| refers to the current line's parent line's parent line and so on. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -979,14 +1087,14 @@ For example, in the next line we add, we specify the justification as \verb|just ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} Reaching \nyth*{}, things get a little more complex since we now have not one, but \emph{two} \bocsnyth{} nested within \nyth[7]. This means that we need \emph{two} sets of square brackets for \nyth{} --- one for each of its two trees. Again, both of these should be nested within the square brackets for \nyth[7] but neither should be nested within the other because the trees for the two branches at \nyth{} are distinct. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1008,14 +1116,14 @@ Again, both of these should be nested within the square brackets for \nyth[7] bu ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} At this point, we need to work separately or in parallel on each of our two branches since each constitutes its own tree. Turning to trees \nyth*{}, each needs to be nested within the relevant tree \nyth[8], since each \bocsnyth{} is nested within the applicable branch's tree. Hence, we nest square brackets for each of the \wff{}s at \nyth{} within the previous set. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1041,7 +1149,7 @@ Hence, we nest square brackets for each of the \wff{}s at \nyth{} within the pre ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} We only have one tree \nyth*{} as there is no corresponding tree in the left-hand branch. @@ -1054,7 +1162,7 @@ We can use \verb|close={8,10}| for this or we can use the same referencing syste In either case, we again surrounding the argument with curly brackets to protect the comma. \verb|!c| refers to the current line --- something useful in many close annotations, but not helpful in specifying non-circular justifications. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1082,13 +1190,13 @@ In either case, we again surrounding the argument with curly brackets to protect ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} This completes the main right-hand branch of the tree and we can focus solely on the remaining left-hand one. Tree \nyth*{} is straightforward --- we just need to nest it within the left-hand tree \nyth[9]. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1118,14 +1226,14 @@ Tree \nyth*{} is straightforward --- we just need to nest it within the left-han ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} At this point, the main left-hand branch itself branches, so we have two trees \nyth*{}. Treating this in the same way as the earlier branch at \nyth[8], we use two sets of square brackets nested within those for tree \nyth{}, but with neither nested within the other. Since we also want to mark the leftmost branch as closed, we add \verb|close={:to Pb or not to Pb,!c}| in the same way as before. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1159,12 +1267,12 @@ Since we also want to mark the leftmost branch as closed, we add \verb|close={:t ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} We complete our initial specification by nesting \nyth*{} within the appropriate tree \nyth[12], again marking closure appropriately. \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1200,12 +1308,12 @@ We complete our initial specification by nesting \nyth*{} within the appropriate ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} Compiling our code, we find that the line numbering is not quite right: -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1241,7 +1349,7 @@ Compiling our code, we find that the line numbering is not quite right: ] ] ] -\end{prooftree} +\end{tableau} \pkg{prooftrees} warns us about this: \begin{latexcode} @@ -1258,7 +1366,7 @@ by \end{latexcode} giving us the following code: \begin{latexcode} -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1294,11 +1402,11 @@ giving us the following code: ] ] ] -\end{prooftree} +\end{tableau} \end{latexcode} which produces our desired result: -\begin{prooftree} +\begin{tableau} { to prove={(\exists x)((\forall y)(Py \lif x = y) \land Px) \sststile{}{} (\exists x)(\forall y)(Py \liff x = y)} } @@ -1334,7 +1442,7 @@ which produces our desired result: ] ] ] -\end{prooftree} +\end{tableau} % END sec:ee @@ -1393,7 +1501,7 @@ The following diagram provides an overview of the configuration and anatomy of a Detailed documentation is provided in \cref{sec:ops} and \cref{sec:macros}. \forestset{declare count register={cau},cau'=0} -\begin{prooftree} +\begin{tableau} { to prove={proof statement}, for tree={% @@ -1472,7 +1580,7 @@ Detailed documentation is provided in \cref{sec:ops} and \cref{sec:macros}. \end{scope} } [[[[][]]]][[[[[]][[[]]]][[]]]]]]] -\end{prooftree} +\end{tableau} % END sec:anatomy @@ -1916,6 +2024,54 @@ For example, if for some reason you would like bold line numbers, try % END sec:macros +\section{Memoization}\label{sec:memoize} +% BEGIN sec:memoize + +Tableaux created by \pkg{prooftrees} cannot, in general, be externalised with \TikZ's \keyname[pkg]{\pkg{external}} library. +Since \keyname[pkg]{\pkg{pgf}}/\TikZ{}, in general, and \pkg{prooftrees}, in particular, can be rather slow to compile, this is a serious issue. +If you only have a two or three small tableaux, the compilation time will be negligible. +But if you have large, complex proofs or many smaller ones, compilation time will quickly become excessive. + +Version 0.9 does not cure the disease, but it does offer an extremely effective remedy for the condition. +While it does not make \pkg{prooftrees} any faster, it supports the \keyname[pkg]{\pkg{memoize}} package developed by \pkg{forest}'s author, Sašo Živanović \autocite*{saso-memoize-manual}. +Memoization is faster, more secure, more robust and easier to use than \TikZ's externalisation. +\begin{description} + \item[It is faster.] It does not require separate compilations for each memoized object, so it is comparatively fast even when memoizing. + \item[It is more secure.] It requires only restricted shell-escape, which almost all \TeX{} installations enable by default, so it is considerably more secure and can be utilised even where shell-escape is disabled. + \item[It is more robust.] It can successfully memoize code which defeats all ordinary mortals' attempts to externalize with the older \TikZ{} library. + \item[It is easier to use.] It requires less configuration and less intervention. + For example, it detects problematic code and aborts memoization automatically in many cases in which \TikZ's \pkg{external} would either cause a compilation error or silently produce nonsense output, forcing the user to manually disable the process for relevant code. +\end{description} + +There is always a ‘but’, but this is a pretty small ‘but’ as ‘but’s go. +\begin{description} + \item[But installation requires slightly more work.] To reap the full benefits, you want to use either the \texttt{perl} or the \texttt{python} ‘extraction’ method. + There is a third method, which does not require any special installation, but this lacks several of the advantages explained above and is not recommended. + + If you use \TeX{} Live, you have \texttt{perl} already, but you may need to install a couple of libraries. + \texttt{python} is not a prerequisite for \TeX{} Live but, if you happen to have it installed, you will probably only need an additional library to use this method. + + See \citetitle{saso-memoize-manual} \autocite{saso-memoize-manual} for further details. +\end{description} + +Once you have the prerequisites setup, all you need do is load \pkg{memoize} \emph{before} \pkg{prooftrees}. + +\begin{latexcode} +\usepackage[extraction method=perl]{memoize}% or python +\usepackage{prooftrees} +\end{latexcode} + +After a single compilation, your document will have expanded to include extra pages. +At this point, it will look pretty weird. +After the next compilation, your document will return to its normal self, the only difference being the speed with which it does so as all your memoized tableaux will simply be included, as opposed to recompiled. +Only when you alter the code for a tableau, delete the generated files, disable memoization or explicitly request it will the proof be recompiled. + +Memoization is compatible with both \pkg{prooftrees}'s cross-referencing system and \LaTeXe's cross-references, but the latter require an additional compilation. +In general, if a document element takes $n$ compilations to stabilise, it will take $n+1$ compilations to complete the memoization process. +See \citetitle{saso-memoize-manual} \autocite{saso-memoize-manual} for details. + +% END sec:memoize + \section{Compatibility}\label{sec:compat} % BEGIN sec:compat @@ -1933,6 +2089,13 @@ This allows you to use \env{tableau} for \pkg{prooftrees} trees and \env{prooftr \section{Version History}\label{sec:hanes} % BEGIN sec:hanes +\subsection{0.9}\label{subsec:0.9} +% BEGIN subsec:0.9 +Add support for \pkg{memoize} and utilise for documentation. + +Use \cs{NewDocumentEnvironment}, removing direct dependency on \pkg{environ}. +% END subsec:0.9 + \subsection{0.8} Add previously unnoticed dependency on \pkg{amstext}. Attempt to fix straying closure symbols evident in documentation and a \TeX\ SE question\footnote{\url{https://tex.stackexchange.com/q/619314/}.} @@ -1948,7 +2111,7 @@ See \cref{subsec:go}. The main point of this option is to allow automatic moves to be switched off if one teaches students to first apply all available non-branching rules for the tableau as a whole, as opposed to all non-branching rules for the sub-tree. The automatic algorithm is consistent with the latter, but not former, approach. The algorithm favours compact trees, which are more likely to fit on \pkg{beamer} slides. -Switching the algorithm off permits users to specify exactly how things should or should not be move. +Switching the algorithm off permits users to specify exactly how things should or should not be moved. Thanks to Peter Smith for prompting this. Fix bug reported at \href{https://tex.stackexchange.com/q/479263/39222}{tex.stackexchange.com/q/479263/39222}. @@ -2001,10 +2164,25 @@ First CTAN release. % END sec:hanes \printbibliography -\clearpage \loadgeometry{safonol}% \fancyheadoffset[lh]{0pt}% + \printindex + +\onecolumn +\appendix + +\section{Implementation}\label{sec:imp} + +{% + % \makeatletter + % \def\@xobeysp{\leavevmode\penalty100\ }% + % \makeatother + % \verbatiminput{prooftrees.sty}% +} +\lstinputlisting[style=lstsrc,numbers=left,inputencoding=utf8/latin1]{prooftrees.sty} + + \end{document} diff --git a/graphics/pgf/contrib/prooftrees/prooftrees_biber.bib b/graphics/pgf/contrib/prooftrees/prooftrees_biber.bib index 021c9d1cfd..0a3ab30332 100644 --- a/graphics/pgf/contrib/prooftrees/prooftrees_biber.bib +++ b/graphics/pgf/contrib/prooftrees/prooftrees_biber.bib @@ -31,3 +31,12 @@ TITLE = {Forest: A {PGF}/Ti\mkbibemph{k}{Z}-Based Package for Drawing Linguistic Trees}, } +@MANUAL{saso-memoize-manual, + AUTHOR = ZIVANOVIC-SASO, + URL = {https://www.ctan.org/pkg/memoize}, + DATE = {2023-10-10}, + EDITION = {1.0.0}, + KEYWORDS = {TeX,LaTeX,PGF,TikZ,Forest,Memoize}, + TITLE = {Memoize}, +} + diff --git a/graphics/pgf/contrib/sunpath/README.md b/graphics/pgf/contrib/sunpath/README.md new file mode 100644 index 0000000000..108f45025d --- /dev/null +++ b/graphics/pgf/contrib/sunpath/README.md @@ -0,0 +1,60 @@ +# `sunpath` -- Draw Sun Path # + + +(C) 2024 Hồng-Phúc Bùi + + +## Description ## + +This package provides tool to draw a sunpath chart like this: + +![sunpath chart](https://raw.githubusercontent.com/hpb-htw/sunpath/refs/heads/master/sunpath.track.svg) + +## Licence ## + + +This package may be distributed and/or modified under the conditions of the +LaTeX Project Public License (LPPL), either version 1.3c of this +License or any later version. The latest version +of this license is in the file https://www.latex-project.org/lppl.txt + +## Build and Install (for Distributor) ## + + +* To build the style file `sunpath.sty` just run **one** of + +``` +latex sunpath.ins +pdflatex sunpath.ins +xelatex sunpath.ins +lualatex sunpath.ins +``` + +then you can copy `sunpath.sty` to your local `texmf` tree, where latex can find it. + +* To create PDF Document manual you must use `lualatex` via `l3build doc`: + +``` +l3build doc +``` + +You also need the TikZ-library hobby to create the curve. + +``` +\usetikzlibrary{hobby} +``` + +(`lualatex` because of my name, really ego right! It needs unicode to be typeset correctly.) + +## Development ## + + +I try to use latex3 as much as posible. You can use + +``` +l3build doc +``` + +to create the style file and documentation files at once. You can also (like I also do) use `make` +to call repeatly tasks. + diff --git a/graphics/pgf/contrib/sunpath/horizontal-coordinate.pdf b/graphics/pgf/contrib/sunpath/horizontal-coordinate.pdf Binary files differnew file mode 100644 index 0000000000..676516d93d --- /dev/null +++ b/graphics/pgf/contrib/sunpath/horizontal-coordinate.pdf diff --git a/graphics/pgf/contrib/sunpath/horizontal-coordinate.tex b/graphics/pgf/contrib/sunpath/horizontal-coordinate.tex new file mode 100644 index 0000000000..2d121e761e --- /dev/null +++ b/graphics/pgf/contrib/sunpath/horizontal-coordinate.tex @@ -0,0 +1,183 @@ +\documentclass[tikz]{standalone} + +\usepackage{fontspec} +\usepackage{mathtools} +\usepackage{unicode-math} +\usepackage{siunitx} + +\newcommand{\az}{\ensuremath{\Phi}} +\newcommand{\el}{\ensuremath{\theta}} + +% Tikz Style +\usepackage{tikz} + +\usetikzlibrary{decorations.markings} +\usetikzlibrary{arrows.meta} + +\usepackage{pgfplots} +\pgfplotsset{ + compat=1.18 + ,width=15cm + ,lua debug +} + +\definecolor{celestial}{rgb}{1,0,1}%{0.0, 0.51, 0.5} +\definecolor{elevation}{rgb}{0,1,0}%{0.6, 0.4, 0.8} +\definecolor{horizon}{rgb}{0,0,1}%{0.54, 0.81, 0.94} +\definecolor{sun}{rgb}{0.83, 0.0, 0.25} + +\tikzstyle{help circle} = [dashed, thick] +\tikzstyle{coordinate curve} = [ultra thick] +\tikzstyle{sun position} = [color=sun,ultra thick] +\tikzstyle{navi direction} = [font=\sffamily\Large] +\tikzstyle{coordinate angle} = [font=\Large] +\tikzstyle{base plane} = [font=\sffamily] + +\begin{document} +\begin{tikzpicture} +\begin{axis}[view={5}{5} + ,axis lines=none, + ,plot box ratio={1 1 1} + ,xlabel=$x$ + ,ylabel=$y$ + ,zlabel=$z$ + ,xmin=-1.4 + ,xmax=1.4 +% ,ymin=-1.2 +% ,ymax=1.2 +% ,zmin=-1.2 +% ,zmax=1.2 + ,declare function={ +% Sun position + azimuth=-110; % Positive = westward from north + elevation = 65; % Positive = from Horizon to Zenith + sunx = cos(azimuth)*cos(elevation); + suny = sin(azimuth)*cos(elevation); + sunz = sin(elevation); +% Text Az coordinates + textazx = cos(3/5*azimuth); + textazy = sin(3/5*azimuth); + textazz = 0; +% Text El coordinates + textelx = cos(azimuth)*cos(elevation/2); + textely = sin(azimuth)*cos(elevation/2); + textelz = sin(elevation/2); +% Celestial Meridian + ucx = 1; + ucy = 0; + ucz = 0; +% + vcx = 0; + vcy = 0; + vcz = 1; + celestialx(\t) = cos(\t)*ucx + sin(\t)*vcx; + celestialy(\t) = cos(\t)*ucy + sin(\t)*vcy; + celestialz(\t) = cos(\t)*ucz + sin(\t)*vcz; +% Horizon => Azimut + uhx = 1; + uhy = 0; + uhz = 0; +% + vhx = 0; + vhy = 1; + vhz = 0; + horizonx(\t) = cos(\t)*uhx + sin(\t)*vhx; + horizony(\t) = cos(\t)*uhy + sin(\t)*vhy; + horizonz(\t) = cos(\t)*uhz + sin(\t)*vhz; +% Elevation + uex = cos(azimuth); + uey = sin(azimuth); + uez = 0; +% + vex = 0; + vey = 0; + vez = 1; + elevationx(\t) = cos(\t)*uex + sin(\t)*vex; + elevationy(\t) = cos(\t)*uey + sin(\t)*vey; + elevationz(\t) = cos(\t)*uez + sin(\t)*vez; + } +] +% +\draw[->] (0,0,0) -- (1.1,0,0) node[anchor=west,navi direction] {North}; +\draw[->] (0,0,0) -- (0,-1.5,0) node[anchor=north,navi direction] {East}; +\draw[->] (0,0,0) -- (0,0,1.1) node[anchor=south,navi direction] {Zenith}; +\node at ( 0.71, 0,0.71)[anchor=west,outer sep=1ex,base plane] {Meridian}; %0.71 app sqrt(2)/2 +\node at (-0.71, 0.71,0) [anchor=south,base plane] {Horizon}; +% Plot the Meridian through Nord +\addplot3 [ + domain=0:360, + samples=60, + samples y=1, + variable=t, + celestial,help circle +] ( + {celestialx(t)}, + {celestialy(t)}, + {celestialz(t)} +); +% Plot the horizon circle +\addplot3 [ + domain=0:360, + samples=60, + samples y=1, + variable=t, + horizon,help circle +] ( + {horizonx(t)}, + {horizony(t)}, + {horizonz(t)} +); +% Plot the azimuth curve +\addplot3 [ + domain=0:azimuth+0.5, + samples=60, + samples y=1, + variable=t, + horizon,coordinate curve, + postaction={decorate}, + decoration={markings, + mark=at position 0.55 with {\arrow{Latex[round]}} + } +] ( + {horizonx(t)}, + {horizony(t)}, + {horizonz(t)} +); +% Plot the great circle through the sun +\addplot3 [ + domain=0:360, + samples=60, + samples y=1, + variable=t, + elevation,help circle +] ( + {elevationx(t)}, + {elevationy(t)}, + {elevationz(t)} +); +% Plot the elevation curve +\addplot3 [ + domain=0.5:elevation, + samples=60, + samples y=1, + variable=t, + elevation,coordinate curve, + postaction={decorate}, + decoration={markings, + mark=at position 0.5 with {\arrow{Latex[round]}} + } +] ( + {elevationx(t)}, + {elevationy(t)}, + {elevationz(t)} +) ; +\draw [-{Latex[round]}, sun position] (0,0,0) -- (sunx, suny, sunz) node[anchor=south east,inner sep=0] {$\odot$}; +\draw [sun position, thin](0,0,0) -- (uex, uey, 0); +\node at (textazx, textazy, textazz) [anchor=north,coordinate angle] {\az}; +\node at (textelx, textely, textelz) [anchor=east ,coordinate angle] {\el}; +\end{axis} +\end{tikzpicture} + +\end{document} + + diff --git a/graphics/pgf/contrib/sunpath/releasenote.txt b/graphics/pgf/contrib/sunpath/releasenote.txt new file mode 100644 index 0000000000..e13301084a --- /dev/null +++ b/graphics/pgf/contrib/sunpath/releasenote.txt @@ -0,0 +1,2 @@ +* [breaking change] Rename prefix draw to sp in exposed command +* [intern] let build.lua also check release date diff --git a/graphics/pgf/contrib/sunpath/sunpath.article.pdf b/graphics/pgf/contrib/sunpath/sunpath.article.pdf Binary files differnew file mode 100644 index 0000000000..0f68980307 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.article.pdf diff --git a/graphics/pgf/contrib/sunpath/sunpath.article.tex b/graphics/pgf/contrib/sunpath/sunpath.article.tex new file mode 100644 index 0000000000..0904568fec --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.article.tex @@ -0,0 +1,39 @@ +\documentclass{article} + +\usepackage{fontspec} +\usepackage{luaotfload} +\usepackage{tikz} +\usepackage{graphicx} +\usepackage{float} + +\usepackage{sunpath} + +\usetikzlibrary{hobby} % this library let one connect points to curve. + +\newcommand{\TikZ}{Ti\textit{k}Z} + +\title{ + \textsf{sunpath} -- Draw Sun Path\\ + (Test Compatibility only) +}% +% +\author{% + Hồng-Phúc Bùi% +} + + + +\begin{document} +% +\parindent0pt +% +\maketitle +\tableofcontents + +\section{Object} + +This file tests if this package can be used within a \texttt{article} class. + +\input{sunpath.docpart.tex} + +\end{document} diff --git a/graphics/pgf/contrib/sunpath/sunpath.docpart.tex b/graphics/pgf/contrib/sunpath/sunpath.docpart.tex new file mode 100644 index 0000000000..810bc8c6b9 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.docpart.tex @@ -0,0 +1,447 @@ +\section{Documentation} + +\subsection{Context and Terms} +The position of the sun from perspective of an observer is defined by two parameters: + +\begin{itemize} + \item the azimuth $\Phi$, which tells the observer, how far (in degree) he must turn around from the North direction, + \item the altitude $\theta$, which tells the observer, how height (in degree) about the horizon he must look to see the sun. +\end{itemize} +The azimuth can take a value in the interval $[0,360)$. +The altitude can take a value in the interval $[0,90]$, whereas 0 is the horizon, 90 is the zenith. +We do not care so much about how far is the sun, so we normalize this distance to 1. + + +The figure~\ref{fig:hz-coordinate} shows these parameter. +The coordinate system, which takes the position of the observer as the centre, +and the observer's local horizon as the fundamental plane, +is called horizontal coordinate system.\footnote{dt.: topozentrisches Koordinatensystem} + +\begin{figure}[H] +\centering +\includegraphics[scale=0.75]{horizontal-coordinate.pdf} +\caption{Horizontal coordinate system} +\label{fig:hz-coordinate} +\end{figure} + +In this package, the cardinal points have specifics values of azimuth as following: + +\begin{tabular}{c c c c} +North & East & South & West \\ +0° & 90° & 180° & 270° +\end{tabular} + + +The projection of the sun on the horizon plane is a point, which can be defined by two parameters: +\begin{itemize} +\item the angle $\Phi$, +\item the distance $r = \cos(\theta)$ from the centre to the sun. +\end{itemize} + +Figure~\ref{fig:sun-projection} shows the projection of the sun on the horizontal plane. +If we track the position of sun on the horizontal plane changes from time to time, we will get a curve. +This curve is called the sun path. +A chart which shows position of the sun from time to time is called a sun path chart. +Of course there are many type of sun path chart. +This package provides tools to plot sun path on the horizontal plane. + +\begin{figure}[H] +\centering +\begin{tikzpicture}[spradius=3] +\spcrosshair +\spaltitudecircle{{0}} +\spgeodirection[0pt] +\path[draw=red,fill=red](sunpath cs:azi=110,alt=66) circle[radius=2pt] ; +\end{tikzpicture} +\caption{Projection of the sun on the horizon plane} +\label{fig:sun-projection} +\end{figure} + + +\subsection{Draw a Sun path chart} + +Figure~\ref{fig:sun-projection} is a very rudimentary sun path chart. +There is neither scalar, nor time on the chart. +A more usable Sun path chart may look like one in the figure~\ref{fig:full-sun-path-chart}. +In this section we will create this chart. + + +\begin{figure}[H] +\centering +\begin{tikzpicture} +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} + +\spazimuthtick + +\spgeodirection +\spaltitudelabel{{10,20,...,80,85}} +\spazimuthlabel{{0,15,...,350}} + +\path[draw=red,fill=red](sunpath cs:azi=110,alt=66) circle[radius=2pt] node[below] {{9:30}}; +\end{tikzpicture} +\caption{A Sun path chart} +\label{fig:full-sun-path-chart} +\end{figure} + +\subsubsection{Outlines} + +User has to place \verb:\usepackage{sunpath}: in the preamble part of the document. + +The chart is a \TikZ-picture, so we need a \texttt{tikzpicture}-environment. +We can also customize the distance from the centre of the chart to the horizon line by setup the option \texttt{spradius}. +By default it is 5.5 in PGF xy coordinate. +In this example we make it a little bigger: + +\marginpar{\texttt{spradius}} +\begin{verbatim} +\begin{tikzpicture}[spradius=6] +\end{tikzpicture} +\end{verbatim} + +We also need the crosshair, the horizon line --in this type of sun path chart it is a circle--, +the fours geographic direction. +This can be done by adding more commands into the \texttt{tikzpicture} + +\begin{verbatim} +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0}} +\spgeodirection +\end{tikzpicture} +\end{verbatim} + +\marginpar{\texttt{drawcrosshair\\ drawgeodirection\\ drawaltitudecircle}} +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0}} +\spgeodirection +\end{tikzpicture} + + +Man has to pay attention to the double curry brackets in the command \texttt{drawaltitudecircle}. +The outer brackets delimit the argument of the command. +The argument of the command is a valid \TikZ-range, which is used in a \verb:\foreach: command, +so it has be placed in between a pair of curry bracket. +That is the inner brackets. + + +\subsubsection{Scalar and labels} + + +As the name of the commando says, we can also draw more than the horizon line by adding some values of altitude in the range of the argument of the command \verb|\spaltitudecircle|. +For example \verb:\spaltitudecircle{{0,10,...,80,85}}: draws 10 circles of altitude. + +\marginpar{\texttt{drawaltitudecircle}} +\begin{verbatim} +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spgeodirection +\end{tikzpicture} +\end{verbatim} + +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spgeodirection +\end{tikzpicture} + + +We can use the command \verb:\drawazumuthline{r}{h}{l}: to draw azimuth lines in range \verb:r:, +from the higher altitude \verb:h: to the lower altitude \verb:l:. + +For example + +\begin{itemize} + \item \verb:\spazimuthline{{0,10,...,360}}{85}{70}: draws every 10° azimuth from the 85° altitude to to 70° altitude. + \item \verb:\spazimuthline{{0,5,...,360}}{80}{0}: draws every 5° azimuth from the 80° altitude to to 0° altitude. +\end{itemize} + +\begin{verbatim} +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} + +\spgeodirection +\end{tikzpicture} +\end{verbatim} + +\marginpar{\texttt{drawazimuthline}} +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} + +\spgeodirection +\end{tikzpicture} + +To draw azimuth ticks outside the horizon line, we can use +\verb:\spazimuthtick:. +This command expects for now no argument. + +\begin{verbatim} +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + +\spgeodirection +\end{tikzpicture} +\end{verbatim} + +\marginpar{\texttt{drawazimuthtick}} +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + +\spgeodirection +\end{tikzpicture} + + +To draw labels of azimuth lines and altitude circles in the chart, we can use the commands + +\verb:\spaltitudelabel{r}: and + +\verb:\spazimuthlabel{r}:. + +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + +\spaltitudelabel{{10,20,...,80,85}} +\spazimuthlabel{{0,15,...,350}} +\spgeodirection +\end{tikzpicture} + +That it's, now we have a nice chart, on which we can draw positions of the sun from time to time. + +\subsubsection{Position of the sun} + +We can easily plot the position of the sun in the chart with the coordinate \texttt{sunpath}, +if the azimuth and the altitude are given. +For example, to plot the position of the sun with 150° Azimuth and 22° Altitude, +we just use the \texttt{path} command as following: + +\verb|\path[fill=red,draw=red] (sunpath cs:azi=150,alt=22);| + +The result would be + +\begin{verbatim} +% ... +\path[fill=red,draw=red] (sunpath cs:azi=150,alt=35) circle[radius=2pt]; +\spaltitudelabel{{10,20,...,80,85}}[160] +% ... +\end{verbatim} + +\marginpar{\texttt{sunpath cs}} +\begin{tikzpicture}[spradius=6] +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + +\path[fill=red,draw=red] (sunpath cs:azi=150,alt=35) circle[radius=2pt]; + +\spaltitudelabel{{10,20,...,80,85}}[160] +\spazimuthlabel{{0,15,...,350}} +\spgeodirection +\end{tikzpicture} + +The command \verb:\spaltitudelabel: can also take an optional argument to set altitude label on other azimuth. +This can be useful if the labels cover distract important points on chart. +In this chart it is set to be 160°. So one can easily read the azimuth of the sun on the chart. + +We can also connect the position of the sun to a path, for example with the positions given in the following table + +{\ttfamily +\begin{tabular}{c c c} +Time & Azimuth & Altitude \\ +07:44 & 98.968673 & -0.208672 \\ +08:00 & 102.009695 & 2.035492 \\ +10:00 & 126.513583 & 19.499874 \\ +12:00 & 156.854847 & 31.593335 \\ +14:00 & 192.292832 & 33.425294 \\ +16:00 & 224.708002 & 24.034984 \\ +18:00 & 250.626597 & 7.619801 \\ +18:53 & 260.810553 & -0.244637 \\ +\end{tabular} +} + +we can get a sun path like this: + +\begin{tikzpicture}[spradius=6] +\tikzset{ + sunpath curve/.style={draw,fill=red}, + sunpath point/.style={radius=2pt,draw=red}, + sunpath node/.style={below,inner sep=0.5pt,outer sep=4.5pt,fill=white} +} +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + +\path[sunpath curve] + (sunpath cs:azi=98.968673,alt=-0.208672) circle[sunpath point] node[sunpath node]{ { 07:44 } } +--(sunpath cs:azi=102.009695,alt=2.035492) circle[sunpath point] node[sunpath node]{ { 08:00 } } +--(sunpath cs:azi=126.513583,alt=19.499874) circle[sunpath point] node[sunpath node]{ { 10:00 } } +--(sunpath cs:azi=156.854847,alt=31.593335) circle[sunpath point] node[sunpath node]{ { 12:00 } } +--(sunpath cs:azi=192.292832,alt=33.425294) circle[sunpath point] node[sunpath node]{ { 14:00 } } +--(sunpath cs:azi=224.708002,alt=24.034984) circle[sunpath point] node[sunpath node]{ { 16:00 } } +--(sunpath cs:azi=250.626597,alt=7.619801) circle[sunpath point] node[sunpath node]{ { 18:00 } } +--(sunpath cs:azi=260.810553,alt=-0.244637) circle[sunpath point] node[sunpath node]{ { 18:53 } } +; + +\spaltitudelabel{{10,20,...,80,85}} +\spazimuthlabel{{0,15,...,350}} +\spgeodirection +\end{tikzpicture} + +But this chart is not nice. +If the data is machine readable, we can generate all stuffs of the chart automatically. +This chart below is generated from the table above. +Just use your favourite programming language to process sun data. + +\begin{tikzpicture}[spradius=6] +\tikzset{ + sun path curve/.style={draw=red!20,thick}, + sun point/.style={radius=2pt,draw=red,fill=red}, + sun label/.style={below,fill=white,outer sep=4pt,text=red}, +} +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + +\coordinate (P0) at (sunpath cs:azi=98.968673,alt=-0.208672); +\coordinate (P1) at (sunpath cs:azi=102.009695,alt=2.035492); +\coordinate (P2) at (sunpath cs:azi=126.513583,alt=19.499874); +\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335); +\coordinate (P4) at (sunpath cs:azi=192.292832,alt=33.425294); +\coordinate (P5) at (sunpath cs:azi=224.708002,alt=24.034984); +\coordinate (P6) at (sunpath cs:azi=250.626597,alt=7.619801); +\coordinate (P7) at (sunpath cs:azi=260.810553,alt=-0.244637); +\path[sun point] (P0) circle; +\path[sun point] (P1) circle; +\path[sun point] (P2) circle; +\path[sun point] (P3) circle; +\path[sun point] (P4) circle; +\path[sun point] (P5) circle; +\path[sun point] (P6) circle; +\path[sun point] (P7) circle; +\node[sun label,anchor=270-98.968673] at (P0) {07:44}; +\node[sun label,anchor=270-102.009695] at (P1) {08:00}; +\node[sun label,anchor=270-126.513583] at (P2) {10:00}; +\node[sun label,anchor=270-156.854847] at (P3) {12:00}; +\node[sun label,anchor=270-192.292832] at (P4) {14:00}; +\node[sun label,anchor=270-224.708002] at (P5) {16:00}; +\node[sun label,anchor=270-250.626597] at (P6) {18:00}; +\node[sun label,anchor=270-260.810553] at (P7) {18:53}; +\path[sun path curve] (P0) to [curve through={ (P1) .. (P2) .. (P3) .. (P4) .. (P5) .. (P6) }] (P7) ; + +\spaltitudelabel{{10,20,...,80,85}}[170] +\spazimuthlabel{{0,15,...,350}} +\spgeodirection +\end{tikzpicture} + +\vfill\newpage +The part, which makes the chart nicer, is there: + +\begin{verbatim} +%... +\coordinate (P0) at (sunpath cs:azi=98.968673,alt=-0.208672); +\coordinate (P1) at (sunpath cs:azi=102.009695,alt=2.035492); +\coordinate (P2) at (sunpath cs:azi=126.513583,alt=19.499874); +\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335); +\coordinate (P4) at (sunpath cs:azi=192.292832,alt=33.425294); +\coordinate (P5) at (sunpath cs:azi=224.708002,alt=24.034984); +\coordinate (P6) at (sunpath cs:azi=250.626597,alt=7.619801); +\coordinate (P7) at (sunpath cs:azi=260.810553,alt=-0.244637); +\path[sun point] (P0) circle; +\path[sun point] (P1) circle; +\path[sun point] (P2) circle; +\path[sun point] (P3) circle; +\path[sun point] (P4) circle; +\path[sun point] (P5) circle; +\path[sun point] (P6) circle; +\path[sun point] (P7) circle; +\node[sun label,anchor=270-98.968673] at (P0) {07:44}; +\node[sun label,anchor=270-102.009695] at (P1) {08:00}; +\node[sun label,anchor=270-126.513583] at (P2) {10:00}; +\node[sun label,anchor=270-156.854847] at (P3) {12:00}; +\node[sun label,anchor=270-192.292832] at (P4) {14:00}; +\node[sun label,anchor=270-224.708002] at (P5) {16:00}; +\node[sun label,anchor=270-250.626597] at (P6) {18:00}; +\node[sun label,anchor=270-260.810553] at (P7) {18:53}; +\path[sun path curve] (P0) to [curve through={ + (P1) .. (P2) .. (P3) .. (P4) .. (P5) .. (P6) + }] + (P7) ; +%... +\end{verbatim} + +To set the altitude scale (and also the altitude lines) equidistance, just use the option \verb|altitude mapping=equidistance|. +The chart above with same data looks like the chart below with this option. + +\marginpar{\texttt{altitude mapping}} \texttt{ = equidistance} + +\begin{tikzpicture}[spradius=6,altitude mapping=equidistance] +\tikzset{ + sun path curve/.style={draw=red!20,thick}, + sun point/.style={radius=2pt,draw=red,fill=red}, + sun label/.style={below,fill=white,outer sep=4pt,text=red}, +} +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + +\coordinate (P0) at (sunpath cs:azi=98.968673,alt=-0.208672); +\coordinate (P1) at (sunpath cs:azi=102.009695,alt=2.035492); +\coordinate (P2) at (sunpath cs:azi=126.513583,alt=19.499874); +\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335); +\coordinate (P4) at (sunpath cs:azi=192.292832,alt=33.425294); +\coordinate (P5) at (sunpath cs:azi=224.708002,alt=24.034984); +\coordinate (P6) at (sunpath cs:azi=250.626597,alt=7.619801); +\coordinate (P7) at (sunpath cs:azi=260.810553,alt=-0.244637); +\path[sun point] (P0) circle; +\path[sun point] (P1) circle; +\path[sun point] (P2) circle; +\path[sun point] (P3) circle; +\path[sun point] (P4) circle; +\path[sun point] (P5) circle; +\path[sun point] (P6) circle; +\path[sun point] (P7) circle; +\node[sun label,anchor=270-98.968673] at (P0) {07:44}; +\node[sun label,anchor=270-102.009695] at (P1) {08:00}; +\node[sun label,anchor=270-126.513583] at (P2) {10:00}; +\node[sun label,anchor=270-156.854847] at (P3) {12:00}; +\node[sun label,anchor=270-192.292832] at (P4) {14:00}; +\node[sun label,anchor=270-224.708002] at (P5) {16:00}; +\node[sun label,anchor=270-250.626597] at (P6) {18:00}; +\node[sun label,anchor=270-260.810553] at (P7) {18:53}; +\path[sun path curve] (P0) to [curve through={ (P1) .. (P2) .. (P3) .. (P4) .. (P5) .. (P6) }] (P7) ; + +\spaltitudelabel{{10,20,...,80,85}}[170] +\spazimuthlabel{{0,15,...,350}} +\spgeodirection +\end{tikzpicture} + + diff --git a/graphics/pgf/contrib/sunpath/sunpath.dtx b/graphics/pgf/contrib/sunpath/sunpath.dtx new file mode 100644 index 0000000000..916443f98f --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.dtx @@ -0,0 +1,353 @@ +% \iffalse meta-comment +% +% File: sunpath.dtx Copyright (C) 2024 Hong-Phuc Bui +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% https://www.latex-project.org/lppl.txt +% +% +% ----------------------------------------------------------------------- +% +% The development version of the bundle can be found at +% +% https://github.com/hpb-htw/sunpath +% +% for those people who are interested. +% +% ----------------------------------------------------------------------- +% \fi +% +% ^^A To get version of latex run: +% ^^A `latex '\typeout{\fmtversion}\stop' | grep LaTeX2e` +% +% \iffalse +%<package>\NeedsTeXFormat{LaTeX2e}[2022/11/01] +%<package>\ProvidesPackage{sunpath}[2024/10/20 v0.5 Draw Sun Path] +% \fi + +% \changes{v0.5} +% {2024/10/20} +% {replace prefix "draw" in exposed commands by "sp"} +% \changes{v0.4-Alpha} +% {2024/10/20} +% {rename option altitude projection to altitude mapping} +% \changes{v0.3-Alpha} +% {2024/10/16} +% {add style option in exposed commands; +% let build.lua read version information from sunpath.dtx file} +% +% \changes{v0.2-Alpha} +% {2024/10/16} +% {Small fixes in README.md and document} +% +% \changes{v0.1-Alpha} +% {2024/10/10} +% {Initial implementation} + + +% \section{Implementation} +% +% \subsection{Package Dependenies} +% +% \begin{macrocode} +\RequirePackage{expl3} +\RequirePackage{tikz} +% \end{macrocode} +% +% Load necsessary \texttt{tikz}-libraries. +% \begin{macrocode} +\usetikzlibrary{calc,math,through} +% \end{macrocode} + + + + +% \subsection{\texttt{tikz}-Options for the new coordinate system} +% Setup options for \texttt{tikzpicture} environment. +% +% \DescribeMacro{spradius} The radius of the 0° Altitude circle, default 5.5. +% This value can be accessed via macro \verb:\spradius:. +% +% \DescribeMacro{altitude mapping} +% How the altitude of the sun is mapped on the sunpath diagram. +% This mapping is a function $f(\theta): [-90,90] \to [0, r]$, where $r$ is saved in \verb|\spradius|. +% +% Valid values are \texttt{spherical} and \texttt{equidistance}. +% Its default value is \texttt{spherical}. +% +% This value can be accessed via macro \verb:\altmapping:. + +% These options can be used like: +% +% \begin{verbatim} +% \begin{tikzpicture}[spradius=6,altitude projection=equidistance] +% \coordinate (sunrise) at (sunpath cs:azi=105, alt=66.6); +% \end{tikzpicture} +% \end{verbatim} +% +% \begin{macrocode} +\pgfkeys{/tikz/.cd, + spradius/.store in=\spradius, + spradius=5.5, + altitude mapping/.store in = \altmapping, + altitude mapping=spherical +} +% \end{macrocode} +% + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \subsection{Define the new coordinate system \texttt{sunpath}} +\makeatletter + +% \subsubsection{Azimuth and altitude} +% Define component \texttt{azi} (=Azimuth angle) and \texttt{alt} (=Altidude angle) for the coordinate system \texttt{sunpath}. +% \begin{macrocode} +\tikzset{ + cs/azi/.store in=\tikz@cs@azi, + cs/alt/.store in=\tikz@cs@alt, +} +% \end{macrocode} + + +% \subsubsection{Projection functions} +% Funtions to map the atitude of the sun to the altitude value on the sun path diagram. +% +% \DescribeMacro{spherical} +% maps an altitude angle $\theta$ to the altitude radius on the diagram with the function +% \[s (\theta) = r \cos(\theta). \] +% +% \DescribeMacro{equidistance} +% maps an altitude angle $\theta$ to the altitude radius on the diagram with the function +% \[e (\theta) = r - r \cdot \frac{\left\lvert \theta \right\rvert}{90}. \] +% +% \DescribeMacro{altradius} +% this function is used in the coordinate system \texttt{sunpath} to determinate the altitude +% radius of an azimuth angle on the sun path chart. +% It depends on the value of the option \verb:altitude projection:. +% +% +% \DescribeMacro{aziangle} +% maps the azimuth angle $\Phi$ to the azimuth angle on the diagram with the function +% \[ a(\Phi) = 90 - \Phi. \] +% \begin{macrocode} +\tikzset{ + declare function = { + spherical(\alt) = \spradius * cos(\alt); + equidistance(\alt) = \spradius - \spradius*abs(\alt)/90; + altradius(\alt) = \altmapping(\alt); + aziangle(\x) = 90 - \x; + } +} +% \end{macrocode} +% + + +% \subsubsection{Coordinate system \texttt{sunpath}} +% \begin{macrocode} +\tikzdeclarecoordinatesystem{sunpath}% +{ + \tikzset{cs/.cd,azi=0,alt=0,#1} + \tikzmath{ + \r = altradius(\tikz@cs@alt); + \angle = aziangle(\tikz@cs@azi); + } + \pgfpointadd{\pgfpointxy{0}{0}}{% + \pgfpointpolarxy{\angle}{\r} + } +} +% \end{macrocode} +\makeatother + + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \subsection{Setup optical options for sunpath diagram} +% These are pre-defined \TikZ{} style for components of the chart. They can be easily changed by using \cmd{\tikzset}. +% +% \DescribeMacro{sunpath grid} \tikz{\draw [sunpath grid] (0,0) -- (1,0);} style for azimuth lines and altitude circles +% +% \DescribeMacro{sunpath tick} \tikz{\draw [sunpath tick] (0,0) -- (4pt,0);} style for ticks around the horizon line +% +% \DescribeMacro{sunpath minor tick} \tikz{\draw [sunpath minor tick] (0,0) -- (4pt,0);} style for minor ticks around horizon line +% +% \DescribeMacro{altitude label} \tikz{\node[altitude label] {80};} +% +% \DescribeMacro{azimuth label} \tikz{\node[altitude label] {350};} style for text label of altitude circle respective azimuth line +% +% \DescribeMacro{direction label} \tikz{\node[direction label] {N E S W}; } style for text label of four directions +% +% \begin{macrocode} +\tikzset{ + sunpath grid/.style={help lines,color=blue!45!white!80}, + sunpath tick/.style={draw,thick,color=blue!90!white!80}, + sunpath minor tick/.style={draw,thin,color=blue!90!white!80}, + altitude label/.style={ + font=\footnotesize\sffamily, + fill=white,minimum width={width("90")+2pt}, + inner sep=0.5pt + }, + azimuth label/.style={ + font=\footnotesize\sffamily, + minimum width={width("360")+2pt}, + inner sep=0.5pt + }, + direction label/.style={ + font=\normalsize\rmfamily + } +} +% \end{macrocode} + + +% \subsection{Expose some commands for end-user} + +% \DescribeMacro{\spcrosshair} \oarg{style} +% +% Draws a thin line from North to South and a thin line from East to West. +% Default value of \oarg{style} is \texttt{sunpath grid}. +% +% \begin{macrocode} +\NewDocumentCommand\spcrosshair{O{sunpath grid}}{ + \draw[#1] (-\spradius,0) -- (\spradius,0); + \draw[#1] (0,-\spradius) -- (0,\spradius); +} +% \end{macrocode} + + + + +% \DescribeMacro{\spgeodirection} \oarg{offset}\oarg{style} +% +% +% Puts four geographic directions North, East, South, West around the horinzon line. +% \oarg{offset} is the distance from horizon to the \TikZ{} node of the directions. +% Its default value is 22pt. +% Set it to zero causes that the directions are set very near to the horizon line. +% \begin{macrocode} +\NewDocumentCommand\spgeodirection{O{22pt} O{direction label}}{ + \foreach \dname / \dgrad in {N/0, E/90, S/180, W/270}{ + \tikzmath{ + \polarangle = aziangle(\dgrad); + } + \coordinate (D) at (\polarangle:\spradius cm + #1); + \node[#2,anchor=270-\dgrad] at (D) {\dname}; + } +} +% \end{macrocode} + + + + +% \DescribeMacro{\spaltitudecircle} \marg{range}\oarg{style} +% +% Draws altitude circle given by \marg{range}. +% The argument \marg{range} must be a valid \TikZ-range, which can be used in \cmd{\foreach}. +% For example \verb|{{10,20,...,80,85}}|. +% The argument \oarg{style} define the style of altitude circles, default is \texttt{sunpath~grid}. +% \begin{macrocode} +\NewDocumentCommand\spaltitudecircle{m O{sunpath grid}}{ + \foreach \altitude in #1 { + \coordinate (A) at (sunpath cs:azi=0,alt=\altitude) ; + \path[draw,sunpath grid] (0,0) circle[radius=altradius(\altitude)]; + } +} +% \end{macrocode} + + + + +% \DescribeMacro{\spaltitudelabel} \marg{range}\oarg{azimuth}\oarg{style} +% +% Draws the labels of altitude circles given by \marg{range}. +% Range must be an in \TikZ{} valid numeric range which can be used in \cmd{\foreach}. +% For example \verb|{{10,20,...,80}}| +% The labels are placed along the azimuth \oarg{azimuth} (default 135) +% and typeset with style \oarg{style} (default \texttt{altitude label}). +% +% \begin{macrocode} +\NewDocumentCommand\spaltitudelabel{m O{135} O{altitude label}}{ + \foreach \altitude in #1 { + \coordinate (A) at (sunpath cs:azi=#2,alt=\altitude) ; + \node [anchor=east,#3] at (A) {\altitude}; + } +} +% \end{macrocode} + + + + +% \DescribeMacro{\spazimuthlabel} \marg{range}\oarg{style} +% +% \begin{macrocode} +\NewDocumentCommand\spazimuthlabel{m O{azimuth label}}{ + \foreach \azimuth in #1 { + \tikzmath{ + \polarangle = aziangle(\azimuth); + } + \coordinate (D) at (\polarangle:\spradius cm + 13pt); + \node[#2] at (D) {\azimuth}; + } +} +% \end{macrocode} + + + + +% \DescribeMacro{\spazimuthline} \marg{range}\marg{start~alt}\marg{end~alt} +% +% \begin{macrocode} +\NewDocumentCommand\spazimuthline{m m m}{ + \foreach \azimuth in #1{ + \draw[sunpath grid] + (sunpath cs:azi=\azimuth,alt={#2}) -- (sunpath cs:azi=\azimuth,alt={#3}); + } +} +% \end{macrocode} + + + + +% \DescribeMacro{\spazimuthtick} \oarg{major}\oarg{minor}\oarg{mid} +% +% Draws ticks along and outside the horizon circle. The optional arguments \oarg{major}, +% \oarg{minor} and \oarg{mid} are the length of major ticks (every 10° from Zero), +% minor ticks (every 1°, from 1°) and the length of the middle ticks (every 30°, from 15°). +% Their default values are 6pt, 2.5pt and 5pt. +% +% \begin{macrocode} +\NewDocumentCommand\spazimuthtick{O{6pt} O{2.5pt} O{5pt}}{ + \foreach \azimuth in {10,20,...,360}{ + \tikzmath{ + \pa = aziangle(\azimuth); + } + \path[sunpath tick] (\pa:\spradius) -- (\pa:{\spradius cm + #1}); + } + + \foreach \azimuth in {1,2,...,360}{ + \tikzmath{ + \pa = aziangle(\azimuth); + } + \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm + #2}); + } + + \foreach \azimuth in {15,45,...,345}{ + \tikzmath{ + \pa = aziangle(\azimuth); + } + \path[sunpath minor tick] (\pa:\spradius) -- (\pa:{\spradius cm + #3}); + } +} +% \end{macrocode} + + + + +%%%%%%%%%%%%%% +\endinput +%%%%%%%%%%%%%% + + diff --git a/graphics/pgf/contrib/sunpath/sunpath.equidistance.pdf b/graphics/pgf/contrib/sunpath/sunpath.equidistance.pdf Binary files differnew file mode 100644 index 0000000000..2b2c5f5c6a --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.equidistance.pdf diff --git a/graphics/pgf/contrib/sunpath/sunpath.equidistance.tex b/graphics/pgf/contrib/sunpath/sunpath.equidistance.tex new file mode 100644 index 0000000000..2bbc7f3cf2 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.equidistance.tex @@ -0,0 +1,36 @@ +\documentclass{standalone} + + +\usepackage{fontspec} +\usepackage{sunpath} +\usetikzlibrary{hobby} + +\usepackage{hyperref} + +\pagecolor{white} +\begin{document} +\begin{tikzpicture}[spradius=6,altitude mapping=equidistance] +\tikzset{ + sun path curve/.style={draw=red!20,thick}, + sun point/.style={radius=2pt,draw=red,fill=red}, + sun label/.style={below,fill=white,outer sep=4pt,text=red}, +} +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + + +\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335); + +\path[sun point] (P3) circle; + +\node[sun label,anchor=270-156.854847] at (P3) {12:00}; + +\spaltitudelabel{{10,20,...,80,85}} +\spazimuthlabel{{0,15,...,350}} +\spgeodirection +\end{tikzpicture} +\end{document} + diff --git a/graphics/pgf/contrib/sunpath/sunpath.ins b/graphics/pgf/contrib/sunpath/sunpath.ins new file mode 100644 index 0000000000..726943e315 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.ins @@ -0,0 +1,62 @@ +\iffalse meta-comment + +File: sunpath.ins Copyright (C) 2024 by Hong-Phuc Bui + +It may be distributed and/or modified under the conditions of the +LaTeX Project Public License (LPPL), either version 1.3c of this +license or (at your option) any later version. The latest version +of this license is in the file + + https://www.latex-project.org/lppl.txt + + +The released version of this bundle is available from CTAN. + +----------------------------------------------------------------------- + +The development version of the bundle can be found at + + https://github.com/hpb-htw/sunpath + +for those people who are interested. + +----------------------------------------------------------------------- + +\fi + +\input l3docstrip.tex +\askforoverwritefalse +\usedir{tex/latex/sunpath} +% stop DocStrip adding rather wordy text +\preamble +\endpreamble +\postamble +Copyright (C) 2024 by + Hong-Phuc Bui + +It may be distributed and/or modified under the conditions of +the LaTeX Project Public License (LPPL), either version 1.3c of +this license or (at your option) any later version. The latest +version of this license is in the file: + + https://www.latex-project.org/lppl.txt + + +This work consists of the files sunpath.dtx, + sunpath.ins, + and the derived files sunpath.pdf, + sunpath.sty. + +\endpostamble + +\keepsilent + +\generate {% + \file{sunpath.sty} {% + \from{sunpath.dtx}{package} + } +} + +\endbatchfile + + diff --git a/graphics/pgf/contrib/sunpath/sunpath.pdf b/graphics/pgf/contrib/sunpath/sunpath.pdf Binary files differnew file mode 100644 index 0000000000..77235519dd --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.pdf diff --git a/graphics/pgf/contrib/sunpath/sunpath.scrartcl.pdf b/graphics/pgf/contrib/sunpath/sunpath.scrartcl.pdf Binary files differnew file mode 100644 index 0000000000..78c93c271a --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.scrartcl.pdf diff --git a/graphics/pgf/contrib/sunpath/sunpath.scrartcl.tex b/graphics/pgf/contrib/sunpath/sunpath.scrartcl.tex new file mode 100644 index 0000000000..d3293d1792 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.scrartcl.tex @@ -0,0 +1,39 @@ +\documentclass{scrartcl} + +\usepackage{fontspec} +\usepackage{luaotfload} +\usepackage{tikz} +\usepackage{graphicx} +\usepackage{float} + +\usepackage{sunpath} + +\usetikzlibrary{hobby} % this library let one connect points to curve. + +\newcommand{\TikZ}{Ti\textit{k}Z} + +\title{ + \textsf{sunpath} -- Draw Sun Path\\ + (Test Compatibility only) +}% +% +\author{% + Hồng-Phúc Bùi% +} + + + +\begin{document} +% +\parindent0pt +% +\maketitle +\tableofcontents + +\section{Object} + +This file tests if this package can be used within a \texttt{scrartcl} class. + +\input{sunpath.docpart.tex} + +\end{document} diff --git a/graphics/pgf/contrib/sunpath/sunpath.spherical.pdf b/graphics/pgf/contrib/sunpath/sunpath.spherical.pdf Binary files differnew file mode 100644 index 0000000000..0655714ca1 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.spherical.pdf diff --git a/graphics/pgf/contrib/sunpath/sunpath.spherical.tex b/graphics/pgf/contrib/sunpath/sunpath.spherical.tex new file mode 100644 index 0000000000..6a231c19c7 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.spherical.tex @@ -0,0 +1,36 @@ +\documentclass{standalone} + + +\usepackage{fontspec} +\usepackage{sunpath} +\usetikzlibrary{hobby} + +\usepackage{hyperref} + +\pagecolor{white} +\begin{document} +\begin{tikzpicture}[spradius=6] +\tikzset{ + sun path curve/.style={draw=red!20,thick}, + sun point/.style={radius=2pt,draw=red,fill=red}, + sun label/.style={below,fill=white,outer sep=4pt,text=red}, +} +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + + +\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335); + +\path[sun point] (P3) circle; + +\node[sun label,anchor=270-156.854847] at (P3) {12:00}; + +\spaltitudelabel{{10,20,...,80,85}} +\spazimuthlabel{{0,15,...,350}} +\spgeodirection +\end{tikzpicture} +\end{document} + diff --git a/graphics/pgf/contrib/sunpath/sunpath.tex b/graphics/pgf/contrib/sunpath/sunpath.tex new file mode 100644 index 0000000000..1468c48687 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.tex @@ -0,0 +1,61 @@ +% main document +% separated from dtx, sothat there is no unrelated things in the dtx itselft, but only code and comment for package + +\documentclass{ltxdoc} + +\usepackage{fontspec} +\usepackage{luaotfload} +\usepackage{tikz} +\usepackage{graphicx} +\usepackage{float} +\usepackage{mathtools} + + +\usepackage{sunpath} + +\usetikzlibrary{hobby} % this library let one connect points to curve. + +\newcommand{\TikZ}{Ti\textit{k}Z} + +\EnableCrossrefs +\CodelineIndex +\RecordChanges + +\GetFileInfo{\jobname.sty} +% +\title{ + \pkg{sunpath} -- Draw Sun Path% + \thanks{This file describes \fileversion, % + last revised \filedate.}\\[1ex]% + \normalsize{Reference}% +}% +% +\author{% + Hồng-Phúc Bùi% + \thanks{% + E-mail: + \href{mailto:Hồng-Phúc Bùi} + {hong-phuc.bui (at) htwsaar dot de}% + }% +} +% +\date{Released \filedate} + + +\begin{document} +% +\parindent0pt +% +\maketitle +\tableofcontents + + +\input{sunpath.docpart.tex} + +\vfill\newpage +% get the document about implementation inside main document +\DocInput{\jobname.dtx} + +\PrintChanges +\PrintIndex +\end{document} diff --git a/graphics/pgf/contrib/sunpath/sunpath.track.pdf b/graphics/pgf/contrib/sunpath/sunpath.track.pdf Binary files differnew file mode 100644 index 0000000000..789e2c9230 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.track.pdf diff --git a/graphics/pgf/contrib/sunpath/sunpath.track.tex b/graphics/pgf/contrib/sunpath/sunpath.track.tex new file mode 100644 index 0000000000..64f7256356 --- /dev/null +++ b/graphics/pgf/contrib/sunpath/sunpath.track.tex @@ -0,0 +1,56 @@ +\documentclass{standalone} + + +\usepackage{fontspec} +\usepackage{sunpath} +\usetikzlibrary{hobby} + +\usepackage{hyperref} + +\pagecolor{white} +\begin{document} +\begin{tikzpicture}[spradius=4] +\tikzset{ + sun path curve/.style={draw=red!20,thick}, + sun point/.style={radius=2pt,draw=red,fill=red}, + sun label/.style={below,fill=white,outer sep=3pt,inner sep=0pt,text=red}, + small alt label/.style={altitude label,font=\scriptsize\sffamily} +} +\spcrosshair +\spaltitudecircle{{0,10,...,80,85}} +\spazimuthline{{0,10,...,360}}{85}{70} +\spazimuthline{{0,5,...,360}}{80}{0} +\spazimuthtick + +\coordinate (P0) at (sunpath cs:azi=98.968673,alt=-0.208672); +\coordinate (P1) at (sunpath cs:azi=102.009695,alt=2.035492); +\coordinate (P2) at (sunpath cs:azi=126.513583,alt=19.499874); +\coordinate (P3) at (sunpath cs:azi=156.854847,alt=31.593335); +\coordinate (P4) at (sunpath cs:azi=192.292832,alt=33.425294); +\coordinate (P5) at (sunpath cs:azi=224.708002,alt=24.034984); +\coordinate (P6) at (sunpath cs:azi=250.626597,alt=7.619801); +\coordinate (P7) at (sunpath cs:azi=260.810553,alt=-0.244637); +\path[sun point] (P0) circle; +\path[sun point] (P1) circle; +\path[sun point] (P2) circle; +\path[sun point] (P3) circle; +\path[sun point] (P4) circle; +\path[sun point] (P5) circle; +\path[sun point] (P6) circle; +\path[sun point] (P7) circle; +\node[sun label,anchor=270-98.968673] at (P0) {07:44}; +\node[sun label,anchor=270-102.009695] at (P1) {08:00}; +\node[sun label,anchor=270-126.513583] at (P2) {10:00}; +\node[sun label,anchor=270-156.854847] at (P3) {12:00}; +\node[sun label,anchor=270-192.292832] at (P4) {14:00}; +\node[sun label,anchor=270-224.708002] at (P5) {16:00}; +\node[sun label,anchor=270-250.626597] at (P6) {18:00}; +\node[sun label,anchor=270-260.810553] at (P7) {18:53}; +\path[sun path curve] (P0) to [curve through={ (P1) .. (P2) .. (P3) .. (P4) .. (P5) .. (P6) }] (P7) ; + +\spaltitudelabel{{10,30,40,...,80,85}}[175][small alt label] +\spazimuthlabel{{0,15,...,350}} +\spgeodirection +\end{tikzpicture} +\end{document} + diff --git a/graphics/pgf/contrib/tikz-decofonts/README.md b/graphics/pgf/contrib/tikz-decofonts/README.md new file mode 100644 index 0000000000..684a360e7c --- /dev/null +++ b/graphics/pgf/contrib/tikz-decofonts/README.md @@ -0,0 +1,8 @@ +This package provides some macros to present simple decoration fonts, made with TikZ. +Available decorations are brushpaint and inkline, and gridlcd. +------------------------------------------------------------------------------------- +Author...: Cédric Pierquet +email....: cpierquet@outlook.fr +Licences.: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt + CC BY-SA 4.0 (https://tex.stackexchange.com/questions/475141/simulating-paintbrush-strokes-in-tikz from user121799) + CC BY-SA 4.0 (https://tex.stackexchange.com/questions/460836/custom-line-cap-to-simulate-inked-line-in-tikz/460842#460842 from user121799)
\ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-decofonts/doc/tikz-decofonts-doc.pdf b/graphics/pgf/contrib/tikz-decofonts/doc/tikz-decofonts-doc.pdf Binary files differnew file mode 100644 index 0000000000..1a5dfe3db0 --- /dev/null +++ b/graphics/pgf/contrib/tikz-decofonts/doc/tikz-decofonts-doc.pdf diff --git a/graphics/pgf/contrib/tikz-decofonts/doc/tikz-decofonts-doc.tex b/graphics/pgf/contrib/tikz-decofonts/doc/tikz-decofonts-doc.tex new file mode 100644 index 0000000000..aa9da75d2b --- /dev/null +++ b/graphics/pgf/contrib/tikz-decofonts/doc/tikz-decofonts-doc.tex @@ -0,0 +1,344 @@ +% !TeX TXS-program:compile = txs:///arara +% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} +% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} + +\documentclass[11pt,a4paper]{ltxdoc} +\usepackage{bera} +\usepackage{inconsolata} +\usepackage[T1]{fontenc} +\usepackage[scale=0.875]{cabin} +\usepackage{tikz-decofonts} +\usepackage{fancyvrb} +\usepackage{fancyhdr} +\usepackage{tabularray} +\usepackage{fontawesome5} +\fancyhf{} +\renewcommand{\headrulewidth}{0pt} +\lfoot{\sffamily\small [tikz-decofonts]} +\cfoot{\sffamily\small - \thepage{} -} +\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} +\usepackage{hologo} +\providecommand\tikzlogo{Ti\textit{k}Z} +\providecommand\TeXLive{\TeX{}Live\xspace} +\let\TikZ\tikzlogo + +\usepackage{hyperref} +\urlstyle{same} +\hypersetup{pdfborder=0 0 0} +\usepackage[margin=2cm]{geometry} +\setlength{\parindent}{0pt} +\def\TPversion{0.1.0} +\def\TPdate{14/10/2024} +\usepackage{tcolorbox} +\tcbuselibrary{breakable,skins,hooks,listingsutf8} + +\lstset{ + language=[LaTeX]TeX,% + basicstyle=\ttfamily,% + keywordstyle={\color{blue}},% + classoffset=0,% + keywords={},% + alsoletter={-},% + keywordstyle={\color{blue}},% + classoffset=1,% + alsoletter={-},% + morekeywords={commalists-tools},% + keywordstyle={\color{violet}},% + classoffset=2,% + alsoletter={-},% + morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote},% + keywordstyle={\color{green!50!black}},% + classoffset=3,% + morekeywords={},% + keywordstyle={\color{orange}} +} + +\newtcblisting{DemoCode}[1]{% + enhanced,width=\linewidth,% + bicolor,size=title,% + colback=cyan!10!white,% + colbacklower=cyan!5!white,% + colframe=cyan!75!black,% + listing options={% + breaklines=true,% + breakatwhitespace=true,% + style=tcblatex,basicstyle=\small\ttfamily,% + tabsize=4,% + commentstyle={\itshape\color{gray}}, + keywordstyle={\color{blue}},% + classoffset=0,% + keywords={\usepackage,\includegraphics,xstring,listofitems,\readlist,\showitems,\xintFor,\xintSeq},% + alsoletter={-},% + keywordstyle={\color{blue}},% + classoffset=1,% + alsoletter={-},% + morekeywords={euromoney},% + keywordstyle={\color{violet}},% + classoffset=2,% + alsoletter={-},% + morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote},% + keywordstyle={\color{green!50!black}},% + classoffset=3,% + morekeywords={color,lines,scale,height,offseth,offsetv,thick,gridcolor,gridafter,nospaceafter,border},% + keywordstyle={\color{orange}} + },% + #1 +} + +\newtcbinputlisting\DemoCodeFile[1]{% + enhanced,width=\linewidth,% + bicolor,size=title,% + colback=lightgray!10!white,% + colbacklower=lightgray!5!white,% + colframe=lightgray!75!black,% + listing options={% + breaklines=true,% + breakatwhitespace=true,% + style=tcblatex, + basicstyle=\scriptsize\ttfamily,% + tabsize=4,% + commentstyle={\itshape\color{gray}},% + %lastline=148 + },% + breakable, + listing only,% + listing file={#1} +} + +\NewDocumentCommand\ShowCode{ m }{% + \lstinline{#1}% +} + +\begin{document} + +\thispagestyle{empty} + +\begin{center} + \begin{minipage}{0.88\linewidth} + \begin{tcolorbox}[colframe=yellow,colback=yellow!15] + \begin{center} + \renewcommand{\arraystretch}{1.25}% + \begin{tabular}{c} + {\Huge \texttt{tikz-decofonts}}\\ + \\ + {\LARGE Simple "decoration" fonts, made} \\ + {\LARGE with Ti\textit{k}Z, for small texts\ldots} \\ + \\ + {\small \texttt{Version \TPversion{} -- \TPdate}} + \end{tabular} + \end{center} + \end{tcolorbox} + \end{minipage} +\end{center} + +\begin{center} + \begin{tabular}{c} + \texttt{Cédric Pierquet}\\ + {\ttfamily c pierquet -- at -- outlook . fr}\\ + \texttt{\url{https://github.com/cpierquet/tikz-decofonts}} \\ + \end{tabular} +\end{center} + +\hrule + +\vfill + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only} +%paintbrush effect +\tkzbrush[color=blue]{DECORATION} + +%paintink effect +\tkzink[color=orange]{DECORATION} + +%pixeletter effect +\tkzpixl[color=violet]{DECORATION} +\end{tcblisting} + +\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] +\tkzbrush[color=blue]{DECORATION} +\end{tcolorbox} + +\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] +\hfill\tkzink[color=orange]{DECORATION}\hfill~ +\end{tcolorbox} + +\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] +\hfill\tkzpixl[color=violet]{Decoration} +\end{tcolorbox} + +\vfill~ + +\hrule + +\vspace*{5mm} + +\textit{Ideas and parts of codes, with \texttt{CC\,BY-SA\,4.0} licenses, come from :} + +\begin{itemize} + \item \href{https://tex.stackexchange.com/questions/475141/simulating-paintbrush-strokes-in-tikz}{[link on tex.stackexchange]} from \textsf{user121799} for paintbrush; + \item \href{https://tex.stackexchange.com/questions/460836/custom-line-cap-to-simulate-inked-line-in-tikz/460842#460842}{[link on tex.stackexchange]} from \textsf{user121799} for inkbrush. +\end{itemize} + +\pagebreak + +\phantomsection + +\hypertarget{matoc}{} + +\tableofcontents + +\vspace*{5mm} + +%\hrule + +\pagebreak + +\section{Loading, useful packages, purposes and acknowledgments} + +\subsection{Loading and useful packages} + +In order to load \texttt{tikz-decofonts}, simply use: + +\begin{DemoCode}{listing only} +\usepackage{tikz-decofonts} +\end{DemoCode} + +Loaded packages are \texttt{tikz}, \texttt{xintexpr}, \texttt{simplekv} and \texttt{xstring}. + +Loaded \texttt{tikz.librairies} are \texttt{decorations}, \texttt{decorations.pathreplacing}, \texttt{calc}, \texttt{positioning}, \texttt{bbox}, \texttt{arrows.meta} and \texttt{bending}. + +\smallskip + +Globally, height of rendering is about 1cm, but some customization are available. + +\subsection{Purposes and acknowledgments} + +The purposes of this small package is not to provide full fonts, with all characters, but give restricted possibility to present \textbf{short} texts of title with \textit{cute} effects. + +\smallskip + +These decorations are not destined to be use for whole paragraphs or texts, but just for fun for small titles or small texts. + +\smallskip + +Since many calculations are required internally, compilation time can be increased, so be careful with intensive use! + +\smallskip + +\textit{Ideas and parts of codes, with \texttt{CC\,BY-SA\,4.0} licenses, come from:} + +\begin{itemize} + \item \href{https://tex.stackexchange.com/questions/475141/simulating-paintbrush-strokes-in-tikz}{[link on tex.stackexchange]} from \textsf{user121799} for paintbrush; + \item \href{https://tex.stackexchange.com/questions/460836/custom-line-cap-to-simulate-inked-line-in-tikz/460842#460842}{[link on tex.stackexchange]} from \textsf{user121799} for inkbrush. +\end{itemize} + +Some adjustments (keys, paths) are maid from original code, but the global usage is due to the links above ! + +\pagebreak + +\section{The different effects} + +\subsection{Paint brush} + +{\small\faBomb} The effect is \textbf{very} \textit{time-consuming} to compile !! + +\begin{DemoCode}{listing only} +%only uppercase letters allowed +\tkzbrush[color=...,lines=...,scale=...]<tikzpicture options>{short text} + +%color = black by default +%lines = 12 by default +%scale = 1 by default +\end{DemoCode} + +\begin{DemoCode}{listing only} +%default output +\tkzbrush{TIKZ DECORATION} +\end{DemoCode} + +\begin{DemoCode}{text only} +%default output +\tkzbrush{TIKZ DECORATION} + +\end{DemoCode} + +\begin{DemoCode}{listing only} +%customization(s) (external file for speeding rendering ^^) +\tkzbrush[color=red,lines=20,scale=1.5]{CUSTOM TEXT} +\end{DemoCode} + +\begin{DemoCode}{text only} +%customization(s) (external file for speeding rendering ^^) +\includegraphics{tkzbrushA.pdf} +\end{DemoCode} + +\pagebreak + +\subsection{Ink brush} + +\begin{DemoCode}{listing only} +%only uppercase letters allowed +\tkzink[color=...,thick=...,scale=...]<tikzpicture options>{short text} + +%color = black by default +%thick = 3 by default +%scale = 1 by default +\end{DemoCode} + +\begin{DemoCode}{} +%default output +\tkzink{TIKZ DECORATION} +\end{DemoCode} + +\begin{DemoCode}{} +%customization(s) +\tkzink[color=olive,thick=5,scale=2]{TIKZ DECORATION} +\end{DemoCode} + +\pagebreak + +\subsection{Pixl brush} + +\begin{DemoCode}{listing only} +%regular letters allowed (upper and/or lower), rendered characters are 5 columns x 7 lines +\tkzpixl% + [height=...,thick=...,color=...,gridcolor=...,border=..., + offseth=...,offsetv=...,gridafter=...,nospaceafter=...] + <tikzpicture options>{short text} + +\tkzpixletter% + [height=...,thick=...,color=...,gridcolor=...,border=..., + offseth=...,offsetv=...,gridafter=...,nospaceafter=...] + <tikzpicture options>{letter} + +\tkzpixlquote%if problem with '... + [height=...,thick=...,color=...,gridcolor=..., + offseth=...,offsetv=...,gridafter=...,nospaceafter=...] + <tikzpicture options> + +%height = 11mm by default, thick = 0.1mm by default +%color = black by default, gridcolor = gray by default +%offseth = 1 by default (squares left/right of regular character) +%offsetv = 2 by default (squares above/below of regular character) +%boder = false by default (boolean for adding border) +%gridafter = false by default (boolean for showing grid after pixls) +%nospaceafter = false by default (boolean for removeing hspace after pixls) +\end{DemoCode} + +\begin{DemoCode}{} +%default output, comparaison with character w/o offsets (5*7) +\tkzpixl{And then, 1+1=2 !?!} and \tkzpixletter[offseth=0,offsetv=0]{*} +\end{DemoCode} + +\begin{DemoCode}{} +%customization(s) +\tkzpixl[color=violet,height=1.75cm,gridafter,offsetv=3,border]{Small custo'm text} +\end{DemoCode} + +\pagebreak + +\section{History} + +\texttt{0.1.0: Initial version} + +\end{document} diff --git a/graphics/pgf/contrib/tikz-decofonts/doc/tkzbrushA.pdf b/graphics/pgf/contrib/tikz-decofonts/doc/tkzbrushA.pdf Binary files differnew file mode 100644 index 0000000000..764b4cc3a4 --- /dev/null +++ b/graphics/pgf/contrib/tikz-decofonts/doc/tkzbrushA.pdf diff --git a/graphics/pgf/contrib/tikz-decofonts/doc/tkzbrushA.tex b/graphics/pgf/contrib/tikz-decofonts/doc/tkzbrushA.tex new file mode 100644 index 0000000000..bda9222441 --- /dev/null +++ b/graphics/pgf/contrib/tikz-decofonts/doc/tkzbrushA.tex @@ -0,0 +1,11 @@ +% !TeX TXS-program:compile = txs:///arara +% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} + +\documentclass{standalone} +\usepackage{tikz-decofonts} + +\begin{document} + +\tkzbrush[color=red,lines=20,scale=1.5]{CUSTOM TEXT} + +\end{document} diff --git a/graphics/pgf/contrib/tikz-decofonts/tex/tikz-decofonts.sty b/graphics/pgf/contrib/tikz-decofonts/tex/tikz-decofonts.sty new file mode 100644 index 0000000000..984ac0a5f9 --- /dev/null +++ b/graphics/pgf/contrib/tikz-decofonts/tex/tikz-decofonts.sty @@ -0,0 +1,896 @@ +% Author : C. Pierquet +% licences : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf +% : CC BY-SA 4.0 (https://tex.stackexchange.com/questions/475141/simulating-paintbrush-strokes-in-tikz from user121799) +% : (https://tex.stackexchange.com/questions/460836/custom-line-cap-to-simulate-inked-line-in-tikz/460842#460842 from user121799) + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{tikz-decofonts}[2024/10/14 0.1.0 Custom fonts, made with TikZ, with effects] + +%------History +% 0.1.0 Initial version + +%------Packages and library +\RequirePackage{tikz} +\RequirePackage{xstring} +\RequirePackage{xintexpr} +\RequirePackage{simplekv} +\usetikzlibrary{decorations,decorations.pathreplacing,calc,positioning,bbox,arrows.meta,bending} + +%------Paintbrush +\pgfmathdeclarerandomlist{randcolor}{{black}{white}} +\pgfkeys{/brush pars/.cd, + lines/.initial={\tkzbrushlines}, + distance/.initial=0.25pt +} +\tikzset{ + brush/.style={ + decorate, + decoration={ + show path construction, + lineto code={ + \foreach\Xbrush in{1,...,\pgfkeysvalueof{/brush pars/lines}}{ + \pgfmathrandomitem{\c}{randcolor} + \pgfmathtruncatemacro{\mix}{100-24*rnd} + \draw[color=brushcolor!\mix!\c, + shorten >={(3-4*rnd)*1pt + -0.5*\pgfkeysvalueof{/brush pars/lines}*\pgfkeysvalueof{/brush pars/distance}}, + shorten <={(3-4*rnd)*1pt + -0.5*\pgfkeysvalueof{/brush pars/lines}*\pgfkeysvalueof{/brush pars/distance}}] + let \p1=($(\tikzinputsegmentlast)-(\tikzinputsegmentfirst)$), + \n1={90+atan2(\y1,\x1)} in + ($(\tikzinputsegmentfirst)+(\n1:{((1.02-0.04*rnd)*\Xbrush-\pgfkeysvalueof{/brush pars/lines}/2)*\pgfkeysvalueof{/brush pars/distance}})$) + -- + ($(\tikzinputsegmentlast)+(\n1:{((1.02-0.04*rnd)*\Xbrush-\pgfkeysvalueof{/brush pars/lines}/2)*\pgfkeysvalueof{/brush pars/distance}})$); + } + }, + curveto code={ + \foreach\Xbrush in{1,...,\pgfkeysvalueof{/brush pars/lines}}{ + \pgfmathrandomitem{\c}{randcolor} + \pgfmathtruncatemacro{\mix}{100-24*rnd} + \draw[color=brushcolor!\mix!\c,shorten >={(3-4*rnd)*1pt + -0.5*\pgfkeysvalueof{/brush pars/lines}*\pgfkeysvalueof{/brush pars/distance}}, + shorten <={(3-4*rnd)*1pt + -0.5*\pgfkeysvalueof{/brush pars/lines}*\pgfkeysvalueof{/brush pars/distance}}] + let \p1=($(\tikzinputsegmentsupporta)-(\tikzinputsegmentfirst)$), + \p2=($(\tikzinputsegmentsupportb)-(\tikzinputsegmentsupporta)$), + \p3=($(\tikzinputsegmentlast)-(\tikzinputsegmentsupportb)$), + \n1={90+atan2(\y1,\x1)}, \n2={90+atan2(\y2,\x2)}, + \n3={90+atan2(\y3,\x3)} in + ($(\tikzinputsegmentfirst)+(\n1:{((1.02-0.04*rnd)*\Xbrush-\pgfkeysvalueof{/brush pars/lines}/2)*\pgfkeysvalueof{/brush pars/distance}})$) + .. controls ($(\tikzinputsegmentsupporta)+(\n2:{((1.02-0.04*rnd)*\Xbrush-\pgfkeysvalueof{/brush pars/lines}/2)*\pgfkeysvalueof{/brush pars/distance}})$) + and ($(\tikzinputsegmentsupportb)+(\n3:{((1.02-0.04*rnd)*\Xbrush-\pgfkeysvalueof{/brush pars/lines}/2)*\pgfkeysvalueof{/brush pars/distance}})$) .. + ($(\tikzinputsegmentlast)+(\n3:{((1.02-0.04*rnd)*\Xbrush-\pgfkeysvalueof{/brush pars/lines}/2)*\pgfkeysvalueof{/brush pars/distance}})$); + } + }, + } + } +} +\tikzset{pics/.cd, + brushA/.style={code={% + \draw[brush] (0,-0.5) -- (0.25,0.5) -- (0.5,-0.5); + \draw[brush] (0.125,-0.15) -- (0.375,-0.15); + %\path (0.725,0);% + %\filldraw[blue] (0,0) circle[radius=2pt] ; + }% + }, + brushB/.style={code={% + \draw[brush] (0,-0.5) -- (0,0.5) to[out=0,in=0,looseness=2.5] (0,0) to[out=0,in=0,looseness=3] cycle; + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushC/.style={code={% + \draw[brush] (0,0) to[out=90,in=180] (0.25,0.5) to[out=0,in=110] (0.5,0.325) ; + \draw[brush] (0,0) to[out=-90,in=180] (0.25,-0.5) to[out=0,in=-110] (0.5,-0.325) ; + %\draw[brush] (0,0) to[out=90,in=110,looseness=2] (0.5,0.325); + %\draw[brush](0,0) to[out=-90,in=-110,looseness=2] (0.5,-0.2325); + %\path (0.7,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushD/.style={code={% + \draw[brush] (0,-0.5) -- (0,0.5) to[out=0,in=0,looseness=1.75] cycle; + %\path (0.675,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushE/.style={code={% + \draw[brush] (0.425,-0.5) --(0,-0.5) -- (0,0.5) -- (0.425,0.5); + \draw[brush] (0,0) -- (0.425,0); + \path (0.5,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushF/.style={code={% + \draw[brush] (0,-0.5) -- (0,0.5) -- (0.425,0.5); + \draw[brush] (0,0) -- (0.425,0); + \path (0.5,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushG/.style={code={% + \draw[brush] (0,0) to[out=90,in=180] (0.25,0.5) to[out=0,in=100] (0.475,0.325) ; + \draw[brush] (0,0) to[out=-90,in=180] (0.25,-0.5) to[out=0,in=-110] (0.475,-0.1) ; + \draw[brush] (0.475,-0.1) to (0.275,-0.1); + %\draw[brush] (0,0) to[out=90,in=110,looseness=2] (0.5,0.25); + %\draw[brush] (0,0) to[out=-90,in=-110,looseness=2] (0.5,-0.25); + %\draw[brush] (0.5,-0.25) to (0.25,-0.25); + %\path (0.7,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushH/.style={code={% + \draw[brush] (0,-0.5) -- (0,0.5); + \draw[brush] (0.5,-0.5) -- (0.5,0.5); + \draw[brush] (0,0) -- (0.5,0); + %\path (0.7,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushI/.style={code={% + \draw[brush] (0,-0.5) -- (0,0.5); + %\path (0.25,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushJ/.style={code={% + \draw[brush] (0.35,0.5) -- (0.35,-0.35) to[out=-90,in=0] (0.175,-0.5) to[out=180,in=-90] (0,-0.3); + %\path (0.45,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushK/.style={code={% + \draw[brush] (0,-0.5) -- (0,0.5); + \draw[brush] (0.4,0.475) -- (0.02,0) -- (0.4,-0.475); + %\path (0.6,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushL/.style={code={ + \draw[brush] (0,0.5) -- (0,-0.5) -- (0.5,-0.5); + %\path (0.6,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushM/.style={code={ + \draw[brush] (0,-0.5) -- (0,0.5) -- (0.25,0.25) -- (0.5,0.5) -- (0.5,-0.5); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushN/.style={code={ + \draw[brush] (0,-0.5) -- (0,0.5) -- (0.5,-0.5) -- (0.5,0.5); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushO/.style={code={ + \draw[brush] (0.25,0) circle(0.25 and 0.5); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushP/.style={code={ + \draw[brush] (0,-0.5) -- (0,0.5) to[out=0,in=0,looseness=2.5] (0,0); + %\path (0.6,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushQ/.style={code={ + \draw[brush] (0.25,0) circle(0.25 and 0.5); + \draw[brush](0.35,-0.25) -- (0.475,-0.45); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushR/.style={code={ + \draw[brush] (0,-0.5) -- (0,0.5) to[out=0,in=0,looseness=2.5] (0.05,0) -- (0.5,-0.5); + %\path (0.6,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushS/.style={code={ + \draw[brush] (0.475,0.475) to[out=150,in=165,looseness=2.25] (0.25,0) to[out=-15,in=-30,looseness=2.25] (0.025,-0.475); + %\path (0.65,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushT/.style={code={ + \draw[brush] (0.25,-0.5) -- (0.25,0.5) (0,0.5) -- (0.5,0.5); + %\path (0.85,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushU/.style={code={ + \draw[brush] (0,0.5) -- (0,0) to[out=-90,in=-90,looseness=4] (0.5,0) -- (0.5,0.5); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushV/.style={code={ + \draw[brush] (0,0.5) -- (0.25,-0.5) -- (0.5,0.5); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushW/.style={code={ + \draw[brush] (0,0.5) -- (0.15,-0.5) -- (0.3,-0.25) -- (0.45,-0.5) -- (0.6,0.5); + %\path (1.1,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushX/.style={code={ + \draw[brush] (0,0.5) -- (0.5,-0.5); + \draw[brush] (0.5,0.5) -- (0,-0.5); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushY/.style={code={ + \draw[brush] (0,0.5) -- (0.25,0); + \draw[brush] (0.5,0.5) -- (0,-0.5); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushZ/.style={code={ + \draw[brush] (0,0.5) --(0.5,0.5) -- (0,-0.5) -- (0.5,-0.5); + %\path (0.8,0); + %\filldraw[blue] (0,0) circle[radius=2pt] ; + } + }, + brushspace/.style={code={\path (0,0) (0.2,0);}}, +} + + +\defKV[tkzbrush]{% + scale=\def\tkzbrushscale{#1},% + color=\colorlet{brushcolor}{#1},% + lines=\def\tkzbrushlines{#1},% + thick=\def\tkzbrushthick{#1} +} + +\setKVdefault[tkzbrush]{% + scale=1,% + color=black,% + lines=12,% + thick=3 +} + +%------inkbrush +\pgfdeclarearrow{ + name=ink, + parameters= {\the\pgfarrowlength}, + setup code={ + \pgfarrowssettipend{0pt} + \pgfarrowssetlineend{-\pgfarrowlength} + \pgfarrowlinewidth=\pgflinewidth + \pgfarrowssavethe\pgfarrowlength + }, + drawing code={ + \pgfpathmoveto{\pgfpoint{-\pgfarrowlength}{0.5\pgflinewidth}} + \pgfpathcurveto{\pgfpoint{-0.75\pgfarrowlength}{0.6\pgflinewidth}}{% + \pgfpoint{-0.01\pgfarrowlength}{0.6\pgflinewidth}}{% + \pgfpoint{0pt}{0pt}} + \pgfpathcurveto{\pgfpoint{-0.01\pgfarrowlength}{-0.5\pgflinewidth}}{% + \pgfpoint{-0.2\pgfarrowlength}{-(1+0.3*rnd)*\pgflinewidth}}{% + \pgfpoint{-0.3\pgfarrowlength}{-0.8*(1+0.3*rnd)*\pgflinewidth}} + \pgfpathcurveto{\pgfpoint{-0.4\pgfarrowlength}{-0.6*(1+0.3*rnd)*\pgflinewidth}}{% + \pgfpoint{-0.6\pgfarrowlength}{-0.3*(1+0.3*rnd)*\pgflinewidth}}{% + \pgfpoint{-1\pgfarrowlength}{-0.5\pgflinewidth}} + \pgfusepathqfill + }, + defaults={length=8pt} +} + +\tikzset{pics/.cd, + inkA/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,-0.5) -- (0.25,0.5) -- (0.5,-0.5); + \draw[line width={\tkzbrushthick}] (0.125,-0.15) -- (0.375,-0.15); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,-0.55) -- (0.3,0.4) -- (0.6,-0.55); + %\draw[line width=5](0.1,1/3-0.45) -- (0.5,1/3-0.45); + %\path (0.7,0); + } + }, + inkB/.style={code={ + \draw[line width={\tkzbrushthick},{ink[bend]}-{ink[bend]}] (0,-0.5) -- (0,0.5) to[out=0,in=0,looseness=2.5] (0,0) to[out=0,in=0,looseness=3] cycle; + %\draw[line width=5] (0,-0.45) -- (0,0.45) to[out=0,in=0,looseness=2.5] (0,0) to[out=0,in=0,looseness=3] cycle; + } + }, + inkC/.style={code={ + \draw[line width={\tkzbrushthick}] (0,0) to[out=90,in=180] (0.25,0.5) to[out=0,in=110] (0.5,0.325) ; + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0) to[out=-90,in=180] (0.25,-0.5) to[out=0,in=-110] (0.5,-0.325) ; + %\draw[line width=5,-{ink[bend]}] (0,0) to[out=90,in=110,looseness=2] (0.5,0.25); + %\draw[line width=5,-{ink[bend]}] (0,0) to[out=-90,in=-110,looseness=2] (0.5,-0.25); + %\path (0.7,0); + } + }, + inkD/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,-0.5) -- (0,0.5) to[out=0,in=0,looseness=1.75] (0.075,-0.5) ; + %\draw[line width=5] (0,-0.45) -- (0,0.45) to[out=0,in=0,looseness=2.25] cycle; + %\path (0.7,0); + } + }, + inkE/.style={code={% + \draw[line width={\tkzbrushthick},{ink[bend]}-] (0.5,0.5) -- (0,0.5) -- (0,-0.5) ; + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0) -- (0.425,0) ; + \draw[line width={\tkzbrushthick}] (0,-0.5) -- (0.4,-0.5); + %\draw[line width={\tkzbrushthick},{ink[bend]}-{ink[bend]}] (0.5,-0.45) --(0,-0.45) -- (0,0.45) -- (0.5,0.45); + %\draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0) -- (0.5,0); + %\path (0.7,0); + } + }, + inkF/.style={code={% + \draw[line width={\tkzbrushthick},{ink[bend]}-] (0.5,0.5) -- (0,0.5) -- (0,-0.5) ; + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0) -- (0.425,0) ; + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,-0.45) -- (0,0.45) -- (0.5,0.45); + %\draw[line width=5,-{ink[bend]}] (0,0) -- (0.5,0); + %\path (0.7,0); + } + }, + inkG/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0) to[out=90,in=180] (0.25,0.5) to[out=0,in=100] (0.475,0.325) ; + \draw[line width={\tkzbrushthick}] (0,0) to[out=-90,in=180] (0.25,-0.5) to[out=0,in=-110] (0.475,-0.1) ; + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0.475,-0.1) to (0.275,-0.1); + %\draw[line width=5,-{ink[bend]}] (0,0) to[out=90,in=110,looseness=2] (0.5,0.25); + %\draw[line width=5] (0,0) to[out=-90,in=-110,looseness=2] (0.5,-0.25); + %\draw[line width=5,-{ink[bend]}] (0.54,-0.25) to (0.3,-0.25); + %\path (0.7,0); + } + }, + inkH/.style={code={% + \draw[line width={\tkzbrushthick},{ink[bend]}-] (0,-0.5) -- (0,0.5); + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0.5,-0.5) -- ([yshift=1pt]0.5,0.5); + \draw[line width={\tkzbrushthick}] (0,0) -- (0.5,0); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,-0.5) -- (0,0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0.5,-0.5) -- (0.5,0.5); + %\draw[line width=5] (0,0) -- (0.5,0); + \path (0.7,0); + } + }, + inkI/.style={code={ + \draw[line width={\tkzbrushthick},-{ink[bend]}] ([yshift=-0.5pt]0,-0.5) -- ([yshift=1pt]0,0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,-0.45) -- (0,0.45); + \path (0.075,0); + } + }, + inkJ/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0.35,0.5) -- (0.35,-0.35) to[out=-90,in=0] (0.175,-0.5) to[out=180,in=-90] (0,-0.3); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0.2,0.45) -- (0.2,-0.35) to[out=-90,in=0] (0.1,-0.45) to[out=180,in=-90] (0,-0.35); + %\path (0.45,0); + } + }, + inkK/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,-0.5) -- ([yshift=1pt]0,0.5); + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0.4,0.5) -- (0.02,0) -- (0.4,-0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,-0.45) -- (0,0.45); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0.4,0.45) -- (0.02,0) -- (0.4,-0.45); + %\path (0.6,0); + } + }, + inkL/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.5) -- (0,-0.5) -- (0.5,-0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,0.5) -- (0,-0.45) -- (0.4,-0.45); + %\path (0.6,0); + } + }, + inkM/.style={code={% + \draw[line width={\tkzbrushthick}] (0,-0.5)--(0,0.45) ; + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.475) -- (0.25,0.25) -- (0.5,0.45) -- (0.5,-0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,-0.45) -- (0,0.45) -- (0.3,0.25) -- (0.6,0.45) -- (0.6,-0.45); + %\path (0.8,0);% + } + }, + inkN/.style={code={% + \draw[line width={\tkzbrushthick}] (0,-0.5)--(0,0.45) ; + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.475) -- (0.5,-0.51) -- (0.5,0.515); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,-0.45) -- (0,0.45) -- (0.6,-0.4) -- (0.6,0.45); + %\path (0.8,0); + } + }, + inkO/.style={code={% + \draw[line width={\tkzbrushthick}] (0.25,0) circle(0.25 and 0.5); + %\path (0.8,0); + } + }, + inkP/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,-0.5) -- (0,0.5) to[out=0,in=0,looseness=2.5] (0,0); + %\draw[line width=5,{ink[bend]}-] (0,-0.45) -- (0,0.45) to[out=0,in=0,looseness=2.5] (0,0); + %\path (0.6,0); + } + }, + inkQ/.style={code={% + \draw[line width={\tkzbrushthick}] (0.25,0) circle(0.25 and 0.5); + \draw[line width={\tkzbrushthick},{ink[bend]}-{ink[bend]}](0.35,-0.25) -- (0.5,-0.5); + %\draw[line width=5] (0.3,0) circle(0.3 and 0.48); + %\draw[line width=5,{ink[bend]}-{ink[bend]}](0.35,-0.25) -- (0.6,-0.45); + %\path (0.8,0); + } + }, + inkR/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,-0.5) -- (0,0.5) to[out=0,in=0,looseness=2.5] (0.05,0) -- (0.5,-0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,-0.45) -- (0,0.45) to[out=0,in=0,looseness=2.5] (0.05,0) -- (0.4,-0.45); + %\path (0.6,0); + } + }, + inkS/.style={code={% + \draw[line width={\tkzbrushthick},{ink[bend]}-] (0.475,0.475) to[out=150,in=165,looseness=2.25] (0.25,0) to[out=-15,in=-30,looseness=2.25] (0.025,-0.475); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0.5,0.4) to[out=160,in=165,looseness=2] (0.3,0) to[out=-15,in=-20,looseness=2] (0.1,-0.4); + %\path (0.65,0); + } + }, + inkT/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0.25,-0.5) -- (0.25,0.5) ; + \draw[line width={\tkzbrushthick}] (0,0.5) -- (0.5,0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0.35,-0.45) -- (0.35,0.45) (0,0.45) -- (0.7,0.45); + %\path (0.85,0); + } + }, + inkU/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.5) -- (0,0.25) to[out=-90,in=180] (0.25,-0.5) to[out=0,in=-90] (0.5,0.25) -- (0.5,0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,0.5) -- (0,0) to[out=-90,in=-90,looseness=2.5] (0.6,0) -- (0.6,0.5); + %\path (0.8,0); + } + }, + inkV/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.5) -- (0.25,-0.5) -- (0.5,0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,0.5) -- (0.3,-0.4) -- (0.6,0.5); + %\path (0.8,0); + } + }, + inkW/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.5) -- (0.15,-0.5) -- (0.3,-0.25) -- (0.45,-0.5) -- (0.6,0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,0.45) -- (0.3,-0.4) -- (0.45,-0.1) -- (0.6,-0.4) -- (0.9,0.45); + %\path (1.1,0); + } + }, + inkX/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.5) -- (0.5,-0.5); + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0.5,0.5) -- (0,-0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,0.45) -- (0.6,-0.45); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0.6,0.45) -- (0,-0.45); + %\path (0.8,0); + } + }, + inkY/.style={code={ + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.5) -- (0.25,0); + \draw[line width={\tkzbrushthick},{ink[bend]}-{ink[bend]}] (0.5,0.5) -- (0,-0.5); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,0.45) -- (0.3,0); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0.6,0.45) -- (0,-0.45); + %\path (0.8,0); + } + }, + inkZ/.style={code={% + \draw[line width={\tkzbrushthick},-{ink[bend]}] (0,0.5) --(0.5,0.5) -- (0,-0.5) -- (0.5,-0.45); + %\draw[line width=5,{ink[bend]}-{ink[bend]}] (0,0.45) --(0.6,0.45) -- (0,-0.45) -- (0.6,-0.45); + %\path (0.8,0); + } + }, + inkspace/.style={code={\path (0,0) (0.2,0);}}, +} + +%------macros +\NewDocumentCommand\tkzbrush{ O{} D<>{} m }{% + \restoreKV[tkzbrush]% + \setKV[tkzbrush]{#1}% + \StrChar{#3}{1}[\myfisrtchar]% + \StrLen{#3}[\mynbofchars]% + \begin{tikzpicture}%[bezier bounding box] + \pic[bezier bounding box,local bounding box=box1,scale={\tkzbrushscale},#2] at (0,0) {brush\myfisrtchar} ;% + %on boucle les lettres une par une ?? + \foreach \i [count=\Y,evaluate=\Y as \Z using {int(\Y+1)}] in {2,...,\mynbofchars}{% + \StrChar{#3}{\i}[\mytmpchar]% + \IfStrEq{\mytmpchar}{ }% + {% + \edef\temp{\noexpand\pic[bezier bounding box,right=2mm of box\Y,local bounding box=box\Z,scale={\tkzbrushscale},#2] {brushspace};} + \temp% + }% + {% + \edef\temp{\noexpand\pic[bezier bounding box,right=2mm of box\Y,local bounding box=box\Z,scale={\tkzbrushscale},#2] {brush\mytmpchar};} + \temp% + }% + }% + \end{tikzpicture}% +} + +\NewDocumentCommand\tkzink{ O{} D<>{} m }{% + \restoreKV[tkzbrush]% + \setKV[tkzbrush]{#1}% + \StrChar{#3}{1}[\myfisrtchar]% + \StrLen{#3}[\mynbofchars]% + \begin{tikzpicture}[brushcolor,line join=round,line cap=round]%,bezier bounding box] + \pic[bezier bounding box,local bounding box=box1,scale={\tkzbrushscale},#2] at (0,0) {ink\myfisrtchar} ;% + \foreach \i [count=\Y,evaluate=\Y as \Z using {int(\Y+1)}] in {2,...,\mynbofchars}{% + \StrChar{#3}{\i}[\mytmpchar]% + \IfStrEq{\mytmpchar}{ }% + {% + \edef\temp{\noexpand\pic[bezier bounding box,right=2mm of box\Y,local bounding box=box\Z,scale={\tkzbrushscale},#2] {inkspace};} + \temp% + }% + {% + \edef\temp{\noexpand\pic[bezier bounding box,right=2mm of box\Y,local bounding box=box\Z,scale={\tkzbrushscale},#2] {ink\mytmpchar};} + \temp% + }% + }% + \end{tikzpicture}% +} + + +%====PixlArt Words +\def\lsteightbittikzA{0,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,1}%7C*5L +\def\lsteightbittikzB{1,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,1,1,1,0}%7C*5L +\def\lsteightbittikzC{0,1,1,1,0,1,0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzD{1,1,1,0,0,1,0,0,1,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,1,0,0} +\def\lsteightbittikzE{1,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1} +\def\lsteightbittikzF{1,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0} +\def\lsteightbittikzG{0,1,1,1,0,1,0,0,0,1,1,0,0,0,0,1,0,1,1,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzH{1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1} +\def\lsteightbittikzI{1,1,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,1,1} +\def\lsteightbittikzJ{0,0,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,1,0,0,1,0,0,1,1,0,0} +\def\lsteightbittikzK{1,0,0,0,1,1,0,0,1,0,1,0,1,0,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,0,1} +\def\lsteightbittikzL{1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1} +\def\lsteightbittikzM{1,0,0,0,1,1,1,0,1,1,1,0,1,0,1,1,0,1,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1} +\def\lsteightbittikzN{1,0,0,0,1,1,0,0,0,1,1,1,0,0,1,1,0,1,0,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,1} +\def\lsteightbittikzO{0,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzP{1,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0} +\def\lsteightbittikzQ{0,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1} +\def\lsteightbittikzR{1,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,1,1,1,0,1,0,1,0,0,1,0,0,1,0,1,0,0,0,1} +\def\lsteightbittikzS{0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0} +\def\lsteightbittikzT{1,1,1,1,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0} +\def\lsteightbittikzU{1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzV{1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0} +\def\lsteightbittikzW{1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,0} +\def\lsteightbittikzX{1,0,0,0,1,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,1,0,0,0,1} +\def\lsteightbittikzY{1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0} +\def\lsteightbittikzZ{1,1,1,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,1,1,1,1,1} +\def\lsteightbittikza{0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,0,0,1,0,1,1,1,1} +\def\lsteightbittikzaaccent{0,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,0,0,1,0,1,1,1,1} +\def\lsteightbittikzaaigu{0,1,0,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,0,0,0,1,0,1,1,1,1} +\def\lsteightbittikzb{1,0,0,0,0,1,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,1,1,0} +\def\lsteightbittikzc{0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzd{0,0,0,0,1,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,1} +\def\lsteightbittikze{0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,0} +\def\lsteightbittikzeaccent{0,1,1,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,0} +\def\lsteightbittikzeaigu{0,1,0,1,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,0} +\def\lsteightbittikzf{0,0,1,1,0,0,1,0,0,1,0,1,0,0,0,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0} +\def\lsteightbittikzg{0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzh{1,0,0,0,0,1,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1} +\def\lsteightbittikzi{0,1,0,0,0,0,1,1,0,0,1,0,0,1,0,0,1,0,1,1,1} +\def\lsteightbittikziaccent{1,1,1,0,0,0,1,1,0,0,1,0,0,1,0,0,1,0,1,1,1} +\def\lsteightbittikziaigu{1,0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,1,0,1,1,1} +\def\lsteightbittikzj{0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,1,0,1,1,0} +\def\lsteightbittikzk{1,0,0,0,1,0,0,0,1,0,0,1,1,0,1,0,1,1,0,0,1,0,1,0,1,0,0,1} +\def\lsteightbittikzl{1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,1,1} +\def\lsteightbittikzm{0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,0,0,1,1,0,0,0,1} +\def\lsteightbittikzn{0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1} +\def\lsteightbittikzo{0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzp{0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0} +\def\lsteightbittikzq{0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,1} +\def\lsteightbittikzr{0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0} +\def\lsteightbittikzs{0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,0} +\def\lsteightbittikzt{0,1,0,0,0,0,1,0,0,0,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,1,1,0} +\def\lsteightbittikzu{0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,1} +\def\lsteightbittikzv{0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,0} +\def\lsteightbittikzw{0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,1,1,0} +\def\lsteightbittikzx{0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1} +\def\lsteightbittikzy{0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzz{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,1} +\def\lsteightbittikzzero{0,1,1,1,0,1,0,0,0,1,1,0,0,1,1,1,0,1,0,1,1,1,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzun{0,1,0,1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,1,1} +\def\lsteightbittikzdeux{0,1,1,1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,1} +\def\lsteightbittikztrois{1,1,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzquatre{0,0,0,1,0,0,0,1,1,0,0,1,0,1,0,1,0,0,1,0,1,1,1,1,1,0,0,0,1,0,0,0,0,1,0} +\def\lsteightbittikzcinq{1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzsix{0,0,1,1,0,0,1,0,0,0,1,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzsept{1,1,1,1,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0} +\def\lsteightbittikzhuit{0,1,1,1,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,0} +\def\lsteightbittikzneuf{0,1,1,1,0,1,0,0,0,1,1,0,0,0,1,0,1,1,1,1,0,0,0,0,1,0,0,0,1,0,0,1,1,0,0} +\def\lsteightbittikzapostr{1,1,0,1,1,0,0,0,0,0,0,0,0} +\def\lsteightbittikzparg{0,0,1,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,0,0,1} +\def\lsteightbittikzpard{1,0,0,0,1,0,0,0,1,0,0,1,0,0,1,0,1,0,1,0,0} +\def\lsteightbittikzfois{0,0,0,0,0,0,0,1,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0} +\def\lsteightbittikzplus{0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,1,1,1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0} +\def\lsteightbittikzvirgule{0,0,0,0,0,0,0,0,1,1,0,1,1,0} +\def\lsteightbittikzmoins{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} +\def\lsteightbittikzpoint{0,0,0,0,0,0,0,0,0,0,1,1,1,1} +\def\lsteightbittikzslash{0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0} +\def\lsteightbittikzdeuxpoints{0,0,1,1,1,1,0,0,1,1,1,1,0,0} +\def\lsteightbittikzpointvirg{0,0,1,1,1,1,0,0,1,1,0,1,1,0} +\def\lsteightbittikzinf{0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0} +\def\lsteightbittikzeggal{0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0} +\def\lsteightbittikzsup{1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0} +\def\lsteightbittikzinterro{0,1,1,1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0} +\def\lsteightbittikzexcla{1,1,1,1,1,0,1} +\def\lsteightbittikzcrog{1,1,1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,1} +\def\lsteightbittikzgrod{1,1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,1,1} +\def\lsteightbittikzbarre{1,1,1,1,1,1,1} +\def\lsteightbittikzspace{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + +\newlength{\eightbitpartthick} +\newlength{\eightbitpartheight} +\newlength{\eightbitpartunit} +\setlength{\eightbitpartthick}{0.1mm} +\setlength{\eightbitpartheight}{11mm} +\setlength{\eightbitpartunit}{1mm} + +\defKV[eightbitpart]{% + %unit=\def\eightbitpartunit{#1},% + height=\setlength{\eightbitpartheight}{#1},% + thick=\setlength{\eightbitpartthick}{#1},% + color=\def\eightbitpartcolor{#1},% + gridcolor=\def\eightbitpartgridcolor{#1},% + offseth=\def\eightbitpartoffseth{#1},% + offsetv=\def\eightbitpartoffsetv{#1}% +} + +\setKVdefault[eightbitpart]{% + height=11mm,% + thick=0.1mm,% + color=black,% + gridcolor=gray, + offseth=1,% + offsetv=2,% + gridafter=false,% + nospaceafter=false,% + border=false +} + +\NewDocumentCommand\tkzpixletter{ }{% + \begingroup + \catcode`\;=12 + \catcode`\:=12 + \catcode`\!=12 + \catcode`\?=12 + \PixlLetterAux +} + +\NewDocumentCommand\PixlLetterAux{ O{} D<>{} m }{% + \endgroup + \restoreKV[eightbitpart]% + \setKV[eightbitpart]{#1}% + \xdef\tmplarg{5}% + %MAJUSCULE + \IfStrEq{#3}{A}{\xdef\TMPLIST{\lsteightbittikzA}}{}% + \IfStrEq{#3}{B}{\xdef\TMPLIST{\lsteightbittikzB}}{}% + \IfStrEq{#3}{C}{\xdef\TMPLIST{\lsteightbittikzC}}{}% + \IfStrEq{#3}{D}{\xdef\TMPLIST{\lsteightbittikzD}}{}% + \IfStrEq{#3}{E}{\xdef\TMPLIST{\lsteightbittikzE}}{}% + \IfStrEq{#3}{F}{\xdef\TMPLIST{\lsteightbittikzF}}{}% + \IfStrEq{#3}{G}{\xdef\TMPLIST{\lsteightbittikzG}}{}% + \IfStrEq{#3}{H}{\xdef\TMPLIST{\lsteightbittikzH}}{}% + \IfStrEq{#3}{I}{\xdef\TMPLIST{\lsteightbittikzI}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{J}{\xdef\TMPLIST{\lsteightbittikzJ}}{}% + \IfStrEq{#3}{K}{\xdef\TMPLIST{\lsteightbittikzK}}{}% + \IfStrEq{#3}{L}{\xdef\TMPLIST{\lsteightbittikzL}}{}% + \IfStrEq{#3}{M}{\xdef\TMPLIST{\lsteightbittikzM}}{}% + \IfStrEq{#3}{N}{\xdef\TMPLIST{\lsteightbittikzN}}{}% + \IfStrEq{#3}{O}{\xdef\TMPLIST{\lsteightbittikzO}}{}% + \IfStrEq{#3}{P}{\xdef\TMPLIST{\lsteightbittikzP}}{}% + \IfStrEq{#3}{Q}{\xdef\TMPLIST{\lsteightbittikzQ}}{}% + \IfStrEq{#3}{R}{\xdef\TMPLIST{\lsteightbittikzR}}{}% + \IfStrEq{#3}{S}{\xdef\TMPLIST{\lsteightbittikzS}}{}% + \IfStrEq{#3}{T}{\xdef\TMPLIST{\lsteightbittikzT}}{}% + \IfStrEq{#3}{U}{\xdef\TMPLIST{\lsteightbittikzU}}{}% + \IfStrEq{#3}{V}{\xdef\TMPLIST{\lsteightbittikzV}}{}% + \IfStrEq{#3}{W}{\xdef\TMPLIST{\lsteightbittikzW}}{}% + \IfStrEq{#3}{X}{\xdef\TMPLIST{\lsteightbittikzX}}{}% + \IfStrEq{#3}{Y}{\xdef\TMPLIST{\lsteightbittikzY}}{}% + \IfStrEq{#3}{Z}{\xdef\TMPLIST{\lsteightbittikzZ}}{}% + %minuscule + \IfStrEq{#3}{a}{\xdef\TMPLIST{\lsteightbittikza}}{}% + \IfStrEq{#3}{à}{\xdef\TMPLIST{\lsteightbittikzaaccent}}{}% + \IfStrEq{#3}{ä}{\xdef\TMPLIST{\lsteightbittikzaaigu}}{}% + \IfStrEq{#3}{b}{\xdef\TMPLIST{\lsteightbittikzb}}{}% + \IfStrEq{#3}{c}{\xdef\TMPLIST{\lsteightbittikzc}}{}% + \IfStrEq{#3}{d}{\xdef\TMPLIST{\lsteightbittikzd}}{}% + \IfStrEq{#3}{e}{\xdef\TMPLIST{\lsteightbittikze}}{}% + \IfStrEq{#3}{é}{\xdef\TMPLIST{\lsteightbittikzeaccent}}{}% + \IfStrEq{#3}{è}{\xdef\TMPLIST{\lsteightbittikzeaccent}}{}% + \IfStrEq{#3}{ê}{\xdef\TMPLIST{\lsteightbittikzeaccent}}{}% + \IfStrEq{#3}{ë}{\xdef\TMPLIST{\lsteightbittikzeaigu}}{}% + \IfStrEq{#3}{f}{\xdef\TMPLIST{\lsteightbittikzf}}{}% + \IfStrEq{#3}{g}{\xdef\TMPLIST{\lsteightbittikzg}}{}% + \IfStrEq{#3}{h}{\xdef\TMPLIST{\lsteightbittikzh}}{}% + \IfStrEq{#3}{i}{\xdef\TMPLIST{\lsteightbittikzi}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{î}{\xdef\TMPLIST{\lsteightbittikziaccent}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{ï}{\xdef\TMPLIST{\lsteightbittikziaigu}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{j}{\xdef\TMPLIST{\lsteightbittikzj}\xdef\tmplarg{4}}{}% + \IfStrEq{#3}{k}{\xdef\TMPLIST{\lsteightbittikzk}\xdef\tmplarg{4}}{}% + \IfStrEq{#3}{l}{\xdef\TMPLIST{\lsteightbittikzl}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{m}{\xdef\TMPLIST{\lsteightbittikzm}}{}% + \IfStrEq{#3}{n}{\xdef\TMPLIST{\lsteightbittikzn}}{}% + \IfStrEq{#3}{o}{\xdef\TMPLIST{\lsteightbittikzo}}{}% + \IfStrEq{#3}{p}{\xdef\TMPLIST{\lsteightbittikzp}}{}% + \IfStrEq{#3}{q}{\xdef\TMPLIST{\lsteightbittikzq}}{}% + \IfStrEq{#3}{r}{\xdef\TMPLIST{\lsteightbittikzr}}{}% + \IfStrEq{#3}{s}{\xdef\TMPLIST{\lsteightbittikzs}}{}% + \IfStrEq{#3}{t}{\xdef\TMPLIST{\lsteightbittikzt}}{}% + \IfStrEq{#3}{u}{\xdef\TMPLIST{\lsteightbittikzu}}{}% + \IfStrEq{#3}{v}{\xdef\TMPLIST{\lsteightbittikzv}}{}% + \IfStrEq{#3}{w}{\xdef\TMPLIST{\lsteightbittikzw}}{}% + \IfStrEq{#3}{x}{\xdef\TMPLIST{\lsteightbittikzx}}{}% + \IfStrEq{#3}{y}{\xdef\TMPLIST{\lsteightbittikzy}}{}% + \IfStrEq{#3}{z}{\xdef\TMPLIST{\lsteightbittikzz}}{}% + %chiffres + \IfStrEq{#3}{0}{\xdef\TMPLIST{\lsteightbittikzzero}}{}% + \IfStrEq{#3}{1}{\xdef\TMPLIST{\lsteightbittikzun}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{2}{\xdef\TMPLIST{\lsteightbittikzdeux}}{}% + \IfStrEq{#3}{3}{\xdef\TMPLIST{\lsteightbittikztrois}}{}% + \IfStrEq{#3}{4}{\xdef\TMPLIST{\lsteightbittikzquatre}}{}% + \IfStrEq{#3}{5}{\xdef\TMPLIST{\lsteightbittikzcinq}}{}% + \IfStrEq{#3}{6}{\xdef\TMPLIST{\lsteightbittikzsix}}{}% + \IfStrEq{#3}{7}{\xdef\TMPLIST{\lsteightbittikzsept}}{}% + \IfStrEq{#3}{8}{\xdef\TMPLIST{\lsteightbittikzhuit}}{}% + \IfStrEq{#3}{9}{\xdef\TMPLIST{\lsteightbittikzneuf}}{}% + %ponctuation + \IfStrEq{#3}{'}{\xdef\TMPLIST{\lsteightbittikzapostr}\xdef\tmplarg{2}}{}% + \IfStrEq{#3}{(}{\xdef\TMPLIST{\lsteightbittikzparg}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{)}{\xdef\TMPLIST{\lsteightbittikzpard}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{*}{\xdef\TMPLIST{\lsteightbittikzfois}}{}% + \IfStrEq{#3}{+}{\xdef\TMPLIST{\lsteightbittikzplus}}{}% + \IfStrEq{#3}{,}{\xdef\TMPLIST{\lsteightbittikzvirgule}\xdef\tmplarg{2}}{}% + \IfStrEq{#3}{-}{\xdef\TMPLIST{\lsteightbittikzmoins}}{}% + \IfStrEq{#3}{.}{\xdef\TMPLIST{\lsteightbittikzpoint}\xdef\tmplarg{2}}{}% + \IfStrEq{#3}{/}{\xdef\TMPLIST{\lsteightbittikzslash}}{}% + \IfStrEq{#3}{:}{\xdef\TMPLIST{\lsteightbittikzdeuxpoints}\xdef\tmplarg{2}}{}% + \IfStrEq{#3}{;}{\xdef\TMPLIST{\lsteightbittikzpointvirg}\xdef\tmplarg{2}}{}% + \IfStrEq{#3}{<}{\xdef\TMPLIST{\lsteightbittikzinf}}{}% + \IfStrEq{#3}{=}{\xdef\TMPLIST{\lsteightbittikzeggal}}{}% + \IfStrEq{#3}{>}{\xdef\TMPLIST{\lsteightbittikzsup}}{}% + \IfStrEq{#3}{?}{\xdef\TMPLIST{\lsteightbittikzinterro}}{}% + \IfStrEq{#3}{!}{\xdef\TMPLIST{\lsteightbittikzexcla}\xdef\tmplarg{1}}{}% + \IfStrEq{#3}{[}{\xdef\TMPLIST{\lsteightbittikzcrog}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{]}{\xdef\TMPLIST{\lsteightbittikzgrod}\xdef\tmplarg{3}}{}% + \IfStrEq{#3}{|}{\xdef\TMPLIST{\lsteightbittikzbarre}\xdef\tmplarg{1}}{}% + \IfStrEq{#3}{ }{\xdef\TMPLIST{\lsteightbittikzspace}\xdef\tmplarg{3}}{}% + %la case ! + \xdef\tmpnumbercasesv{\inteval{7+2*\eightbitpartoffsetv}}% + \pgfmathsetlength{\eightbitpartunit}{\eightbitpartheight/\tmpnumbercasesv}% + %tikzpicture + \begin{tikzpicture}[line cap=rect,x=\eightbitpartunit,y=\eightbitpartunit,line width=\eightbitpartthick,#2] + %clipping ? + %\clip ([shift={(-0.5\eightbitpartthick,-0.5\eightbitpartthick)}]{-\eightbitpartoffseth},{-\eightbitpartoffsetv}) rectangle ([shift={(0.5\eightbitpartthick,0.5\eightbitpartthick)}]{\tmplarg+\eightbitpartoffseth},{7+\eightbitpartoffsetv}) ; + %gridbefore + \ifboolKV[eightbitpart]{gridafter}% + {}% + {% + \foreach \x in {-\eightbitpartoffseth,...,\numexpr\tmplarg+\eightbitpartoffseth\relax} + {% + \draw[line width=\eightbitpartthick,\eightbitpartgridcolor] (\x,{-\eightbitpartoffsetv}) --++ (0,{7+2*\eightbitpartoffsetv}) ; + }% + \foreach \y in {-\eightbitpartoffsetv,...,\numexpr7+\eightbitpartoffseth+\eightbitpartoffseth\relax} + {% + \draw[line width=\eightbitpartthick,\eightbitpartgridcolor] ({-\eightbitpartoffseth},\y) --++ ({\tmplarg+2*\eightbitpartoffseth},0) ; + }% + }% + \ifnum\tmplarg=1% + \foreach \i [count=\j] in \TMPLIST {% + \ifnum\i=1% + \fill[\eightbitpartcolor] (0,{7-\j}) rectangle++ (1,1) ; + \fi% + }% + \fi% + \ifnum\tmplarg=2% + \foreach \i [count=\j] in \TMPLIST {% + \ifnum\i=1% + \xintifboolexpr{ \xintiiOdd{\j} == 1 }% + {%si c'est impair + \xdef\tmpX{0}% + \xdef\tmpY{\xintieval{(\j-1)/2}}% + }% + {%si c'est pair + \xdef\tmpX{1}% + \xdef\tmpY{\xintieval{(\j)/2-1}}% + }% + \fill[\eightbitpartcolor] ({\tmpX},{6-\tmpY}) rectangle++ (1,1) ; + \fi% + }% + \fi% + \ifnum\tmplarg>2% + \foreach \i [count=\j] in \TMPLIST {% + \ifnum\i=1% + \xdef\tmpX{\xintiiRem{\j-1}{\tmplarg}}% + \xdef\tmpY{\xintiiQuo{\j-1}{\tmplarg}}% + \fill[\eightbitpartcolor] ({\tmpX},{6-\tmpY}) rectangle++ (1,1) ; + \fi% + }% + \fi% + %gridafter + \ifboolKV[eightbitpart]{gridafter}% + {% + \foreach \x in {-\eightbitpartoffseth,...,\numexpr\tmplarg+\eightbitpartoffseth\relax} + {% + \draw[line width=\eightbitpartthick,\eightbitpartgridcolor] (\x,{-\eightbitpartoffsetv}) --++ (0,{7+2*\eightbitpartoffsetv}) ; + }% + \foreach \y in {-\eightbitpartoffsetv,...,\numexpr7+\eightbitpartoffseth+\eightbitpartoffseth\relax} + {% + \draw[line width=\eightbitpartthick,\eightbitpartgridcolor] ({-\eightbitpartoffseth},\y) --++ ({\tmplarg+2*\eightbitpartoffseth},0) ; + }% + }% + {}% + \end{tikzpicture}% + \ifboolKV[eightbitpart]{nospaceafter}{\hspace*{-\eightbitpartthick}}{}% +} + +\NewDocumentCommand\tkzpixlquote{ O{} D<>{} }{% + \restoreKV[eightbitpart]% + \setKV[eightbitpart]{#1}% + \xdef\tmplarg{2}% + \xdef\tmpnumbercasesv{\inteval{7+2*\eightbitpartoffsetv}}% + \pgfmathsetlength{\eightbitpartunit}{\eightbitpartheight/\tmpnumbercasesv}% + \begin{tikzpicture}[line cap=rect,x=\eightbitpartunit,y=\eightbitpartunit,line width=\eightbitpartthick,#2] + %clipping ? + %\clip ({-\eightbitpartoffseth},{-\eightbitpartoffsetv}) rectangle ({\tmplarg+\eightbitpartoffseth},{7+\eightbitpartoffsetv}) ; + %gridbefore + \ifboolKV[eightbitpart]{gridafter}% + {}% + {% + \foreach \x in {-\eightbitpartoffseth,...,\numexpr\tmplarg+\eightbitpartoffseth\relax} + {% + \draw[line width=\eightbitpartthick,\eightbitpartgridcolor] (\x,{-\eightbitpartoffsetv}) --++ (0,{7+2*\eightbitpartoffsetv}) ; + }% + \foreach \y in {-\eightbitpartoffsetv,...,\numexpr7+\eightbitpartoffseth+\eightbitpartoffseth\relax} + {% + \draw[line width=\eightbitpartthick,\eightbitpartgridcolor] ({-\eightbitpartoffseth},\y) --++ ({\tmplarg+2*\eightbitpartoffseth},0) ; + }% + }% + \fill[\eightbitpartcolor] ({0},{6}) rectangle++ (1,1) ; + \fill[\eightbitpartcolor] ({1},{6}) rectangle++ (1,1) ; + \fill[\eightbitpartcolor] ({1},{5}) rectangle++ (1,1) ; + \fill[\eightbitpartcolor] ({0},{4}) rectangle++ (1,1) ; + %gridafter + \ifboolKV[eightbitpart]{gridafter}% + {% + \foreach \x in {-\eightbitpartoffseth,...,\numexpr\tmplarg+\eightbitpartoffseth\relax} + {% + \draw[line width=\eightbitpartthick,\eightbitpartgridcolor] (\x,{-\eightbitpartoffsetv}) --++ (0,{7+2*\eightbitpartoffsetv}) ; + }% + \foreach \y in {-\eightbitpartoffsetv,...,\numexpr7+\eightbitpartoffseth+\eightbitpartoffseth\relax} + {% + \draw[line width=\eightbitpartthick,\eightbitpartgridcolor] ({-\eightbitpartoffseth},\y) --++ ({\tmplarg+2*\eightbitpartoffseth},0) ; + }% + }% + {}% + \end{tikzpicture}% + \ifboolKV[eightbitpart]{nospaceafter}{\hspace*{-2\eightbitpartthick}}{}% +} + +\NewDocumentCommand\tkzpixl{ }{% + \begingroup + \catcode`\;=12 + \catcode`\:=12 + \catcode`\!=12 + \catcode`\?=12 + \PixlLettersAux +} + +\NewDocumentCommand\PixlLettersAux{ O{} D<>{} m }{% + \endgroup + \setKV[eightbitpart]{#1}% + \StrLen{#3}[\tmpnbcaract]% + \ifboolKV[eightbitpart]{border}% + {% + \setlength{\fboxrule}{1.75\eightbitpartthick}% + \setlength{\fboxsep}{-\eightbitpartthick}% + \fbox{% + \foreach \i in {1,...,\tmpnbcaract}{% + \StrChar{#3}{\i}[\tmpcaract]% + \tkzpixletter[#1]<#2>{\tmpcaract}% + \ifnum\i<\tmpnbcaract\hspace*{-\eightbitpartthick}\fi% + }% + }% + \ifboolKV[eightbitpart]{nospaceafter}{\hspace*{-\eightbitpartthick}}{}% + \fboxrule=0.4pt% + \fboxsep=3.0pt% + }% + {% + \foreach \i in {1,...,\tmpnbcaract}{% + \StrChar{#3}{\i}[\tmpcaract]% + \tkzpixletter[#1]<#2>{\tmpcaract}% + \ifnum\i<\tmpnbcaract\hspace*{-\eightbitpartthick}\fi% + \ifboolKV[eightbitpart]{nospaceafter}{\hspace*{-\eightbitpartthick}}{}% + }% + }% +} + + +\endinput
\ No newline at end of file diff --git a/graphics/pgf/contrib/tikz3d-fr/doc/tikz3d-fr-doc.pdf b/graphics/pgf/contrib/tikz3d-fr/doc/tikz3d-fr-doc.pdf Binary files differindex 68574d0bff..e765213680 100644 --- a/graphics/pgf/contrib/tikz3d-fr/doc/tikz3d-fr-doc.pdf +++ b/graphics/pgf/contrib/tikz3d-fr/doc/tikz3d-fr-doc.pdf diff --git a/graphics/pgf/contrib/tikz3d-fr/doc/tikz3d-fr-doc.tex b/graphics/pgf/contrib/tikz3d-fr/doc/tikz3d-fr-doc.tex index 287d240690..f45f5b8eb8 100644 --- a/graphics/pgf/contrib/tikz3d-fr/doc/tikz3d-fr-doc.tex +++ b/graphics/pgf/contrib/tikz3d-fr/doc/tikz3d-fr-doc.tex @@ -4,8 +4,8 @@ \documentclass[french,a4paper,11pt]{article} \usepackage[margin=2cm,includefoot]{geometry} -\def\TPversion{0.1.2} -\def\TPdate{22 juillet 2023} +\def\TPversion{0.1.3} +\def\TPdate{16 septembre 2024} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb} @@ -16,6 +16,7 @@ \makesavenoteenv{tabular} \usepackage{enumitem} \usepackage{tabularray} +\UseTblrLibrary{diagbox} \usepackage{fancyvrb} \usepackage{fancyhdr} \fancyhf{} @@ -206,6 +207,7 @@ \vspace*{-2cm} + \def\listecouleursdes{red!25,blue!25,yellow!25,orange!25,green!25}\TirageAleaDesTriDim[EspaceH=-2mm]{5} \hfill \begin{EmpilementCubes} \PlaquePetitsCubes[cyan/red/green/yellow]{ 3111-1-4 / 233123 / 2-1112 } @@ -242,17 +244,19 @@ \tableofcontents -\vfill +\pagebreak \part{Historique} +\verb|v0.1.3|~:~~~~Affichage de dés en 3d (avec aléatoire possible) + \verb|v0.1.2|~:~~~~Option pour l'épaisseur des traits + \textsf{[line join=round]} pour les cubes \verb|v0.1.1|~:~~~~Tracé des segments individuels avec l'option \textsf{[line cap=round]} \verb|v0.1.0|~:~~~~Version initiale -\newpage +\pagebreak \part{Introduction} @@ -268,7 +272,8 @@ Le package propose des commandes basiques -- et francisées -- pour travailler s \item une commande pour tracer et personnaliser un cube ; \item des commandes pour créer/afficher/nommer des points de l'espace ; \item des commandes pour tracer un ou plusieurs segments ; - \item des commandes et un environnement pour travailler sur des \textit{empilements} de cubes. + \item des commandes et un environnement pour travailler sur des \textit{empilements} de cubes ; + \item des commandes pour représenter des dés en perspective (avec aléatoire possible). \end{itemize} \vspace*{-\baselineskip}\leavevmode \end{noteblock} @@ -297,8 +302,8 @@ Il n'existe pas d'option pour le package, et \texttt{xcolor} n'est pas chargé. \textsf{tikz3d-fr} charge les packages suivantes : \begin{itemize} - \item \texttt{tikz}, \texttt{xstring}, \texttt{xintexpr}, \texttt{simplekv} et \texttt{xinttools} et \texttt{listofitems} ; - \item les librairies \texttt{\textit{tikz}.calc} et \texttt{\textit{tikz}.babel}. + \item \texttt{tikz}, \texttt{xstring}, \texttt{xintexpr}, \texttt{simplekv} et \texttt{xinttools} et \texttt{listofitems}, \texttt{tikz-3dplot} et \texttt{randomlist} ; + \item la librairie \texttt{\textit{tikz}.calc}. \end{itemize} Il est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} ou \textsf{xelatex}. @@ -758,4 +763,144 @@ Par exemple, la \textit{grille} associée à l'empilement précédent est : \end{EmpilementCubes} \end{PresCode} +\newpage + +\part{Dés à jouer, en 3D} + +\section{Fonctionnement global} + +\begin{tipblock} +L'idée est de proposer des commandes pour travailler avec des dés, en 3D, avec possibilité de les \textit{lancer} de manière aléatoire. + +\smallskip + +La commande peut être autonome pour afficher dé par dé, mais elle peut être également à intégrer dans un environnement \texttt{tikzpicture}. +\end{tipblock} + +\begin{importantblock} +Par défaut, les dés ont une hauteur proche de 1~cm (sans la perspective). + +\smallskip + +L'orientation est \textit{globalement} fixée, mais il est possible (dans une certaine mesure) de pivoter les dés (suivants les angles $\theta$ et $\phi$ des coordonnées sphériques). + +\smallskip + +Il est également possible de spécifier un \textit{angle de vue}, droite ou gauche. +\end{importantblock} + + +\begin{PresCodeTex}{listing only} +%affichage indépendant +\DeTriDim[clés]{numéro(s)} +\end{PresCodeTex} + +\begin{PresCodeTex}{listing only} +%affichage dans un environnement +\begin{tikzpicture} + \DeTriDim*[clés]{numéro(s)} +\end{tikzpicture} +\end{PresCodeTex} + +\begin{PresCodeTex}{listing only} +%tirages aléatoires +\TirageAleaDesTriDim[clés]{tirages} +\end{PresCodeTex} + +\begin{PresCode}{} +\DeTriDim{6/2}~\DeTriDim{1/5}~\DeTriDim{6/4}~\DeTriDim{3/2} +\end{PresCode} + +\begin{PresCode}{} +\begin{tikzpicture} + %\tdplotsetmaincoords{70}{110} + \DeTriDim*[Echelle=2]{6/2} + \DeTriDim*[Echelle=2,Origine={(2,-0.2)}]{6/5} + \DeTriDim*[Echelle=2,Origine={(4,-0.4)},]{6/3} + \DeTriDim*[Echelle=2,Origine={(6,-0.6)},Hasard]{} +\end{tikzpicture} +\end{PresCode} + +\begin{PresCode}{} +\TirageAleaDesTriDim[Vue=G,Yams,Echelle=3,Couleurs={red!25,blue!25,yellow!25}]{3} +\end{PresCode} + +\section{Influence des paramètres} + +\subsection{Clés et options} + +\begin{tipblock} +Quelques \Cle{clés} sont disponibles pour cette commande (elles ne sont pas toutes utilisées par les toutes les commandes) : + +\begin{itemize} + \item \Cle{Echelle} : échelle pour modifier la taille ;\hfill{}défaut \Cle{1} + \item \Cle{Couleur} : couleur (individuelle) ;\hfill{}défaut \Cle{lightgray!25} + \item \Cle{CouleurPoints} : couleurs des points ;\hfill{}défaut \Cle{black} + \item \Cle{Phi} : angle $\phi$ de la perpective ;\hfill{}défaut \Cle{110} + \item \Cle{Theta} : angle $\theta$ de la perpective ;\hfill{}défaut \Cle{70} + \item \Cle{Vue} : vue de la perspective (\texttt{D/G}) ;\hfill{}défaut \Cle{D} + \item \Cle{Hasard} : booléen pour un tirage aléatoire ;\hfill{}défaut \Cle{false} + \item \Cle{Origine} : origine du dé pour la version \texttt{tikzpicture} ; + \item en ce qui concerne les clés spécifiques au tirage : + \begin{itemize} + \item \Cle{EspaceH} : espace horizontal entre les dés ;\hfill{}défaut \Cle{0mm} + \item \Cle{Couleurs} : liste des couleurs pour les dés ;\hfill{}défaut \Cle{lightgray!25} + \item \Cle{Yams} : booléen pour forcer un affichage en ligne.\hfill{}défaut \Cle{false} + \end{itemize} +\end{itemize} + +Hormis dans le cas où \texttt{Harsard=true}, l'argument obligatoire, pour l'affichage unique, est à donner sous la forme \texttt{face de devant/face du dessus} (l'autre face visible est déterminée automatiquement). +\end{tipblock} + +\subsection{Exemples} + +\begin{PresCode}{} +\TirageAleaDesTriDim[EspaceH=-2mm]{5} + +\TirageAleaDesTriDim[EspaceH=1mm,Echelle=2,Couleurs=darkgray,CouleurPoints=white]{5} +\end{PresCode} + +\begin{PresCode}{} +\def\listecouleursdes{red!25,blue!25,yellow!25,orange!25,green!25} + +\TirageAleaDesTriDim[Yams,Couleurs=brown!10]{10} + +\TirageAleaDesTriDim[Yams,Echelle=2,Couleurs=\listecouleursdes,CouleurPoints=magenta]{5} + +\TirageAleaDesTriDim[Vue=G,Yams,Echelle=3,Couleurs=\listecouleursdes]{3} +\end{PresCode} + +\subsection{Angles de rotation} + +\begin{cautionblock} +Les paramètres $\theta$ et $\phi$ peuvent être modifiés, en fonction du rendu souhaité. + +Mais comme toutes les faces ne sont pas traitées (du fait de la perspective), il est conseillé de rester dans une \textit{fenêtre classique}. +\end{cautionblock} + +\begin{tipblock} +Vue \texttt{D} : + +\begin{tblr}{hlines,vlines,colspec={*{5}{Q[m,c]}}} + \diagbox{$\phi$}{$\theta$} & 60 & \textbf{70} & 80 & 85 \\ + 95 & \DeTriDim[Hasard,Theta=60,Phi=95]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=70,Phi=95]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=80,Phi=95]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=85,Phi=95]<baseline=0pt>{} \\ + 100 & \DeTriDim[Hasard,Theta=60,Phi=100]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=70,Phi=100]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=80,Phi=100]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=85,Phi=100]<baseline=0pt>{} \\ + \textbf{110} & \DeTriDim[Hasard,Theta=60,Phi=95]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=70,Phi=110,Couleur=red!25]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=80,Phi=110]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=85,Phi=110]<baseline=0pt>{} \\ + 120 & \DeTriDim[Hasard,Theta=60,Phi=120]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=70,Phi=120]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=80,Phi=120]<baseline=0pt>{} & \DeTriDim[Hasard,Theta=85,Phi=120]<baseline=0pt>{} \\ +\end{tblr} +\end{tipblock} + +\begin{tipblock} +Vue \texttt{G} : + +\begin{tblr}{hlines,vlines,colspec={*{5}{Q[m,c]}}} + \diagbox{$\phi$}{$\theta$} & 60 & \textbf{70} & 80 & 85 \\ + 95 & \DeTriDim[Vue=G,Hasard,Theta=60,Phi=95]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=70,Phi=95]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=80,Phi=95]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=85,Phi=95]<baseline=0pt>{} \\ + 100 & \DeTriDim[Vue=G,Hasard,Theta=60,Phi=100]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=70,Phi=100]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=80,Phi=100]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=85,Phi=100]<baseline=0pt>{} \\ + \textbf{110} & \DeTriDim[Vue=G,Hasard,Theta=60,Phi=95]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=70,Phi=110,Couleur=red!25]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=80,Phi=110]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=85,Phi=110]<baseline=0pt>{} \\ + 120 & \DeTriDim[Vue=G,Hasard,Theta=60,Phi=120]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=70,Phi=120]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=80,Phi=120]<baseline=0pt>{} & \DeTriDim[Vue=G,Hasard,Theta=85,Phi=120]<baseline=0pt>{} \\ +\end{tblr} +\end{tipblock} + + \end{document}
\ No newline at end of file diff --git a/graphics/pgf/contrib/tikz3d-fr/tex/tikz3d-fr.sty b/graphics/pgf/contrib/tikz3d-fr/tex/tikz3d-fr.sty index 5056c951a8..b6d4e20829 100644 --- a/graphics/pgf/contrib/tikz3d-fr/tex/tikz3d-fr.sty +++ b/graphics/pgf/contrib/tikz3d-fr/tex/tikz3d-fr.sty @@ -3,15 +3,18 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tikz3d-fr}[2023/07/22 0.1.2 Aide pour l'utilisation de TikZ 3D] +\ProvidesPackage{tikz3d-fr}[2024/09/16 0.1.3 Aide pour l'utilisation de TikZ 3D] +%0.1.3 Dés à jouer en 3D %0.1.2 Option pour l'épaisseur des traits + [line join=round] pour les cubes %0.1.1 Segments avec [line cap=round] %0.1.0 Version initiale %------Packages utiles \RequirePackage{tikz} +\RequirePackage{tikz-3dplot} \RequirePackage{xstring} \RequirePackage{simplekv} +\RequirePackage{randomlist} \RequirePackage{xinttools} \RequirePackage{xintexpr} \RequirePackage{listofitems} @@ -328,4 +331,258 @@ {\end{EnvTikzEspace}} } +%====DÉS EN 3D +\newlength{\detridimoffseth} +\setlength{\detridimoffseth}{0mm} + +\defKV[DeTriDim]{% + Echelle=\def\detridimscale{#1},% + Couleur=\def\detridimcouleur{#1},% + EspaceH=\setlength{\detridimoffseth}{#1},% + Couleurs=\def\detridimcouleurs{#1},% + CouleurPoints=\def\detridimcouleurpts{#1},% + Phi=\def\detridimphi{#1},% + Theta=\def\detridimtheta{#1},% + Vue=\def\deftridimvue{#1},% + Origine=\def\deftridimorigin{#1} +} +\setKVdefault[DeTriDim]{% + Echelle=1,% + Couleur=lightgray!25,% + CouleurPoints=black,% + Hasard=false,% + EspaceH={0mm},% + Couleurs=lightgray!25,% + Phi=110,% + Theta=70,% + Vue=D,% + Origine={(0,0)},% + Yams=false +} + +\NewDocumentCommand\FaceDeTriDim{ m }{% + %1 = face avec points communs si besoin pour simplifier le code + \xintifboolexpr{#1 == 2 'or' #1 == 4 'or' #1 == 5 'or' #1 == 6}% + {% + \fill[\detridimcouleurpts] (0.5,0.5) circle[radius=1/6] ; % HG + \fill[\detridimcouleurpts] (-0.5,-0.5) circle[radius=1/6] ; % BD + }% + {}% + \xintifboolexpr{#1 == 3 'or' #1 == 4 'or' #1 == 5 'or' #1 == 6}% + {% + \fill[\detridimcouleurpts] (-0.5,0.5) circle[radius=1/6] ; % HD + \fill[\detridimcouleurpts] (0.5,-0.5) circle[radius=1/6] ; % BG + }% + {}% + \xintifboolexpr{#1 == 1 'or' #1 == 3 'or' #1 == 5}% + {% + \fill[\detridimcouleurpts] (0,0) circle[radius=1/6] ; % CENTRE + }% + {}% + \xintifboolexpr{#1 == 6}% + {% + \fill[\detridimcouleurpts] (0.5,0) circle[radius=1/6] ; % MG + \fill[\detridimcouleurpts] (-0.5,0) circle[radius=1/6] ; % MD + }% + {}% +} + +%liste pour les faces +\NewList{detridimfaceU}\SetList{detridimfaceU}{2,3,4,5} +\NewList{detridimfaceD}\SetList{detridimfaceD}{1,3,4,6} +\NewList{detridimfaceT}\SetList{detridimfaceT}{1,2,6,5} +\NewList{detridimfaceQ}\SetList{detridimfaceQ}{1,5,6,2} +\NewList{detridimfaceC}\SetList{detridimfaceC}{1,3,6,4} +\NewList{detridimfaceS}\SetList{detridimfaceS}{2,4,5,3} + +%commande autonome +\NewDocumentCommand\DeTriDim{ s O{} D<>{} m }{% + %* = mode non autonome + %1 = clés + %2 = options tikzpicture + %3 = faces devant/dessus + \restoreKV[DeTriDim]% + \setKV[DeTriDim]{#2}% + %si aléatoire + \ifboolKV[DeTriDim]{Hasard}% + {% + \xdef\detridimfacedevant{\xinteval{randrange(1,7)}}% + \xintifboolexpr{\detridimfacedevant == 1}% + {% + \GetRandomItem{detridimfaceU}{detridimfacedessus}% + }% + {}% + \xintifboolexpr{\detridimfacedevant == 2}% + {% + \GetRandomItem{detridimfaceD}{detridimfacedessus}% + }% + {}% + \xintifboolexpr{\detridimfacedevant == 3}% + {% + \GetRandomItem{detridimfaceT}{detridimfacedessus}% + }% + {}% + \xintifboolexpr{\detridimfacedevant == 4}% + {% + \GetRandomItem{detridimfaceQ}{detridimfacedessus}% + }% + {}% + \xintifboolexpr{\detridimfacedevant == 5}% + {% + \GetRandomItem{detridimfaceC}{detridimfacedessus}% + }% + {}% + \xintifboolexpr{\detridimfacedevant == 6}% + {% + \GetRandomItem{detridimfaceS}{detridimfacedessus}% + }% + {}% + \xdef\detridimfaces{\detridimfacedevant/\detridimfacedessus}% + }% + {% + \xdef\detridimfaces{#4}% + \StrCut{#4}{/}{\detridimfacedevant}{\detridimfacedessus}% + }% + \IfStrEq{\deftridimvue}{D}% + {% + \IfStrEqCase{\detridimfaces}{% + {1/2}{\def\detridimfacedroite{3}}% + {1/3}{\def\detridimfacedroite{5}}% + {1/5}{\def\detridimfacedroite{4}}% + {1/4}{\def\detridimfacedroite{2}}% + % + {2/1}{\def\detridimfacedroite{4}}% + {2/4}{\def\detridimfacedroite{6}}% + {2/6}{\def\detridimfacedroite{3}}% + {2/3}{\def\detridimfacedroite{1}}% + % + {3/1}{\def\detridimfacedroite{2}}% + {3/2}{\def\detridimfacedroite{6}}% + {3/6}{\def\detridimfacedroite{5}}% + {3/5}{\def\detridimfacedroite{1}}% + % + {4/1}{\def\detridimfacedroite{5}}% + {4/5}{\def\detridimfacedroite{6}}% + {4/6}{\def\detridimfacedroite{2}}% + {4/2}{\def\detridimfacedroite{1}}% + % + {5/1}{\def\detridimfacedroite{3}}% + {5/3}{\def\detridimfacedroite{6}}% + {5/6}{\def\detridimfacedroite{4}}% + {5/4}{\def\detridimfacedroite{1}}% + % + {6/2}{\def\detridimfacedroite{4}}% + {6/4}{\def\detridimfacedroite{5}}% + {6/5}{\def\detridimfacedroite{3}}% + {6/3}{\def\detridimfacedroite{2}}% + }% + }% + {% + \IfStrEqCase{\detridimfaces}{% + {1/2}{\def\detridimfacedroite{4}}% + {1/3}{\def\detridimfacedroite{2}}% + {1/5}{\def\detridimfacedroite{3}}% + {1/4}{\def\detridimfacedroite{5}}% + % + {2/1}{\def\detridimfacedroite{3}}% + {2/4}{\def\detridimfacedroite{1}}% + {2/6}{\def\detridimfacedroite{4}}% + {2/3}{\def\detridimfacedroite{6}}% + % + {3/1}{\def\detridimfacedroite{5}}% + {3/2}{\def\detridimfacedroite{1}}% + {3/6}{\def\detridimfacedroite{2}}% + {3/5}{\def\detridimfacedroite{6}}% + % + {4/1}{\def\detridimfacedroite{2}}% + {4/5}{\def\detridimfacedroite{1}}% + {4/6}{\def\detridimfacedroite{5}}% + {4/2}{\def\detridimfacedroite{6}}% + % + {5/1}{\def\detridimfacedroite{3}}% + {5/3}{\def\detridimfacedroite{6}}% + {5/6}{\def\detridimfacedroite{4}}% + {5/4}{\def\detridimfacedroite{1}}% + % + {6/2}{\def\detridimfacedroite{3}}% + {6/4}{\def\detridimfacedroite{2}}% + {6/5}{\def\detridimfacedroite{4}}% + {6/3}{\def\detridimfacedroite{5}}% + }% + }% + \IfStrEq{\deftridimvue}{D}{\def\tmpdetridimxscale{1}}{\def\tmpdetridimxscale{-1}}% + \IfBooleanF{#1}{\begin{tikzpicture}[#3]}% + \tdplotsetmaincoords{\detridimtheta}{\detridimphi} + \begin{scope}[shift={(\deftridimorigin)},scale=\fpeval{0.5*\detridimscale},xscale=\tmpdetridimxscale,thick,tdplot_main_coords,rounded corners=\fpeval{\detridimscale*0.5*0.33}cm,fill=\detridimcouleur] + \begin{scope}[canvas is xy plane at z=-1] + \filldraw (-1,-1) rectangle (1,1); + \end{scope} + \begin{scope}[canvas is xz plane at y=-1] + \filldraw (-1,-1) rectangle (1,1); + \end{scope} + \begin{scope}[canvas is yz plane at x=-1] + \filldraw (-1,-1) rectangle (1,1); + \end{scope} + \begin{scope}[canvas is xy plane at z=1]%face du dessus + \filldraw (-1,-1) rectangle (1,1); + \FaceDeTriDim{\detridimfacedessus} + \end{scope} + \begin{scope}[canvas is xz plane at y=1]%face de droite + \filldraw (-1,-1) rectangle (1,1); + \FaceDeTriDim{\detridimfacedroite} + \end{scope} + \begin{scope}[canvas is yz plane at x=1]%face de devant + \filldraw (-1,-1) rectangle (1,1); + \FaceDeTriDim{\detridimfacedevant} + \end{scope} + \end{scope} + \IfBooleanF{#1}{\end{tikzpicture}}% +} + +\NewDocumentCommand\TirageAleaDesTriDim{ O{} D<>{} m }{% + \restoreKV[DeTriDim]% + \setKV[DeTriDim]{#1}% + \readlist*\detridimlstcolors{\detridimcouleurs}% + \ifboolKV[DeTriDim]{Yams}% + {% + \begin{tikzpicture}[#2] + \ifnum\detridimlstcolorslen=1\relax + \foreach \i in {1,...,#3}{% + \IfStrEq{\deftridimvue}{D}% + {% + \DeTriDim*[#1,Hasard,Couleur=\detridimcouleurs,Origine={(\i*\detridimscale,-\i*\detridimscale*0.1)}]{}% + }% + {% + \DeTriDim*[#1,Hasard,Couleur=\detridimcouleurs,Origine={(-\i*\detridimscale,-\i*\detridimscale*0.1)}]{}% + }% + }% + \else% + \foreach \i in {1,...,#3}{% + \itemtomacro\detridimlstcolors[\i]{\tmpdetridimcolor}% + \IfStrEq{\deftridimvue}{D}% + {% + \DeTriDim*[#1,Hasard,Couleur=\tmpdetridimcolor,Origine={(\i*\detridimscale,-\i*\detridimscale*0.1)}]{}% + }% + {% + \DeTriDim*[#1,Hasard,Couleur=\tmpdetridimcolor,Origine={(-\i*\detridimscale,-\i*\detridimscale*0.1)}]{}% + }% + }% + \fi% + \end{tikzpicture} + }% + {% + \ifnum\detridimlstcolorslen=1\relax + \foreach \i in {1,...,#3}{% + \DeTriDim[#1,Hasard,Couleur=\detridimcouleurs]<#2>{}\ifnum\i<#3\relax\hspace*{\detridimoffseth}\fi% + }% + \else% + \foreach \i in {1,...,#3}{% + \itemtomacro\detridimlstcolors[\i]{\tmpdetridimcolor}% + \DeTriDim[#1,Hasard,Couleur=\tmpdetridimcolor]<#2>{}\ifnum\i<#3\relax\hspace*{\detridimoffseth}\fi% + }% + \fi% + }% +} + + \endinput
\ No newline at end of file diff --git a/graphics/pgf/contrib/tikzdotncross/README.md b/graphics/pgf/contrib/tikzdotncross/README.md index 0c4cbfd2de..a3c4a261a2 100644 --- a/graphics/pgf/contrib/tikzdotncross/README.md +++ b/graphics/pgf/contrib/tikzdotncross/README.md @@ -70,7 +70,10 @@ The Current Maintainer of this work is Alceu Frigeri - documentation in PDF format ------------- -* Version 1.1 (this) +* Version 1.2 (this) + - Added some package options, to change pin defaults, see documentation. + +* Version 1.1 - Documentation typos and improvement. Code cleanup. * Version 1.0 diff --git a/graphics/pgf/contrib/tikzdotncross/doc/tikzdotncross.pdf b/graphics/pgf/contrib/tikzdotncross/doc/tikzdotncross.pdf Binary files differindex c4bb9648fe..e2e476b8c7 100644 --- a/graphics/pgf/contrib/tikzdotncross/doc/tikzdotncross.pdf +++ b/graphics/pgf/contrib/tikzdotncross/doc/tikzdotncross.pdf diff --git a/graphics/pgf/contrib/tikzdotncross/doc/tikzdotncross.tex b/graphics/pgf/contrib/tikzdotncross/doc/tikzdotncross.tex index 0719876146..317fbdb200 100644 --- a/graphics/pgf/contrib/tikzdotncross/doc/tikzdotncross.tex +++ b/graphics/pgf/contrib/tikzdotncross/doc/tikzdotncross.tex @@ -15,7 +15,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.1} {2024/01/11} +%% This is version {1.2} {2024/10/22} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/tikzdotncross @@ -47,11 +47,27 @@ This package offers a few alternative ways for declaring and marking coordinates %\tableofcontents \section{Introduction} -One recurring problem when drawing in general is how to interpret a crossing line. There are many conventions, notably, the old school (like the author of this) a jump denotes ``non touching lines'' while a simple cross is a connection, more recently (like the past 25 years), the winning convention has been that a dot marks a connection, whilst a simple cross denotes ``non touching lines''. Many, for the sake of staying in the safe side of the wall are now marking a connection with dots and non touching lines with a jump, which is a bit overkill, but at least there is no margin for error. +One recurring problem when drawing circuits in general is how to interpret a crossing line. There are many conventions, notably, for the old school (like the author of this) a jump denotes ``non touching lines'' while a simple cross is a connection, more recently (like the past 25 years), the winning convention has been that a dot marks a connection, whilst a simple cross denotes ``non touching lines''. Many, for the sake of staying in the safe side of the wall, mark a connection with dots and non touching lines with a jump, which is a bit overkill, but at least there is no margin for interpretation errors. And that's it, this package defines some commands to mark/pin a connection, declaring a coordinate and node at the same spot, for later reference, and a command to draw a line jumping over crossing lines of a pre-existent path. +\section{Package Options}\label{options} +\begin{describelist}{option} + \describe {pinsize} {pin (circle) size (default: 1.2), in pt.} + \describe {pinang} {pin angle (default: 45). } + \describe {pincolor} {pin color (default: blue).} + \describe {pinlength} {pin length (default: 4), in pt.} + \describe {coordcolor} {coordinate color (default: red), used if \tsobj{\showcoordstrue}.} +\end{describelist} + + +Those can also be set, middle code, via: +\begin{codedescribe}[code,new=2024/10/22]{\setpindefaults} +\begin{codesyntax}% +\tsmacro{\setpindefaults}{options as above} +\end{codesyntax} +\end{codedescribe} \section{Declaring and Marking Coordinates/Nodes}\label{coord} Those are based on some ideas from Redaelli et al. (\tsobj[pkg]{CircuiTikZ}). Main differences: a variable number of parameters (see below) and it always also adds an empty node n\tsobj[marg]{coord}. @@ -69,13 +85,16 @@ These will affect how \tsobj{\ncoord,\dotcoord,\odotcoord} will behave, with \ts \tsobj{\pincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord}\tsverb{)} \tsobj{\pincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color}\tsverb{)} \tsobj{\pincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle}\tsverb{)} -\tsobj{\pincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle,distance}\tsverb{)} +\tsobj{\pincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle,length}\tsverb{)} \end{codesyntax} The \tsobj{\ncoord} always expects a single parameter \tsobj[parg]{coord}. A coordinate named \tsobj[marg]{coord} and node named n\tsobj[marg]{coord} (a ``n'' is added as a prefix) will be created for later use/reference. If \tsobj{\showcoordstrue} is en force, it will also add a pin. -The \tsobj{\pincoord} always draws a pin, besides declaring a coordinate and node as \tsobj{\ncoord}. It expects one to 4 parameters, as listed. If omitted, the default value for distance is 4 (unit: pt), the default value for the angle is -45 (degrees), the default value for color is blue. -In fact, the \tsobj{\coord(name)} is just a short cut for \tsverb{\pincoord(name,red,45)}, if \tsobj{\showcoordstrue}. +The \tsobj{\pincoord} always draws a pin, besides declaring a coordinate and node as \tsobj{\ncoord}. It expects one to 4 parameters, as listed. If omitted, the default length is 4 (unit: pt), the default angle is -45 (degrees), the default color is blue. +Likewise, if \tsobj{\showcoordstrue}, \tsobj{\coord(name)} is just a short cut for \tsverb{\pincoord(name,red,45)}. \end{codedescribe} +\begin{tsremark} + Those defaults can be changed via package options, see \ref{options}, or \tsobj{\setpindefaults}. +\end{tsremark} \begin{codedescribe}{\dotcoord,\dotpincoord} \begin{codesyntax}% @@ -83,7 +102,7 @@ In fact, the \tsobj{\coord(name)} is just a short cut for \tsverb{\pincoord(name \tsobj{\dotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord}\tsverb{)} \tsobj{\dotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color}\tsverb{)} \tsobj{\dotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle}\tsverb{)} -\tsobj{\dotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle,distance}\tsverb{)} +\tsobj{\dotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle,length}\tsverb{)} \end{codesyntax} These are the same as \tsobj{\ncoord} and friends, just adding a dot (a filled in, small circle) at the coordinate. \end{codedescribe} @@ -94,7 +113,7 @@ These are the same as \tsobj{\ncoord} and friends, just adding a dot (a filled i \tsobj{\odotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord}\tsverb{)} \tsobj{\odotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color}\tsverb{)} \tsobj{\odotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle}\tsverb{)} -\tsobj{\odotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle,distance}\tsverb{)} +\tsobj{\odotpincoord}\tsverb{(}\tsobj[oarg,sep={,}]{coord,color,angle,length}\tsverb{)} \end{codesyntax} These are the same as \tsobj{\ncoord} and friends, just adding an open dot (a small circle filled with white) at the coordinate. \end{codedescribe} @@ -114,7 +133,7 @@ Then this will ``calculate'' the intersections between the line (defined by the At each intersection a semi-circle will be drawn, and finally a line will be draw connecting \tsobj[marg]{coordA} to \tsobj[marg]{coordB} over all intermediate nodes. -The star version flips the semi-circles. +The star version flips the semi-circles orientation. \begin{tsremark} The default \tsobj[oarg]{cross-name} is ``cross''. It may contain only characters, as any valid \TeX\ macro name. The default \tsobj[oarg]{width} of the semi-circle is 7pt. \end{tsremark} @@ -126,7 +145,7 @@ The star version flips the semi-circles. \end{tsremark} \end{codedescribe} -\newpage +%\newpage \section{Some Examples} \textbf{\color{red}Note:} In the examples below, the circuit doesn't make much/any sense, it is just a way to show the commands possibilities. @@ -175,6 +194,8 @@ And the same with \tsobj{\showcoordsfalse} \newpage As said, the main limitation (derived from how \tsobj[pkg]{intersections} works) is that crossings between the line and nodes might not be detected at all. For example, if someone tries to connect the nodes \tsobj[key]{D1,D2}, it will, unfortunately, fail detecting the node (pnp transistor) entirely: +%\showcoordstrue +%\setpindefaults{coordcolor=cyan,pincolor=red} \begin{codestore}[crossdemoC] \resizebox{0.5\textwidth}{!}{ \begin{tikzpicture} diff --git a/graphics/pgf/contrib/tikzdotncross/latex/tikzdotncross.sty b/graphics/pgf/contrib/tikzdotncross/latex/tikzdotncross.sty index 2385fb155e..84d6613c10 100644 --- a/graphics/pgf/contrib/tikzdotncross/latex/tikzdotncross.sty +++ b/graphics/pgf/contrib/tikzdotncross/latex/tikzdotncross.sty @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.1} {2024/01/11} +%% This is version {1.2} {2024/10/22} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/tikzdotncross @@ -26,8 +26,8 @@ \ProvidesExplPackage {tikzdotncross} - {2024/01/11} - {1.1} + {2024/10/22} + {1.2} {Marking coordinates and crossing paths} %%%%%%% @@ -40,8 +40,8 @@ { name .code:n = {tikzdotncross} , prefix .code:n = {tikzdotncross} , - date .code:n = {2024/01/11}, - version .code:n = {1.1} , + date .code:n = {2024/10/22}, + version .code:n = {1.2} , description .code:n = {Marking~ coordinates~ and~ crossing~ paths} } \cs_if_exist:NF \PkgInfo @@ -54,9 +54,48 @@ %%% End of cut-n-paste %%%%%%% +%%% +%%% why that here? well, the token list's commands will be used outside expl3 'domain' +%%% +\makeatletter + +\keys_define:nn { tikzdotncross } + { + pin size .tl_set:N = \dotncross@@pinsep , + pin size .value_required:n = true , + pin size .initial:n = 1.2 , + pin size .usage:n = general , + + pin ang .tl_set:N = \dotncross@@pinang , + pin ang .value_required:n = true , + pin ang .initial:n = 45 , + pin ang .usage:n = general , + + pin color .tl_set:N = \dotncross@@pincolor , + pin color .value_required:n = true , + pin color .initial:n = blue , + pin color .usage:n = general , + + pin length .tl_set:N = \dotncross@@pindistance , + pin length .value_required:n = true , + pin length .initial:n = 4 , + pin length .usage:n = general , + + coord color .tl_set:N = \dotncross@@coordcolor , + coord color .value_required:n = true , + coord color .initial:n = red , + coord color .usage:n = general , + } + +\ProcessKeyOptions [ tikzdotncross ] + +\NewDocumentCommand{\setpindefaults}{m} { + \keys_set:nn {tikzdotncross}{#1} +} + \ExplSyntaxOff -\makeatletter +%\makeatletter \usetikzlibrary{intersections} %% @@ -84,17 +123,16 @@ \pgfextra{\csxdef{#2T}{\CrossTotal}} \foreach \aux in {1,...,\csuse{#2T}}{(#2-\aux) node[minimum size=#6-\pgflinewidth,inner sep=0pt](n#2-\aux){}}; \tikzmath{% - coordinate \Ctmp; real \dx , \dy , \d; int \idx; + coordinate \Ctmp; real \dtmp; int \idx; \Ctmp{from} = (#3); \Ctmp{to} = (#4); - \dx{tmp} = \Ctmpx{to} - \Ctmpx{from}; - \dy{tmp} = \Ctmpy{to} - \Ctmpy{from}; - \d{ang} = atan2(\dy{tmp},\dx{tmp}); + \dtmp{x} = \Ctmpx{to} - \Ctmpx{from}; + \dtmp{y} = \Ctmpy{to} - \Ctmpy{from}; + \dtmp{ang} = atan2(\dtmp{y},\dtmp{x}); \Ctmp{1st} = (n#2-1); \Ctmp{last} = (n#2-\csuse{#2T}); \idx{1st} = 1; \idx{last} = \csuse{#2T}; - \idx{crossing} = 1; if \Ctmpx{1st} == \Ctmpx{from} then { if \Ctmpy{1st} == \Ctmpy{from} then { \idx{1st} = 2; @@ -109,9 +147,9 @@ \ifnum\idx{last}<\idx{1st} \draw (#3) -- (#4); \else - \draw[line width=1.8\pgflinewidth,white,rotate=\d{ang}] + \draw[line width=1.8\pgflinewidth,white,rotate=\dtmp{ang}] \foreach \aux in {\idx{1st},...,\idx{last}}{(#2-\aux) +(-#6/2,0) arc[start angle=\dotncross@@sign180,end angle=0,radius=#6/2]}; - \draw[rotate=\d{ang},line cap=round] + \draw[rotate=\dtmp{ang},line cap=round] \foreach \aux in {\idx{1st},...,\idx{last}}{(#2-\aux) +(-#6/2,0) arc[start angle=\dotncross@@sign180,end angle=0,radius=#6/2]}; \gdef\dotncross@@tmpA{#3} @@ -133,14 +171,14 @@ \newcommand\showcoordsfalse{\let\ncoord=\dotncross@@coordnode \let\dotcoord=\dotncross@@dotcoordnode \let\odotcoord=\dotncross@@odotcoordnode} \newcommand\showcoordstrue{\let\ncoord=\dotncross@@coordpin \let\dotcoord=\dotncross@@dotcoordpin \let\odotcoord=\dotncross@@odotcoordpin} -\def\dotncross@@coordpin(#1){\pincoord(#1,red,45)} -\def\dotncross@@coordnode(#1){coordinate(#1) node[minimum size=1.2pt,inner sep=1.2pt](n#1){}} +\def\dotncross@@coordpin(#1){\pincoord(#1,\dotncross@@coordcolor,\dotncross@@pinang)} +\def\dotncross@@coordnode(#1){coordinate(#1) node[minimum size=\dotncross@@pinsep pt,inner sep=\dotncross@@pinsep pt](n#1){}} -\def\dotncross@@dotcoordpin(#1){\dotpincoord(#1,red,45)} -\def\dotncross@@dotcoordnode(#1){coordinate(#1) node[circle,minimum size=1.2pt,inner sep=1.2pt,fill](n#1){}} +\def\dotncross@@dotcoordpin(#1){\dotpincoord(#1,\dotncross@@coordcolor,\dotncross@@pinang)} +\def\dotncross@@dotcoordnode(#1){coordinate(#1) node[circle,minimum size=\dotncross@@pinsep pt,inner sep=\dotncross@@pinsep pt,fill](n#1){}} -\def\dotncross@@odotcoordpin(#1){\odotpincoord(#1,red,45)} -\def\dotncross@@odotcoordnode(#1){coordinate(#1) node[circle,minimum size=1.2pt,inner sep=1.2pt,fill=white,draw](n#1){}} +\def\dotncross@@odotcoordpin(#1){\odotpincoord(#1,\dotncross@@coordcolor,\dotncross@@pinang)} +\def\dotncross@@odotcoordnode(#1){coordinate(#1) node[circle,minimum size=\dotncross@@pinsep pt,inner sep=\dotncross@@pinsep pt,fill=white,draw](n#1){}} %%%% %% @@ -155,17 +193,17 @@ \def\dotncross@@pincasew#1#2{\dotncross@@pincase#1,,,,\dotncross@@pincaseA\dotncross@@pincaseB\dotncross@@pincaseC\dotncross@@pincaseD;#2:} \def\dotncross@@pincase#1,#2,#3,#4,#5#6#7#8#9:{#8:#1:#2:#3:#4:#9:} \def\dotncross@@pincaseA:#1:#2:#3:#4:#5;#6:{\dotncross@@pincoord{#1}{#2}{#3}{#4}{#6}} -\def\dotncross@@pincaseB:#1:#2:#3:#4:#5;#6:{\dotncross@@pincoord{#1}{#2}{#3}{4}{#6}} -\def\dotncross@@pincaseC:#1:#2:#3:#4:#5;#6:{\dotncross@@pincoord{#1}{#2}{-45}{4}{#6}} -\def\dotncross@@pincaseD:#1:#2:#3:#4:#5;#6:{\dotncross@@pincoord{#1}{blue}{-45}{4}{#6}} +\def\dotncross@@pincaseB:#1:#2:#3:#4:#5;#6:{\dotncross@@pincoord{#1}{#2}{#3}{\dotncross@@pindistance}{#6}} +\def\dotncross@@pincaseC:#1:#2:#3:#4:#5;#6:{\dotncross@@pincoord{#1}{#2}{-\dotncross@@pinang}{\dotncross@@pindistance}{#6}} +\def\dotncross@@pincaseD:#1:#2:#3:#4:#5;#6:{\dotncross@@pincoord{#1}{\dotncross@@pincolor}{-\dotncross@@pinang}{\dotncross@@pindistance}{#6}} \def\pincoord(#1){\dotncross@@pincasew{#1}{}} \def\dotpincoord(#1){\dotncross@@pincasew{#1}{circle,fill,}} \def\odotpincoord(#1){\dotncross@@pincasew{#1}{circle,fill=white,draw,}} \newcommand\dotncross@@pincoord[5]{% - coordinate(#1) node[#5minimum size=1.2pt,inner sep=1.2pt](n#1){} - node[circle, #2, inner sep=1.2pt, outer sep=0pt, radius=1pt, fill=#2!20!white, fill opacity=0.2, draw opacity=0.4, draw, + coordinate(#1) node[#5minimum size=\dotncross@@pinsep pt,inner sep=\dotncross@@pinsep pt](n#1){} + node[circle, #2, inner sep=\dotncross@@pinsep pt, outer sep=0pt, radius=1pt, fill=#2!20!white, fill opacity=0.2, draw opacity=0.4, draw, pin={[#2, overlay, inner sep=0pt, outer sep=1pt, font=\tiny, pin distance=#4pt, pin edge={#2, overlay}]#3:#1}]{}% } diff --git a/graphics/pgf/contrib/tikzquads/README.md b/graphics/pgf/contrib/tikzquads/README.md index 4ea07b35cb..ab8d126c52 100644 --- a/graphics/pgf/contrib/tikzquads/README.md +++ b/graphics/pgf/contrib/tikzquads/README.md @@ -79,6 +79,9 @@ The Current Maintainer of this work is Alceu Frigeri ## Changelog +* Version 1.1 (this) + - Added a 'raw sources' key (see manual) + - a few typos in the documentation * Version 1.0 - Initial release by CTAN diff --git a/graphics/pgf/contrib/tikzquads/doc/tikzquads.pdf b/graphics/pgf/contrib/tikzquads/doc/tikzquads.pdf Binary files differindex 4ea887cb74..0bfc7d4b14 100644 --- a/graphics/pgf/contrib/tikzquads/doc/tikzquads.pdf +++ b/graphics/pgf/contrib/tikzquads/doc/tikzquads.pdf diff --git a/graphics/pgf/contrib/tikzquads/doc/tikzquads.tex b/graphics/pgf/contrib/tikzquads/doc/tikzquads.tex index b6f6f1a30b..0e549ead63 100644 --- a/graphics/pgf/contrib/tikzquads/doc/tikzquads.tex +++ b/graphics/pgf/contrib/tikzquads/doc/tikzquads.tex @@ -15,7 +15,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.0} {2024/01/13} +%% This is version {1.1} {2024/10/17} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/tikzdotncross @@ -91,7 +91,7 @@ This package defines a few extra shapes (single / dual port boxes) designed to b \tableofcontents \section{Introduction} -In standard text books, both for Circuits Theory and Electronics, quite frequently, in the process of modelling sub-circuits, one ends representing them either: +In standard text books, Circuits Theory and Electronics alike, quite frequently, in the process of modelling sub-circuits, one ends representing them either: \begin{itemize} \item as a single port \emph{black box}, or \item as a dual port \emph{black box} @@ -113,7 +113,7 @@ This package defines a few, parameterized shapes for each case: \item Quad G \item Quad H \end{itemize} -Lastly, this package also defines a \emph{Pseudo-Graph load line} shape, for those moments where a true graph, \tsobj[pkg]{pgfplots}, isn't needed. +Lastly, this package also defines a \emph{Pseudo-Graph load line} shape, for those moments where a true graph, like the ones \tsobj[pkg]{pgfplots} enables, isn't needed. \end{itemize} \subsection{CircuiTi\emph{k}Z} @@ -161,7 +161,7 @@ The point being that, regardless of the sub-shape orientation, the intuitive geo \subsection{General Keys}\label{generalkeys} -These are the keys to fine tuning a shape: +General keys to fine tuning a shape: \begin{describelist*}[30mm]{keys} \describe {outer sep} {Text outer separation, initial value: 1.5pt} \describe {inner sep} {Text inner separation, initial value: 1pt} @@ -392,7 +392,7 @@ node[Quad Z]{} \tscode*[emph={draw,node},emph2={x,y,fit,to,outer,inner,node},emph3={Quad,ToQuad,Black,ToBlack,Box,Thevenin,ToThevenin,Norton,ToNorton},basicstyle={\scriptsize\ttfamily},numbers=left,codeprefix={}]{QuadZDef} -This shape, besides the base anchors (see \ref{quadanchors}) it has 4 internal nodes: \tsobj[key]{<node>-Z11,<node>-Z12,<node>-Z21,<node>-Z22} and each of those sub-nodes has geographic anchors as defined at \ref{auxiliarynodes}. +Besides the base anchors (see \ref{quadanchors}) it has 4 internal nodes: \tsobj[key]{<node>-Z11,<node>-Z12,<node>-Z21,<node>-Z22} and each of those sub-nodes has geographic anchors as defined at \ref{auxiliarynodes}. \begin{tsremark} There is also a \tsobj[key]{ToQuad Z} to be used in a \tsobj[key]{to[ ]} path, in which case the key \tsobj[key]{outer x fit to} style will be triggered with the starting and ending points of the \tsobj[key]{to[ ]} path. \end{tsremark} @@ -423,6 +423,7 @@ There is also a \tsobj[key]{ToQuad Z} to be used in a \tsobj[key]{to[ ]} path, i \describe{I2}{Initial value:\tsverb{$I_2$}} \describe{V1}{Initial value:\tsverb{$V_1$}} \describe{V2}{Initial value:\tsverb{$V_2$}} + \describe {raw sources} {This will suppress the control variables (I1, I2) in the sources' labels} \describe{Z11}{Initial value:\tsverb{$Z_{11}$}} \describe{Z12}{Initial value:\tsverb{$Z_{12}$}} \describe{Z21}{Initial value:\tsverb{$Z_{21}$}} @@ -448,7 +449,7 @@ node[Quad Y]{} \end{codestore} \tscode*[emph={draw,node},emph2={x,y,fit,to,outer,inner,node},emph3={Quad,ToQuad,Black,ToBlack,Box,Thevenin,ToThevenin,Norton,ToNorton},basicstyle={\scriptsize\ttfamily},numbers=left,codeprefix={}]{QuadYDef} -This shape, besides the base anchors (see \ref{quadanchors}) it has 4 internal nodes: \tsobj[key]{<node>-Y11,<node>-Y12,<node>-Y21,<node>-Y22} and each of those sub-nodes has geographic anchors as defined at \ref{auxiliarynodes}. +Besides the base anchors (see \ref{quadanchors}) it has 4 internal nodes: \tsobj[key]{<node>-Y11,<node>-Y12,<node>-Y21,<node>-Y22} and each of those sub-nodes has geographic anchors as defined at \ref{auxiliarynodes}. \begin{tsremark} There is also a \tsobj[key]{ToQuad Y} to be used in a \tsobj[key]{to[ ]} path, in which case the key \tsobj[key]{outer x fit to} style will be triggered with the starting and ending points of the \tsobj[key]{to[ ]} path. \end{tsremark} @@ -479,6 +480,7 @@ There is also a \tsobj[key]{ToQuad Y} to be used in a \tsobj[key]{to[ ]} path, i \describe{I2}{Initial value:\tsverb{$I_2$}} \describe{V1}{Initial value:\tsverb{$V_1$}} \describe{V2}{Initial value:\tsverb{$V_2$}} + \describe {raw sources} {This will suppress the control variables (V1, V2) in the sources' labels} \describe{Y11}{Initial value:\tsverb{$Y_{11}$}} \describe{Y12}{Initial value:\tsverb{$Y_{12}$}} \describe{Y21}{Initial value:\tsverb{$Y_{21}$}} @@ -503,7 +505,7 @@ node[Quad G]{} \tscode*[emph={draw,node},emph2={x,y,fit,to,outer,inner,node},emph3={Quad,ToQuad,Black,ToBlack,Box,Thevenin,ToThevenin,Norton,ToNorton},basicstyle={\scriptsize\ttfamily},numbers=left,codeprefix={}]{QuadGDef} -This shape, besides the base anchors (see \ref{quadanchors}) it has 4 internal nodes: \tsobj[key]{<node>-G11,<node>-G12,<node>-G21,<node>-G22} and each of those sub-nodes has geographic anchors as defined at \ref{auxiliarynodes}. +Besides the base anchors (see \ref{quadanchors}) it has 4 internal nodes: \tsobj[key]{<node>-G11,<node>-G12,<node>-G21,<node>-G22} and each of those sub-nodes has geographic anchors as defined at \ref{auxiliarynodes}. \begin{tsremark} There is also a \tsobj[key]{ToQuad G} to be used in a \tsobj[key]{to[ ]} path, in which case the key \tsobj[key]{outer x fit to} style will be triggered with the starting and ending points of the \tsobj[key]{to[ ]} path. \end{tsremark} @@ -535,6 +537,7 @@ There is also a \tsobj[key]{ToQuad G} to be used in a \tsobj[key]{to[ ]} path, i \describe{I2}{Initial value:\tsverb{$I_2$}} \describe{V1}{Initial value:\tsverb{$V_1$}} \describe{V2}{Initial value:\tsverb{$V_2$}} + \describe {raw sources} {This will suppress the control variables (V1, I2) in the sources' labels} \describe{G11}{Initial value:\tsverb{$G_{11}$}} \describe{G12}{Initial value:\tsverb{$G_{12}$}} \describe{G21}{Initial value:\tsverb{$G_{21}$}} @@ -559,7 +562,7 @@ node[Quad H]{} \tscode*[emph={draw,node},emph2={x,y,fit,to,outer,inner,node},emph3={Quad,ToQuad,Black,ToBlack,Box,Thevenin,ToThevenin,Norton,ToNorton},basicstyle={\scriptsize\ttfamily},numbers=left,codeprefix={}]{QuadHDef} -This shape, besides the base anchors (see \ref{quadanchors}) it has 4 internal nodes: \tsobj[key]{<node>-H11,<node>-H12,<node>-H21,<node>-H22} and each of those sub-nodes has geographic anchors as defined at \ref{auxiliarynodes}. +Besides the base anchors (see \ref{quadanchors}) it has 4 internal nodes: \tsobj[key]{<node>-H11,<node>-H12,<node>-H21,<node>-H22} and each of those sub-nodes has geographic anchors as defined at \ref{auxiliarynodes}. \begin{tsremark} There is also a \tsobj[key]{ToQuad H} to be used in a \tsobj[key]{to[ ]} path, in which case the key \tsobj[key]{outer x fit to} style will be triggered with the starting and ending points of the \tsobj[key]{to[ ]} path. \end{tsremark} @@ -592,6 +595,7 @@ There is also a \tsobj[key]{ToQuad H} to be used in a \tsobj[key]{to[ ]} path, i \describe{I2}{Initial value:\tsverb{$I_2$}} \describe{V1}{Initial value:\tsverb{$V_1$}} \describe{V2}{Initial value:\tsverb{$V_2$}} + \describe {raw sources} {This will suppress the control variables (I1, V2) in the sources' labels} \describe{H11}{Initial value:\tsverb{$H_{11}$}} \describe{H12}{Initial value:\tsverb{$H_{12}$}} \describe{H21}{Initial value:\tsverb{$H_{21}$}} diff --git a/graphics/pgf/contrib/tikzquads/latex/tikzquads.sty b/graphics/pgf/contrib/tikzquads/latex/tikzquads.sty index 31fc675742..1cdaf13300 100644 --- a/graphics/pgf/contrib/tikzquads/latex/tikzquads.sty +++ b/graphics/pgf/contrib/tikzquads/latex/tikzquads.sty @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.0} {2024/01/13} +%% This is version {1.1} {2024/10/17} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/tikzquads @@ -27,8 +27,8 @@ \ProvidesExplPackage {tikzquads} - {2024/01/13} - {1.0} + {2024/10/17} + {1.1} {CircuiTikZ Extension - Quadripoles and Dipoles} \ExplSyntaxOn @@ -42,8 +42,8 @@ { name .code:n = {tikzquads} , prefix .code:n = {tikzquads} , - date .code:n = {2024/01/13}, - version .code:n = {1.0} , + date .code:n = {2024/10/17}, + version .code:n = {1.1} , description .code:n = {CircuiTikZ~ Extension~- Quadripoles~ and~ Dipoles} } \cs_if_exist:NF \PkgInfo @@ -86,6 +86,7 @@ \newtoggle{tikzquads@@toggle@outermarks} \newtoggle{tikzquads@@toggle@beziertip} \newtoggle{tikzquads@@toggle@roundsources} +\newtoggle{tikzquads@@toggle@rawsources} % % @@ -301,7 +302,7 @@ %%%%%%%%%%%%%%% %%% -%%% "QUadKeys" Path (Quadripoles) +%%% "QuadKeys" Path (Quadripoles) %%% %%%%%%%%%%%%%%% @@ -503,6 +504,8 @@ inner marks/.style={@inner marks}, @outer marks/.code={\toggletrue{tikzquads@@toggle@outermarks}}, outer marks/.style={@outer marks}, + @raw sources/.code={\toggletrue{tikzquads@@toggle@rawsources}}, + raw sources/.style={@raw sources}, @invert/.code={\toggletrue{tikzquads@@toggle@inverted}}, invert/.style={% /tikz/xscale=-1, @@ -803,7 +806,11 @@ \SearchValueOf{QuadKeys}{#3}{\@@valC} \pgftransformresetnontranslations \tikzquads@@CondDraw{#1}{}{\pgftext[\tikzquads@@TanchorA,at={\pgfpointanchor{\tikz@fig@name-#1}{\tikzquads@@NanchorA}}]{\@@valA}} - \tikzquads@@CondDraw{#2}{}{\pgftext[\tikzquads@@TanchorB,at={\pgfpointanchor{\tikz@fig@name-#2}{\tikzquads@@NanchorB}}]{\@@valB\@@valC}} + \ifboolexpr{togl{tikzquads@@toggle@rawsources}}{% + \tikzquads@@CondDraw{#2}{}{\pgftext[\tikzquads@@TanchorB,at={\pgfpointanchor{\tikz@fig@name-#2}{\tikzquads@@NanchorB}}]{\@@valB}} + }{% + \tikzquads@@CondDraw{#2}{}{\pgftext[\tikzquads@@TanchorB,at={\pgfpointanchor{\tikz@fig@name-#2}{\tikzquads@@NanchorB}}]{\@@valB\@@valC}} + } } } @@ -901,7 +908,11 @@ \SearchValueOf{QuadKeys}{#4}{\@@valC} \pgftransformresetnontranslations \tikzquads@@CondDraw{#2}{}{\pgftext[\tikzquads@@TanchorA,at={\pgfpointanchor{\tikz@fig@name-#2}{\tikzquads@@NanchorA}}]{\@@valA}} - \tikzquads@@CondDraw{#3}{}{\pgftext[\tikzquads@@TanchorB,at={\pgfpointanchor{\tikz@fig@name-#3}{\tikzquads@@NanchorB}}]{\@@valB\@@valC}} + \ifboolexpr{togl{tikzquads@@toggle@rawsources}}{% + \tikzquads@@CondDraw{#3}{}{\pgftext[\tikzquads@@TanchorB,at={\pgfpointanchor{\tikz@fig@name-#3}{\tikzquads@@NanchorB}}]{\@@valB}} + }{% + \tikzquads@@CondDraw{#3}{}{\pgftext[\tikzquads@@TanchorB,at={\pgfpointanchor{\tikz@fig@name-#3}{\tikzquads@@NanchorB}}]{\@@valB\@@valC}} + } } } diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.pdf b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.pdf Binary files differindex 6ef7f59476..ce114e03f7 100644 --- a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.pdf +++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.pdf diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.tex b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.tex index 88e9abb16a..27d56d19a5 100644 --- a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.tex +++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.tex @@ -6,6 +6,7 @@ \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{tkz-grapheur} +\pgfplotsset{compat=newest} \usepackage{amsmath} \usepackage{fancyvrb} \usepackage{fancyhdr} @@ -13,6 +14,7 @@ \usepackage{nicefrac} \usepackage{fontawesome5} \usepackage{tcolorbox} +\usepackage{minted2} \tcbuselibrary{skins,minted} \fancyhf{} \renewcommand{\headrulewidth}{0pt} @@ -29,11 +31,12 @@ \hypersetup{pdfborder=0 0 0} \usepackage[margin=2cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.5} -\def\TPdate{22/06/2024} +\def\TPversion{0.2.0} +\def\TPdate{29/10/2024} \usepackage{soul} \usepackage{codehigh} \usepackage{tabularray} +\usepackage{alphalph} \sethlcolor{lightgray!25} \NewDocumentCommand\MontreCode{ m }{% \hl{\vphantom{\texttt{pf}}\texttt{#1}}% @@ -532,7 +535,7 @@ The mandatory arguments correspond to the x-coordinates (in \TikZ\ language) and \subsection{Draw a line}\label{tracstraight} -The idea is to propose a command to draw a line, from: +The idea is to propose a command to draw a line (or an asymptote), from: \begin{itemize} \item of two points (or nodes); @@ -542,6 +545,7 @@ The idea is to propose a command to draw a line, from: \begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} %in the GraphiqueTikz environment \DrawLine[keys]{point or node}{point or node or slope} +\DrawAsymptote[keys]{x value} \end{tcblisting} The optional \MontreCode{[keys]} available are: @@ -564,6 +568,7 @@ The optional \MontreCode{[keys]} available are: \DrawLine[Color=red]{(-2,-1)}{(2,4)} \DrawLine[Color=blue,Start=-5,End=3]{(A)}{(B)} \DrawLine[Color=olive,Slope]{(C)}{0.25} + \DrawAsymptote[Color=brown]{-6} \end{GraphTikz} \end{tcblisting} @@ -1396,7 +1401,11 @@ The last mandatory argument is the work point (abscissa version or node followin \section{Commands specific to two-variable statistics} -\subsection{The point cloud}\label{scatter} +\subsection{Limitations} + +Given the specific features of \TikZ, we advise you not to use values that are too \textit{large} at axis level (this can cause problems with years, for example), or else you'll have to \textit{transform} axis and/or data values so that everything is displayed as it should be (also beware of regressions, calculations, etc.). + +\subsection{The point scatter}\label{scatter} In addition to commands linked to functions, it is also possible to represent double statistical series. @@ -1490,7 +1499,7 @@ In partnership with the \MontreCode{xint-regression} package, loaded by the pack The command, similar to that of defining a curve, is: \begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} -\DrawRegression[keys]<no fct>{type}<rounded>{listex}{listey} +\DrawRegression[keys]<name fct>{type}<rounded>{listex}{listey} \end{tcblisting} The \MontreCode{[keys]} available are, classically: @@ -1651,60 +1660,146 @@ $\begin{cases} \gamma \approx \RoundNb[0]{\Cgamma} \end{cases}$. \end{tcblisting} -% -%\newpage -% -%\section{Liste des commandes} -% -%Les commandes disponibles sont : -% -%\NewDocumentCommand\lstcmd{ m m m }{% -% \item[\texttt{#1}] : \mintinline{latex}|#2|\hfill{}page \pageref{#3} -%} -% -%\begin{description} -% \lstcmd{environnement~~}{\begin{GraphiqueTikz}...\end{GraphiqueTikz}}{creaenvt} -% \lstcmd{axes et grilles}{\TracerAxesGrille}{creaaxesgr} -% \lstcmd{aj val axes X~~}{\RajouterValeursAxeX}{ajoutvals} -% \lstcmd{aj val axes Y~~}{\RajouterValeursAxeY}{ajoutvals} -% \lstcmd{def fonction~~~}{\DefineCurve}{deftracfct} -% \lstcmd{tracé courbe~~~}{\DrawCurve}{deftracfct} -% \lstcmd{def interpo~~~~}{\DefineCurveInterpo}{deftracinterpo} -% \lstcmd{tracé interpo~~}{\DrawCurveInterpo}{deftracinterpo} -% \lstcmd{def spline~~~~~}{\DefineSplineCurve}{deftracfctspline} -% \lstcmd{tracé spline~~~}{\DrawSplineCurve}{deftracfctspline} -% \lstcmd{tracé droite~~~}{\TracerDroite}{tracdroite} -% \lstcmd{def points~~~~~}{\DefinirPts}{defpts} -% \lstcmd{def image~~~~~~}{\DefinirImage}{defpts} -% \lstcmd{marq pts~~~~~~~}{\MarquerPts}{markpts} -% \lstcmd{placer txt~~~~~}{\PlacerTexte}{placetxt} -% \lstcmd{récup absc~~~~~}{\RecupererAbscisse}{recupcoordo} -% \lstcmd{récup ordo~~~~~}{\RecupererOrdonnee}{recupcoordo} -% \lstcmd{récup coordos~~}{\RecupererCoordonnees}{recupcoordo} -% \lstcmd{images~~~~~~~~~}{\PlacerImages}{images} -% \lstcmd{antécédents~~~~}{\TrouverAntecedents}{defanteced} -% \lstcmd{antécédents~~~~}{\PlacerAntecedents}{tracanteced} -% \lstcmd{intersection~~~}{\TrouverIntersections}{intersect} -% \lstcmd{maximum~~~~~~~~}{\TrouverMaximum}{maximum} -% \lstcmd{minimum~~~~~~~~}{\TrouverMinimum}{minimum} -% \lstcmd{intégrale~~~~~~}{\DrawIntegral}{integr} -% \lstcmd{tangente~~~~~~~}{\DrawTangente}{tgte} -% \lstcmd{loi normale~~~~}{\DefinirLoiNormale}{loinormale} -% \lstcmd{loi normale~~~~}{\TracerLoiNormale}{loinormale} -% \lstcmd{loi khideux~~~~}{\DefinirLoiKhiDeux}{loikhideux} -% \lstcmd{loi khideux~~~~}{\TracerLoiKhiDeux}{loikhideux} -% \lstcmd{stats 2 var~~~~}{\TracerNuage}{nuage} -% \lstcmd{regressions~~~~}{\TracerAjustement}{regressions} -% \lstcmd{arrondi~~~~~~~~}{\RoundNb}{numarrond} -% \lstcmd{nb aléat~~~~~~~}{\ChoisirNbAlea}{nbalea} -%\end{description} + +\subsection{Monte-Carle method} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%in the GraphiqueTikz environment +\SimulateMonteCarlo[keys]<function>}{number of points}[\nbptsmcok][\nbptsmcko] +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphTikz}% + [x=10cm,y=10cm,Xmin=0,Xmax=1,Xgrid=0.1,Xgrids=0.05, + Ymin=0,Ymax=1,Ygrid=0.1,Ygrids=0.05] + \DrawAxisGrids[Enlarge=2.5mm,Last]{auto}{auto} + \DefineCurve[Trace,Color=teal,Step=0.001]<f>{sqrt(1-x^2)} + \SimulateMonteCarlo<f>{5000} +\end{GraphTikz} + +There is \textcolor{blue}{\num{\nbptsmcok}} blue points, +there is \textcolor{red}{\num{\nbptsmcko}} red points. + +And $\frac{\num{\nbptsmcok}}{\num{\nbptsmc}} +\approx \RoundNb[4]{\nbptsmcok/\nbptsmc}$ +et $\frac{\pi}{4} \approx \RoundNb[4]{pi/4}$. +\end{tcblisting} \pagebreak +\subsection{Some pgfplots macros} + +In addition to pgfplots/axis, there's few \textit{simple} macros in order to work with \MontreCode{pgfplots/axis} environement. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%find intersection of two [name path] objects defined +\findintersectionspgf[nodename baises]{object1}{object2}[\myt] +%global extraction of coordinates +\gextractxnodepgf{node}[\myxcoord] +\gextractynodepgf{node}[\myycoord] +\gextractxynodepgf{node}[\myxcoord][\myycoord] +%area between curves +\fillbetweencurvespgf[tikz options]{curve1}{curve2}<soft domain options> +%cubic splines +\addplotspline(*)[tikz options]<coeffs>{list of points}[\myspline] +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%\usepackage{alphalph} + +\begin{tikzpicture} + \begin{axis}% + [% + axis y line=center,axis x line=middle, %axis + axis line style={line width=0.8pt,-latex}, + x=0.33cm,y=0.55cm,xmin=1985,xmax=2030,ymin=56,ymax=70, %units + grid=both,xtick distance=5,ytick distance=2, %gridp + minor x tick num=4,minor y tick num=1, %grids + extra x ticks={1985},extra x tick style={grid=none}, %origx + extra y ticks={56},extra y tick style={grid=none}, %origy + x tick label style={/pgf/number format/.cd,use comma,1000 sep={}}, %year + major tick length={2*3pt},minor tick length={1.5*3pt}, %grads + every tick/.style={line width=0.8pt},enlargelimits=false, %style + enlarge x limits={abs=2.5mm,upper},enlarge y limits={abs=2.5mm,upper}, %énlarge + ] + %spline + y=66 + \addplot[name path global=eqtest,mark=none,red,line width=1.05pt,domain=1985:2030] {66} ; + \def\LISTETEST{1985/60/0§1995/68/0§2015/58/0§2025/69/0§2030/62/-2} + \addplotspline*[line width=1.05pt,violet,name path global=splinecubtest]{\LISTETEST}[\monsplineviolet] + %equation f(x)=66 + \findintersectionspgf[MonItsc]{eqtest}{splinecubtest} + %extraction of coordinates + \gextractxnodepgf{(MonItsc-1)}[\xMonItscA] + \gextractxnodepgf{(MonItsc-2)}[\xMonItscB] + \gextractxnodepgf{(MonItsc-3)}[\xMonItscC] + \gextractxnodepgf{(MonItsc-4)}[\xMonItscD] + %vizualisation + \xintFor* #1 in {\xintSeq{1}{4}}\do{% + \draw[line width=0.9pt,densely dashed,olive,->,>=latex] (MonItsc-#1) -- (\csname xMonItsc\AlphAlph{#1}\endcsname,56) ; + \filldraw[olive] (MonItsc-#1) circle[radius=1.75pt] ; + } + %area + \path [name path=xaxis] (1985,56) -- (2030,56); + \fillbetweencurvespgf{splinecubtest}{xaxis}<domain={\xMonItscB:\xMonItscA}> + \fillbetweencurvespgf{splinecubtest}{xaxis}<domain={\xMonItscD:\xMonItscC}> + \end{axis} +\end{tikzpicture} + +Solutions of $f(x)=66$ are \RoundNb[0]{\xMonItscA} \&\ \RoundNb[0]{\xMonItscB} \&\ \RoundNb[0]{\xMonItscC} \&\ \RoundNb[0]{\xMonItscD}. +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,text only} +\begin{tikzpicture} + \begin{axis}% + [% + axis y line=center,axis x line=middle, %axis + axis line style={line width=0.8pt,-latex}, + x=0.33cm,y=0.55cm,xmin=1985,xmax=2030,ymin=56,ymax=70, %units + grid=both,xtick distance=5,ytick distance=2, %gridp + minor x tick num=4,minor y tick num=1, %grids + extra x ticks={1985},extra x tick style={grid=none}, %origx + extra y ticks={56},extra y tick style={grid=none}, %origy + x tick label style={/pgf/number format/.cd,use comma,1000 sep={}}, %year + major tick length={2*3pt},minor tick length={1.5*3pt}, %grads + every tick/.style={line width=0.8pt},enlargelimits=false, %style + enlarge x limits={abs=2.5mm,upper},enlarge y limits={abs=2.5mm,upper}, %énlarge + ] + %spline + y=66 + \addplot[name path global=eqtest,mark=none,red,line width=1.05pt,domain=1985:2030] {66} ; + \def\LISTETEST{1985/60/0§1995/68/0§2015/58/0§2025/69/0§2030/62/-2} + \addplotspline*[line width=1.05pt,violet,name path global=splinecubtest]{\LISTETEST}[\monsplineviolet] + %equation f(x)=66 + \findintersectionspgf[MonItsc]{eqtest}{splinecubtest} + %extraction of coordinates + \gextractxnodepgf{(MonItsc-1)}[\xMonItscA] + \gextractxnodepgf{(MonItsc-2)}[\xMonItscB] + \gextractxnodepgf{(MonItsc-3)}[\xMonItscC] + \gextractxnodepgf{(MonItsc-4)}[\xMonItscD] + %vizualisation + \xintFor* #1 in {\xintSeq{1}{4}}\do{% + \draw[line width=0.9pt,densely dashed,olive,->,>=latex] (MonItsc-#1) -- (\csname xMonItsc\AlphAlph{#1}\endcsname,56) ; + \filldraw[olive] (MonItsc-#1) circle[radius=1.75pt] ; + } + %area + \path [name path=xaxis] (1985,56) -- (2030,56); + \fillbetweencurvespgf{splinecubtest}{xaxis}<domain={\xMonItscB:\xMonItscA}> + \fillbetweencurvespgf{splinecubtest}{xaxis}<domain={\xMonItscD:\xMonItscC}> + \end{axis} +\end{tikzpicture} + +Solutions of $f(x)=66$ are \RoundNb[0]{\xMonItscA} \&\ \RoundNb[0]{\xMonItscB} \&\ \RoundNb[0]{\xMonItscC} \&\ \RoundNb[0]{\xMonItscD}. +\end{tcblisting} + + + \section{History} \begin{quote} \begin{verbatim} +0.2.0 : [Alt] key for Hermite spline + few pgfplots macros +0.1.9 : Bugfix +0.1.8 : New commands [in french doc] (binomial, cabweb,\ldots) +0.1.6 : Vertical asymptote + [in french doc] commands for integrals 0.1.5 : Initial version [en] \end{verbatim} \end{quote} diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdf b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdf Binary files differindex c53d69179c..0a5577dafe 100644 --- a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdf +++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdf diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex index 9ea6b13200..e851265a5f 100644 --- a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex +++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex @@ -6,13 +6,17 @@ \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{tkz-grapheur} +\pgfplotsset{compat=newest} +\usepackage{alphalph} \usepackage{amsmath} +\usepackage{enumitem} \usepackage{fancyvrb} \usepackage{fancyhdr} \usepackage{hyperref} \usepackage{nicefrac} \usepackage{fontawesome5} \usepackage{tcolorbox} +\usepackage{minted2} \tcbuselibrary{skins,minted} \fancyhf{} \renewcommand{\headrulewidth}{0pt} @@ -29,8 +33,8 @@ \hypersetup{pdfborder=0 0 0} \usepackage[margin=2cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.5} -\def\TPdate{22/06/2024} +\def\TPversion{0.2.0} +\def\TPdate{29/10/2024} \usepackage{soul} \usepackage{codehigh} \usepackage{tabularray} @@ -39,7 +43,7 @@ \hl{\vphantom{\texttt{pf}}\texttt{#1}}% } \usepackage[french]{babel} - +\sisetup{group-minimum-digits=4} \renewcommand{\footnoterule}{\vfill\kern -3pt \hrule width 0.4\columnwidth \kern 2.6pt} \begin{document} @@ -174,7 +178,7 @@ \subsection{Description et idées générales} -Avec ce modeste package, loin des capacités offertes par exemple par les excellents packages \MontreCode{tkz-*}\footnote{par exemple tkz-base \url{https://ctan.org/pkg/tkz-base} et tkz-fct \url{https://ctan.org/pkg/tkz-fct}.} (d'Alain Matthes) ou \MontreCode{tzplot}\footnote{CTAN : \url{https://ctan.org/pkg/tzplot}.} (de In-Sung Cho), il est possible de travailler sur des graphiques de fonctions, en langage \TikZ, de manière \textit{intuitive} et \textit{explicite}. +Avec ce modeste package, loin des capacités offertes par exemple par les excellents packages \MontreCode{pgfplots}\footnote{CTAN : \url{https://ctan.org/pkg/pgfplots}}, \MontreCode{tkz-*}\footnote{par exemple tkz-base \url{https://ctan.org/pkg/tkz-base} et tkz-fct \url{https://ctan.org/pkg/tkz-fct}.} (d'Alain Matthes) ou \MontreCode{tzplot}\footnote{CTAN : \url{https://ctan.org/pkg/tzplot}.} (de In-Sung Cho), il est possible de travailler sur des graphiques de fonctions, en langage \TikZ, de manière \textit{intuitive} et \textit{explicite}. \smallskip @@ -183,7 +187,7 @@ Concernant le fonctionnement global : \smallskip \begin{itemize} - \item des styles particuliers pour les objets utilisés ont été définis, mais ils peuvent localement être modifiés ; + \item des styles particuliers pour les objets utilisés ont été définis (modifiables localement) ; \item le nom des commandes est sous forme \textit{opérationnelle}, de sorte que la construction des éléments graphiques a une forme quasi \textit{algorithmique}. \end{itemize} @@ -209,7 +213,8 @@ Il sera ensuite possible : \item de tracer des courbes ; \item de déterminer graphiquement des images ou des antécédents ; \item de rajouter des éléments de dérivation (tangentes) ou d'intégration (domaine) ; - \item de tracer une droite d'ajustement linéaire ou la courbe d'un autre ajustement. + \item de tracer une droite d'ajustement linéaire ou la courbe d'un autre ajustement ; + \item \dots \end{itemize} \subsection{Packages utilisés, et options du package} @@ -221,6 +226,7 @@ Le package utilise : \begin{itemize} \item \MontreCode{tikz}, avec les librairies \MontreCode{calc,intersections,patterns,patterns.meta,bbox} ; \item \MontreCode{simplekv}, \MontreCode{xintexpr}, \MontreCode{xstring}, \MontreCode{listofitems} ; + \item \MontreCode{pgfplots}, avec la librairie \MontreCode{fillbetween} (désactivable via \MontreCode{[nonpgfplots]}) ; \item \MontreCode{xint-regression}\footnote{CTAN : \url{https://ctan.org/pkg/xint-regression}.} (pour les régressions, désactivable via \MontreCode{[nonxintreg]}). \end{itemize} @@ -228,7 +234,9 @@ Le package utilise : Le package charge également \MontreCode{siunitx} avec les options classiques \texttt{[fr]}, mais il est possible de ne pas le charger en utilisant l'option \MontreCode{[nonsiunitx]}. -\smallskip +\pagebreak + +\subsection{Chargement du package} Le package charge également la librairie \TikZ\ \MontreCode{babel}, mais il est possible de ne pas la charger en utilisant l'option \MontreCode{[nontikzbabel]}. @@ -245,9 +253,11 @@ Les différentes options sont bien évidemment cumulables. %chargement sans tikz.babel \usepackage[nontikzbabel]{tkz-grapheur} -\end{tcblisting} -\pagebreak +%chargement sans pgfplots + options compat +\usepackage[nonpgfplots]{tkz-grapheur} +\pgfplotsset{compat=...} +\end{tcblisting} À noter également que certaines commandes peuvent utiliser des packages comme \MontreCode{nicefrac}, qui sera donc à charger le cas échéant. @@ -263,13 +273,15 @@ Il est possible, dû aux calculs (multiples) effectués en interne, que le temps La précision des résultats (de détermination) semble être aux environs de $10^{-4}$, ce qui devrait normalement garantir des tracés et lectures \textit{satisfaisantes}. Il est quand même conseillé d'être prudent quant aux résultats obtenus et ceux attendus. +\pagebreak + \subsection{Exemple introductif} On peut par exemple partir de l'exemple suivant, pour \textit{illustrer} le cheminement des commandes de ce package. Les commandes et la syntaxe seront détaillées dans les sections suivantes ! \begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} \begin{GraphiqueTikz}% - [x=7.5cm,y=7.5cm,Xmin=0,Xmax=1.001,Xgrille=0.1,Xgrilles=0.02, + [x=10cm,y=10cm,Xmin=0,Xmax=1.001,Xgrille=0.1,Xgrilles=0.02, Ymin=0,Ymax=1.001,Ygrille=0.1,Ygrilles=0.02] \TracerAxesGrilles[Elargir=2.5mm,Police=\small]% {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1} @@ -331,16 +343,24 @@ Concernant les styles des \textit{objets}, ils sont donnés ci-dessous. \tikzset{pflgrillep/.style={thin,lightgray}} \tikzset{pflgrilles/.style={very thin,lightgray}} \tikzset{pflaxes/.style={line width=0.8pt,->,>=latex}} +\end{tcblisting} -%style des points (courbe / nuage /labels) +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%style des points (courbe / nuage /labels / montecarlo) \tikzset{pflpoint/.style={line width=0.95pt}} \tikzset{pflpointc/.style={radius=1.75pt}} \tikzset{pflpointnuage/.style={radius=1.75pt}} +\tikzset{pflpointmc/.style={radius=0.875pt}} \tikzset{pflnoeud/.style={}} %pour les inner sep par exemple :-) +\tikzset{pflcourbediscont/.style={line width=1.1pt}} +\end{tcblisting} +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} %style des courbes \tikzset{pflcourbe/.style={line width=1.05pt}} +\end{tcblisting} +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} %style des traits (normaux, antécédents, images) \tikzset{pfltrait/.style={line width=0.8pt}} \tikzset{pfltraitantec/.style={line width=0.95pt,densely dashed}} @@ -352,6 +372,18 @@ Concernant les styles des \textit{objets}, ils sont donnés ci-dessous. \tikzset{pflflechegd/.style={<->,>=latex}} \end{tcblisting} +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%style des constructions ECC (courbe / paramètres) +\tikzset{pfltraitsparamecc/.style={line width=0.9pt,densely dashed}} +\tikzset{pflcourbeecc/.style={line width=1.05pt}} +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%style des constructions récurrence +\tikzset{pfltraitrec/.style={line width=0.8pt}} +\tikzset{pfltraitrecpointill/.style={pfltraitrec,densely dashed}} +\end{tcblisting} + L'idée est donc de pouvoir redéfinir globalement ou localement les styles, et éventuellement de rajouter des éléments, en utilisant \mintinline{latex}|monstyle/.append style={...}|. \subsection{Création de l'environnement}\label{creaenvt} @@ -544,9 +576,12 @@ L'idée est de proposer une commande pour tracer une droite, à partir : \item d'un point (ou nœud) et de la pente. \end{itemize} +Il existe également une commande pour une asymptote verticale. + \begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} %dans l'environnement GraphiqueTikz \TracerDroite[clés]{point ou nœud}{point ou noeud ou pente} +\TracerAsymptote[clés]{abscisse} \end{tcblisting} Les \MontreCode{[clés]}, optionnelles, disponibles sont : @@ -569,6 +604,7 @@ Les \MontreCode{[clés]}, optionnelles, disponibles sont : \TracerDroite[Couleur=red]{(-2,-1)}{(2,4)} \TracerDroite[Couleur=blue,Debut=-5,Fin=3]{(A)}{(B)} \TracerDroite[Couleur=olive,Pente]{(C)}{0.25} + \TracerAsymptote[Couleur=brown]{-6} \end{GraphiqueTikz} \end{tcblisting} @@ -676,7 +712,8 @@ Les \MontreCode{[clés]} pour la définition ou le tracé, optionnelles, disponi \item \MontreCode{Nom} : nom de la courbe d'interpolation (important pour la suite !) ; \item \MontreCode{Coeffs} : modifier (voir la documentation de \textsf{ProfLycee}\footnote{CTAN : \url{https://ctan.org/pkg/proflycee}} les \textit{coefficients} du spline ; \item \MontreCode{Couleur} : couleur du tracé (\MontreCode{black} par défaut) ; - \item \MontreCode{Trace} : booléen pour tracer également la courbe (\MontreCode{false} par défaut). + \item \MontreCode{Trace} : booléen pour tracer également la courbe (\MontreCode{false} par défaut) ; + \item \MontreCode{Alt} : booléen pour activer une autre \textit{méthode de calcul} (\MontreCode{false} par défaut). \end{itemize} L'argument obligatoire permet quant à lui de spécifier la liste des points supports sous la forme \MontreCode{x1/y1/f'1§x2/y2/f'2§...} avec : @@ -690,12 +727,13 @@ L'argument obligatoire permet quant à lui de spécifier la liste des points sup \begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} \begin{GraphiqueTikz}% - [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5] + [x=0.8cm,y=0.8cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5] \TracerAxesGrilles[Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5} %définition de la liste des points support du spline \def\LISTETEST{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5} - %définition et tracé du spline cubique + %définition et tracé du spline cubique (x2) \DefinirCourbeSpline[Nom=splinetest,Trace,Couleur=olive]{\LISTETEST} + \DefinirCourbeSpline[Alt,Nom=splinetest,Trace,Couleur=teal]{\LISTETEST} \end{GraphiqueTikz} \end{tcblisting} @@ -823,6 +861,38 @@ Les \MontreCode{[clés]}, optionnelles, disponibles sont : \end{GraphiqueTikz} \end{tcblisting} +\subsection{Marquer des points de discontinuité}\label{ptsdiscont} + +Il est possible de marquer des points de discontinuité, mais c'est commande est \textit{déconnectée} des commandes de tracé de courbes/splines. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%dans l'environnement GraphiqueTikz +\AfficherPtsDiscont[clés]{liste} +\end{tcblisting} + +Le premier argument, \textit{optionnel} et entre \MontreCode{[...]}, contient les \MontreCode{Clés} suivantes : + +\begin{itemize} + \item \MontreCode{Couleur=...} (\MontreCode{black} par défaut) ; + \item \MontreCode{Pos=...} (\MontreCode{D} par défaut) pour choisir la position de la discontinuité (parmi \MontreCode{G/D}) ; + \item \MontreCode{Echelle=...} (\MontreCode{1} par défaut) pour modifier l'échelle du symbole ; + \item \MontreCode{Type=...} (\MontreCode{par} par défaut) pour choisir le type de symbole, parmi \MontreCode{par/cro/rond/demirond}. +\end{itemize} + +Le second argument, obligatoire et entre \MontreCode{\{...\}} permet de préciser la liste des points en lesquels le symbole de discontinuité sera positionné, sous la forme \MontreCode{x1/y1/d1 § x2/y2/d2 § ...} avec les points \MontreCode{(xi;yi)} et \MontreCode{f'(xi)=di}. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz}[x=1cm,y=1cm,Xmin=0,Xmax=10,Ymin=0,Ymax=5] + \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto} + \DefinirCourbeSpline[Trace,Couleur=red]{0/1/-1 § 4/4/0} + \AfficherPtsDiscont{4/4/0} + \AfficherPtsDiscont[Pos=G,Type=cro]{0/1/-1} + \DefinirCourbeSpline[Trace,Couleur=blue]{5/1/1.5 § 8/4/0.5} + \AfficherPtsDiscont[Couleur=blue,Type=rond]{8/4/0.5} + \AfficherPtsDiscont[Couleur=blue,Pos=G,Type=demirond,Echelle=2]{5/1/1.5} +\end{GraphiqueTikz} +\end{tcblisting} + \subsection{Récupérer les coordonnées de nœuds}\label{recupcoordo} Il est également possible, dans l'optique d'une réutilisation de coordonnées, de récupérer les coordonnées d'un nœud (défini ou déterminé). @@ -1330,6 +1400,60 @@ Le dernier argument obligatoire est le point de travail (version abscisse ou nœ \pagebreak +\subsection{Suites récurrentes et toiles}\label{toilerecurr} + +L'idée est d'obtenir une commande pour tracer la \og toile \fg{} permettant d'obtenir -- graphiquement -- les termes d'une suite récurrente définie par une relation $u_{n+1}=f(u_n)$. + +La commande est compatible avec une fonction précédemment définie, mais également avec une courbe type \textit{spline} précédemment définie. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%dans l'environnement GraphiqueTikz +\TracerToileRecurrence[clés]{fct ou courbe} +\end{tcblisting} + +Le premier argument, \textit{optionnel} et entre \MontreCode{[...]}, contient les \MontreCode{Clés} suivantes : + +\begin{itemize} + \item \MontreCode{Couleur=...} (\MontreCode{black} par défaut) ; + \item \MontreCode{Spline=...} (\MontreCode{false} par défaut) pour spécifier qu'une courbe \textit{spline} est utilisée ; + \item \MontreCode{No=...} (\MontreCode{0} par défaut) est l'indice initial ; + \item \MontreCode{Uno=...} est qui est la valeur du terme initial (à donner obligatoirement !) ; + \item \MontreCode{Nom=...} (\MontreCode{u} par défaut) est le nom de la suite ; + \item \MontreCode{Nb=...} (\MontreCode{5} par défaut) ; + \item \MontreCode{AffTermes=...} (\MontreCode{false} par défaut) qui est un booléen pour afficher les termes ; + \item \MontreCode{AffPointilles=...} (\MontreCode{true} par défaut) pour afficher les pointillés ; + \item \MontreCode{TailleLabel=...} (\MontreCode{\textbackslash small} par défaut) ; + \item \MontreCode{PosLabel=...} (\MontreCode{below} par défaut). +\end{itemize} + +Le second argument, obligatoire et entre \MontreCode{\{...\}} permet de préciser l'objet avec lequel il faut effectuer les tracés (fonction ou nom\_courbe). + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz}% + [x=0.75cm,y=0.75cm,Xmin=0,Xmax=10,Xgrille=1,Xgrilles=0.5, + Ymin=0,Ymax=8,Ygrille=1,Ygrilles=0.5] + \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{auto}{auto} + \DefinirCourbe[Couleur=red,Nom=cf,Debut=0,Fin=10,Trace]<f>{sqrt(5*x)+1} + \TracerCourbe[Couleur=blue]{x} + \TracerToileRecurrence[Couleur=orange,No=1,Uno=1]{f} +\end{GraphiqueTikz} +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz}[x=4cm,y=3cm,Xmin=0,Xmax=2.5,Xgrille=1,Xgrilles=0.25, + Ymin=0,Ymax=1.25,Ygrille=0.5,Ygrilles=0.25] + \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{auto}{auto} + \DefinirCourbeInterpo[Nom=interpotest,Couleur=blue,Trace]% + {(0,0)(0.5,0.75)(1,0.25)(2,1)(2.5,0.25)} + \TracerCourbe[Couleur=olive]{x} + \TracerToileRecurrence% + [AffTermes,Couleur=purple,Spline,No=0,Uno=2,PosLabel=above left]% + {interpotest} +\end{GraphiqueTikz} +\end{tcblisting} + +\pagebreak + \section{Commandes spécifiques des fonctions de densité} \subsection{Loi normale}\label{loinormale} @@ -1413,11 +1537,244 @@ Les \MontreCode{[clés]}, optionnelles, disponibles sont : \end{GraphiqueTikz} \end{tcblisting} +\subsection{Histogramme pour une loi binomiale}\label{histobinom} + +Il est également possible (d'une manière moins explicite que dans \MontreCode{ProfLycee}) de représenter l'histogramme d'une loi binomiale (\MontreCode{ProfLycee} permet de déterminer les unités automatiquement, ici elles doivent être précisées et connues). + +Il est également possible de rajouter la loi normale \og associée \fg. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%dans l'environnement GraphiqueTikz +\TracerHistoBinomiale[clés]<nom fct normale>{n}{p} +\end{tcblisting} + +Le premier argument, optionnel et entre \MontreCode{[...]} propose les clés suivantes : + +\begin{itemize} + + \item \MontreCode{Plage} : plage, sous la forme \MontreCode{a-b} du coloriage éventuel ; + \item \MontreCode{CouleurPlage} : couleur de la plage éventuelle ; + \item \MontreCode{ClipX} : restriction de l'axe Ox, sous la forme \MontreCode{a-b} ; + \item \MontreCode{AffNormale} : booléen (\MontreCode{true} par défaut) pour rajouter la loi normale ; + \item \MontreCode{CouleurNormale} : couleur pour la loi normale. +\end{itemize} + +Les arguments obligatoires et entre \MontreCode{\{...\}} permettent de spécifier les paramètres de la loi binomiale. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +%les unités ont été déterminées au préalable... +\begin{GraphiqueTikz}[x=0.2cm,y=50cm,Origx=-0.5,Xmin=-0.5,Xmax=50.5, + Xgrille=5,Xgrilles=1,Ymin=0,Ymax=0.12,Ygrille=0.01,Ygrilles=0.001] + \TracerAxesGrilles[Elargir=2.5mm,Police=\small,Grille=false]% + {0,5,...,50}{auto} + \TracerHistoBinomiale{50}{0.4} +\end{GraphiqueTikz} +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +%les unités ont été déterminées au préalable... +\begin{GraphiqueTikz}[x=0.5cm,y=100cm,Origx=14.5,Xmin=14.5,Xmax=35.5, + Xgrille=5,Xgrilles=1,Ymin=0,Ymax=0.09,Ygrille=0.01,Ygrilles=0.001] + \TracerAxesGrilles[Elargir=2.5mm,Police=\small,Grille=false]% + {15,20,...,35}{auto} + \TracerHistoBinomiale% + [ClipX=15-35,Plage=18-25,CouleurPlage=teal,AffNormale,CouleurNormale=red]% + {1000}{0.02} +\end{GraphiqueTikz} +\end{tcblisting} + \pagebreak -\section{Commandes spécifiques des statistiques à deux variables} +\section{Commandes spécifiques des méthodes intégrales} + +\subsection{Méthodes géométriques}\label{methodesintergrales} + +L'idée est de proposer plusieurs méthodes graphiques pour illustrer graphiquement une intégrale, via : -\subsection{Le nuage de points}\label{nuage} +\begin{itemize} + \item une méthode des rectangles (Gauche, Droite ou Milieu) ; + \item la méthode des trapèzes. +\end{itemize} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%dans l'environnement GraphiqueTikz +\RepresenterMethodeIntegrale[clés]<fonction>{a}{b} +\end{tcblisting} + +Les \MontreCode{Clés} disponibles sont : + +\begin{itemize} + \item \MontreCode{Spline} : booléen pour préciser qu'un spline est utilisé, \MontreCode{false} par défaut ; + \item \MontreCode{Couleur} : couleur des tracés, \MontreCode{red} par défaut ; + \item \MontreCode{NbSubDiv} : nombre de subdivisions, \MontreCode{10} par défaut ; + \item \MontreCode{Methode} : méthode géométrique utilisée, parmi parmi \MontreCode{RectanglesGauche / RectanglesDroite / RectanglesMilieu / Trapezes} pour spécifier la méthode utilisée, \MontreCode{RectanglesGauche} par défaut ; + \item \MontreCode{Remplir} : booléen, \MontreCode{true} par défaut, pour remplir les éléments graphiques ; + \item \MontreCode{CouleurRemplissage} : couleur de remplissage, définie par rapport à la couleur principale par défaut ; + \item \MontreCode{Opacite} : opacité, \MontreCode{0.25} par défaut, du remplissage. +\end{itemize} + +\smallskip + +Le deuxième argument, optionnel et entre \MontreCode{<...>}, correspond à la fonction ou le spline \textbf{précédemment définie} ! + +\smallskip + +Les deux derniers arguments, obligatoires, correspondent aux bornes de l'intégrale. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz} + [x=0.66cm,y=0.033cm,Xmin=0,Xmax=21,Xgrille=2,Xgrilles=1, + Ymin=0,Ymax=160,Ygrille=20,Ygrilles=10] + \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto} + \DefinirCourbe[Couleur=red,Nom=cf,Debut=1,Fin=20,Trace]<f>{80*x*exp(-0.2*x)} + \RepresenterMethodeIntegrale[Couleur=teal]<f>{5}{15} +\end{GraphiqueTikz} +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz} + [x=0.66cm,y=0.033cm,Xmin=0,Xmax=21,Xgrille=2,Xgrilles=1, + Ymin=0,Ymax=160,Ygrille=20,Ygrilles=10] + \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto} + \DefinirCourbe[Couleur=red,Nom=cf,Debut=1,Fin=20,Trace]<f>{80*x*exp(-0.2*x)} + \RepresenterMethodeIntegrale + [Methode=RectanglesDroite,Couleur=orange,NbSubDiv=7]<f>{1}{10} +\end{GraphiqueTikz} +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz} + [x=0.66cm,y=0.033cm,Xmin=0,Xmax=21,Xgrille=2,Xgrilles=1, + Ymin=0,Ymax=160,Ygrille=20,Ygrilles=10] + \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto} + \DefinirCourbe[Couleur=red,Nom=cf,Debut=1,Fin=20,Trace]<f>{80*x*exp(-0.2*x)} + \RepresenterMethodeIntegrale + [Methode=RectanglesMilieu,Couleur=yellow,NbSubDiv=25]<f>{1}{20} +\end{GraphiqueTikz} +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz} + [x=0.66cm,y=0.033cm,Xmin=0,Xmax=21,Xgrille=2,Xgrilles=1, + Ymin=0,Ymax=160,Ygrille=20,Ygrilles=10] + \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto} + \DefinirCourbe[Couleur=red,Nom=cf,Debut=1,Fin=20,Trace]<f>{80*x*exp(-0.2*x)} + \RepresenterMethodeIntegrale + [Methode=Trapezes,Couleur=pink,Remplir=false]<f>{1}{20} +\end{GraphiqueTikz} +\end{tcblisting} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz}% + [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=0,Ymax=5] + \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto} + \DefinirListeSpline{-6.5/0/2.5§-2/4/0§3.75/0/-1}[\lstsplineB] + \DefinirCourbeSpline[Nom=splinered]{\lstsplineB} + \TracerCourbeSpline[Couleur=red]{\lstsplineB} + \RepresenterMethodeIntegrale[Methode=RectanglesMilieu,Spline,Couleur=teal]<splinered>{-5}{1.25} +\end{GraphiqueTikz} +\end{tcblisting} + +\subsection{Méthode de Monte-Carlo}\label{montecarlo} + +L'idée est de proposer une commande pour simuler un calcul intégral via la méthode de Monte-Carlo. + +Le code se charge de simuler les \textit{tirages}, et les résultats peuvent être stockés dans des macros. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%dans l'environnement GraphiqueTikz +\SimulerMonteCarlo[clés]<fonction>{nb essais}[\nbptsmcok][\nbptsmcko] +\end{tcblisting} + +Les \MontreCode{Clés} disponibles sont : + +\begin{itemize} + \item \MontreCode{Couleurs} : couleurs des points, \MontreCode{blue/red} par défaut ; + \item \MontreCode{BornesX} : bornes \textit{horizontales} pour la simulation, valant \MontreCode{\textbackslash pflxmin,\textbackslash pflxmax} par défaut ; + \item \MontreCode{BornesY} : bornes \textit{verticales} pour la simulation, valant \MontreCode{\textbackslash pflymin,\textbackslash pflymax} par défaut. +\end{itemize} + +Le deuxième argument, optionnel et entre \MontreCode{<...>}, est la fonction \textbf{précédemment définie} à utiliser. + +\smallskip + +Les deux derniers arguments, optionnels et entre \MontreCode{[...]}, sont les macros dans lesquelles sont stockées les résultats de la simulation. Ces macros sont \MontreCode{\textbackslash nbptsmcok} et \MontreCode{\textbackslash nbptsmcko} par défaut. + +À noter que la macro \MontreCode{\textbackslash nbptsmc} permet de récupérer le nombre de points utilisés. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +%avec \sisetup{group-minimum-digits=4} pour le formatage des "milliers" + +\begin{GraphiqueTikz}% + [x=10cm,y=10cm,Xmin=0,Xmax=1,Xgrille=0.1,Xgrilles=0.05, + Ymin=0,Ymax=1,Ygrille=0.1,Ygrilles=0.05] + \TracerAxesGrilles[Elargir=2.5mm,Dernier]{auto}{auto} + \DefinirCourbe[Trace,Couleur=teal,Pas=0.001]<f>{sqrt(1-x^2)} + \SimulerMonteCarlo<f>{5000} +\end{GraphiqueTikz} + +Le nombre de points bleus est de \textcolor{blue}{\num{\nbptsmcok}}, +le nombre de points rouges est de \textcolor{red}{\num{\nbptsmcko}}. + +La proportion de points bleus est de $\frac{\num{\nbptsmcok}}{\num{\nbptsmc}} +\approx \ArrondirNum[4]{\nbptsmcok/\nbptsmc}$ +et $\frac{\pi}{4} \approx \ArrondirNum[4]{pi/4}$. +\end{tcblisting} + +\pagebreak + +\section{Commandes spécifiques des statistiques} + +\subsection{Limitations} + +Compte-tenu des spécificités de \TikZ, il est conseillé de ne pas utiliser de valeurs trop \textit{grandes} au niveau de axes (cela peut coincer avec des année par exemple\ldots), ou bien il faudra \textit{transformer} les valeurs des axes et/ou des données pour que tout s'affiche comme il faut (attention également aux régressions, aux calculs\ldots). + +\subsection{Courbe des ECC/FCC (1 variable)}\label{cbeECC} + +Il est possible de travailler sur une représentation de la courbe des ECC/FCC. + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +\TracerCourbeECC[clés]{liste valeurs}{liste effectifs} +\end{tcblisting} + +Le code se charge de déterminer une valeur des paramètres, pour utilisation ultérieure (avec arrondis éventuels car ils sont obtenus par \textit{conversions}) : + +\begin{itemize} + \item le premier quartile, $Q_1$, est stocké dans la macro \MontreCode{\textbackslash ValPremQuartile} ; + \item la médiane, méd, est stocké dans la macro \MontreCode{\textbackslash ValMed} ; + \item le troisième quartile, $Q_3$, est stocké dans la macro \MontreCode{\textbackslash ValTroisQuartile}. +\end{itemize} + +Les \MontreCode{Clés} disponibles sont : + +\begin{itemize} + \item \MontreCode{Couleur=...} : couleur du tracé, \MontreCode{black} par défaut ; + \item \MontreCode{AffParams} : booléen, \MontreCode{true} par défaut, pour afficher les paramètres ; + \item \MontreCode{CouleursParams=...} : couleur des paramètres, \MontreCode{black} par défaut ; + \item \MontreCode{TraitsComplets} : booléen, \MontreCode{true} par défaut, pour afficher les pointillés en entier +\end{itemize} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +\begin{GraphiqueTikz}[x=0.15cm,y=0.03cm,Xmin=0,Xmax=75,Xgrille=10,Xgrilles=5, + Ymin=0,Ymax=200,Ygrille=20,Ygrilles=10] + \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{auto}{auto} + \TracerCourbeECC% + [Couleur=blue,CouleursParams={lime!75!black/pink!75!black}, + TraitsComplets=false]% + {0,15,25,35,40,45,55,65,75}% + {15,20,50,30,35,25,15,10} + %ajouts 'manuels' + \PlacerTexte[Couleur=lime!75!black,Police=\small,Position=below]% + {(\ValPremQuartile,0)}{\ArrondirNum[0]{\ValPremQuartile}} + \PlacerTexte[Couleur=lime!75!black,Police=\small,Position=below]% + {(\ValTroisQuartile,0)}{\ArrondirNum[0]{\ValTroisQuartile}} + \PlacerTexte[Couleur=pink!75!black,Police=\small,Position=below]% + {(\ValMed,0)}{\ArrondirNum[0]{\ValMed}} +\end{GraphiqueTikz} + +\end{tcblisting} + +\subsection{Le nuage de points (2 variables)}\label{nuage} En marge des commandes liées aux fonctions, il est également possible de représenter des séries statistiques doubles. @@ -1460,7 +1817,7 @@ Les arguments, obligatoires, permettent de spécifier : \end{GraphiqueTikz} \end{tcblisting} -\subsection{La droite de régression}\label{reglin} +\subsection{La droite de régression (2 variables)}\label{reglin} La droite de régression linéaire (obtenue par la méthode des moindres carrés) peut facilement être rajoutée, en utilisant la clé \MontreCode{TracerDroite}. @@ -1494,7 +1851,7 @@ Dans ce cas, de nouvelles clés sont disponibles : \end{GraphiqueTikz} \end{tcblisting} -\subsection{Autres régressions}\label{regressions} +\subsection{Autres régressions (2 variables)}\label{regressions} En partenariat avec le package \MontreCode{xint-regression}, chargé par le package (mais \textit{désactivable} via l'option \MontreCode{[nonxintreg]}), il est possible de travailler sur d'autres types de régression : @@ -1752,10 +2109,10 @@ $\begin{cases} Les commandes disponibles sont : \NewDocumentCommand\lstcmd{ m m m }{% - \item[\texttt{#1}] : \mintinline{latex}|#2|\hfill{}page \pageref{#3} + \item[\footnotesize\texttt{#1}]{\footnotesize : \mintinline{latex}|#2|\hfill{}page \pageref{#3}} } -\begin{description} +\begin{description}[noitemsep] \lstcmd{environnement~~}{\begin{GraphiqueTikz}...\end{GraphiqueTikz}}{creaenvt} \lstcmd{axes et grilles}{\TracerAxesGrille}{creaaxesgr} \lstcmd{aj val axes X~~}{\RajouterValeursAxeX}{ajoutvals} @@ -1767,10 +2124,12 @@ Les commandes disponibles sont : \lstcmd{def spline~~~~~}{\DefinirCourbeSpline}{deftracfctspline} \lstcmd{tracé spline~~~}{\TracerCourbeSpline}{deftracfctspline} \lstcmd{tracé droite~~~}{\TracerDroite}{tracdroite} + \lstcmd{asymptote vert~}{\TracerAsymptote}{tracdroite} \lstcmd{def points~~~~~}{\DefinirPts}{defpts} \lstcmd{def image~~~~~~}{\DefinirImage}{defpts} \lstcmd{marq pts~~~~~~~}{\MarquerPts}{markpts} \lstcmd{placer txt~~~~~}{\PlacerTexte}{placetxt} + \lstcmd{pts discont~~~~}{\AfficherPtsDiscont}{ptsdiscont} \lstcmd{récup absc~~~~~}{\RecupererAbscisse}{recupcoordo} \lstcmd{récup ordo~~~~~}{\RecupererOrdonnee}{recupcoordo} \lstcmd{récup coordos~~}{\RecupererCoordonnees}{recupcoordo} @@ -1781,23 +2140,151 @@ Les commandes disponibles sont : \lstcmd{maximum~~~~~~~~}{\TrouverMaximum}{maximum} \lstcmd{minimum~~~~~~~~}{\TrouverMinimum}{minimum} \lstcmd{intégrale~~~~~~}{\TracerIntegrale}{integr} + \lstcmd{méthodes int~~~}{\RepresenterMethodeIntegrale}{methodesintergrales} + \lstcmd{Monte-Carlo~~~~}{\SimulerMonteCarlo}{montecarlo} \lstcmd{tangente~~~~~~~}{\TracerTangente}{tgte} + \lstcmd{toile récurr~~~}{\TracerToileRecurrence}{toilerecurr} \lstcmd{loi normale~~~~}{\DefinirLoiNormale}{loinormale} \lstcmd{loi normale~~~~}{\TracerLoiNormale}{loinormale} \lstcmd{loi khideux~~~~}{\DefinirLoiKhiDeux}{loikhideux} \lstcmd{loi khideux~~~~}{\TracerLoiKhiDeux}{loikhideux} + \lstcmd{loi binom~~~~~~}{\TracerHistoBinomiale}{histobinom} + \lstcmd{courbe ECC~~~~~}{\TracerCourbeECC}{cbeECC} \lstcmd{stats 2 var~~~~}{\TracerNuage}{nuage} \lstcmd{regressions~~~~}{\TracerAjustement}{regressions} \lstcmd{arrondi~~~~~~~~}{\ArrondirNum}{numarrond} \lstcmd{nb aléat~~~~~~~}{\ChoisirNbAlea}{nbalea} \end{description} +\newpage + +\section{Quelques commandes liées à pgfplots} + +\subsection{Introduction} + +Pour des graphiques avec des fenêtres d'affichage \textit{particulières}, il est fort possible que les commandes \textit{classiques} de \MontreCode{tkz-grapheur} coincent, avec notamment des \MontreCode{dimension tool large}$\ldots$ + +\smallskip + +Dans ce cas, il est possible d'utiliser plutôt l'environnement \MontreCode{axis} de \MontreCode{pgfplots} qui est plus palier ce problème \textit{interne}$\ldots$ + +\MontreCode{tkz-grapheur} ne fournit pas d'environnement dédié pour la création de la fenêtre, mais quelques commandes spécifiques ont été intégrées pour certains points, avec un fonctionnement assez semblable (donc se référer aux paragraphes précédents) à celui des commandes \textit{classiques}. + +\subsection{Macros spécifique pgfplots/axis} + +\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only} +%déterminer l'intersection de deux objets préalablement définis via [name path] +\findintersectionspgf[base nom nœuds]{objet1}{objet2}[macro nb total] + +%extraction (globale, non limitée à l'environnement) et stockage de coordonnées +\gextractxnodepgf{nœud}[\myxcoord] +\gextractynodepgf{nœud}[\myycoord] +\gextractxynodepgf{nœud}[\myxcoord][\myycoord] + +%domaine entre courbes +\fillbetweencurvespgf[options tikz]{courbe1}{courbe2}<options soft domain> + +%splines cubiques +\addplotspline(*)[options tikz]<coeffs>{liste des points support}[\monspline] +\end{tcblisting} + +\subsection{Exemple illustré} + +\begin{tcblisting}{listing only,listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5} +%\usepackage{alphalph} + +\begin{tikzpicture} + \begin{axis}% + [% + axis y line=center,axis x line=middle, %axes + axis line style={line width=0.8pt,-latex}, + x=0.33cm,y=0.55cm,xmin=1985,xmax=2030,ymin=56,ymax=70, %unités + grid=both,xtick distance=5,ytick distance=2, %grillep + minor x tick num=4,minor y tick num=1, %grilles + extra x ticks={1985},extra x tick style={grid=none}, %origx + extra y ticks={56},extra y tick style={grid=none}, %origy + x tick label style={/pgf/number format/.cd,use comma,1000 sep={}}, %année + major tick length={2*3pt},minor tick length={1.5*3pt}, %grads + every tick/.style={line width=0.8pt},enlargelimits=false, %style + enlarge x limits={abs=2.5mm,upper},enlarge y limits={abs=2.5mm,upper}, %élargir + ] + %spline + y=66 + \addplot[name path global=eqtest,mark=none,red,line width=1.05pt,domain=1985:2030] {66} ; + \def\LISTETEST{1985/60/0§1995/68/0§2015/58/0§2025/69/0§2030/62/-2} + \addplotspline*[line width=1.05pt,violet,name path global=splinecubtest]{\LISTETEST}[\monsplineviolet] + %recherche d'antécédents + \findintersectionspgf[MonItsc]{eqtest}{splinecubtest} + %extraction des coordonnées + \gextractxnodepgf{(MonItsc-1)}[\xMonItscA] + \gextractxnodepgf{(MonItsc-2)}[\xMonItscB] + \gextractxnodepgf{(MonItsc-3)}[\xMonItscC] + \gextractxnodepgf{(MonItsc-4)}[\xMonItscD] + %visualisation + \xintFor* #1 in {\xintSeq{1}{4}}\do{% + \draw[line width=0.9pt,densely dashed,olive,->,>=latex] (MonItsc-#1) -- (\csname xMonItsc\AlphAlph{#1}\endcsname,56) ; + \filldraw[olive] (MonItsc-#1) circle[radius=1.75pt] ; + } + %intégrale + \path [name path=xaxis] (1985,56) -- (2030,56); + \fillbetweencurvespgf{splinecubtest}{xaxis}<domain={\xMonItscB:\xMonItscA}> + \fillbetweencurvespgf{splinecubtest}{xaxis}<domain={\xMonItscD:\xMonItscC}> + \end{axis} +\end{tikzpicture} + +Les solutions de $f(x)=66$ sont d'environ \ArrondirNum*[0]{\xMonItscA} \&\ \ArrondirNum*[0]{\xMonItscB} \&\ \ArrondirNum*[0]{\xMonItscC} \&\ \ArrondirNum*[0]{\xMonItscD}. +\end{tcblisting} + +\begin{tikzpicture} + \begin{axis}% + [% + axis y line=center,axis x line=middle, %axes + axis line style={line width=0.8pt,-latex}, + x=0.33cm,y=0.55cm,xmin=1985,xmax=2030,ymin=56,ymax=70, %unités + grid=both,xtick distance=5,ytick distance=2, %grillep + minor x tick num=4,minor y tick num=1, %grilles + extra x ticks={1985},extra x tick style={grid=none}, %originex + extra y ticks={56},extra y tick style={grid=none}, %originey + x tick label style={/pgf/number format/.cd,use comma,1000 sep={}}, %année + major tick length={2*3pt},minor tick length={1.5*3pt}, %grads + every tick/.style={line width=0.8pt},enlargelimits=false, %style + enlarge x limits={abs=2.5mm,upper},enlarge y limits={abs=2.5mm,upper}, %élargir + ] + %spline + y=66 + \addplot[name path global=eqtest,mark=none,red,line width=1.05pt,domain=1985:2030] {66} ; + \def\LISTETEST{1985/60/0§1995/68/0§2015/58/0§2025/69/0§2030/62/-2} + \addplotspline*[line width=1.05pt,violet,name path global=splinecubtest]{\LISTETEST}[\monsplineviolet] + %recherche d'antécédents + \findintersectionspgf[MonItsc]{eqtest}{splinecubtest} + %extraction des coordonnées + \gextractxnodepgf{(MonItsc-1)}[\xMonItscA] + \gextractxnodepgf{(MonItsc-2)}[\xMonItscB] + \gextractxnodepgf{(MonItsc-3)}[\xMonItscC] + \gextractxnodepgf{(MonItsc-4)}[\xMonItscD] + %visualisation + \xintFor* #1 in {\xintSeq{1}{4}}\do{% + \draw[line width=0.9pt,densely dashed,olive,->,>=latex] (MonItsc-#1) -- (\csname xMonItsc\AlphAlph{#1}\endcsname,56) ; + \filldraw[olive] (MonItsc-#1) circle[radius=1.75pt] ; + } + %intégrale + \path [name path=xaxis] (1985,56) -- (2030,56); + \fillbetweencurvespgf{splinecubtest}{xaxis}<domain={\xMonItscB:\xMonItscA}> + \fillbetweencurvespgf{splinecubtest}{xaxis}<domain={\xMonItscD:\xMonItscC}> + \end{axis} +\end{tikzpicture} + +Les solutions de $f(x)=66$ sont d'environ \ArrondirNum*[0]{\xMonItscA} \&\ \ArrondirNum*[0]{\xMonItscB} \&\ \ArrondirNum*[0]{\xMonItscC} \&\ \ArrondirNum*[0]{\xMonItscD}. + \pagebreak \section{Historique} -\begin{quote} +{\footnotesize \begin{quote} \begin{verbatim} +0.2.0 : Méthode alternative des splines cubiques + commandes auxiliaires pgfplots +0.1.9 : Correction d'un bug avec la détermination d'unités +0.1.8 : Courbes ECC/FCC + Toile récurrence + Points discontinuité + HistoBinom +0.1.7 : Méthodes intégrales avec des splines +0.1.6 : Asymptote verticale + Méthodes intégrales (géom + Monte Carlo) 0.1.5 : Correction d'un bug sur les rajouts de valeurs + Nœud pour une image + [en] version ! 0.1.4 : Placement de texte 0.1.3 : Ajout de régressions avec le package xint-regression @@ -1805,6 +2292,6 @@ Les commandes disponibles sont : 0.1.1 : Densité loi normale et khi deux + Marquage points + Améliorations 0.1.0 : Version initiale \end{verbatim} -\end{quote} +\end{quote}} \end{document}
\ No newline at end of file diff --git a/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty b/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty index 3de4286c8e..be1337a970 100644 --- a/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty +++ b/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty @@ -2,9 +2,14 @@ % licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tkz-grapheur}[2024/06/22 0.1.5.Des outils en TikZ pour travailler comme avec un grapheur] +\ProvidesPackage{tkz-grapheur}[2024/10/29 0.2.0 Des outils en TikZ pour travailler comme avec un grapheur] %====HISTORIQUE +% v 0.2.0 Petites commandes en lien avec pgfplots + modification mineure splinecubique (calculs Alt) +% v 0.1.9 Correction d'un bug avec la détermination des unités... +% v 0.1.8 Ajout des courbes d'ECC/FCC + Toile récurrence + Points discontinuité + Histobinom +% v 0.1.7 Méthodes intégrales avec des splines +% v 0.1.6 Asymptote verticale + Monte Carlo + Méthode intégrales (rectangles, etc) % v 0.1.5 Correction d'un bug avec les valeurs manuelles + Nœud pour une image + [en] version ! % v 0.1.4 Ajout des placements de textes % v 0.1.3 Régressions, avec xintreg (désactivable) @@ -25,6 +30,10 @@ \DeclareOption{nonxintreg}{\@loadxintregfalse}% \DeclareOption{noxintreg}{\@loadxintregfalse}% +\newif\if@loadpgfplots \@loadpgfplotstrue +\DeclareOption{nonpgfplots}{\@loadpgfplotsfalse}% +\DeclareOption{nopgfplots}{\@loadpgfplotsfalse}% + \newif\if@lngenglish \@lngenglishfalse \DeclareOption{english}{\@lngenglishtrue}% @@ -34,6 +43,10 @@ %====BASE \RequirePackage{tikz} \RequirePackage{ifthen} +\if@loadpgfplots + \RequirePackage{pgfplots} + \usepgfplotslibrary{fillbetween} +\fi \usetikzlibrary{calc,intersections,patterns,patterns.meta,bbox} \RequirePackage{simplekv} \RequirePackage{xintexpr} @@ -49,7 +62,7 @@ \if@lngenglish \sisetup{mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true} \else - \sisetup{locale=FR,output-decimal-marker={,},mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true} + \sisetup{locale=FR,output-decimal-marker={,},mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true}%,group-minimum-digits=4} \fi \fi @@ -97,19 +110,37 @@ %====PATCH NUM \@ifundefined{ArrondirNum}% {% - \NewDocumentCommand\ArrondirNum{ O{2} m}{\num{\xintfloateval{round(#2,#1)}}\relax}% + \NewDocumentCommand\ArrondirNum{ s O{2} m}{% + \IfBooleanTF{#1}% + {% + \xintfloateval{round(#3,#2)}\relax% + }% + {% + \num{\xintfloateval{round(#3,#2)}}\relax% + }% + }% }% {% - \RenewDocumentCommand\ArrondirNum{ O{2} m}{\num{\xintfloateval{round(#2,#1)}}\relax}% + \RenewDocumentCommand\ArrondirNum{ s O{2} m}{% + \IfBooleanTF{#1}% + {% + \xintfloateval{round(#3,#2)}\relax% + }% + {% + \num{\xintfloateval{round(#3,#2)}}\relax% + }% + }% }% %====STYLES DE BASE \tikzset{pflnoeud/.style={}} \tikzset{pflpoint/.style={line width=0.95pt}} +\tikzset{pflpointmc/.style={radius=0.875pt}} \tikzset{pflpointc/.style={radius=1.75pt}} \tikzset{pflpointnuage/.style={radius=1.75pt}} \tikzset{pflcadre/.style={line width=0.8pt,gray}} \tikzset{pflcourbe/.style={line width=1.05pt}} +\tikzset{pflcourbediscont/.style={line width=1.1pt}} \tikzset{pfltrait/.style={line width=0.8pt}} \tikzset{pflflecheg/.style={<-,>=latex}} \tikzset{pflfleched/.style={->,>=latex}} @@ -316,9 +347,9 @@ } \newcommand\TikZUnites{ - \coordinate (@0) at (0,0) ; - \coordinate (@X) at (1,0) ; - \coordinate (@Y) at (0,1) ; + \coordinate (@0) at (\pflOx,\pflOy) ; + \coordinate (@X) at ({\pflOx+1},\pflOy) ; + \coordinate (@Y) at ({\pflOx},{\pflOy+1}) ; \DistanceEntreNoeuds[\pflxunit]{@0}{@X} \DistanceEntreNoeuds[\pflyunit]{@0}{@Y} } @@ -863,17 +894,18 @@ Nom=spline,% Couleur=black,% Coeffs=3,% - Trace=false + Trace=false,% + Alt=false } -\NewDocumentCommand\GenererSpline{ m m O{\monspline} }{% +\NewDocumentCommand\GenererSpline{ s m m O{\monspline} }{% %1=liste \setsepchar[.]{§./}% - \readlist*\SPLlistepoints{#1}% + \readlist*\SPLlistepoints{#2}% %les données \def\tmpsplinenumdeb{1} \def\tmpsplinenumfin{\SPLlistepointslen}% - \pflextractcoeff{#2}{\tmpsplinenumdeb}% + \pflextractcoeff{#3}{\tmpsplinenumdeb}% %nb de calculs \def\SPLnbsplines{\inteval{\tmpsplinenumfin-1}}% %extraction des coordonnées @@ -883,10 +915,16 @@ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xb% \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\yb% \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimeb% - \xdef#3{(\xa,\ya) ..controls +({atan \fprimea}:{(\xb-\xa)/\COEFFA}) and +({-180 + atan \fprimeb}:{(\xb-\xa)/\COEFFA}).. (\xb,\yb)}% + \IfBooleanTF{#1}% + {% + \xdef#4{(\xa,\ya) ..controls +({(\xb-\xa)/\COEFFA},{\fprimea*(\xb-\xa)/\COEFFA}) and +({-(\xb-\xa)/\COEFFA},{-\fprimeb*(\xb-\xa)/\COEFFA}).. (\xb,\yb)}% + }% + {% + \xdef#4{(\xa,\ya) ..controls +({atan \fprimea}:{(\xb-\xa)/\COEFFA}) and +({-180 + atan \fprimeb}:{(\xb-\xa)/\COEFFA}).. (\xb,\yb)}% + }% \foreach \i in {\tmpsplinenumdeb,...,\SPLnbsplines}{% %extraction des coeffs de compensation - \pflextractcoeff{#2}{\i}% + \pflextractcoeff{#3}{\i}% \def\j{\inteval{\i+1}}% \itemtomacro\SPLlistepoints[\i,1]\xa% \itemtomacro\SPLlistepoints[\i,2]\ya% @@ -894,7 +932,13 @@ \itemtomacro\SPLlistepoints[\j,1]\xb% \itemtomacro\SPLlistepoints[\j,2]\yb% \itemtomacro\SPLlistepoints[\j,3]\fprimeb% - \xdef#3{#3 ..controls +({atan \fprimea}:{(\xb-\xa)/\COEFFA}) and +({-180 + atan \fprimeb}:{(\xb-\xa)/\COEFFB}).. (\xb,\yb)}% + \IfBooleanTF{#1}% + {% + \xdef#4{#4 ..controls +({(\xb-\xa)/\COEFFA},{\fprimea*(\xb-\xa)/\COEFFA}) and +({-(\xb-\xa)/\COEFFA},{-\fprimeb*(\xb-\xa)/\COEFFA}).. (\xb,\yb)}% + }% + {% + \xdef#4{#4 ..controls +({atan \fprimea}:{(\xb-\xa)/\COEFFA}) and +({-180 + atan \fprimeb}:{(\xb-\xa)/\COEFFB}).. (\xb,\yb)}% + }% }% } @@ -902,7 +946,13 @@ %1=liste \restoreKV[GraphiqueTikzSpline]% \setKV[GraphiqueTikzSpline]{#1}% - \GenererSpline{#2}{\pflsplinecoeffs}[#3]% + \ifboolKV[GraphiqueTikzSpline]{Alt}% + {% + \GenererSpline*{#2}{\pflsplinecoeffs}[#3]% + }% + {% + \GenererSpline{#2}{\pflsplinecoeffs}[#3]% + }% \begin{scope} \ifboolKV[GraphiqueTikzSpline]{Trace}% {% @@ -934,7 +984,13 @@ %1=liste \restoreKV[GraphiqueTikzSpline]% \setKV[GraphiqueTikzSpline]{#1}% - \GenererSpline{#2}{\pflsplinecoeffs}[#3]% + \ifboolKV[GraphiqueTikzSpline]{Alt}% + {% + \GenererSpline*{#2}{\pflsplinecoeffs}[#3]% + }% + {% + \GenererSpline{#2}{\pflsplinecoeffs}[#3]% + }% \begin{scope} \draw[pflcourbe,{\useKV[GraphiqueTikzSpline]{Couleur}}] #3 ; \end{scope} @@ -1012,6 +1068,146 @@ \end{scope} } +%====MONTE CARLO +\defKV[graphiquetikzmontecarlo]{% + Couleurs=\def\graphtikzmccols{#1},% + BornesX=\def\graphtikzmcxbornes{#1},% + BornesY=\def\graphtikzmcybornes{#1} +} + +\setKVdefault[graphiquetikzmontecarlo]{% + Couleurs={blue/red},% + BornesX={\pflxmin,\pflxmax},% + BornesY={\pflymin,\pflymax} +} + +\NewDocumentCommand\SimulerMonteCarlo{ O{} D<>{f} m O{\nbptsmcok} O{\nbptsmcko} }{% + \restoreKV[graphiquetikzmontecarlo]% + \setKV[graphiquetikzmontecarlo]{#1}% + \StrCut{\graphtikzmccols}{/}{\tmpMCcolOK}{\tmpMCcolKO}% + \StrCut{\graphtikzmcxbornes}{,}{\tmpMCxmin}{\tmpMCxmax}% + \StrCut{\graphtikzmcybornes}{,}{\tmpMCymin}{\tmpMCymax}% + \xdef#4{0}% + \xdef#5{0}% + \xdef\nbptsmc{#3}% + \foreach \i in {1,...,#3}{% + \xdef\tmpMCrandX{\xintfloateval{random()*((\tmpMCxmax)-(\tmpMCxmin))+(\tmpMCxmin)}}% + \xdef\tmpMCrandY{\xintfloateval{random()*((\tmpMCymax)-(\tmpMCymin))+(\tmpMCymin)}}% + \xdef\tmpMCrandfX{\xintfloateval{#2(\tmpMCrandX)}}% + \xintifboolexpr{ \tmpMCrandfX > \tmpMCrandY }% + {% + \xdef#4{\xinteval{#4+1}}% + \filldraw[\tmpMCcolOK] (\tmpMCrandX,\tmpMCrandY) circle[pflpointmc] ; + }% + {% + \xdef#5{\xinteval{#5+1}}% + \filldraw[\tmpMCcolKO] (\tmpMCrandX,\tmpMCrandY) circle[pflpointmc] ; + }% + }% +} + +%====MÉTHODES INTÉGRALES + +\defKV[graphiquetikzintegr]{% + Couleur=\def\graphtikzintgrcol{#1},% + CouleurRemplissage=\def\graphtikzintgrcolrempl{#1},% + NbSubDiv=\def\graphtikzintgrnb{#1},% + Methode=\def\graphtikzintgrtype{#1},% + Opacite=\def\graphtikzintgropac{#1} +} + +\setKVdefault[graphiquetikzintegr]{% + Couleur=red,% + NbSubDiv=10,% + Methode=RectanglesGauche,% + Remplir=true,% + CouleurRemplissage={\graphtikzintgrcol!25},% + Opacite=0.25,% + Spline=false +} + +\NewDocumentCommand\RepresenterMethodeIntegrale{ O{} D<>{f} m m }{%opts+nom_fct/spline+a+b + \useKVdefault[graphiquetikzintegr]% + \setKV[graphiquetikzintegr]{#1}% + \ifboolKV[graphiquetikzintegr]{Remplir}% + {% + \tikzset{pflfigureintegr/.style={pfltrait,\graphtikzintgrcol,fill=\graphtikzintgrcolrempl,fill opacity=\graphtikzintgropac}}% + }% + {% + \tikzset{pflfigureintegr/.style={pfltrait,\graphtikzintgrcol}}% + }% + \tikzset{figureintegr/.style={pfltrait,\graphtikzintgrcol,fill=\graphtikzintgrcolrempl,fill opacity=\graphtikzintgropac}}% + \def\TmpH{(#4-#3)/\graphtikzintgrnb} + \ifboolKV[graphiquetikzintegr]{Spline}% + {% + \IfEq{\graphtikzintgrtype}{RectanglesGauche}% + {% + \foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}{% + \path[draw=none,pflcourbe,name path=tmpintmethod] ({#3+\i*\TmpH},{\pflymin})--({#3+\i*\TmpH},{\pflymax}) ; + \path[name intersections={of=#2 and tmpintmethod,name=KLM}] ; + \draw[pflfigureintegr] let \p1 = (KLM-1) in ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\y1}) ; + }% + }% + {}% + \IfEq{\graphtikzintgrtype}{RectanglesDroite}% + {% + \foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}{% + \path[draw=none,pflcourbe,name path=tmpintmethod] ({#3+(\i+1)*\TmpH},{\pflymin})--({#3+(\i+1)*\TmpH},{\pflymax}) ; + \path[name intersections={of=#2 and tmpintmethod,name=KLM}] ; + \draw[pflfigureintegr] let \p1 = (KLM-1) in ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\y1}) ; + }% + }% + {}% + \IfEq{\graphtikzintgrtype}{RectanglesMilieu}% + {% + \foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}{% + \path[draw=none,pflcourbe,name path=tmpintmethod] ({#3+(\i+0.5)*\TmpH},{\pflymin})--({#3+(\i+0.5)*\TmpH},{\pflymax}) ; + \path[name intersections={of=#2 and tmpintmethod,name=KLM}] ; + \draw[pflfigureintegr] let \p1 = (KLM-1) in ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\y1}) ; + }% + }% + {}% + \IfEq{\graphtikzintgrtype}{Trapezes}% + {% + \foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}{% + \path[draw=none,pflcourbe,name path=tmpintmethodg] ({#3+(\i)*\TmpH},{\pflymin})--({#3+(\i)*\TmpH},{\pflymax}) ; + \path[name intersections={of=#2 and tmpintmethodg,name=KLMg}] ; + \path[draw=none,pflcourbe,name path=tmpintmethodd] ({#3+(\i+1)*\TmpH},{\pflymin})--({#3+(\i+1)*\TmpH},{\pflymax}) ; + \path[name intersections={of=#2 and tmpintmethodd,name=KLMd}] ; + \draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) -- (KLMg-1) -- (KLMd-1) -- ({#3+(\i+1)*\TmpH},{0}) -- cycle ; + }% + }% + {}% + }% + {% + \IfEq{\graphtikzintgrtype}{RectanglesGauche}% + {% + \foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}% + \draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\xintfloateval{#2(#3+\i*\TmpH)}}) ; + }% + {}% + \IfEq{\graphtikzintgrtype}{RectanglesDroite}% + {% + \foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}% + \draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\xintfloateval{#2(#3+(\i+1)*\TmpH)}}) ; + }% + {}% + \IfEq{\graphtikzintgrtype}{RectanglesMilieu}% + {% + \foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}% + \draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\xintfloateval{#2(#3+(\i+0.5)*\TmpH)}}) ; + }% + {}% + \IfEq{\graphtikzintgrtype}{Trapezes}% + {% + \foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}% + \draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) -- ({#3+\i*\TmpH},{\xintfloateval{#2(#3+\i*\TmpH)}}) -- ({#3+(\i+1)*\TmpH},{\xintfloateval{#2(#3+(\i+1)*\TmpH)}}) -- ({#3+(\i+1)*\TmpH},{0}) -- cycle ; + }% + {}% + }% +} + + %====INTÉGRALES %v2 avec modification de la clé [Type=...] ? \defKV[GraphiqueTikzIntegr]{% @@ -1961,6 +2157,16 @@ \end{scope} } +%====asymptote +\NewDocumentCommand\TracerAsymptote{ O{} m D<>{} }{% + \restoreKV[GraphiquetikzDroite]% + \setKV[GraphiquetikzDroite]{#1}% + %tracé + \draw[pfltrait,{\useKV[GraphiquetikzDroite]{Couleur}},#3] ({#2},{\pflymin})--({#2},{\pflymax}) ; +} + + +%====MinMax \defKV[GraphiqueTikzMinMax]{% Pas=\def\pflminmaxstep{#1},% Methode=\def\pflminmaxmethode{#1},% @@ -2059,7 +2265,7 @@ } \setKVdefault[GraphiqueTikzNode]{% Couleur=black,% - Debut={\normalfont\normalsize},% + Police={\normalfont\normalsize},% Position={} } \NewDocumentCommand\PlacerTexte{ O{} m m }{% @@ -2117,6 +2323,7 @@ \tikzset{tkzgrphnode/.style={}} \tikzset{tkzgrphpoint/.style={line width=0.95pt}} \tikzset{tkzgrphpointc/.style={radius=1.75pt}} +\tikzset{tkzgrphpointmc/.style={radius=0.875pt}} \tikzset{tkzgrphscatter/.style={radius=1.75pt}} \tikzset{tkzgrphframe/.style={line width=0.8pt,gray}} \tikzset{tkzgrphcurve/.style={line width=1.05pt}} @@ -2861,7 +3068,8 @@ Name=spline,% Color=black,% Coeffs=3,% - Trace=false + Trace=false,% + Alt=false } \NewDocumentCommand\GenerateSpline{ m m O{\myspline} }{% @@ -3898,11 +4106,11 @@ } %====droite -\defKV[GraphiquetikzDroite]{% +\defKV[GraphicTikzLine]{% Name=\def\pfldroitename{#1} } -\setKVdefault[GraphiquetikzDroite]{% +\setKVdefault[GraphicTikzLine]{% Slope=false,% Color=black,% Start={\pflxmin},% @@ -3911,15 +4119,15 @@ } \NewDocumentCommand\DrawLine{ O{} m m D<>{} }{% - \restoreKV[GraphiquetikzDroite]% - \setKV[GraphiquetikzDroite]{#1}% + \restoreKV[GraphicTikzLine]% + \setKV[GraphicTikzLine]{#1}% %1er point \path #2;% \pgfgetlastxy{\macrox}{\macroy}% \xdef\pfldtetikzxA{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}% \xdef\pfldtetikzyA{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}% %2ème point si besoin - \ifboolKV[GraphiquetikzDroite]{Slope}% + \ifboolKV[GraphicTikzLine]{Slope}% {% \xdef\pfldtepente{\xintfloateval{#3}}% }% @@ -3936,24 +4144,33 @@ {% \IfEq{\pfldroitename}{}% {% - \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},#4] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ; + \draw[tkzgrphline,{\useKV[GraphicTikzLine]{Color}},#4] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ; }% {% - \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},#4,name path global=\pfldroitename] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ; + \draw[tkzgrphline,{\useKV[GraphicTikzLine]{Color}},#4,name path global=\pfldroitename] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ; }% }% {% \IfEq{\pfldroitename}{}% {% - \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},domain={\useKV[GraphiquetikzDroite]{Start}}:{\useKV[GraphiquetikzDroite]{End}},samples=2,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ; + \draw[tkzgrphline,{\useKV[GraphicTikzLine]{Color}},domain={\useKV[GraphicTikzLine]{Start}}:{\useKV[GraphicTikzLine]{End}},samples=2,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ; }% {% - \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},domain={\useKV[GraphiquetikzDroite]{Start}}:{\useKV[GraphiquetikzDroite]{End}},samples=2,name path global=\pfldroitename,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ; + \draw[tkzgrphline,{\useKV[GraphicTikzLine]{Color}},domain={\useKV[GraphicTikzLine]{Start}}:{\useKV[GraphicTikzLine]{End}},samples=2,name path global=\pfldroitename,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ; }% }% \end{scope} } +%====asymptote +\NewDocumentCommand\DrawAsymptote{ O{} m D<>{} }{% + \restoreKV[GraphicTikzLine]% + \setKV[GraphicTikzLine]{#1}% + %tracé + \draw[tkzgrphline,{\useKV[GraphicTikzLine]{Color}},#3] ({#2},{\pflymin})--({#2},{\pflymax}) ; +} + +%====minmax \defKV[GraphicTikzMinMax]{% Pas=\def\pflminmaxstep{#1},% Method=\def\pflminmaxmethode{#1},% @@ -4061,4 +4278,457 @@ \draw #2 node[tkzgrphnode,font=\pflnodefonte,text=\pflnodecol,\pfnodepos] {#3} ; } +%====MONTE CARLO +\defKV[GraphicTikzmontecarlo]{% + Colors=\def\graphtikzmccols{#1},% + BoundsX=\def\graphtikzmcxbornes{#1},% + BoundsY=\def\graphtikzmcybornes{#1} +} + +\setKVdefault[GraphicTikzmontecarlo]{% + Colors={blue/red},% + BoundsX={\pflxmin,\pflxmax},% + BoundsY={\pflymin,\pflymax} +} + +\NewDocumentCommand\SimulateMonteCarlo{ O{} D<>{f} m O{\nbptsmcok} O{\nbptsmcko} }{% + \restoreKV[GraphicTikzmontecarlo]% + \setKV[GraphicTikzmontecarlo]{#1}% + \StrCut{\graphtikzmccols}{/}{\tmpMCcolOK}{\tmpMCcolKO}% + \StrCut{\graphtikzmcxbornes}{,}{\tmpMCxmin}{\tmpMCxmax}% + \StrCut{\graphtikzmcybornes}{,}{\tmpMCymin}{\tmpMCymax}% + \xdef#4{0}% + \xdef#5{0}% + \xdef\nbptsmc{#3}% + \foreach \i in {1,...,#3}{% + \xdef\tmpMCrandX{\xintfloateval{random()*((\tmpMCxmax)-(\tmpMCxmin))+(\tmpMCxmin)}}% + \xdef\tmpMCrandY{\xintfloateval{random()*((\tmpMCymax)-(\tmpMCymin))+(\tmpMCymin)}}% + \xdef\tmpMCrandfX{\xintfloateval{#2(\tmpMCrandX)}}% + \xintifboolexpr{ \tmpMCrandfX > \tmpMCrandY }% + {% + \xdef#4{\xinteval{#4+1}}% + \filldraw[\tmpMCcolOK] (\tmpMCrandX,\tmpMCrandY) circle[tkzgrphpointmc] ; + }% + {% + \xdef#5{\xinteval{#5+1}}% + \filldraw[\tmpMCcolKO] (\tmpMCrandX,\tmpMCrandY) circle[tkzgrphpointmc] ; + }% + }% +} + +%====ECC +\defKV[tkzgECC]{% + Couleur=\def\tkzecc@coul@graph{#1},% + CouleursParams=\def\tkzecc@coul@params{#1} +} + +\setKVdefault[tkzgECC]{% + Couleur=black,% + AffParams=true,% + CouleursParams={black},% + TraitsComplets=true +} + +\tikzset{pfltraitsparamecc/.style={line width=0.9pt,densely dashed}} +\tikzset{pflcourbeecc/.style={line width=1.05pt}} + +\NewDocumentCommand\TracerCourbeECC{ O{} m m }{% + \restoreKV[tkzgECC]% + \setKV[tkzgECC]{#1}% + \IfSubStr{\tkzecc@coul@params}{/}% + {% + \StrCut{\tkzecc@coul@params}{/}{\tkzecc@coul@quart}{\tkzecc@coul@med}% + }% + {% + \def\tkzecc@coul@quart{\tkzecc@coul@params}\def\tkzecc@coul@med{\tkzecc@coul@params}% + }% + \readlist*\DataClass{#2}% + \readlist*\DataEff{#3}% + \xdef\DonneesECC{0}% + \xintFor* ##1 in {\xintSeq{1}{\DataEfflen}}\do{% + \xdef\DonneesTmp{0} + \xintFor* ##2 in {\xintSeq{1}{##1}}\do{% + \xdef\DonneesTmp{\xintfloateval{\DonneesTmp+\DataEff[##2]}}% + }% + \xdef\DonneesECC{\DonneesECC,\DonneesTmp}% + }% + \readlist*\DataECC\DonneesECC% + \itemtomacro\DataClass[1]\DonneesXmin% + \itemtomacro\DataClass[-1]\DonneesXmax% + \itemtomacro\DataECC[-1]\DonneesEffMax% + \xdef\DonneesListeECC{(\DataClass[1],\DataECC[1])}% + \xintFor* ##1 in {\xintSeq{2}{\DataECClen}}\do{% + \xdef\DonneesListeECC{\DonneesListeECC--(\DataClass[##1],\DataECC[##1])}% + }% + %paramètres par interpolation + \xintFor* ##1 in {\xintSeq{1}{\DataEfflen}}\do{% + \xdef\isuiv{\xinteval{##1+1}}% + \xintifboolexpr{\DataECC[##1] < (0.25*\DonneesEffMax) 'and' \DataECC[\isuiv] >= (0.25*\DonneesEffMax)}% + {% + \xdef\pentetmpECC{(\DataECC[\isuiv]-\DataECC[##1])/(\DataClass[\isuiv]-\DataClass[##1])}%OK + \xdef\ValPremQuartile{\xintfloateval{(0.25*\DonneesEffMax+\pentetmpECC*\DataClass[##1]-\DataECC[##1])/(\pentetmpECC)}}% + } + {}% + \xintifboolexpr{\DataECC[##1] < (0.50*\DonneesEffMax) 'and' \DataECC[\isuiv] >= (0.50*\DonneesEffMax)}% + {% + \xdef\pentetmpECC{(\DataECC[\isuiv]-\DataECC[##1])/(\DataClass[\isuiv]-\DataClass[##1])}%OK + \xdef\ValMed{\xintfloateval{(0.50*\DonneesEffMax+\pentetmpECC*\DataClass[##1]-\DataECC[##1])/(\pentetmpECC)}}% + } + {}% + \xintifboolexpr{\DataECC[##1] < (0.75*\DonneesEffMax) 'and' \DataECC[\isuiv] >= (0.75*\DonneesEffMax)}% + {% + \xdef\pentetmpECC{(\DataECC[\isuiv]-\DataECC[##1])/(\DataClass[\isuiv]-\DataClass[##1])}%OK + \xdef\ValTroisQuartile{\xintfloateval{(0.75*\DonneesEffMax+\pentetmpECC*\DataClass[##1]-\DataECC[##1])/(\pentetmpECC)}}% + } + {}% + }% + %partie graphique + \draw[pflcourbeecc,\tkzecc@coul@graph] \DonneesListeECC ; + \xintFor* ##1 in {\xintSeq{1}{\DataECClen}}\do{% + \filldraw[\tkzecc@coul@graph] (\DataClass[##1],\DataECC[##1]) circle[pflpointnuage] ; + }% + \ifboolKV[tkzgECC]{AffParams}% + {% + %médiane + \ifboolKV[tkzgECC]{TraitsComplets}% + {% + \draw[pfltraitsparamecc,\tkzecc@coul@med] (\pflxmin,{0.50*\DonneesEffMax})--(\pflxmax,{0.50*\DonneesEffMax}); + \draw[pfltraitsparamecc,\tkzecc@coul@quart] (\pflxmin,{0.25*\DonneesEffMax})--++({\pflxmax-\pflxmin},0); + \draw[pfltraitsparamecc,\tkzecc@coul@quart] (\pflxmin,{0.75*\DonneesEffMax})--++({\pflxmax-\pflxmin},0); + }% + {% + \draw[pfltraitsparamecc,\tkzecc@coul@med] (\pflxmin,{0.50*\DonneesEffMax})--(\ValMed,{0.50*\DonneesEffMax}); + \draw[pfltraitsparamecc,\tkzecc@coul@quart] (\pflxmin,{0.25*\DonneesEffMax})--++({\ValPremQuartile-\pflxmin},0); + \draw[pfltraitsparamecc,\tkzecc@coul@quart] (\pflxmin,{0.75*\DonneesEffMax})--++({\ValTroisQuartile-\pflxmin},0); + }% + \draw[pfltraitsparamecc,\tkzecc@coul@med] (\ValMed,{0.5*\DonneesEffMax})--(\ValMed,0) ; \draw[\tkzecc@coul@med,thick,fill=white] (\ValMed,{0.5*\DonneesEffMax}) circle[pflpointnuage] ; + \draw[pfltraitsparamecc,\tkzecc@coul@quart] (\ValPremQuartile,{0.25*\DonneesEffMax})--(\ValPremQuartile,\pflymin) ; \draw[\tkzecc@coul@quart,thick,fill=white] (\ValPremQuartile,{0.25*\DonneesEffMax}) circle[pflpointnuage] ; + \draw[pfltraitsparamecc,\tkzecc@coul@quart] (\ValTroisQuartile,{0.75*\DonneesEffMax})--(\ValTroisQuartile,\pflymin) ; \draw[\tkzecc@coul@quart,thick,fill=white] (\ValTroisQuartile,{0.75*\DonneesEffMax}) circle[pflpointnuage] ; + }% + {}% +} + +%====PTS DISCONTINUITÉ +\defKV[tkzptdiscont]{% + Couleur=\def\pfldiscontcouleur{#1},% + Pos=\def\pfldiscontpos{#1},% + Echelle=\def\pfldiscontechelle{#1},% + Type=\def\pfldisconttype{#1} +} + +\setKVdefault[tkzptdiscont]{% + Couleur=black,% + Pos=D,% + Echelle=1,% + Type=par +} + +\NewDocumentCommand\AfficherPtsDiscont{ O{} m }{% + \restoreKV[tkzptdiscont] + \setKV[tkzptdiscont]{#1}% + \setsepchar[.]{§./}% + \readlist*\SPLlisteDiscont{#2}% + \def\SPLlisteDiscontNb{\SPLlisteDiscontlen}% + \foreach \i in {1,...,\SPLlisteDiscontNb}{% + \begin{scope}[shift={(\SPLlisteDiscont[\i,1],\SPLlisteDiscont[\i,2])},rotate={atan \SPLlisteDiscont[\i,3]},scale=\pfldiscontechelle] + \IfStrEq{\pfldisconttype}{rond}% + {% + \draw[pflcourbediscont,fill=white,draw=\pfldiscontcouleur] (0,0) circle[radius=3pt] ; + }{}% + \IfStrEq{\pfldiscontpos}{D}% + {% + \IfStrEq{\pfldisconttype}{par}% + {% + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=90,in=170] (4pt,5pt) ; + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=-90,in=-170] (4pt,-5pt) ; + }{}% + \IfStrEq{\pfldisconttype}{demirond}% + {% + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=90,in=180] (3pt,3pt) ; + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=-90,in=180] (3pt,-3pt) ; + }{}% + \IfStrEq{\pfldisconttype}{cro}% + {% + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) |- (4pt,5pt) ; + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) |- (4pt,-5pt) ; + }{}% + }% + {% + \IfStrEq{\pfldisconttype}{par}% + {% + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=90,in=-10] (-4pt,5pt) ; + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=-90,in=10] (-4pt,-5pt) ; + }{}% + \IfStrEq{\pfldisconttype}{demirond}% + {% + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=90,in=0] (-3pt,3pt) ; + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=-90,in=0] (-3pt,-3pt) ; + }{}% + \IfStrEq{\pfldisconttype}{cro}% + {% + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) |- (-4pt,5pt) ; + \draw[pflcourbediscont,\pfldiscontcouleur] (0,0) |- (-4pt,-5pt) ; + }{}% + }% + \end{scope} + }% +} + +%====TOILE RÉCURRENCE (OK avec courbe + spline !!) +\tikzset{pfltraitrec/.style={line width=0.8pt}} +\tikzset{pfltraitrecpointill/.style={pfltraitrec,densely dashed}} + +\defKV[tkzwebrecurr]{% + Couleur=\def\pflrecurcolor{#1},% + Nom=\def\pflrecurnom{#1},% + No=\def\pflrecurno{#1},% + Nb=\def\pflrecurnb{#1},% + Uno=\def\pflrecuruno{#1}, + TailleLabel=\def\pflrecurlabelsize{#1},% + PosLabel=\def\pflrecurlabelpos{#1} +} + +\setKVdefault[tkzwebrecurr]{% + Couleur=black,% + Spline=false,% + No=0,% + Nom=u,% + Nb=5,% + AffTermes=false,% + AffPointilles=true,% + TailleLabel=\small,% + PosLabel=below +} + +\NewDocumentCommand\TracerToileRecurrence{ O{} m }{ + %<clés> + fonction/courbe + \useKVdefault[tkzwebrecurr]% + \setKV[tkzwebrecurr]{#1}% on paramètres les nouvelles clés et on les simplifie + \ifboolKV[tkzwebrecurr]{Spline}% + {% + \foreach \i [remember=\i as \x (initially \pflrecuruno)] in {1,...,\pflrecurnb}{% + %\xdef\y{\xintfloateval{#2(\x)}}% + \path[draw=none,pflcourbe,name path=tmprecur] ({\x},{\pflymin})--({\x},{\pflymax}) ; + \path[name intersections={of=#2 and tmprecur,name=ZZZZ}] ; + %\coordinate (\pflrecurnoms) at (ZZZZ-1) ; + \GetYcoord{(ZZZZ-1)}[\y] + %test de la position courbe / bissectrice ? + \ifnum \i=1 + \newdimen \X + \newdimen \Y + \X = \x pt + \Y = \y pt + \ifdim \Y < \X + \draw[pfltraitrec,\pflrecurcolor] (\x,\y)--(\y,\y) ; + \else + \draw[pfltraitrec,\pflrecurcolor] (\x,\x)--(\x,\y)--(\y,\y) ; + \fi + \else + \draw[pfltraitrec,\pflrecurcolor] (\x,\x)--(\x,\y)--(\y,\y) ; + \fi + \ifboolKV[tkzwebrecurr]{AffPointilles}% + {% + \def\indice{\fpeval{\i+\pflrecurno-1}}% + \ifboolKV[tkzwebrecurr]{AffTermes}% + {% + \draw[pfltraitrecpointill,\pflrecurcolor] (\x,\y)--(\x,\pflxmin) node[\pflrecurlabelpos,font=\pflrecurlabelsize]{$\pflrecurnom_{\indice}$};% + }% + {% + \draw[pfltraitrecpointill,\pflrecurcolor] (\x,\y)--(\x,\pflxmin) ;% + }% + }% + {} + \def\i{\y}% + }% + }% + {% + \foreach \i [remember=\i as \x (initially \pflrecuruno)] in {1,...,\pflrecurnb}{% + \xdef\y{\xintfloateval{#2(\x)}}% + %test de la position courbe / bissectrice ? + \ifnum \i=1 + \newdimen \X + \newdimen \Y + \X = \x pt + \Y = \y pt + \ifdim \Y < \X + \draw[pfltraitrec,\pflrecurcolor] (\x,\y)--(\y,\y) ; + \else + \draw[pfltraitrec,\pflrecurcolor] (\x,\x)--(\x,\y)--(\y,\y) ; + \fi + \else + \draw[pfltraitrec,\pflrecurcolor] (\x,\x)--(\x,\y)--(\y,\y) ; + \fi + \ifboolKV[tkzwebrecurr]{AffPointilles}% + {% + \def\indice{\fpeval{\i+\pflrecurno-1}}% + \ifboolKV[tkzwebrecurr]{AffTermes}% + {% + \draw[pfltraitrecpointill,\pflrecurcolor] (\x,\y)--(\x,\pflxmin) node[\pflrecurlabelpos,font=\pflrecurlabelsize]{$\pflrecurnom_{\indice}$};% + }% + {% + \draw[pfltraitrecpointill,\pflrecurcolor] (\x,\y)--(\x,\pflxmin) ;% + }% + }% + {} + \def\i{\xintfloateval{\y}}% + }% + }% +} + +%====HISTOBINOM +\defKV[tkzHistoBinom]{% + Plage=\def\tkzGraphBinomPlage{#1},% + CouleurPlage=\def\tkzGraphBimomColPlage{#1},% + ClipX=\def\tkzGraphBinomXminmax{#1},% + CouleurNormale=\def\tkzGraphBinomColNorm{#1} +} +\setKVdefault[tkzHistoBinom]{% + Plage={},% + CouleurPlage=black,% + ClipX={},% + AffNormale=false,% + CouleurNormale=black +} + +\NewDocumentCommand\TracerHistoBinomiale{ O{} D<>{phi} m m }{% + \restoreKV[tkzHistoBinom]% + \setKV[tkzHistoBinom]{#1} + \def\tkzGraphBinomN{#3}% + \def\tkzGraphBinomP{#4}% + \IfStrEq{\tkzGraphBinomXminmax}{}% + {% + \xdef\tkzGraphBinomXmin{0}% + \xdef\tkzGraphBinomXmax{\tkzGraphBinomN}% + }% + {% + \StrCut{\tkzGraphBinomXminmax}{-}{\tkzGraphBinomXmin}{\tkzGraphBinomXmax}% + \IfStrEq{\tkzGraphBinomXmin}{*}{\xdef\tkzGraphBinomXmin{0}}{}% + \IfStrEq{\tkzGraphBinomXmax}{*}{\xdef\tkzGraphBinomXmax{\tkzGraphBinomN}}{}% + }% + \IfStrEq{\tkzGraphBinomPlage}{}% + {}% + {% + \StrCut{\tkzGraphBinomPlage}{-}{\tkzGraphBinomColorMin}{\tkzGraphBinomColorMax}% + \IfStrEq{\tkzGraphBinomColorMin}{*}{\xdef\tkzGraphBinomColorMin{\tkzGraphBinomXmin}}{}% + \IfStrEq{\tkzGraphBinomColorMax}{*}{\xdef\tkzGraphBinomColorMax{\tkzGraphBinomXmax}}{}% + }% + %coloriage éventuel + \IfStrEq{\tkzGraphBinomPlage}{}% + {}% + {% + \xintFor* ##1 in {\xintSeq{\tkzGraphBinomColorMin}{\tkzGraphBinomColorMax}}\do{% + \xdef\tkztmpYYY{\xintfloateval{binomial(\tkzGraphBinomN,##1)*(\tkzGraphBinomP)^(##1)*(1-(\tkzGraphBinomP))^((\tkzGraphBinomN)-(##1))}}% + \draw[draw=none,fill=\tkzGraphBimomColPlage,fill opacity=0.5] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; + }% + }% + %tracé + \xintFor* ##1 in {\xintSeq{\tkzGraphBinomXmin}{\tkzGraphBinomXmax}}\do{% + \xdef\tkztmpYYY{\xintfloateval{binomial(\tkzGraphBinomN,##1)*(\tkzGraphBinomP)^(##1)*(1-(\tkzGraphBinomP))^((\tkzGraphBinomN)-(##1))}}% + \draw[pfltrait] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; + }% + \ifboolKV[tkzHistoBinom]{AffNormale}% + {% + \xdef\tkzMinNormHistoBinom{\xintfloateval{{\tkzGraphBinomXmin-0.5}}}% + \xdef\tkzMaxNormHistoBinom{\xintfloateval{{\tkzGraphBinomXmax+0.5}}}% + \xdef\tkzEsperNorm{\xintfloateval{(#3)*(#4)}}% + \xdef\tkzVarNorm{\xintfloateval{sqrt((#3)*(#4)*(1-(#4)))}}% + \DefinirLoiNormale[Trace,Couleur=\tkzGraphBinomColNorm,pflcourbe,Debut=\tkzMinNormHistoBinom,Fin=\tkzMaxNormHistoBinom]<#2>{\tkzEsperNorm}{\tkzVarNorm} + }% + {}% +} + +%====pgfplots small macros +\NewDocumentCommand\findintersectionspgf{ O{ITSC} m m D<>{\myt} }{% + %1 = name of node name + %2 = 1st object + %3 = 2d object + %4 = macro storing number of intersections + \path[name intersections={of=#2 and #3,name=#1,total=\t}] \pgfextra{\xdef#4{\t}} ; +} + +\NewDocumentCommand\gextractxnodepgf{ m O{\myxcoord} }{% + \path \pgfextra{\pgfplotspointgetcoordinates{#1}\pgfkeysgetvalue{/data point/x}{\tmpxgetvalue}\xdef#2{\tmpxgetvalue}} ; +} + +\NewDocumentCommand\gextractynodepgf{ m O{\myycoord} }{% + \path \pgfextra{\pgfplotspointgetcoordinates{#1}\pgfkeysgetvalue{/data point/y}{\tmpygetvalue}\xdef#2{\tmpygetvalue}} ; +} + +\NewDocumentCommand\gextractxynodepgf{ m O{\myxcoord} O{\myycoord} }{% + \path \pgfextra{\pgfplotspointgetcoordinates{#1}\pgfkeysgetvalue{/data point/x}{\tmpxgetvalue}\xdef#2{\tmpxgetvalue}\pgfkeysgetvalue{/data point/y}{\tmpygetvalue}\xdef#3{\tmpygetvalue}} ; +} + +\NewDocumentCommand\fillbetweencurvespgf{ O{gray,fill opacity=0.25} m m D<>{} }{% + \addplot[#1] fill between [of=#2 and #3,soft clip={#4}]; +} + +\NewDocumentCommand\gensplinecubicpgf{ s m m O{\monspline} }{% + %1=liste + \setsepchar[.]{§./}% + \readlist*\SPLlistepoints{#2}% + %les données + \def\tmpsplinenumdeb{1} + \def\tmpsplinenumfin{\SPLlistepointslen}% + \pflextractcoeff{#3}{\tmpsplinenumdeb}% + %nb de calculs + \def\SPLnbsplines{\inteval{\tmpsplinenumfin-1}}% + %extraction des coordonnées + \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xa% + \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\ya% + \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimea% + \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xb% + \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\yb% + \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimeb% + \IfBooleanTF{#1}% + {% + \xdef\tmpcontrolsxa{\xintfloateval{(\xa)+(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsya{\xintfloateval{(\ya)+\fprimea*(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsxb{\xintfloateval{(\xb)-(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsyb{\xintfloateval{(\yb)-\fprimeb*(\xb-\xa)/\COEFFA}}% + }% + {% + \xdef\tmpcontrolsxa{\xintfloateval{(\xa)+cos(atand(\fprimea))*(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsya{\xintfloateval{(\ya)+sin(atand(\fprimea))*(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsxb{\xintfloateval{(\xb)-cos(atand(\fprimeb))*(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsyb{\xintfloateval{(\yb)-sin(atand(\fprimeb))*(\xb-\xa)/\COEFFA}}% + }% + \xdef#4{(\xa,\ya) ..controls (\tmpcontrolsxa,\tmpcontrolsya) and (\tmpcontrolsxb,\tmpcontrolsyb).. (\xb,\yb)}% + \foreach \i in {\tmpsplinenumdeb,...,\SPLnbsplines}{% + %extraction des coeffs de compensation + \pflextractcoeff{#3}{\i}% + \def\j{\inteval{\i+1}}% + \itemtomacro\SPLlistepoints[\i,1]\xa% + \itemtomacro\SPLlistepoints[\i,2]\ya% + \itemtomacro\SPLlistepoints[\i,3]\fprimea% + \itemtomacro\SPLlistepoints[\j,1]\xb% + \itemtomacro\SPLlistepoints[\j,2]\yb% + \itemtomacro\SPLlistepoints[\j,3]\fprimeb% + \IfBooleanTF{#1}% + {% + \xdef\tmpcontrolsxa{\xintfloateval{(\xa)+(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsya{\xintfloateval{(\ya)+\fprimea*(\xb-\xa)/\COEFFA\fprimea*(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsxb{\xintfloateval{(\xb)-(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsyb{\xintfloateval{(\yb)-\fprimeb*(\xb-\xa)/\COEFFA}}% + }% + {% + \xdef\tmpcontrolsxa{\xintfloateval{(\xa)+cos(atand(\fprimea))*(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsya{\xintfloateval{(\ya)+sin(atand(\fprimea))*(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsxb{\xintfloateval{(\xb)-cos(atand(\fprimeb))*(\xb-\xa)/\COEFFA}}% + \xdef\tmpcontrolsyb{\xintfloateval{(\yb)-sin(atand(\fprimeb))*(\xb-\xa)/\COEFFA}}% + }% + \xdef#4{#4 ..controls (\tmpcontrolsxa,\tmpcontrolsya) and (\tmpcontrolsxb,\tmpcontrolsyb).. (\xb,\yb)}% + }% +} + +\NewDocumentCommand\addplotspline{ s O{} D<>{3} m O{\monspline} }{% + \IfBooleanTF{#1}% + {% + \gensplinecubicpgf*{#4}{#3}[#5]% + }% + {% + \gensplinecubicpgf{#4}{#3}[#5]% + }% + \draw[#2] #5 ; +} + \endinput
\ No newline at end of file diff --git a/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-en.pdf b/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-en.pdf Binary files differindex 44c8e897ce..14f9e46afe 100644 --- a/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-en.pdf +++ b/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-en.pdf diff --git a/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-en.tex b/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-en.tex index b0a81f9e6a..95cbe02f11 100644 --- a/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-en.tex +++ b/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-en.tex @@ -21,8 +21,8 @@ \hypersetup{pdfborder=0 0 0} \usepackage[margin=2cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.1} -\def\TPdate{26/11/2023} +\def\TPversion{0.1.2} +\def\TPdate{21/10/2024} \usepackage{tcolorbox} \tcbuselibrary{skins,hooks,listingsutf8} \usepackage{soul} @@ -135,6 +135,7 @@ Loaded are useful package are : \begin{quote} \begin{verbatim} +0.1.2 : Key [ShortVersion] in order to reduce number of border cells 0.1.1 : Adding two schemes of colors 0.1.0 : Initial version \end{verbatim} @@ -160,7 +161,9 @@ All the available keys are presented in the following paragraph, but concerning % \BoardTrivialPursuit[Radius=4,BorderHeight=1.25] %beware of the rendering... -\BoardTrivialPursuit[Unit=0.33] %'optimal' rendering +\BoardTrivialPursuit[Unit=0.33] +% +\BoardTrivialPursuit[Unit=0.33,ShortVersion] \end{tcblisting} \pagebreak @@ -188,7 +191,8 @@ Available \textsf{keys} are : \item \MontreCode{Blank} := boolean for an empty board, and \MontreCode{false} by default ; \item \MontreCode{Unit} := to precis an unit (better than a scale !), and \MontreCode{1} by default ; \item \MontreCode{Thickness} := thickness of the borders, and \MontreCode{0.8pt} by default ; - \item \MontreCode{Rotation} := possible rotation of the board, and \MontreCode{0} by default. + \item \MontreCode{Rotation} := possible rotation of the board, and \MontreCode{0} by default ; + \item \MontreCode{ShortVersion} := use 5 cells instead 6 between 'big cells', and \MontreCode{false} by default. \end{itemize} \begin{tcblisting}{colframe=lightgray,colback=lightgray!5} diff --git a/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-fr.pdf b/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-fr.pdf Binary files differindex 2b6b766846..16dcd58e8b 100644 --- a/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-fr.pdf +++ b/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-fr.pdf diff --git a/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-fr.tex b/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-fr.tex index ff50c6a07d..d93190d0e0 100644 --- a/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-fr.tex +++ b/graphics/pgf/contrib/trivialpursuit/doc/TrivialPursuit-doc-fr.tex @@ -21,8 +21,8 @@ \hypersetup{pdfborder=0 0 0} \usepackage[margin=2cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.1} -\def\TPdate{26 novembre 2023} +\def\TPversion{0.1.2} +\def\TPdate{21 octobre 2024} \usepackage{tcolorbox} \tcbuselibrary{skins,hooks,listingsutf8} \usepackage{soul} @@ -135,6 +135,7 @@ Les packages chargés et utilisés par \MontreCode{TrivialPursuit} sont : \begin{quote} \begin{verbatim} +0.1.2 : Ajout d'une clé [VersionCourte] pour diminuer le nombre de cases 0.1.1 : Ajout de palettes de couleurs prédéfinies 0.1.0 : Version initiale \end{verbatim} @@ -160,7 +161,9 @@ Toutes les clés disponibles sont présentées dans le paragraphe suivant, mais % \PlateauTrivialPursuit[Rayon=4,HauteurCases=1.25] %attention au rendu... -\PlateauTrivialPursuit[Unite=0.33] %le rendu est 'optimal' +\PlateauTrivialPursuit[Unite=0.33] +% +\PlateauTrivialPursuit[Unite=0.33,VersionCourte] \end{tcblisting} \pagebreak @@ -188,7 +191,8 @@ Les \textsf{clés} disponibles sont : \item \MontreCode{Vide} := booléen pour afficher le plateau vide, et valant \MontreCode{false} par défaut ; \item \MontreCode{Unite} := pour préciser l'unité (et gérer un facteur d'échelle), et valant \MontreCode{1} par défaut ; \item \MontreCode{Epaisseur} := épaisseur des tracés, et valant \MontreCode{0.8pt} par défaut ; - \item \MontreCode{Rotation} := rotation éventuelle du plateau, et valant \MontreCode{0} par défaut. + \item \MontreCode{Rotation} := rotation éventuelle du plateau, et valant \MontreCode{0} par défaut ; + \item \MontreCode{VersionCourte} := utiliser 5 cases au lieu de 6 entre les camemberts, et valant \MontreCode{false} par défaut. \end{itemize} \begin{tcblisting}{colframe=lightgray,colback=lightgray!5} diff --git a/graphics/pgf/contrib/trivialpursuit/tex/TrivialPursuit.sty b/graphics/pgf/contrib/trivialpursuit/tex/TrivialPursuit.sty index d8b8411130..9bc0185a91 100644 --- a/graphics/pgf/contrib/trivialpursuit/tex/TrivialPursuit.sty +++ b/graphics/pgf/contrib/trivialpursuit/tex/TrivialPursuit.sty @@ -4,7 +4,8 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{TrivialPursuit}[2023/11/26 0.1.1 Present a Trivial Pursuit Board] +\ProvidesPackage{TrivialPursuit}[2024/10/21 0.1.2 Present a Trivial Pursuit Board] +% 0.1.2 'Short' version % 0.1.1 Adding schemes of colors % 0.1.0 Initial version @@ -62,7 +63,8 @@ Epaisseur=0.8pt,% Rotation=0,% Jokers=true,% - IconeJoker={\faDice} + IconeJoker={\faDice},% + VersionCourte=false } %====INTERN COMMANDS @@ -113,17 +115,17 @@ \ifboolKV[TrivPurs]{Couleurs}% {% %Couleur du 1er camembert - \filldraw[{\triv@purs@lstcol[1]}] (PB-47)--(GB-47) arc ({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-1) arc ({\triv@purs@anglecases}:{-\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-47)--(GB-47) arc ({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-1) arc ({\triv@purs@anglecases}:{-\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 2ème - \filldraw[{\triv@purs@lstcol[2]}] (PB-7)--(GB-7) arc ({7*\triv@purs@anglecases}:{9*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-9) arc ({9*\triv@purs@anglecases}:{7*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-7)--(GB-7) arc ({7*\triv@purs@anglecases}:{9*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-9) arc ({9*\triv@purs@anglecases}:{7*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 3ème - \filldraw[{\triv@purs@lstcol[3]}] (PB-15)--(GB-15) arc ({15*\triv@purs@anglecases}:{17*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-17) arc ({17*\triv@purs@anglecases}:{15*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-15)--(GB-15) arc ({15*\triv@purs@anglecases}:{17*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-17) arc ({17*\triv@purs@anglecases}:{15*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 4ème - \filldraw[{\triv@purs@lstcol[4]}] (PB-23)--(GB-23) arc ({23*\triv@purs@anglecases}:{25*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-25) arc ({25*\triv@purs@anglecases}:{23*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-23)--(GB-23) arc ({23*\triv@purs@anglecases}:{25*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-25) arc ({25*\triv@purs@anglecases}:{23*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 5ème - \filldraw[{\triv@purs@lstcol[5]}] (PB-31)--(GB-31) arc ({31*\triv@purs@anglecases}:{33*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-33) arc ({33*\triv@purs@anglecases}:{31*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-31)--(GB-31) arc ({31*\triv@purs@anglecases}:{33*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-33) arc ({33*\triv@purs@anglecases}:{31*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 6ème - \filldraw[{\triv@purs@lstcol[6]}] (PB-39)--(GB-39) arc ({39*\triv@purs@anglecases}:{41*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-41) arc ({41*\triv@purs@anglecases}:{39*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-39)--(GB-39) arc ({39*\triv@purs@anglecases}:{41*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-41) arc ({41*\triv@purs@anglecases}:{39*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; }% {}% %si on affiche les icones @@ -141,7 +143,7 @@ \NewDocumentCommand\RemplirCaseTrivial{ m m m }{%deb + fin + numcouleur \ifboolKV[TrivPurs]{Couleurs}% {% - \filldraw[{\triv@purs@lstcol[#3]}] (PB-#1)--(GB-#1) arc ({#1*\triv@purs@anglecases}:{#2*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-#2) arc ({#2*\triv@purs@anglecases}:{#1*\triv@purs@anglecases}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (PB-#1)--(GB-#1) arc ({#1*\triv@purs@anglecases}:{#2*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-#2) arc ({#2*\triv@purs@anglecases}:{#1*\triv@purs@anglecases}:{\triv@purs@rayonint}); }% {}% \ifboolKV[TrivPurs]{Icones}% @@ -160,7 +162,7 @@ \xdef\tmpcaseap{\xinteval{#2+1}}% \xintifboolexpr{#2 > 1 'and' #2 < 5}% {% - \filldraw[{\triv@purs@lstcol[#3]}] (C-#1-\tmpcase)--(D-#1-\tmpcase)--(D-#1-#2)--(C-#1-#2)--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (C-#1-\tmpcase)--(D-#1-\tmpcase)--(D-#1-#2)--(C-#1-#2)--cycle ; }% {}% \xintifboolexpr{#2 == 5}% @@ -178,12 +180,12 @@ {% \xintifboolexpr{#1 == 1}% {% - \filldraw[{\triv@purs@lstcol[#3]}] (C-1-1)--(PB-\triv@purs@numcasavant) arc({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-1-1)--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (C-1-1)--(PB-\triv@purs@numcasavant) arc({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-1-1)--cycle ; }% {% \xdef\tmp@ii{\xinteval{(-1+8*(#1-1))}}% \xdef\tmp@jj{\xinteval{(\tmp@ii+2)}}% - \filldraw[{\triv@purs@lstcol[#3]}] (C-#1-1)--(PB-\tmp@ii) arc({\tmp@ii*\triv@purs@anglecases}:{\tmp@jj*\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-#1-1)--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (C-#1-1)--(PB-\tmp@ii) arc({\tmp@ii*\triv@purs@anglecases}:{\tmp@jj*\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-#1-1)--cycle ; }% }% {}% @@ -398,6 +400,361 @@ \end{scope} } +%courte +\NewDocumentCommand\CreationNoeudsTrivialCourt{}{%OK !!!!!!!!!!!!!! + %création des nœuds grand bord petit bord GB-i (et PB-i) + \coordinate (GB-1) at ({7.5}:{\triv@purs@rayon}) ; + \coordinate (PB-1) at ({7.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-2) at ({7.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-2) at ({7.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-3) at ({7.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-3) at ({7.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-4) at ({7.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-4) at ({7.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-5) at ({7.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-5) at ({7.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-6) at ({7.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-6) at ({7.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-7) at ({67.5}:{\triv@purs@rayon}) ; + \coordinate (PB-7) at ({67.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-8) at ({67.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-8) at ({67.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-9) at ({67.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-9) at ({67.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-10) at ({67.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-10) at ({67.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-11) at ({67.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-11) at ({67.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-12) at ({67.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-12) at ({67.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-13) at ({127.5}:{\triv@purs@rayon}) ; + \coordinate (PB-13) at ({127.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-14) at ({127.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-14) at ({127.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-15) at ({127.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-15) at ({127.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-16) at ({127.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-16) at ({127.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-17) at ({127.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-17) at ({127.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-18) at ({127.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-18) at ({127.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-19) at ({187.5}:{\triv@purs@rayon}) ; + \coordinate (PB-19) at ({187.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-20) at ({187.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-20) at ({187.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-21) at ({187.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-21) at ({187.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-22) at ({187.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-22) at ({187.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-23) at ({187.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-23) at ({187.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-24) at ({187.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-24) at ({187.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-25) at ({247.5}:{\triv@purs@rayon}) ; + \coordinate (PB-25) at ({247.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-26) at ({247.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-26) at ({247.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-27) at ({247.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-27) at ({247.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-28) at ({247.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-28) at ({247.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-29) at ({247.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-29) at ({247.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-30) at ({247.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-30) at ({247.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-31) at ({307.5}:{\triv@purs@rayon}) ; + \coordinate (PB-31) at ({307.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-32) at ({307.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-32) at ({307.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-33) at ({307.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-33) at ({307.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-34) at ({307.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-34) at ({307.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-35) at ({307.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-35) at ({307.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-36) at ({307.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-36) at ({307.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + %tests ?!?! +% \foreach \i in {1,...,36}{%OK +% \filldraw[teal] (GB-\i) circle[radius=1.75pt] node[font=\tiny\ttfamily] {GB-\i}; +% \filldraw[purple] (PB-\i) circle[radius=1.75pt] node[font=\tiny\ttfamily] {PB-\i}; +% } + %création des nœuds pour la figure centrale, boucle pour les 1ers + le dernier + \foreach \i in {1,...,\triv@purs@nbcat}{% + \coordinate (OM-\i) at ({30+(\i-1)*60}:{\triv@purs@rayonhexag}) ; + %\filldraw[orange] (OM-\i) circle[radius=1.75pt] node[font=\tiny\ttfamily] {OM-\i}; + }% + %les nœuds des cases verticales + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-1-\j) at ($(PB-1)!\tmp@coeff!(OM-1)$) ; + %\filldraw[yellow] (D-1-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-1-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-2-\j) at ($(PB-6)!\tmp@coeff!(OM-1)$) ; + %\filldraw[yellow] (D-2-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-2-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-3-\j) at ($(PB-7)!\tmp@coeff!(OM-2)$) ; + %\filldraw[yellow] (D-3-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-3-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-4-\j) at ($(PB-12)!\tmp@coeff!(OM-2)$) ; + %\filldraw[yellow] (D-4-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-4-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-5-\j) at ($(PB-13)!\tmp@coeff!(OM-3)$) ; + %\filldraw[yellow] (D-5-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-5-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-6-\j) at ($(PB-18)!\tmp@coeff!(OM-3)$) ; + %\filldraw[yellow] (D-6-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-5-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-7-\j) at ($(PB-19)!\tmp@coeff!(OM-4)$) ; + %\filldraw[yellow] (D-7-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-7-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-8-\j) at ($(PB-24)!\tmp@coeff!(OM-4)$) ; + %\filldraw[yellow] (D-8-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-8-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-9-\j) at ($(PB-25)!\tmp@coeff!(OM-5)$) ; + %\filldraw[yellow] (D-9-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-9-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-10-\j) at ($(PB-30)!\tmp@coeff!(OM-5)$) ; + %\filldraw[yellow] (D-10-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-10-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-11-\j) at ($(PB-31)!\tmp@coeff!(OM-6)$) ; + %\filldraw[yellow] (D-11-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-11-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-12-\j) at ($(PB-36)!\tmp@coeff!(OM-6)$) ; + %\filldraw[yellow] (D-12-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-12-\j}; + }% +} + +\NewDocumentCommand\RemplirCasesTourCourt{}{% + %-------Vertical + %niveau 1 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (OM-6)--(OM-1)--(D-1-4)--(D-12-4)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-6)!0.5!(D-1-4)$) {\triv@purs@lsticons[2]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (D-12-4)--(D-1-4)--(D-1-3)--(D-12-3)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-12-4)!0.5!(D-1-3)$) {\triv@purs@lsticons[6]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (D-12-3)--(D-1-3)--(D-1-2)--(D-12-2)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-12-3)!0.5!(D-1-2)$) {\triv@purs@lsticons[5]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (D-12-2)--(D-1-2)--(D-1-1)--(D-12-1)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-12-2)!0.5!(D-1-1)$) {\triv@purs@lsticons[3]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (D-1-1)--(PB-1) arc({\triv@purs@anglecases}:{-\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-12-1)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-12-1)!0.5!(PB-1)$) {\triv@purs@lsticons[4]} ; + %niveau 2 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (OM-1)--(OM-2)--(D-3-4)--(D-2-4)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-1)!0.5!(D-3-4)$) {\triv@purs@lsticons[3]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (D-2-4)--(D-3-4)--(D-3-3)--(D-2-3)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-2-4)!0.5!(D-3-3)$) {\triv@purs@lsticons[1]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (D-2-3)--(D-3-3)--(D-3-2)--(D-2-2)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-2-3)!0.5!(D-3-2)$) {\triv@purs@lsticons[6]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (D-2-2)--(D-3-2)--(D-3-1)--(D-2-1)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-2-2)!0.5!(D-3-1)$) {\triv@purs@lsticons[4]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (D-3-1)--(PB-7) arc({67.5}:{52.5}:{\triv@purs@rayonint}) --(D-2-1)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-2-1)!0.5!(PB-7)$) {\triv@purs@lsticons[5]} ; + %niveau 3 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (OM-2)--(OM-3)--(D-5-4)--(D-4-4)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-2)!0.5!(D-5-4)$) {\triv@purs@lsticons[4]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (D-4-4)--(D-5-4)--(D-5-3)--(D-4-3)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-4-4)!0.5!(D-5-3)$) {\triv@purs@lsticons[2]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (D-4-3)--(D-5-3)--(D-5-2)--(D-4-2)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-4-3)!0.5!(D-5-2)$) {\triv@purs@lsticons[1]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (D-4-2)--(D-5-2)--(D-5-1)--(D-4-1)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-4-2)!0.5!(D-5-1)$) {\triv@purs@lsticons[5]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (D-5-1)--(PB-13) arc({127.5}:{112.5}:{\triv@purs@rayonint}) --(D-4-1)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-4-1)!0.5!(PB-13)$) {\triv@purs@lsticons[6]} ; + %niveau 4 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (OM-3)--(OM-4)--(D-7-4)--(D-6-4)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-3)!0.5!(D-7-4)$) {\triv@purs@lsticons[5]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (D-6-4)--(D-7-4)--(D-7-3)--(D-6-3)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-6-4)!0.5!(D-7-3)$) {\triv@purs@lsticons[3]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (D-6-3)--(D-7-3)--(D-7-2)--(D-6-2)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-6-3)!0.5!(D-7-2)$) {\triv@purs@lsticons[2]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (D-6-2)--(D-7-2)--(D-7-1)--(D-6-1)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-6-2)!0.5!(D-7-1)$) {\triv@purs@lsticons[6]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (D-7-1)--(PB-19) arc({187.5}:{172.5}:{\triv@purs@rayonint}) --(D-6-1)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-6-1)!0.5!(PB-19)$) {\triv@purs@lsticons[1]} ; + %niveau 5 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (OM-4)--(OM-5)--(D-9-4)--(D-8-4)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-4)!0.5!(D-9-4)$) {\triv@purs@lsticons[6]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (D-8-4)--(D-9-4)--(D-9-3)--(D-8-3)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-8-4)!0.5!(D-9-3)$) {\triv@purs@lsticons[4]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (D-8-3)--(D-9-3)--(D-9-2)--(D-8-2)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-8-3)!0.5!(D-9-2)$) {\triv@purs@lsticons[3]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (D-8-2)--(D-9-2)--(D-9-1)--(D-8-1)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-8-2)!0.5!(D-9-1)$) {\triv@purs@lsticons[1]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (D-9-1)--(PB-25) arc({247.5}:{232.5}:{\triv@purs@rayonint}) --(D-8-1)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-8-1)!0.5!(PB-25)$) {\triv@purs@lsticons[2]} ; + %niveau 6 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (OM-5)--(OM-6)--(D-11-4)--(D-10-4)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-5)!0.5!(D-11-4)$) {\triv@purs@lsticons[1]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (D-10-4)--(D-11-4)--(D-11-3)--(D-10-3)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-10-4)!0.5!(D-11-3)$) {\triv@purs@lsticons[5]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (D-10-3)--(D-11-3)--(D-11-2)--(D-10-2)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-10-3)!0.5!(D-11-2)$) {\triv@purs@lsticons[4]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (D-10-2)--(D-11-2)--(D-11-1)--(D-10-1)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-10-2)!0.5!(D-11-1)$) {\triv@purs@lsticons[2]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (D-11-1)--(PB-31) arc({307.5}:{292.5}:{\triv@purs@rayonint}) --(D-10-1)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-10-1)!0.5!(PB-31)$) {\triv@purs@lsticons[3]} ; + %--------BORDS !!! + \ifboolKV[TrivPurs]{Couleurs}% + {% + %Secteur1 + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-1)--(GB-1) arc ({7.5+0*9}:{7.5+1*9}:{\triv@purs@rayon})--(PB-2) arc ({7.5+1*9}:{7.5+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-2)--(GB-2) arc ({7.5+1*9}:{7.5+2*9}:{\triv@purs@rayon})--(PB-3) arc ({7.5+2*9}:{7.5+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-4)--(GB-4) arc ({7.5+3*9}:{7.5+4*9}:{\triv@purs@rayon})--(PB-5) arc ({7.5+4*9}:{7.5+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-5)--(GB-5) arc ({7.5+4*9}:{7.5+5*9}:{\triv@purs@rayon})--(PB-6) arc ({7.5+5*9}:{7.5+4*9}:{\triv@purs@rayonint}); + %Secteur2 + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-7)--(GB-7) arc ({7.5+60+0*9}:{7.5+60+1*9}:{\triv@purs@rayon})--(PB-8) arc ({7.5+60+1*9}:{7.5+60+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-8)--(GB-8) arc ({7.5+60+1*9}:{7.5+60+2*9}:{\triv@purs@rayon})--(PB-9) arc ({7.5+60+2*9}:{7.5+60+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-10)--(GB-10) arc ({7.5+60+3*9}:{7.5+60+4*9}:{\triv@purs@rayon})--(PB-11) arc ({7.5+60+4*9}:{7.5+60+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-11)--(GB-11) arc ({7.5+60+4*9}:{7.5+60+5*9}:{\triv@purs@rayon})--(PB-12) arc ({7.5+60+5*9}:{7.5+60+4*9}:{\triv@purs@rayonint}); + %Secteur3 + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-13)--(GB-13) arc ({7.5+120+0*9}:{7.5+120+1*9}:{\triv@purs@rayon})--(PB-14) arc ({7.5+120+1*9}:{7.5+120+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-14)--(GB-14) arc ({7.5+120+1*9}:{7.5+120+2*9}:{\triv@purs@rayon})--(PB-15) arc ({7.5+120+2*9}:{7.5+120+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-16)--(GB-16) arc ({7.5+120+3*9}:{7.5+120+4*9}:{\triv@purs@rayon})--(PB-17) arc ({7.5+120+4*9}:{7.5+120+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-17)--(GB-17) arc ({7.5+120+4*9}:{7.5+120+5*9}:{\triv@purs@rayon})--(PB-18) arc ({7.5+120+5*9}:{7.5+120+4*9}:{\triv@purs@rayonint}); + %Secteur4 + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-19)--(GB-19) arc ({7.5+180+0*9}:{7.5+180+1*9}:{\triv@purs@rayon})--(PB-20) arc ({7.5+180+1*9}:{7.5+180+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-20)--(GB-20) arc ({7.5+180+1*9}:{7.5+180+2*9}:{\triv@purs@rayon})--(PB-21) arc ({7.5+180+2*9}:{7.5+180+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-22)--(GB-22) arc ({7.5+180+3*9}:{7.5+180+4*9}:{\triv@purs@rayon})--(PB-23) arc ({7.5+180+4*9}:{7.5+180+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-23)--(GB-23) arc ({7.5+180+4*9}:{7.5+180+5*9}:{\triv@purs@rayon})--(PB-24) arc ({7.5+180+5*9}:{7.5+180+4*9}:{\triv@purs@rayonint}); + %Secteur5 + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-25)--(GB-25) arc ({7.5+240+0*9}:{7.5+240+1*9}:{\triv@purs@rayon})--(PB-26) arc ({7.5+240+1*9}:{7.5+240+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-26)--(GB-26) arc ({7.5+240+1*9}:{7.5+240+2*9}:{\triv@purs@rayon})--(PB-27) arc ({7.5+240+2*9}:{7.5+240+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-28)--(GB-28) arc ({7.5+240+3*9}:{7.5+240+4*9}:{\triv@purs@rayon})--(PB-29) arc ({7.5+240+4*9}:{7.5+240+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-29)--(GB-29) arc ({7.5+240+4*9}:{7.5+240+5*9}:{\triv@purs@rayon})--(PB-30) arc ({7.5+240+5*9}:{7.5+240+4*9}:{\triv@purs@rayonint}); + %Secteur6 + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-31)--(GB-31) arc ({7.5+300+0*9}:{7.5+300+1*9}:{\triv@purs@rayon})--(PB-32) arc ({7.5+300+1*9}:{7.5+300+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-32)--(GB-32) arc ({7.5+300+1*9}:{7.5+300+2*9}:{\triv@purs@rayon})--(PB-33) arc ({7.5+300+2*9}:{7.5+300+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-34)--(GB-34) arc ({7.5+300+3*9}:{7.5+300+4*9}:{\triv@purs@rayon})--(PB-35) arc ({7.5+300+4*9}:{7.5+300+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-35)--(GB-35) arc ({7.5+300+4*9}:{7.5+300+5*9}:{\triv@purs@rayon})--(PB-36) arc ({7.5+300+5*9}:{7.5+300+4*9}:{\triv@purs@rayonint}); + }% + {}% + \ifboolKV[TrivPurs]{Icones}% + {% + %secteur1 + \node[rotate={90+0.5*(7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + \node[rotate={90+0.5*(7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + \node[rotate={90+0.5*(7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + \node[rotate={90+0.5*(7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + %secteur2 + \node[rotate={90+0.5*(2*60+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*60+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + \node[rotate={90+0.5*(2*60+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*60+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + \node[rotate={90+0.5*(2*60+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*60+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + \node[rotate={90+0.5*(2*60+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*60+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + %secteur3 + \node[rotate={90+0.5*(2*120+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*120+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + \node[rotate={90+0.5*(2*120+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*120+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + \node[rotate={90+0.5*(2*120+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*120+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + \node[rotate={90+0.5*(2*120+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*120+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + %secteur4 + \node[rotate={90+0.5*(2*180+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*180+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + \node[rotate={90+0.5*(2*180+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*180+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + \node[rotate={90+0.5*(2*180+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*180+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + \node[rotate={90+0.5*(2*180+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*180+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + %secteur5 + \node[rotate={90+0.5*(2*240+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*240+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + \node[rotate={90+0.5*(2*240+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*240+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + \node[rotate={90+0.5*(2*240+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*240+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + \node[rotate={90+0.5*(2*240+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*240+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + %secteur6 + \node[rotate={90+0.5*(2*300+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*300+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + \node[rotate={90+0.5*(2*300+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*300+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + \node[rotate={90+0.5*(2*300+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*300+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + \node[rotate={90+0.5*(2*300+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*300+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + }% + {}% + + %les jokers + \ifboolKV[TrivPurs]{Icones}% + {% + \ifboolKV[TrivPurs]{Jokers}% + {% + \node[rotate=30,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({30}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=90,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({90}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=150,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({150}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=210,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({210}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=270,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({270}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=330,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({330}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + }% + {}% + }% + {}% +} +\NewDocumentCommand\TraceBorduresTrivialCourt{ }{%OK Court + %les tracés des cases + \draw[EpTraits] (0,0) circle[radius=\triv@purs@rayon] ; + \draw[EpTraits] (0,0) circle[radius={\triv@purs@rayon-\triv@purs@hautcases}] ; + \foreach \i in {1,...,36}{% + \draw[EpTraits] (PB-\i)--(GB-\i) ; + } + \draw[EpTraits] (PB-1)--(OM-1)--(OM-6)--(PB-36) ; + \draw[EpTraits] (PB-6)--(OM-1)--(OM-2)--(PB-7) ; + \draw[EpTraits] (PB-12)--(OM-2)--(OM-3)--(PB-13) ; + \draw[EpTraits] (PB-18)--(OM-3)--(OM-4)--(PB-19) ; + \draw[EpTraits] (PB-24)--(OM-4)--(OM-5)--(PB-25) ; + \draw[EpTraits] (PB-30)--(OM-5)--(OM-6)--(PB-31) ; + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \draw[EpTraits] (D-2-\j)--(D-3-\j) ; + \draw[EpTraits] (D-4-\j)--(D-5-\j) ; + \draw[EpTraits] (D-6-\j)--(D-7-\j) ; + \draw[EpTraits] (D-8-\j)--(D-9-\j) ; + \draw[EpTraits] (D-10-\j)--(D-11-\j) ; + \draw[EpTraits] (D-12-\j)--(D-1-\j) ; + }% +} + +\NewDocumentCommand\RemplirCamembertsTrivialCourt{ }{%numéro des camemberts, en partant de la droite + \ifboolKV[TrivPurs]{Couleurs}% + {% + %Couleur du 1er camembert + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-36)--(GB-36) arc ({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-1) arc ({\triv@purs@anglecases}:{-\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 2ème + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-6)--(GB-6) arc ({7*\triv@purs@anglecases}:{9*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-7) arc ({9*\triv@purs@anglecases}:{7*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 3ème + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-12)--(GB-12) arc ({15*\triv@purs@anglecases}:{17*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-13) arc ({17*\triv@purs@anglecases}:{15*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 4ème + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-18)--(GB-18) arc ({23*\triv@purs@anglecases}:{25*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-19) arc ({25*\triv@purs@anglecases}:{23*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 5ème + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-24)--(GB-24) arc ({31*\triv@purs@anglecases}:{33*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-25) arc ({33*\triv@purs@anglecases}:{31*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 6ème + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-30)--(GB-30) arc ({39*\triv@purs@anglecases}:{41*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-31) arc ({41*\triv@purs@anglecases}:{39*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + }% + {}% + %si on affiche les icones + \ifboolKV[TrivPurs]{Icones}% + {% + \node[rotate={90+0*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + \node[rotate={90+8*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({8*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + \node[rotate={90+16*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({16*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + \node[rotate={90+24*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({24*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + \node[rotate={90+32*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({32*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + \node[rotate={90+40*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({40*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + }% + {}% +} + %====CREATION \NewDocumentCommand\PlateauTrivialPursuit{ O{} D<>{} }{% \restoreKV[TrivPurs]% revenir au valeurs par défaut @@ -433,18 +790,35 @@ \useasboundingbox (0,0) circle[radius={\triv@purs@rayon}] ; %création \begin{scope}[rotate=\triv@purs@rotate] - %les nœuds OK - \CreationNoeudsTrivial - %test avec centre OK - \ifboolKV[TrivPurs]{Centre}{\RemplirCentreTrivial}{} - %camemberts OK - \RemplirCamembertsTrivial - %cases OK - \RemplirCasesTour - %bordures - \TraceBorduresTrivial - %logo central - \ifboolKV[TrivPurs]{Logo}{\LogoTrivialPursuit}{} + \ifboolKV[TrivPurs]{VersionCourte}% + {% + %les nœuds OK + \CreationNoeudsTrivialCourt + %test avec centre OK + \ifboolKV[TrivPurs]{Centre}{\RemplirCentreTrivial}{} + %camemberts OK + \RemplirCamembertsTrivialCourt + %cases OK + \RemplirCasesTourCourt + %bordures + \TraceBorduresTrivialCourt + %logo central + \ifboolKV[TrivPurs]{Logo}{\LogoTrivialPursuit}{} + }% + {% + %les nœuds OK + \CreationNoeudsTrivial + %test avec centre OK + \ifboolKV[TrivPurs]{Centre}{\RemplirCentreTrivial}{} + %camemberts OK + \RemplirCamembertsTrivial + %cases OK + \RemplirCasesTour + %bordures + \TraceBorduresTrivial + %logo central + \ifboolKV[TrivPurs]{Logo}{\LogoTrivialPursuit}{} + }% \end{scope} \end{tikzpicture}% } @@ -477,7 +851,8 @@ Thickness=0.8pt,% Rotation=0,% Jokers=true,% - IconJoker={\faDice} + IconJoker={\faDice},% + ShortVersion=false } %====INTERN COMMANDS @@ -528,17 +903,17 @@ \ifboolKV[TrivPursEN]{Colors}% {% %Couleur du 1er camembert - \filldraw[{\triv@purs@lstcol[1]}] (PB-47)--(GB-47) arc ({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-1) arc ({\triv@purs@anglecases}:{-\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-47)--(GB-47) arc ({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-1) arc ({\triv@purs@anglecases}:{-\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 2ème - \filldraw[{\triv@purs@lstcol[2]}] (PB-7)--(GB-7) arc ({7*\triv@purs@anglecases}:{9*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-9) arc ({9*\triv@purs@anglecases}:{7*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-7)--(GB-7) arc ({7*\triv@purs@anglecases}:{9*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-9) arc ({9*\triv@purs@anglecases}:{7*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 3ème - \filldraw[{\triv@purs@lstcol[3]}] (PB-15)--(GB-15) arc ({15*\triv@purs@anglecases}:{17*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-17) arc ({17*\triv@purs@anglecases}:{15*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-15)--(GB-15) arc ({15*\triv@purs@anglecases}:{17*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-17) arc ({17*\triv@purs@anglecases}:{15*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 4ème - \filldraw[{\triv@purs@lstcol[4]}] (PB-23)--(GB-23) arc ({23*\triv@purs@anglecases}:{25*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-25) arc ({25*\triv@purs@anglecases}:{23*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-23)--(GB-23) arc ({23*\triv@purs@anglecases}:{25*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-25) arc ({25*\triv@purs@anglecases}:{23*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 5ème - \filldraw[{\triv@purs@lstcol[5]}] (PB-31)--(GB-31) arc ({31*\triv@purs@anglecases}:{33*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-33) arc ({33*\triv@purs@anglecases}:{31*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-31)--(GB-31) arc ({31*\triv@purs@anglecases}:{33*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-33) arc ({33*\triv@purs@anglecases}:{31*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; %Couleur du 6ème - \filldraw[{\triv@purs@lstcol[6]}] (PB-39)--(GB-39) arc ({39*\triv@purs@anglecases}:{41*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-41) arc ({41*\triv@purs@anglecases}:{39*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-39)--(GB-39) arc ({39*\triv@purs@anglecases}:{41*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-41) arc ({41*\triv@purs@anglecases}:{39*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; }% {}% %si on affiche les icones @@ -556,7 +931,7 @@ \NewDocumentCommand\FillCellTrivial{ m m m }{%deb + fin + numcouleur \ifboolKV[TrivPursEN]{Colors}% {% - \filldraw[{\triv@purs@lstcol[#3]}] (PB-#1)--(GB-#1) arc ({#1*\triv@purs@anglecases}:{#2*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-#2) arc ({#2*\triv@purs@anglecases}:{#1*\triv@purs@anglecases}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (PB-#1)--(GB-#1) arc ({#1*\triv@purs@anglecases}:{#2*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-#2) arc ({#2*\triv@purs@anglecases}:{#1*\triv@purs@anglecases}:{\triv@purs@rayonint}); }% {}% \ifboolKV[TrivPursEN]{Icons}% @@ -575,17 +950,17 @@ \xdef\tmpcaseap{\xinteval{#2+1}}% \xintifboolexpr{#2 > 1 'and' #2 < 5}% {% - \filldraw[{\triv@purs@lstcol[#3]}] (C-#1-\tmpcase)--(D-#1-\tmpcase)--(D-#1-#2)--(C-#1-#2)--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (C-#1-\tmpcase)--(D-#1-\tmpcase)--(D-#1-#2)--(C-#1-#2)--cycle ; }% {}% \xintifboolexpr{#2 == 5}% {% \xintifboolexpr{#1 == 1}% {% - \filldraw[{\triv@purs@lstcol[#3]}] (C-#1-\tmpcase)--(D-#1-\tmpcase)--(OM-#1)--(OM-6)--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (C-#1-\tmpcase)--(D-#1-\tmpcase)--(OM-#1)--(OM-6)--cycle ; }% {% - \filldraw[{\triv@purs@lstcol[#3]}] (C-#1-\tmpcase)--(D-#1-\tmpcase)--(OM-#1)--(OM-\tmpnivav)--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (C-#1-\tmpcase)--(D-#1-\tmpcase)--(OM-#1)--(OM-\tmpnivav)--cycle ; }% }% {}% @@ -593,12 +968,12 @@ {% \xintifboolexpr{#1 == 1}% {% - \filldraw[{\triv@purs@lstcol[#3]}] (C-1-1)--(PB-\triv@purs@numcasavant) arc({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-1-1)--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (C-1-1)--(PB-\triv@purs@numcasavant) arc({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-1-1)--cycle ; }% {% \xdef\tmp@ii{\xinteval{(-1+8*(#1-1))}}% \xdef\tmp@jj{\xinteval{(\tmp@ii+2)}}% - \filldraw[{\triv@purs@lstcol[#3]}] (C-#1-1)--(PB-\tmp@ii) arc({\tmp@ii*\triv@purs@anglecases}:{\tmp@jj*\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-#1-1)--cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[#3]}] (C-#1-1)--(PB-\tmp@ii) arc({\tmp@ii*\triv@purs@anglecases}:{\tmp@jj*\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-#1-1)--cycle ; }% }% {}% @@ -766,7 +1141,7 @@ \begin{scope}[shift={(0:{0.15*\triv@purs@lgcamemb})}] \ifboolKV[TrivPursEN]{Colors}% {% - \filldraw[{\triv@purs@lstcol[1]}] (0,0)--({-30}:{0.765*\triv@purs@lgcamemb}) arc (-30:30:{0.765*\triv@purs@lgcamemb}) -- cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (0,0)--({-30}:{0.765*\triv@purs@lgcamemb}) arc (-30:30:{0.765*\triv@purs@lgcamemb}) -- cycle ; }% {}% \draw[EpTraitsPlus] (0,0)--({-30}:{0.765*\triv@purs@lgcamemb}) arc (-30:30:{0.765*\triv@purs@lgcamemb}) -- cycle ; @@ -774,7 +1149,7 @@ \begin{scope}[shift={(60:{0.15*\triv@purs@lgcamemb})}] \ifboolKV[TrivPursEN]{Colors}% {% - \filldraw[{\triv@purs@lstcol[2]}] (0,0)--({30}:{0.765*\triv@purs@lgcamemb}) arc (30:90:{0.765*\triv@purs@lgcamemb}) -- cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (0,0)--({30}:{0.765*\triv@purs@lgcamemb}) arc (30:90:{0.765*\triv@purs@lgcamemb}) -- cycle ; }% {}% \draw[EpTraitsPlus] (0,0)--({30}:{0.765*\triv@purs@lgcamemb}) arc (30:90:{0.765*\triv@purs@lgcamemb}) -- cycle ; @@ -782,7 +1157,7 @@ \begin{scope}[shift={(120:{0.15*\triv@purs@lgcamemb})}] \ifboolKV[TrivPursEN]{Colors}% {% - \filldraw[{\triv@purs@lstcol[3]}] (0,0)--({90}:{0.765*\triv@purs@lgcamemb}) arc (90:150:{0.765*\triv@purs@lgcamemb}) -- cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (0,0)--({90}:{0.765*\triv@purs@lgcamemb}) arc (90:150:{0.765*\triv@purs@lgcamemb}) -- cycle ; }% {}% \draw[EpTraitsPlus] (0,0)--({90}:{0.765*\triv@purs@lgcamemb}) arc (90:150:{0.765*\triv@purs@lgcamemb}) -- cycle ; @@ -790,7 +1165,7 @@ \begin{scope}[shift={(180:{0.15*\triv@purs@lgcamemb})}] \ifboolKV[TrivPursEN]{Colors}% {% - \filldraw[{\triv@purs@lstcol[4]}] (0,0)--({150}:{0.765*\triv@purs@lgcamemb}) arc (150:210:{0.765*\triv@purs@lgcamemb}) -- cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (0,0)--({150}:{0.765*\triv@purs@lgcamemb}) arc (150:210:{0.765*\triv@purs@lgcamemb}) -- cycle ; }% {}% \draw[EpTraitsPlus] (0,0)--({150}:{0.765*\triv@purs@lgcamemb}) arc (150:210:{0.765*\triv@purs@lgcamemb}) -- cycle ; @@ -798,7 +1173,7 @@ \begin{scope}[shift={(240:{0.15*\triv@purs@lgcamemb})}] \ifboolKV[TrivPursEN]{Colors}% {% - \filldraw[{\triv@purs@lstcol[5]}] (0,0)--({210}:{0.765*\triv@purs@lgcamemb}) arc (210:270:{0.765*\triv@purs@lgcamemb}) -- cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (0,0)--({210}:{0.765*\triv@purs@lgcamemb}) arc (210:270:{0.765*\triv@purs@lgcamemb}) -- cycle ; }% {}% \draw[EpTraitsPlus] (0,0)--({210}:{0.765*\triv@purs@lgcamemb}) arc (210:270:{0.765*\triv@purs@lgcamemb}) -- cycle ; @@ -806,13 +1181,368 @@ \begin{scope}[shift={(300:{0.15*\triv@purs@lgcamemb})}] \ifboolKV[TrivPursEN]{Colors}% {% - \filldraw[{\triv@purs@lstcol[6]}] (0,0)--({270}:{0.765*\triv@purs@lgcamemb}) arc (270:330:{0.765*\triv@purs@lgcamemb}) -- cycle ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (0,0)--({270}:{0.765*\triv@purs@lgcamemb}) arc (270:330:{0.765*\triv@purs@lgcamemb}) -- cycle ; }% {}% \draw[EpTraitsPlus] (0,0)--({270}:{0.765*\triv@purs@lgcamemb}) arc (270:330:{0.765*\triv@purs@lgcamemb}) -- cycle ; \end{scope} } +%courte +\NewDocumentCommand\CreationNodesTrivialShort{}{%OK !!!!!!!!!!!!!! + %création des nœuds grand bord petit bord GB-i (et PB-i) + \coordinate (GB-1) at ({7.5}:{\triv@purs@rayon}) ; + \coordinate (PB-1) at ({7.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-2) at ({7.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-2) at ({7.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-3) at ({7.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-3) at ({7.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-4) at ({7.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-4) at ({7.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-5) at ({7.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-5) at ({7.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-6) at ({7.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-6) at ({7.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-7) at ({67.5}:{\triv@purs@rayon}) ; + \coordinate (PB-7) at ({67.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-8) at ({67.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-8) at ({67.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-9) at ({67.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-9) at ({67.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-10) at ({67.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-10) at ({67.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-11) at ({67.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-11) at ({67.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-12) at ({67.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-12) at ({67.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-13) at ({127.5}:{\triv@purs@rayon}) ; + \coordinate (PB-13) at ({127.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-14) at ({127.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-14) at ({127.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-15) at ({127.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-15) at ({127.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-16) at ({127.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-16) at ({127.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-17) at ({127.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-17) at ({127.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-18) at ({127.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-18) at ({127.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-19) at ({187.5}:{\triv@purs@rayon}) ; + \coordinate (PB-19) at ({187.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-20) at ({187.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-20) at ({187.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-21) at ({187.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-21) at ({187.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-22) at ({187.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-22) at ({187.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-23) at ({187.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-23) at ({187.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-24) at ({187.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-24) at ({187.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-25) at ({247.5}:{\triv@purs@rayon}) ; + \coordinate (PB-25) at ({247.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-26) at ({247.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-26) at ({247.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-27) at ({247.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-27) at ({247.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-28) at ({247.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-28) at ({247.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-29) at ({247.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-29) at ({247.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-30) at ({247.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-30) at ({247.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-31) at ({307.5}:{\triv@purs@rayon}) ; + \coordinate (PB-31) at ({307.5}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-32) at ({307.5+9}:{\triv@purs@rayon}) ; + \coordinate (PB-32) at ({307.5+9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-33) at ({307.5+2*9}:{\triv@purs@rayon}) ; + \coordinate (PB-33) at ({307.5+2*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-34) at ({307.5+3*9}:{\triv@purs@rayon}) ; + \coordinate (PB-34) at ({307.5+3*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-35) at ({307.5+4*9}:{\triv@purs@rayon}) ; + \coordinate (PB-35) at ({307.5+4*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + \coordinate (GB-36) at ({307.5+5*9}:{\triv@purs@rayon}) ; + \coordinate (PB-36) at ({307.5+5*9}:{\triv@purs@rayon-\triv@purs@hautcases}) ; + %tests ?!?! +% \foreach \i in {1,...,36}{%OK +% \draw[EpTraits,fill=teal] (GB-\i) circle[radius=1.75pt] node[font=\tiny\ttfamily] {GB-\i}; +% \draw[EpTraits,fill=purple] (PB-\i) circle[radius=1.75pt] node[font=\tiny\ttfamily] {PB-\i}; +% } + %création des nœuds pour la figure centrale, boucle pour les 1ers + le dernier + \foreach \i in {1,...,\triv@purs@nbcat}{% + \coordinate (OM-\i) at ({30+(\i-1)*60}:{\triv@purs@rayonhexag}) ; + %\draw[EpTraits,fill=orange] (OM-\i) circle[radius=1.75pt] node[font=\tiny\ttfamily] {OM-\i}; + }% + %les nœuds des cases verticales + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-1-\j) at ($(PB-1)!\tmp@coeff!(OM-1)$) ; + %\draw[EpTraits,fill=yellow] (D-1-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-1-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-2-\j) at ($(PB-6)!\tmp@coeff!(OM-1)$) ; + %\draw[EpTraits,fill=yellow] (D-2-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-2-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-3-\j) at ($(PB-7)!\tmp@coeff!(OM-2)$) ; + %\draw[EpTraits,fill=yellow] (D-3-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-3-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-4-\j) at ($(PB-12)!\tmp@coeff!(OM-2)$) ; + %\draw[EpTraits,fill=yellow] (D-4-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-4-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-5-\j) at ($(PB-13)!\tmp@coeff!(OM-3)$) ; + %\draw[EpTraits,fill=yellow] (D-5-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-5-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-6-\j) at ($(PB-18)!\tmp@coeff!(OM-3)$) ; + %\draw[EpTraits,fill=yellow] (D-6-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-5-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-7-\j) at ($(PB-19)!\tmp@coeff!(OM-4)$) ; + %\draw[EpTraits,fill=yellow] (D-7-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-7-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-8-\j) at ($(PB-24)!\tmp@coeff!(OM-4)$) ; + %\draw[EpTraits,fill=yellow] (D-8-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-8-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-9-\j) at ($(PB-25)!\tmp@coeff!(OM-5)$) ; + %\draw[EpTraits,fill=yellow] (D-9-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-9-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-10-\j) at ($(PB-30)!\tmp@coeff!(OM-5)$) ; + %\draw[EpTraits,fill=yellow] (D-10-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-10-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-11-\j) at ($(PB-31)!\tmp@coeff!(OM-6)$) ; + %\draw[EpTraits,fill=yellow] (D-11-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-11-\j}; + }% + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \xdef\tmp@coeff{\xintfloateval{\j/(\triv@purs@nbcat-1)}}% + \coordinate (D-12-\j) at ($(PB-36)!\tmp@coeff!(OM-6)$) ; + %\draw[EpTraits,fill=yellow] (D-12-\j) circle[radius=1.75pt] node[font=\tiny\ttfamily] {D-12-\j}; + }% +} + +\NewDocumentCommand\FillCellsBorderShort{}{% + %-------Vertical + %niveau 1 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (OM-6)--(OM-1)--(D-1-4)--(D-12-4)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-6)!0.5!(D-1-4)$) {\triv@purs@lsticons[2]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (D-12-4)--(D-1-4)--(D-1-3)--(D-12-3)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-12-4)!0.5!(D-1-3)$) {\triv@purs@lsticons[6]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (D-12-3)--(D-1-3)--(D-1-2)--(D-12-2)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-12-3)!0.5!(D-1-2)$) {\triv@purs@lsticons[5]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (D-12-2)--(D-1-2)--(D-1-1)--(D-12-1)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-12-2)!0.5!(D-1-1)$) {\triv@purs@lsticons[3]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (D-1-1)--(PB-1) arc({\triv@purs@anglecases}:{-\triv@purs@anglecases}:{\triv@purs@rayonint}) --(D-12-1)--cycle ; + \node[rotate={90},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-12-1)!0.5!(PB-1)$) {\triv@purs@lsticons[4]} ; + %niveau 2 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (OM-1)--(OM-2)--(D-3-4)--(D-2-4)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-1)!0.5!(D-3-4)$) {\triv@purs@lsticons[3]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (D-2-4)--(D-3-4)--(D-3-3)--(D-2-3)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-2-4)!0.5!(D-3-3)$) {\triv@purs@lsticons[1]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (D-2-3)--(D-3-3)--(D-3-2)--(D-2-2)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-2-3)!0.5!(D-3-2)$) {\triv@purs@lsticons[6]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (D-2-2)--(D-3-2)--(D-3-1)--(D-2-1)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-2-2)!0.5!(D-3-1)$) {\triv@purs@lsticons[4]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (D-3-1)--(PB-7) arc({67.5}:{52.5}:{\triv@purs@rayonint}) --(D-2-1)--cycle ; + \node[rotate={90+(8)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-2-1)!0.5!(PB-7)$) {\triv@purs@lsticons[5]} ; + %niveau 3 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (OM-2)--(OM-3)--(D-5-4)--(D-4-4)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-2)!0.5!(D-5-4)$) {\triv@purs@lsticons[4]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (D-4-4)--(D-5-4)--(D-5-3)--(D-4-3)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-4-4)!0.5!(D-5-3)$) {\triv@purs@lsticons[2]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (D-4-3)--(D-5-3)--(D-5-2)--(D-4-2)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-4-3)!0.5!(D-5-2)$) {\triv@purs@lsticons[1]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (D-4-2)--(D-5-2)--(D-5-1)--(D-4-1)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-4-2)!0.5!(D-5-1)$) {\triv@purs@lsticons[5]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (D-5-1)--(PB-13) arc({127.5}:{112.5}:{\triv@purs@rayonint}) --(D-4-1)--cycle ; + \node[rotate={90+(16)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-4-1)!0.5!(PB-13)$) {\triv@purs@lsticons[6]} ; + %niveau 4 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (OM-3)--(OM-4)--(D-7-4)--(D-6-4)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-3)!0.5!(D-7-4)$) {\triv@purs@lsticons[5]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (D-6-4)--(D-7-4)--(D-7-3)--(D-6-3)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-6-4)!0.5!(D-7-3)$) {\triv@purs@lsticons[3]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (D-6-3)--(D-7-3)--(D-7-2)--(D-6-2)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-6-3)!0.5!(D-7-2)$) {\triv@purs@lsticons[2]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (D-6-2)--(D-7-2)--(D-7-1)--(D-6-1)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-6-2)!0.5!(D-7-1)$) {\triv@purs@lsticons[6]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (D-7-1)--(PB-19) arc({187.5}:{172.5}:{\triv@purs@rayonint}) --(D-6-1)--cycle ; + \node[rotate={90+(24)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-6-1)!0.5!(PB-19)$) {\triv@purs@lsticons[1]} ; + %niveau 5 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (OM-4)--(OM-5)--(D-9-4)--(D-8-4)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-4)!0.5!(D-9-4)$) {\triv@purs@lsticons[6]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (D-8-4)--(D-9-4)--(D-9-3)--(D-8-3)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-8-4)!0.5!(D-9-3)$) {\triv@purs@lsticons[4]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (D-8-3)--(D-9-3)--(D-9-2)--(D-8-2)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-8-3)!0.5!(D-9-2)$) {\triv@purs@lsticons[3]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (D-8-2)--(D-9-2)--(D-9-1)--(D-8-1)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-8-2)!0.5!(D-9-1)$) {\triv@purs@lsticons[1]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (D-9-1)--(PB-25) arc({247.5}:{232.5}:{\triv@purs@rayonint}) --(D-8-1)--cycle ; + \node[rotate={90+(32)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-8-1)!0.5!(PB-25)$) {\triv@purs@lsticons[2]} ; + %niveau 6 vertical + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (OM-5)--(OM-6)--(D-11-4)--(D-10-4)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(OM-5)!0.5!(D-11-4)$) {\triv@purs@lsticons[1]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (D-10-4)--(D-11-4)--(D-11-3)--(D-10-3)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-10-4)!0.5!(D-11-3)$) {\triv@purs@lsticons[5]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (D-10-3)--(D-11-3)--(D-11-2)--(D-10-2)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-10-3)!0.5!(D-11-2)$) {\triv@purs@lsticons[4]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (D-10-2)--(D-11-2)--(D-11-1)--(D-10-1)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-10-2)!0.5!(D-11-1)$) {\triv@purs@lsticons[2]} ; + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (D-11-1)--(PB-31) arc({307.5}:{292.5}:{\triv@purs@rayonint}) --(D-10-1)--cycle ; + \node[rotate={90+(40)*\triv@purs@anglecases},scale={0.75*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ($(D-10-1)!0.5!(PB-31)$) {\triv@purs@lsticons[3]} ; + %--------BORDS !!! + \ifboolKV[TrivPursEN]{Colors}% + {% + %Secteur1 + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-1)--(GB-1) arc ({7.5+0*9}:{7.5+1*9}:{\triv@purs@rayon})--(PB-2) arc ({7.5+1*9}:{7.5+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-2)--(GB-2) arc ({7.5+1*9}:{7.5+2*9}:{\triv@purs@rayon})--(PB-3) arc ({7.5+2*9}:{7.5+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-4)--(GB-4) arc ({7.5+3*9}:{7.5+4*9}:{\triv@purs@rayon})--(PB-5) arc ({7.5+4*9}:{7.5+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-5)--(GB-5) arc ({7.5+4*9}:{7.5+5*9}:{\triv@purs@rayon})--(PB-6) arc ({7.5+5*9}:{7.5+4*9}:{\triv@purs@rayonint}); + %Secteur2 + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-7)--(GB-7) arc ({7.5+60+0*9}:{7.5+60+1*9}:{\triv@purs@rayon})--(PB-8) arc ({7.5+60+1*9}:{7.5+60+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-8)--(GB-8) arc ({7.5+60+1*9}:{7.5+60+2*9}:{\triv@purs@rayon})--(PB-9) arc ({7.5+60+2*9}:{7.5+60+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-10)--(GB-10) arc ({7.5+60+3*9}:{7.5+60+4*9}:{\triv@purs@rayon})--(PB-11) arc ({7.5+60+4*9}:{7.5+60+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-11)--(GB-11) arc ({7.5+60+4*9}:{7.5+60+5*9}:{\triv@purs@rayon})--(PB-12) arc ({7.5+60+5*9}:{7.5+60+4*9}:{\triv@purs@rayonint}); + %Secteur3 + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-13)--(GB-13) arc ({7.5+120+0*9}:{7.5+120+1*9}:{\triv@purs@rayon})--(PB-14) arc ({7.5+120+1*9}:{7.5+120+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-14)--(GB-14) arc ({7.5+120+1*9}:{7.5+120+2*9}:{\triv@purs@rayon})--(PB-15) arc ({7.5+120+2*9}:{7.5+120+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-16)--(GB-16) arc ({7.5+120+3*9}:{7.5+120+4*9}:{\triv@purs@rayon})--(PB-17) arc ({7.5+120+4*9}:{7.5+120+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-17)--(GB-17) arc ({7.5+120+4*9}:{7.5+120+5*9}:{\triv@purs@rayon})--(PB-18) arc ({7.5+120+5*9}:{7.5+120+4*9}:{\triv@purs@rayonint}); + %Secteur4 + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-19)--(GB-19) arc ({7.5+180+0*9}:{7.5+180+1*9}:{\triv@purs@rayon})--(PB-20) arc ({7.5+180+1*9}:{7.5+180+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-20)--(GB-20) arc ({7.5+180+1*9}:{7.5+180+2*9}:{\triv@purs@rayon})--(PB-21) arc ({7.5+180+2*9}:{7.5+180+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-22)--(GB-22) arc ({7.5+180+3*9}:{7.5+180+4*9}:{\triv@purs@rayon})--(PB-23) arc ({7.5+180+4*9}:{7.5+180+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-23)--(GB-23) arc ({7.5+180+4*9}:{7.5+180+5*9}:{\triv@purs@rayon})--(PB-24) arc ({7.5+180+5*9}:{7.5+180+4*9}:{\triv@purs@rayonint}); + %Secteur5 + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-25)--(GB-25) arc ({7.5+240+0*9}:{7.5+240+1*9}:{\triv@purs@rayon})--(PB-26) arc ({7.5+240+1*9}:{7.5+240+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-26)--(GB-26) arc ({7.5+240+1*9}:{7.5+240+2*9}:{\triv@purs@rayon})--(PB-27) arc ({7.5+240+2*9}:{7.5+240+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-28)--(GB-28) arc ({7.5+240+3*9}:{7.5+240+4*9}:{\triv@purs@rayon})--(PB-29) arc ({7.5+240+4*9}:{7.5+240+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-29)--(GB-29) arc ({7.5+240+4*9}:{7.5+240+5*9}:{\triv@purs@rayon})--(PB-30) arc ({7.5+240+5*9}:{7.5+240+4*9}:{\triv@purs@rayonint}); + %Secteur6 + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-31)--(GB-31) arc ({7.5+300+0*9}:{7.5+300+1*9}:{\triv@purs@rayon})--(PB-32) arc ({7.5+300+1*9}:{7.5+300+0*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-32)--(GB-32) arc ({7.5+300+1*9}:{7.5+300+2*9}:{\triv@purs@rayon})--(PB-33) arc ({7.5+300+2*9}:{7.5+300+1*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-34)--(GB-34) arc ({7.5+300+3*9}:{7.5+300+4*9}:{\triv@purs@rayon})--(PB-35) arc ({7.5+300+4*9}:{7.5+300+3*9}:{\triv@purs@rayonint}); + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-35)--(GB-35) arc ({7.5+300+4*9}:{7.5+300+5*9}:{\triv@purs@rayon})--(PB-36) arc ({7.5+300+5*9}:{7.5+300+4*9}:{\triv@purs@rayonint}); + }% + {}% + \ifboolKV[TrivPursEN]{Icons}% + {% + %secteur1 + \node[rotate={90+0.5*(7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + \node[rotate={90+0.5*(7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + \node[rotate={90+0.5*(7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + \node[rotate={90+0.5*(7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + %secteur2 + \node[rotate={90+0.5*(2*60+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*60+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + \node[rotate={90+0.5*(2*60+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*60+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + \node[rotate={90+0.5*(2*60+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*60+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + \node[rotate={90+0.5*(2*60+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*60+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + %secteur3 + \node[rotate={90+0.5*(2*120+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*120+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + \node[rotate={90+0.5*(2*120+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*120+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + \node[rotate={90+0.5*(2*120+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*120+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + \node[rotate={90+0.5*(2*120+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*120+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + %secteur4 + \node[rotate={90+0.5*(2*180+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*180+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + \node[rotate={90+0.5*(2*180+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*180+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + \node[rotate={90+0.5*(2*180+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*180+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + \node[rotate={90+0.5*(2*180+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*180+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + %secteur5 + \node[rotate={90+0.5*(2*240+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*240+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + \node[rotate={90+0.5*(2*240+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*240+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + \node[rotate={90+0.5*(2*240+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*240+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + \node[rotate={90+0.5*(2*240+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*240+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + %secteur6 + \node[rotate={90+0.5*(2*300+7.5+0*9+7.5+1*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*300+7.5+7.5+1*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + \node[rotate={90+0.5*(2*300+7.5+1*9+7.5+2*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*300+7.5+1*9+7.5+2*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + \node[rotate={90+0.5*(2*300+7.5+3*9+7.5+4*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*300+7.5+3*9+7.5+4*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + \node[rotate={90+0.5*(2*300+7.5+5*9+7.5+5*9)},scale={\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0.5*(2*300+7.5+4*9+7.5+5*9)}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + }% + {}% + + %les jokers + \ifboolKV[TrivPursEN]{Icons}% + {% + \ifboolKV[TrivPursEN]{Jokers}% + {% + \node[rotate=30,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({30}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=90,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({90}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=150,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({150}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=210,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({210}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=270,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({270}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + \node[rotate=330,scale={\triv@purs@scaleicons*\triv@purs@hautcases}] at ({330}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@iconjok} ; + }% + {}% + }% + {}% +} +\NewDocumentCommand\DrawBordersTrivialShort{ }{%OK Court + %les tracés des cases + \draw[EpTraits] (0,0) circle[radius=\triv@purs@rayon] ; + \draw[EpTraits] (0,0) circle[radius={\triv@purs@rayon-\triv@purs@hautcases}] ; + \foreach \i in {1,...,36}{% + \draw[EpTraits] (PB-\i)--(GB-\i) ; + } + \draw[EpTraits] (PB-1)--(OM-1)--(OM-6)--(PB-36) ; + \draw[EpTraits] (PB-6)--(OM-1)--(OM-2)--(PB-7) ; + \draw[EpTraits] (PB-12)--(OM-2)--(OM-3)--(PB-13) ; + \draw[EpTraits] (PB-18)--(OM-3)--(OM-4)--(PB-19) ; + \draw[EpTraits] (PB-24)--(OM-4)--(OM-5)--(PB-25) ; + \draw[EpTraits] (PB-30)--(OM-5)--(OM-6)--(PB-31) ; + \foreach \j in {1,...,\xinteval{\triv@purs@nbcat-2}}{% + \draw[EpTraits] (D-2-\j)--(D-3-\j) ; + \draw[EpTraits] (D-4-\j)--(D-5-\j) ; + \draw[EpTraits] (D-6-\j)--(D-7-\j) ; + \draw[EpTraits] (D-8-\j)--(D-9-\j) ; + \draw[EpTraits] (D-10-\j)--(D-11-\j) ; + \draw[EpTraits] (D-12-\j)--(D-1-\j) ; + }% +} + +\NewDocumentCommand\FillCamembersTrivialShort{ }{%numéro des camemberts, en partant de la droite + \ifboolKV[TrivPursEN]{Colors}% + {% + %Couleur du 1er camembert + \draw[EpTraits,fill={\triv@purs@lstcol[1]}] (PB-36)--(GB-36) arc ({-\triv@purs@anglecases}:{\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-1) arc ({\triv@purs@anglecases}:{-\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 2ème + \draw[EpTraits,fill={\triv@purs@lstcol[2]}] (PB-6)--(GB-6) arc ({7*\triv@purs@anglecases}:{9*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-7) arc ({9*\triv@purs@anglecases}:{7*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 3ème + \draw[EpTraits,fill={\triv@purs@lstcol[3]}] (PB-12)--(GB-12) arc ({15*\triv@purs@anglecases}:{17*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-13) arc ({17*\triv@purs@anglecases}:{15*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 4ème + \draw[EpTraits,fill={\triv@purs@lstcol[4]}] (PB-18)--(GB-18) arc ({23*\triv@purs@anglecases}:{25*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-19) arc ({25*\triv@purs@anglecases}:{23*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 5ème + \draw[EpTraits,fill={\triv@purs@lstcol[5]}] (PB-24)--(GB-24) arc ({31*\triv@purs@anglecases}:{33*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-25) arc ({33*\triv@purs@anglecases}:{31*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + %Couleur du 6ème + \draw[EpTraits,fill={\triv@purs@lstcol[6]}] (PB-30)--(GB-30) arc ({39*\triv@purs@anglecases}:{41*\triv@purs@anglecases}:{\triv@purs@rayon})--(PB-31) arc ({41*\triv@purs@anglecases}:{39*\triv@purs@anglecases}:{\triv@purs@rayonint})--cycle ; + }% + {}% + %si on affiche les icones + \ifboolKV[TrivPursEN]{Icons}% + {% + \node[rotate={90+0*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({0}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[1]} ; + \node[rotate={90+8*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({8*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[2]} ; + \node[rotate={90+16*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({16*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[3]} ; + \node[rotate={90+24*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({24*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[4]} ; + \node[rotate={90+32*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({32*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[5]} ; + \node[rotate={90+40*\triv@purs@anglecases},scale={1.5*\triv@purs@scaleicons*\triv@purs@hautcases},anchor=center] at ({40*\triv@purs@anglecases}:{\triv@purs@rayon-0.5*\triv@purs@hautcases}) {\triv@purs@lsticons[6]} ; + }% + {}% +} + %====CREATION \NewDocumentCommand\BoardTrivialPursuit{ O{} D<>{} }{% \restoreKV[TrivPursEN]% revenir au valeurs par défaut @@ -848,18 +1578,35 @@ \useasboundingbox (0,0) circle[radius={\triv@purs@rayon}] ; %création \begin{scope}[rotate=\triv@purs@rotate] - %les nœuds OK - \CreationNodesTrivial - %test avec centre OK - \ifboolKV[TrivPursEN]{Center}{\FillCenterTrivial}{} - %camemberts OK - \FillCamembersTrivial - %cases OK - \FillCellsBorder - %bordures - \DrawBordersTrivial - %logo central - \ifboolKV[TrivPursEN]{Logo}{\LogoCenterTrivialPursuit}{} + \ifboolKV[TrivPursEN]{ShortVersion}% + {% + %les nœuds OK + \CreationNodesTrivialShort + %test avec centre OK + \ifboolKV[TrivPursEN]{Center}{\FillCenterTrivial}{} + %camemberts OK + \FillCamembersTrivialShort + %cases OK + \FillCellsBorderShort + %bordures + \DrawBordersTrivialShort + %logo central + \ifboolKV[TrivPursEN]{Logo}{\LogoCenterTrivialPursuit}{} + }% + {% + %les nœuds OK + \CreationNodesTrivial + %test avec centre OK + \ifboolKV[TrivPursEN]{Center}{\FillCenterTrivial}{} + %camemberts OK + \FillCamembersTrivial + %cases OK + \FillCellsBorder + %bordures + \DrawBordersTrivial + %logo central + \ifboolKV[TrivPursEN]{Logo}{\LogoCenterTrivialPursuit}{} + }% \end{scope} \end{tikzpicture}% } diff --git a/graphics/pgf/contrib/wheelchart/README.md b/graphics/pgf/contrib/wheelchart/README.md index ec414f3440..df9f81a74d 100644 --- a/graphics/pgf/contrib/wheelchart/README.md +++ b/graphics/pgf/contrib/wheelchart/README.md @@ -2,9 +2,11 @@ ## Diagrams with circular or other shapes using Ti*k*Z and LaTeX3 -Version 3.0 (2024/03/08) +Version 4.0 (2024/07/28) -This package is based on the package [Ti*k*Z](https://ctan.org/pkg/pgf) and can be used to draw various kinds of diagrams such as a bar chart, doughnut chart, infographic, pie chart, ring chart, square chart, sunburst chart, waffle chart and wheel chart with Ti*k*Z. It provides several options to customize the diagrams. It is also possible to specify a plot for the shape of the chart. Furthermore a legend can be added and the table of contents can be displayed as one of these diagrams. +This package is based on the package [Ti*k*Z](https://ctan.org/pkg/pgf) and can be used to draw various kinds of diagrams such as bar charts, doughnut charts, infographics, pie charts, ring charts, square charts, sunburst charts, waffle charts and wheel charts. + +It provides several options to customize the diagrams. It is also possible to specify a plot for the shape of the chart. Furthermore a legend can be added and the table of contents can be displayed as one of these diagrams. %% README.md %% Copyright 2022-2024 Matthias Floré diff --git a/graphics/pgf/contrib/wheelchart/wheelchart.pdf b/graphics/pgf/contrib/wheelchart/wheelchart.pdf Binary files differindex 2cfa0dd1be..808551f33c 100644 --- a/graphics/pgf/contrib/wheelchart/wheelchart.pdf +++ b/graphics/pgf/contrib/wheelchart/wheelchart.pdf diff --git a/graphics/pgf/contrib/wheelchart/wheelchart.sty b/graphics/pgf/contrib/wheelchart/wheelchart.sty index e2c8543976..21e232b099 100644 --- a/graphics/pgf/contrib/wheelchart/wheelchart.sty +++ b/graphics/pgf/contrib/wheelchart/wheelchart.sty @@ -18,7 +18,7 @@ \NeedsTeXFormat{LaTeX2e} \RequirePackage{tikz} \usetikzlibrary{calc} -\ProvidesExplPackage{wheelchart}{2024/03/08}{3.0}{Diagrams with circular or other shapes using TikZ and LaTeX3} +\ProvidesExplPackage{wheelchart}{2024/07/28}{4.0}{Diagrams with circular or other shapes using TikZ and LaTeX3} %%> \subsection{Variables} @@ -59,6 +59,8 @@ \fp_const:Nn \c__wheelchart_arc_data_end_factor_left_fp { 1 } \fp_const:Nn \c__wheelchart_arc_data_end_factor_right_fp { 0 } \fp_new:N \l__wheelchart_arc_data_line_sep_factor_fp +\fp_new:N \l__wheelchart_arc_data_lines_pos_fp +\fp_new:N \l__wheelchart_arc_data_lines_shift_fp \fp_new:N \l__wheelchart_arc_data_pos_fp \fp_new:N \l__wheelchart_arc_data_radius_plot_false_fp \fp_new:N \l__wheelchart_arc_data_sep_fp @@ -168,6 +170,9 @@ \int_new:N \l__wheelchart_lines_ext_top_dir_int \int_new:N \l__wheelchart_max_list_items_int +\regex_const:Nn \c__wheelchart_braces_regex { \{(.+)\} } +\regex_const:Nn \c__wheelchart_key_braces_regex { [\w\s]+\{(.+)\} } + \seq_new:N \l__wheelchart_arc_data_seq \seq_new:N \l__wheelchart_discrete_coefficients_first_seq \seq_new:N \l__wheelchart_discrete_coefficients_second_seq @@ -180,8 +185,8 @@ { sign ( \l__wheelchart_arc_data_dir_fp ) * ( - \cs:w c__wheelchart_arc_data_start_factor_\l__wheelchart_arc_data_align_tl _fp\cs_end: - + \cs:w c__wheelchart_arc_data_end_factor_\l__wheelchart_arc_data_align_tl _fp\cs_end: + \cs:w c__wheelchart_arc_data_start_factor_\l__wheelchart_arc_data_align_tl _fp \cs_end: + + \cs:w c__wheelchart_arc_data_end_factor_\l__wheelchart_arc_data_align_tl _fp \cs_end: ) } \tl_new:N \l__wheelchart_arc_data_align_tl @@ -262,7 +267,7 @@ \cs_new_protected:Npn \__wheelchart_caption_and_title:nnnnn #1#2#3#4#5 { - \__wheelchart_if_text:nn {#1} + \__wheelchart_if_text:nnn {#1} { o } { \node [ anchor = #2 , align = #3 , / wheelchart / #1_style ] at ( $ (#4) + ( 0 , { #5 * ( \pgfkeysvalueof { / wheelchart / #1~sep } ) } ) $ ) @@ -282,12 +287,12 @@ { \fp_eval:n { - ( 1 - (#1) ) * \cs:w g__wheelchart_slice_inner_start_angle_\WCcount _fp\cs_end: - + (#1) * \cs:w g__wheelchart_slice_inner_end_angle_\WCcount _fp\cs_end: + ( 1 - (#1) ) * \cs:w g__wheelchart_slice_inner_start_angle_\WCcount _fp \cs_end: + + (#1) * \cs:w g__wheelchart_slice_inner_end_angle_\WCcount _fp \cs_end: + \l__wheelchart_counter_or_clockwise_fp * (#2) } } - { \fp_eval:n { \cs:w g__wheelchart_inner_radius_\WCcount _fp\cs_end: - (#4) } } + { \fp_eval:n { \cs:w g__wheelchart_inner_radius_\WCcount _fp \cs_end: - (#4) } } ) ! { \fp_eval:n {#3} } ! ( @@ -295,12 +300,12 @@ { \fp_eval:n { - ( 1 - (#1) ) * \cs:w g__wheelchart_slice_outer_start_angle_\WCcount _fp\cs_end: - + (#1) * \cs:w g__wheelchart_slice_outer_end_angle_\WCcount _fp\cs_end: + ( 1 - (#1) ) * \cs:w g__wheelchart_slice_outer_start_angle_\WCcount _fp \cs_end: + + (#1) * \cs:w g__wheelchart_slice_outer_end_angle_\WCcount _fp \cs_end: + \l__wheelchart_counter_or_clockwise_fp * (#2) } } - { \fp_eval:n { \cs:w g__wheelchart_outer_radius_\WCcount _fp\cs_end: + (#4) } } + { \fp_eval:n { \cs:w g__wheelchart_outer_radius_\WCcount _fp \cs_end: + (#4) } } ) $%note the () around the #i's to keep these contents together } @@ -374,10 +379,10 @@ \path let \p { l__wheelchart_def_angle_1 } = \__wheelchart_point_plot_true:nnnnn { \WCcount } {#1} {#2} { 0 } - { \fp_eval:n { (#4) + 1 / \cs:w g__wheelchart_samples_\WCcount _fp\cs_end: } } , + { \fp_eval:n { (#4) + 1 / \cs:w g__wheelchart_samples_\WCcount _fp \cs_end: } } , \p { l__wheelchart_def_angle_2 } = \__wheelchart_point_plot_true:nnnnn { \WCcount } {#1} {#2} { 1 } - { \fp_eval:n { (#4) + 1 / \cs:w g__wheelchart_samples_\WCcount _fp\cs_end: } } + { \fp_eval:n { (#4) + 1 / \cs:w g__wheelchart_samples_\WCcount _fp \cs_end: } } in [ / utils / exec = { \__wheelchart_def_angle_aux: } ] ; } @@ -392,10 +397,10 @@ { ( 1 - (#2) ) * ( - \cs:w g__wheelchart_slice_outer_start_angle_#1_fp\cs_end: - - \cs:w g__wheelchart_slice_inner_start_angle_#1_fp\cs_end: + \cs:w g__wheelchart_slice_outer_start_angle_#1_fp \cs_end: + - \cs:w g__wheelchart_slice_inner_start_angle_#1_fp \cs_end: ) - + (#2) * ( \cs:w g__wheelchart_slice_outer_end_angle_#1_fp\cs_end: - \cs:w g__wheelchart_slice_inner_end_angle_#1_fp\cs_end: ) + + (#2) * ( \cs:w g__wheelchart_slice_outer_end_angle_#1_fp \cs_end: - \cs:w g__wheelchart_slice_inner_end_angle_#1_fp \cs_end: ) } \cs_new:Npn \__wheelchart_def_angle_plot_false:nnnnn #1#2#3#4#5 @@ -410,11 +415,11 @@ ( sqrt ( - ( \cs:w g__wheelchart_outer_radius_#1_fp\cs_end: + \cs:w g__wheelchart_inner_radius_#1_fp\cs_end: ) ^ 2 - - \cs:w g__wheelchart_outer_radius_#1_fp\cs_end: * \cs:w g__wheelchart_inner_radius_#1_fp\cs_end: * + ( \cs:w g__wheelchart_outer_radius_#1_fp \cs_end: + \cs:w g__wheelchart_inner_radius_#1_fp \cs_end: ) ^ 2 + - \cs:w g__wheelchart_outer_radius_#1_fp \cs_end: * \cs:w g__wheelchart_inner_radius_#1_fp \cs_end: * ( 2 + 2 * cosd ( \__wheelchart_def_angle_plot_false_aux_angle:nn {#1} {#2} ) - + \cs:w g__wheelchart_outer_radius_#1_fp\cs_end: * \cs:w g__wheelchart_inner_radius_#1_fp\cs_end: + + \cs:w g__wheelchart_outer_radius_#1_fp \cs_end: * \cs:w g__wheelchart_inner_radius_#1_fp \cs_end: * ( ( @@ -425,25 +430,25 @@ ) ) ) - + \cs:w g__wheelchart_inner_radius_#1_fp\cs_end: * + + \cs:w g__wheelchart_inner_radius_#1_fp \cs_end: * ( - \cs:w g__wheelchart_inner_radius_#1_fp\cs_end: - - \cs:w g__wheelchart_outer_radius_#1_fp\cs_end: + \cs:w g__wheelchart_inner_radius_#1_fp \cs_end: + - \cs:w g__wheelchart_outer_radius_#1_fp \cs_end: * cosd ( \__wheelchart_def_angle_plot_false_aux_angle:nn {#1} {#2} ) ) / \__wheelchart_def_radius:nnn {#1} {#4} {#5} ) - * \cs:w g__wheelchart_outer_radius_#1_fp\cs_end: * sind ( \__wheelchart_def_angle_plot_false_aux_angle:nn {#1} {#2} ) + * \cs:w g__wheelchart_outer_radius_#1_fp \cs_end: * sind ( \__wheelchart_def_angle_plot_false_aux_angle:nn {#1} {#2} ) / ( - ( \cs:w g__wheelchart_outer_radius_#1_fp\cs_end: + \cs:w g__wheelchart_inner_radius_#1_fp\cs_end: ) ^ 2 - - 2 * \cs:w g__wheelchart_outer_radius_#1_fp\cs_end: * \cs:w g__wheelchart_inner_radius_#1_fp\cs_end: + ( \cs:w g__wheelchart_outer_radius_#1_fp \cs_end: + \cs:w g__wheelchart_inner_radius_#1_fp \cs_end: ) ^ 2 + - 2 * \cs:w g__wheelchart_outer_radius_#1_fp \cs_end: * \cs:w g__wheelchart_inner_radius_#1_fp \cs_end: * ( 1 + cosd ( \__wheelchart_def_angle_plot_false_aux_angle:nn {#1} {#2} ) ) ) ) } - + ( 1 - (#2) ) * ( \cs:w g__wheelchart_slice_inner_start_angle_#1_fp\cs_end: ) - + (#2) * ( \cs:w g__wheelchart_slice_inner_end_angle_#1_fp\cs_end: ) + + ( 1 - (#2) ) * ( \cs:w g__wheelchart_slice_inner_start_angle_#1_fp \cs_end: ) + + (#2) * ( \cs:w g__wheelchart_slice_inner_end_angle_#1_fp \cs_end: ) + \l__wheelchart_counter_or_clockwise_fp * (#3) } } @@ -451,7 +456,7 @@ \cs_new_protected:Npn \__wheelchart_def_coord:nnnn #1#2#3#4 { \path let \p { l__wheelchart_coord } = - ( \cs:w __wheelchart_#2_plot:nn\cs_end: {#4} { \fp_use:c { g__wheelchart_#2_radius_\WCcount _fp } } ) + ( \cs:w __wheelchart_#2_plot:nn \cs_end: {#4} { \fp_use:c { g__wheelchart_#2_radius_\WCcount _fp } } ) in [ / utils / exec = @@ -484,11 +489,11 @@ < \l__wheelchart_gap_fp ? - min ( \cs:w g__wheelchart_abs_half_angle_minus_new_angle_\WCcount _fp\cs_end: , \l__wheelchart_gap_max_angle_def_fp ) + min ( \cs:w g__wheelchart_abs_half_angle_minus_new_angle_\WCcount _fp \cs_end: , \l__wheelchart_gap_max_angle_def_fp ) : asind ( min ( \l__wheelchart_gap_fp / ( (#2) + 1 - sign (#2) ) , 1 ) ) + \l__wheelchart_gap_polar_fp - %note the min ( ... , 1 ) such that the asind is always defined - %also note the + 1 - sign (#2) such that the denominator is also nonzero if #2 = 0 + %note the min ( ... , 1 ) so that the asind is always defined + %also note the + 1 - sign (#2) so that the denominator is also nonzero if #2 = 0 } } @@ -516,7 +521,7 @@ : \g__wheelchart_new_angle_fp - \g__wheelchart_angle_fp ) - / \cs:w g__wheelchart_samples_1_fp\cs_end: + / \cs:w g__wheelchart_samples_1_fp \cs_end: } \path let \p { l__wheelchart_slices_orientation_1 } = @@ -579,8 +584,8 @@ { \fp_eval:n { - ( 1 - (#2) ) * ( \cs:w g__wheelchart_inner_radius_#1_fp\cs_end: - (#3) ) - + (#2) * ( \cs:w g__wheelchart_outer_radius_#1_fp\cs_end: + (#3) ) + ( 1 - (#2) ) * ( \cs:w g__wheelchart_inner_radius_#1_fp \cs_end: - (#3) ) + + (#2) * ( \cs:w g__wheelchart_outer_radius_#1_fp \cs_end: + (#3) ) } } @@ -591,26 +596,26 @@ { \fp_gset:cn { g__wheelchart_slice_#1_#2_angle_\WCcount _fp } { - \cs:w g__wheelchart_#3angle_fp\cs_end: + + \cs:w g__wheelchart_#3angle_fp \cs_end: + ( \l__wheelchart_counter_or_clockwise_fp * - ( (#4) * \cs:w g__wheelchart_#1_gap_\WCcount _fp\cs_end: + \cs:w l__wheelchart_slices_#1_#2_angle_shift_fp\cs_end: ) + ( (#4) * \cs:w g__wheelchart_#1_gap_\WCcount _fp \cs_end: + \cs:w l__wheelchart_slices_#1_#2_angle_shift_fp \cs_end: ) ) } } { \fp_gset:cn { g__wheelchart_slice_#1_#2_angle_\WCcount _fp } { - \cs:w g__wheelchart_#3angle_fp\cs_end: + + \cs:w g__wheelchart_#3angle_fp \cs_end: + ( \l__wheelchart_counter_or_clockwise_fp * ( - (#4) * \cs:w g__wheelchart_#1_gap_\WCcount _fp\cs_end: + \cs:w l__wheelchart_slices_#1_#2_angle_shift_fp\cs_end: + (#4) * \cs:w g__wheelchart_#1_gap_\WCcount _fp \cs_end: + \cs:w l__wheelchart_slices_#1_#2_angle_shift_fp \cs_end: - asind ( - \cs:w g__wheelchart_inner_radius_\WCcount _fp\cs_end: - * sind ( \cs:w l__wheelchart_slices_#1_#2_angle_shift_fp\cs_end: ) - / \cs:w g__wheelchart_outer_radius_\WCcount _fp\cs_end: + \cs:w g__wheelchart_inner_radius_\WCcount _fp \cs_end: + * sind ( \cs:w l__wheelchart_slices_#1_#2_angle_shift_fp \cs_end: ) + / \cs:w g__wheelchart_outer_radius_\WCcount _fp \cs_end: ) ) ) @@ -620,8 +625,8 @@ \cs_new_protected:Npn \__wheelchart_def_slice_keys:n #1 { - {%note the double {{...}} such that the contents is in a group - %such that pgfkeys which are specific to the current slice are local for this slice + {%note the double braces {{...}} so that the contents is in a group + %and in particular, pgfkeys which are specific to the current slice are local for this slice \clist_if_in:NVT \l__wheelchart_slice_range_local_clist \WCcount { \pgfkeys { / wheelchart , slice_final /. expanded = { \exp_not:v { l__wheelchart_slice_\WCcount _keys_clist } } } @@ -663,24 +668,24 @@ %g__wheelchart_WCcount_counter to be larger than \WCtotalcount \tl_build_end:N \WClegend \cs_set:Npn \WCcount { \theg__wheelchart_WCcount_counter } - \cs_set:Npn \WCpercentage { \cs:w l__wheelchart_WCpercentage_\theg__wheelchart_WCcount_counter\cs_end: } - \cs_set:Npn \WCpercentagerounded { \cs:w l__wheelchart_WCpercentagerounded_\theg__wheelchart_WCcount_counter\cs_end: } + \cs_set:Npn \WCpercentage { \cs:w l__wheelchart_WCpercentage_\theg__wheelchart_WCcount_counter \cs_end: } + \cs_set:Npn \WCpercentagerounded { \cs:w l__wheelchart_WCpercentagerounded_\theg__wheelchart_WCcount_counter \cs_end: } \str_if_eq:eeTF { \l__wheelchart_type_tl } { etoc } { \cs_set:Npn \WCetocthelinkedname - { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_linked_name_\theg__wheelchart_WCcount_counter\cs_end: } + { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_linked_name_\theg__wheelchart_WCcount_counter \cs_end: } \cs_set:Npn \WCetocthelinkednumber - { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_linked_number_\theg__wheelchart_WCcount_counter\cs_end: } + { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_linked_number_\theg__wheelchart_WCcount_counter \cs_end: } \cs_set:Npn \WCetocthelinkedpage - { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_linked_page_\theg__wheelchart_WCcount_counter\cs_end: } + { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_linked_page_\theg__wheelchart_WCcount_counter \cs_end: } \cs_set:Npn \WCetocthename - { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_name_\theg__wheelchart_WCcount_counter\cs_end: } + { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_name_\theg__wheelchart_WCcount_counter \cs_end: } \cs_set:Npn \WCetocthenumber - { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_number_\theg__wheelchart_WCcount_counter\cs_end: } + { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_number_\theg__wheelchart_WCcount_counter \cs_end: } \cs_set:Npn \WCetocthepage - { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_page_\theg__wheelchart_WCcount_counter\cs_end: } + { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_page_\theg__wheelchart_WCcount_counter \cs_end: } \cs_set:Npn \WCetocthenumberofpages - { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_number_of_pages_\theg__wheelchart_WCcount_counter\cs_end: } + { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _the_number_of_pages_\theg__wheelchart_WCcount_counter \cs_end: } } { \clist_if_empty:NTF \l__wheelchart_header_clist @@ -688,7 +693,7 @@ \int_step_inline:nn { \l__wheelchart_max_list_items_int } { \cs_set:cpn { WCvar\int_to_Alph:n {##1} } - { \cs:w l__wheelchart_item_WCvar\int_to_Alph:n {##1}_\theg__wheelchart_WCcount_counter\cs_end: } + { \cs:w l__wheelchart_item_WCvar\int_to_Alph:n {##1}_\theg__wheelchart_WCcount_counter \cs_end: } } } { @@ -717,13 +722,13 @@ ( atand ( - \cs:w g__wheelchart_#3_y_fp\cs_end: - \cs:w g__wheelchart_#4_y_fp\cs_end: , - \cs:w g__wheelchart_#3_x_fp\cs_end: - \cs:w g__wheelchart_#4_x_fp\cs_end: + \cs:w g__wheelchart_#3_y_fp \cs_end: - \cs:w g__wheelchart_#4_y_fp \cs_end: , + \cs:w g__wheelchart_#3_x_fp \cs_end: - \cs:w g__wheelchart_#4_x_fp \cs_end: ) - atand ( - \cs:w g__wheelchart_#1_y_fp\cs_end: - \cs:w g__wheelchart_#2_y_fp\cs_end: , - \cs:w g__wheelchart_#1_x_fp\cs_end: - \cs:w g__wheelchart_#2_x_fp\cs_end: + \cs:w g__wheelchart_#1_y_fp \cs_end: - \cs:w g__wheelchart_#2_y_fp \cs_end: , + \cs:w g__wheelchart_#1_x_fp \cs_end: - \cs:w g__wheelchart_#2_x_fp \cs_end: ) ) } @@ -969,9 +974,9 @@ \__wheelchart_for_loop:n { \pgfkeysvalueof { / wheelchart / before~slices } - \int_step_inline:nn { \fp_eval:n { round ( \cs:w g__wheelchart_value_\WCcount _fp\cs_end: ) } } - %note that \fp_eval:n { round ( ... ) } is necessary even when the value is an integer because if parse=pgfmath - %then .0 is added and then \int_step_inline:nn { \cs:w g__wheelchart_value_\WCcount _fp\cs_end: } would give the messages + \int_step_inline:nn { \fp_eval:n { round ( \cs:w g__wheelchart_value_\WCcount _fp \cs_end: ) } } + %note that \fp_eval:n { round ( ... ) } is necessary even when the value is an integer because pgfmath + %could have added .0 and then \int_step_inline:nn { \cs:w g__wheelchart_value_\WCcount _fp \cs_end: } would give the messages %Missing character: There is no . in font nullfont! Missing character: There is no 0 in font nullfont! { \int_gincr:N \g__wheelchart_discrete_count_int @@ -1082,7 +1087,7 @@ \cs_set:Npe \WCmidangle { \fp_use:c { g__wheelchart_WCmidangle_\WCcount _fp } } \pgfkeysvalueof { / wheelchart / for~loop~start }%this must be placed after the definition of macros such as \WCpercentage - %such that these macros can be used in the key for loop start + %so that these macros can be used in the key for loop start \begin { scope } [ shift = { ( \WCmidangle \c_colon_str \fp_use:c { g__wheelchart_explode_\WCcount _fp } ) } , @@ -1161,16 +1166,21 @@ \fp_gset:cn { g__wheelchart_#1_\WCcount _fp } { \pgfmathresult } } -\cs_new_protected:Npn \__wheelchart_if_text:nn #1#2 +\cs_new_protected:Npn \__wheelchart_if_text:nnn #1#2#3 { %https://tex.stackexchange.com/questions/42280/expand-away-empty-macros-within-ifthenelse %https://tex.stackexchange.com/questions/44919/proper-way-to-detect-empty-blank-text \begin { pgfinterruptpicture } + \DeclareDocumentCommand \\ {#2} {} + %for arc data, \\ is used with seq_set_split so has no optional argument thus then #2 is empty + %otherwise, #2 is o + %no s because an optional star does not apply in a node + %no ! because a space between \\ and its optional argument is allowed in a node %https://tex.stackexchange.com/questions/459853/savebox-within-tikzpicture-results-in-an-empty-savebox \hbox_gset:Nn \g__wheelchart_if_text_box { \pgfkeysvalueof { / wheelchart / #1 } } \end { pgfinterruptpicture } \dim_compare:nNnT { \box_wd:N \g__wheelchart_if_text_box } > { 0 pt } - { {#2} } + { {#3} } } \cs_new_protected:Npn \__wheelchart_initial:n #1 @@ -1182,7 +1192,7 @@ \tl_if_empty:nTF {#1} { \cs_set:Npn \WCtotalcount { 0 } } { - \cs:w seq_set_split:Ne\l__wheelchart_expand_list_tl\cs_end: + \cs:w seq_set_split:Ne\l__wheelchart_expand_list_tl \cs_end: \l__wheelchart_list_seq { \pgfkeysvalueof { / wheelchart / separator~rows } } {#1} @@ -1190,7 +1200,7 @@ \int_zero:N \l__wheelchart_max_list_items_int \seq_map_indexed_inline:Nn \l__wheelchart_list_seq { - \cs:w seq_set_split:Ne\l__wheelchart_expand_list_items_tl\cs_end: + \cs:w seq_set_split:Ne\l__wheelchart_expand_list_items_tl \cs_end: \l__wheelchart_list_items_seq { \pgfkeysvalueof { / wheelchart / separator~columns } } {##2} @@ -1245,7 +1255,7 @@ \etocsetnexttocdepth { -1 }%only for the next toc \etocsetstyle { \l__wheelchart_etoc_level_tl } {} {} { - \int_compare:nNnT { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _count_int\cs_end: } > { 0 } + \int_compare:nNnT { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _count_int \cs_end: } > { 0 } { \cs_gset:cpe { @@ -1304,7 +1314,7 @@ {} \int_gzero_new:c { g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _count_int } \pgfkeysvalueof { / wheelchart / etoc~code } - \int_compare:nNnT { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _count_int\cs_end: } > { 0 } + \int_compare:nNnT { \cs:w g__wheelchart_etoc_item_\l__wheelchart_etoc_name_tl _count_int \cs_end: } > { 0 } { \cs_gset:cpe { @@ -1331,32 +1341,32 @@ { \__wheelchart_def_slice_keys:n { \__wheelchart_gdef_count_fp:nn { value } { value } } - \cs_set:Npe \WCtotalnum { \fp_eval:n { \WCtotalnum + \cs:w g__wheelchart_value_\WCcount _fp\cs_end: } } + \cs_set:Npe \WCtotalnum { \fp_eval:n { \WCtotalnum + \cs:w g__wheelchart_value_\WCcount _fp \cs_end: } } } \int_step_inline:nn { \WCtotalcount } { \cs_set:cpe { l__wheelchart_WCpercentage_##1 } - { \fp_eval:n { \cs:w g__wheelchart_value_##1_fp\cs_end: / ( \WCtotalnum / 100 ) } } + { \fp_eval:n { \cs:w g__wheelchart_value_##1_fp \cs_end: / ( \WCtotalnum / 100 ) } } \cs_set:cpe { l__wheelchart_WCpercentagerounded_##1 } - { \fp_eval:n { round ( \cs:w l__wheelchart_WCpercentage_##1\cs_end: , \pgfkeysvalueof { / wheelchart / perc~precision } ) } } + { \fp_eval:n { round ( \cs:w l__wheelchart_WCpercentage_##1 \cs_end: , \pgfkeysvalueof { / wheelchart / perc~precision } ) } } } } \cs_new_protected:Npn \__wheelchart_inner_and_wheel_data:n #1 { - \__wheelchart_if_text:nn { #1~data } + \__wheelchart_if_text:nnn { #1~data } { o } { \__wheelchart_def_fp:nn { #1_data_angle_pos } { #1~data~angle~pos } \__wheelchart_def_fp:nn { #1_data_angle_shift } { #1~data~angle~shift } \__wheelchart_def_fp:nn { #1_data_pos } { #1~data~pos } \__wheelchart_def_fp:nn { #1_data_sep } { #1~data~sep } \node [ align = left , / wheelchart / #1_data_style ] at - \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn\cs_end: + \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn \cs_end: { \WCcount } - { \cs:w l__wheelchart_#1_data_angle_pos_fp\cs_end: } - { \cs:w l__wheelchart_#1_data_angle_shift_fp\cs_end: } - { \cs:w l__wheelchart_#1_data_pos_fp\cs_end: } - { \cs:w l__wheelchart_#1_data_sep_fp\cs_end: } + { \cs:w l__wheelchart_#1_data_angle_pos_fp \cs_end: } + { \cs:w l__wheelchart_#1_data_angle_shift_fp \cs_end: } + { \cs:w l__wheelchart_#1_data_pos_fp \cs_end: } + { \cs:w l__wheelchart_#1_data_sep_fp \cs_end: } { \pgfkeysvalueof { / wheelchart / #1~data } } ; } } @@ -1366,13 +1376,13 @@ \cs_new_protected:Npn \__wheelchart_legend_append:nn #1#2 { - \tl_build_put_right:NV \WClegend \l__wheelchart_legend_row_tl%note the V specifier such that \WClegend can also be combined - %with an S column of the package siunitx and such that \WClegend can be used in a tblr environment of the package tabularray + \tl_build_put_right:NV \WClegend \l__wheelchart_legend_row_tl%note the V specifier so that \WClegend can also be combined + %with an S column of the package siunitx and so that \WClegend can be used in a tblr environment of the package tabularray %and then the option expand=\WClegend needs to be given to the tblr environment \tl_build_put_right:Nn \WClegend { \protect \setcounter { g__wheelchart_WCcount_counter } }%note the \protect for in case that %\WClegend would be parsed in a particular way %note that the counter g__wheelchart_WCcount_counter is defined globally and at the end of the previous \l__wheelchart_legend_row_tl - %such that this value is defined and has the right value at the start of the next \l__wheelchart_legend_row_tl + %so that this value is defined and has the right value at the start of the next \l__wheelchart_legend_row_tl %if \WClegend is used in a tblr environment of the package tabularray then \UseTblrLibrary{counter} is required \tl_build_put_right:Ne \WClegend { { \int_eval:n {#1} } } \tl_build_put_right:Nn \WClegend {#2} @@ -1414,8 +1424,8 @@ { atand ( - \cs:w g__wheelchart_#3_y_fp\cs_end: - \cs:w g__wheelchart_#4_y_fp\cs_end: , - \cs:w g__wheelchart_#3_x_fp\cs_end: - \cs:w g__wheelchart_#4_x_fp\cs_end: + \cs:w g__wheelchart_#3_y_fp \cs_end: - \cs:w g__wheelchart_#4_y_fp \cs_end: , + \cs:w g__wheelchart_#3_x_fp \cs_end: - \cs:w g__wheelchart_#4_x_fp \cs_end: ) } \fp_set:Nn \l__wheelchart_slices_arc_coord_fp @@ -1440,7 +1450,7 @@ ) : atand ( ( \l__wheelchart_slices_arc_A_fp - ( 1 / \l__wheelchart_slices_arc_A_fp ) ) / 2 ) - }%note the min ( \l__wheelchart_slices_arc_B_fp , 0 ) such that the acosd is always defined + }%note the min ( \l__wheelchart_slices_arc_B_fp , 0 ) so that the acosd is always defined } } ] @@ -1486,8 +1496,8 @@ * abs ( ( 1 / \l__wheelchart_slices_arc_A_fp ) + \l__wheelchart_slices_arc_A_fp ) * sqrt ( - ( \cs:w g__wheelchart_#3_x_fp\cs_end: - \cs:w g__wheelchart_#4_x_fp\cs_end: ) ^ 2 - + ( \cs:w g__wheelchart_#3_y_fp\cs_end: - \cs:w g__wheelchart_#4_y_fp\cs_end: ) ^ 2 + ( \cs:w g__wheelchart_#3_x_fp \cs_end: - \cs:w g__wheelchart_#4_x_fp \cs_end: ) ^ 2 + + ( \cs:w g__wheelchart_#3_y_fp \cs_end: - \cs:w g__wheelchart_#4_y_fp \cs_end: ) ^ 2 ) } } @@ -1539,11 +1549,11 @@ \fp_eval:n { ( - \cs:w g__wheelchart_#3_x_fp\cs_end: + \cs:w g__wheelchart_#4_x_fp\cs_end: + + \cs:w g__wheelchart_#3_x_fp \cs_end: + \cs:w g__wheelchart_#4_x_fp \cs_end: + ( \g__wheelchart_slices_orientation_fp * ( \l__wheelchart_slices_arrow_coord_fp - 1 ) * \l__wheelchart_slices_arrow_A_fp - * ( \cs:w g__wheelchart_#3_y_fp\cs_end: - \cs:w g__wheelchart_#4_y_fp\cs_end: ) + * ( \cs:w g__wheelchart_#3_y_fp \cs_end: - \cs:w g__wheelchart_#4_y_fp \cs_end: ) ) ) / 2 @@ -1552,11 +1562,11 @@ \fp_eval:n { ( - \cs:w g__wheelchart_#3_y_fp\cs_end: + \cs:w g__wheelchart_#4_y_fp\cs_end: + + \cs:w g__wheelchart_#3_y_fp \cs_end: + \cs:w g__wheelchart_#4_y_fp \cs_end: + ( \g__wheelchart_slices_orientation_fp * ( \l__wheelchart_slices_arrow_coord_fp - 1 ) * \l__wheelchart_slices_arrow_A_fp - * ( \cs:w g__wheelchart_#4_x_fp\cs_end: - \cs:w g__wheelchart_#3_x_fp\cs_end: ) + * ( \cs:w g__wheelchart_#4_x_fp \cs_end: - \cs:w g__wheelchart_#3_x_fp \cs_end: ) ) ) / 2 @@ -1593,10 +1603,10 @@ { \fp_eval:n { - ( 1 - (#1) / max ( round ( \cs:w g__wheelchart_value_\WCcount _fp\cs_end: ) , 1 ) ) - * \cs:w g__wheelchart_slice_#2_start_angle_\WCcount _fp\cs_end: - + (#1) * \cs:w g__wheelchart_slice_#2_end_angle_\WCcount _fp\cs_end: - / max ( round ( \cs:w g__wheelchart_value_\WCcount _fp\cs_end: ) , 1 ) + ( 1 - (#1) / max ( round ( \cs:w g__wheelchart_value_\WCcount _fp \cs_end: ) , 1 ) ) + * \cs:w g__wheelchart_slice_#2_start_angle_\WCcount _fp \cs_end: + + (#1) * \cs:w g__wheelchart_slice_#2_end_angle_\WCcount _fp \cs_end: + / max ( round ( \cs:w g__wheelchart_value_\WCcount _fp \cs_end: ) , 1 ) } } @@ -1617,17 +1627,19 @@ arc_style /. style = {} , arc~around~line /. initial = 1 , arc~around~text /. default = true ,%this key is not set up with /.is choice or \bool_set:Nn - %such that for example \WCvarA can be used as value for this key + %so that for example \WCvarA can be used as value for this key arc~around~text /. initial = false , arc~data /. initial = {} , arc~data~align /. code = { \tl_set:Nn \l__wheelchart_arc_data_align_tl {#1} } ,%this key is not set up with /.is choice - %such that for example \WCvarA can be used as value for this key + %so that for example \WCvarA can be used as value for this key arc~data~align = center , arc~data~angle~pos /. initial = 0.5 , arc~data~angle~shift /. initial = 0 , arc~data~dir /. initial = 1 , arc~data~expand /. initial = n , arc~data~line~sep~factor /. initial = 1 , + arc~data~lines~pos /. initial = 0.5 , + arc~data~lines~shift /. initial = 0 , arc~data~pos /. initial = 1 , arc~data~sep /. initial = 1 ex / 1 cm , arc~data~style /. style = { arc_data_style /. style = {#1} } , @@ -1640,7 +1652,7 @@ arc~sep /. initial = 1 ex / 1 cm , at /. initial = { ( 0 , 0 ) } , before~slices /. initial = {} , - bool_set_true /. code = { \bool_set_true:N #1 } , + bool_set_true /. code = \bool_set_true:N #1 , caption /. initial = {} , caption~left /. initial = {} , caption~left~sep /. initial = 0.5 , @@ -1670,9 +1682,9 @@ data~style /. style = { data_style /. style = {#1} } , data_style /. style = {} , discrete /. is~choice , - discrete / false /. code = { \bool_set_false:N \l__wheelchart_discrete_bool } , + discrete / false /. code = \bool_set_false:N \l__wheelchart_discrete_bool , discrete / false /. value~forbidden , - discrete / true /. code = { \bool_set_true:N \l__wheelchart_discrete_bool } , + discrete / true /. code = \bool_set_true:N \l__wheelchart_discrete_bool , discrete / true /. value~forbidden , discrete /. default = true , discrete = false , @@ -1777,7 +1789,7 @@ legend /. initial = {} , legend~columns /. initial = 1 , legend~entry /. initial = {} , - legend~only /. code = { \bool_set:Nn \l__wheelchart_legend_only_bool { \cs:w c_#1_bool\cs_end: } } , + legend~only /. code = \bool_set:Nn \l__wheelchart_legend_only_bool { \cs:w c_#1_bool \cs_end: } , legend~only /. default = true , legend~only = false , legend~row /. code = @@ -1800,7 +1812,7 @@ } , lines~ext~dirsep /. initial = 0 , lines~ext~fixed /. default = true ,%this key is not set up with /.is choice or \bool_set:Nn - %such that for example \WCvarA can be used as value for this key + %so that for example \WCvarA can be used as value for this key lines~ext~fixed /. initial = false , lines~ext~fixed~left /. initial = { @@ -1808,7 +1820,7 @@ { \l__wheelchart_lines_ext_dir_int * ( - \cs:w g__wheelchart_outer_radius_\WCcount _fp\cs_end: + \l__wheelchart_lines_sep_fp + \cs:w g__wheelchart_outer_radius_\WCcount _fp \cs_end: + \l__wheelchart_lines_sep_fp + \l__wheelchart_lines_fp + \l__wheelchart_lines_ext_fp ) } @@ -1819,7 +1831,7 @@ { \l__wheelchart_lines_ext_dir_int * ( - \cs:w g__wheelchart_outer_radius_\WCcount _fp\cs_end: + \l__wheelchart_lines_sep_fp + \cs:w g__wheelchart_outer_radius_\WCcount _fp \cs_end: + \l__wheelchart_lines_sep_fp + \l__wheelchart_lines_fp + \l__wheelchart_lines_ext_fp ) } @@ -1870,7 +1882,7 @@ outer_plot_style /. style = {} , outer~radius /. initial = 3 , perc~precision /. initial = 0 , - pie /. code = { \bool_set:Nn \l__wheelchart_pie_bool { \cs:w c_#1_bool\cs_end: } } , + pie /. code = \bool_set:Nn \l__wheelchart_pie_bool { \cs:w c_#1_bool \cs_end: } , pie /. default = true , pie = false , plot /. style = @@ -2029,12 +2041,12 @@ } , slices~inner /. initial = { - \fp_compare:nNnT { \cs:w g__wheelchart_inner_radius_\WCcount _fp\cs_end: } > { 0 } + \fp_compare:nNnT { \cs:w g__wheelchart_inner_radius_\WCcount _fp \cs_end: } > { 0 } { \fp_compare:nNnT - { \cs:w g__wheelchart_inner_gap_\WCcount _fp\cs_end: } + { \cs:w g__wheelchart_inner_gap_\WCcount _fp \cs_end: } < - { \cs:w g__wheelchart_abs_half_angle_minus_new_angle_\WCcount _fp\cs_end: } + { \cs:w g__wheelchart_abs_half_angle_minus_new_angle_\WCcount _fp \cs_end: } { arc [ @@ -2212,7 +2224,7 @@ {} } } , - slices~start~arrow/.style~2~args = + slices~start~arrow /. style~2~args = { slices~start = { @@ -2241,13 +2253,13 @@ (#1) - \fp_eval:n { - \l__wheelchart_counter_or_clockwise_fp * \cs:w g__wheelchart_value_1_fp\cs_end: * 0.5 + \l__wheelchart_counter_or_clockwise_fp * \cs:w g__wheelchart_value_1_fp \cs_end: * 0.5 * ( \l__wheelchart_total_angle_fp / \WCtotalnum ) } } } , start~half /. default = 90 , - title /. initial= {} , + title /. initial = {} , title~left /. initial = {} , title~left~sep /. initial = 0.5 , title~left~style /. style = { title~left_style /. style = {#1} } , @@ -2283,13 +2295,13 @@ { \cs_set:cpn {#1} { \use:e { \clist_item:nn {#2} { \int_mod:nn { \WCcount - 1 } { \clist_count:n {#2} } + 1 } } } - %note the \use:e such that \WClist<name> also works when given as an argument to pgfmath + %note the \use:e so that \WClist<name> also works when given as an argument to pgfmath %if the list contains a macro, for example %\begin{tikzpicture} %\def\n{1} %\wheelchart[ - % value=\WClistA, - % WClistA={\n} + % value=\WClistA, + % WClistA=\n %]{\exampleforthismanual} %\end{tikzpicture} %https://tex.stackexchange.com/questions/671298/clist-item-and-pgfmathsetmacro-causing-an-error @@ -2331,18 +2343,18 @@ { \tl_set:Ne \l__wheelchart_key_name_tl { \pgfkeyscurrentname }%it is necessary to define \l__wheelchart_key_name_tl %because \pgfkeyscurrentname will be overwritten by / errors / unknown~key /. expanded - \regex_match:nVTF { \{(.+)\} } \l__wheelchart_key_name_tl + \regex_match:NVTF \c__wheelchart_braces_regex \l__wheelchart_key_name_tl { \tl_set:Ne \l__wheelchart_key_range_tl { \pgfkeyscurrentname } - \regex_replace_all:nnN { \{(.+)\} } {} \l__wheelchart_key_name_tl - \regex_replace_all:nnN { [\w\s]+\{(.+)\} } { \1 } \l__wheelchart_key_range_tl + \regex_replace_all:NnN \c__wheelchart_braces_regex {} \l__wheelchart_key_name_tl + \regex_replace_all:NnN \c__wheelchart_key_braces_regex { \1 } \l__wheelchart_key_range_tl \str_if_eq:eeTF { \l__wheelchart_key_range_tl } { list } { \pgfkeys { / wheelchart , WC_list = { l__wheelchart_list_\l__wheelchart_key_name_tl } {#1} } \pgfkeys { / wheelchart , - \l__wheelchart_key_name_tl /. expand~once = { \cs:w l__wheelchart_list_\l__wheelchart_key_name_tl\cs_end: } + \l__wheelchart_key_name_tl /. expand~once = { \cs:w l__wheelchart_list_\l__wheelchart_key_name_tl \cs_end: } } } { @@ -2393,12 +2405,12 @@ \NewDocumentCommand \wheelchart { O {} m } { - {%note the double braces {{...}} such that the contents is in a group and such that & can be used in pgfmath in a tabular + {%note the double braces {{...}} so that the contents is in a group and so that & can be used in pgfmath in a tabular \pgfkeys { / wheelchart , #1 } \IfPackageLoadedTF { siunitx } { \cs_set:Npn \WCperc { \qty { \WCpercentagerounded } { \percent } } } { \cs_set:Npn \WCperc { \WCpercentagerounded \, \% } }%the definition of \WCperc is placed inside the command \wheelchart - %such that \WCperc is not defined outside this command + %so that \WCperc is not defined outside this command \bool_if:NTF \l__wheelchart_legend_only_bool { \__wheelchart_initial:n {#2} @@ -2430,7 +2442,7 @@ { \g__wheelchart_angle_fp + ( - \l__wheelchart_counter_or_clockwise_fp * \cs:w g__wheelchart_value_\WCcount _fp\cs_end: + \l__wheelchart_counter_or_clockwise_fp * \cs:w g__wheelchart_value_\WCcount _fp \cs_end: * ( \l__wheelchart_total_angle_fp / \WCtotalnum ) ) } @@ -2455,7 +2467,7 @@ \fp_gset:cn { g__wheelchart_abs_half_angle_minus_new_angle_\WCcount _fp } { abs ( \g__wheelchart_angle_fp - \g__wheelchart_new_angle_fp ) / 2 } \fp_set:Nn \l__wheelchart_abs_half_angle_minus_new_angle_minus_gap_polar_fp - { \cs:w g__wheelchart_abs_half_angle_minus_new_angle_\WCcount _fp\cs_end: - \l__wheelchart_gap_polar_fp } + { \cs:w g__wheelchart_abs_half_angle_minus_new_angle_\WCcount _fp \cs_end: - \l__wheelchart_gap_polar_fp } \fp_gzero_new:c { g__wheelchart_outer_gap_\WCcount _fp } \fp_gzero_new:c { g__wheelchart_inner_gap_\WCcount _fp } \bool_if:NTF \l__wheelchart_plot_bool @@ -2466,7 +2478,7 @@ { \fp_set:Nn \l__wheelchart_gap_max_angle_def_fp { - \cs:w g__wheelchart_inner_radius_\WCcount _fp\cs_end: > 0 + \cs:w g__wheelchart_inner_radius_\WCcount _fp \cs_end: > 0 ? 90 : @@ -2490,8 +2502,8 @@ ) ) } - \__wheelchart_def_gap:nn { outer } { \cs:w g__wheelchart_outer_radius_\WCcount _fp\cs_end: } - \__wheelchart_def_gap:nn { inner } { \cs:w g__wheelchart_inner_radius_\WCcount _fp\cs_end: } + \__wheelchart_def_gap:nn { outer } { \cs:w g__wheelchart_outer_radius_\WCcount _fp \cs_end: } + \__wheelchart_def_gap:nn { inner } { \cs:w g__wheelchart_inner_radius_\WCcount _fp \cs_end: } \fp_compare:nNnT { \l__wheelchart_abs_half_angle_minus_new_angle_minus_gap_polar_fp } > { 0.01 } { \fp_gset:cn { g__wheelchart_inner_radius_\WCcount _fp } @@ -2508,7 +2520,7 @@ ) ) , - \cs:w g__wheelchart_inner_radius_\WCcount _fp\cs_end: + \cs:w g__wheelchart_inner_radius_\WCcount _fp \cs_end: ) } } @@ -2523,14 +2535,14 @@ \__wheelchart_gdef_count_fp:nn { data_pos } { data~pos } \__wheelchart_gdef_count_fp:nn { data_sep } { data~sep } \__wheelchart_def_angle:nnnn - { \cs:w g__wheelchart_data_angle_pos_\WCcount _fp\cs_end: } - { \cs:w g__wheelchart_data_angle_shift_\WCcount _fp\cs_end: } - { \cs:w g__wheelchart_data_pos_\WCcount _fp\cs_end: } - { \cs:w g__wheelchart_data_sep_\WCcount _fp\cs_end: } + { \cs:w g__wheelchart_data_angle_pos_\WCcount _fp \cs_end: } + { \cs:w g__wheelchart_data_angle_shift_\WCcount _fp \cs_end: } + { \cs:w g__wheelchart_data_pos_\WCcount _fp \cs_end: } + { \cs:w g__wheelchart_data_sep_\WCcount _fp \cs_end: } \cs_set:Npe \WCdataangle { \pgfmathresult } \__wheelchart_gdef_count_fp:nn { explode } { explode } \pgfkeysvalueof { / wheelchart / for~loop~start }%this must be placed after the definition of macros such as - %\WCpercentage such that these macros can be used in the key for loop start + %\WCpercentage so that these macros can be used in the key for loop start \int_compare:nNnT { \WCcount } = { 1 } { \begin { scope } @@ -2601,7 +2613,7 @@ [ shift /. expanded = { - \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn\cs_end: + \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn \cs_end: { \WCcount } { \l__wheelchart_slices_angle_pos_fp } { \l__wheelchart_slices_angle_shift_fp } @@ -2639,9 +2651,9 @@ \__wheelchart_for_loop:n { \bool_if:NT \l__wheelchart_wheel_lines_bool - %this is placed inside \__wheelchart_for_loop:n such that wheel lines can be applied for specific slices + %this is placed inside \__wheelchart_for_loop:n so that wheel lines can be applied for specific slices { - \int_step_inline:nnn { 0 } { \fp_eval:n { round ( \cs:w g__wheelchart_value_\WCcount _fp\cs_end: ) } } + \int_step_inline:nnn { 0 } { \fp_eval:n { round ( \cs:w g__wheelchart_value_\WCcount _fp \cs_end: ) } } %note the \fp_eval:n { round ( ... ) } to avoid the messages Missing character: There is no ... in font nullfont! { \bool_if:NTF \l__wheelchart_plot_bool @@ -2783,14 +2795,14 @@ \fp_compare:nF { \l__wheelchart_lines_fp == 0 && \l__wheelchart_lines_ext_fp == 0 } { \draw [ / wheelchart / lines_style ] let \p { l__wheelchart_lines_1 } = - \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn\cs_end: + \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn \cs_end: { \WCcount } - { \cs:w g__wheelchart_data_angle_pos_\WCcount _fp\cs_end: } - { \cs:w g__wheelchart_data_angle_shift_\WCcount _fp\cs_end: } - { \cs:w g__wheelchart_data_pos_\WCcount _fp\cs_end: } + { \cs:w g__wheelchart_data_angle_pos_\WCcount _fp \cs_end: } + { \cs:w g__wheelchart_data_angle_shift_\WCcount _fp \cs_end: } + { \cs:w g__wheelchart_data_pos_\WCcount _fp \cs_end: } { \l__wheelchart_lines_sep_fp + \l__wheelchart_lines_fp } in - \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn\cs_end: + \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn \cs_end: { \WCcount } { \l__wheelchart_lines_angle_pos_fp } { \l__wheelchart_lines_angle_shift_fp } @@ -2838,7 +2850,7 @@ { \fp_eval:n { - \l__wheelchart_lines_ext_dir_int * \cs:w g__wheelchart_data_sep_\WCcount _fp\cs_end: + \l__wheelchart_lines_ext_dir_int * \cs:w g__wheelchart_data_sep_\WCcount _fp \cs_end: } } , 0 @@ -2849,7 +2861,7 @@ } ; } - \__wheelchart_if_text:nn { data } + \__wheelchart_if_text:nnn { data } { o } { \fp_compare:nNnTF { \l__wheelchart_lines_ext_fp } = { 0 } { @@ -2876,13 +2888,13 @@ \coordinate [ at = - \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn\cs_end: + \cs:w __wheelchart_point_plot_\bool_to_str:N \l__wheelchart_plot_bool :nnnnn \cs_end: { \WCcount } - { \cs:w g__wheelchart_data_angle_pos_\WCcount _fp\cs_end: } - { \cs:w g__wheelchart_data_angle_shift_\WCcount _fp\cs_end: } - { \cs:w g__wheelchart_data_pos_\WCcount _fp\cs_end: } + { \cs:w g__wheelchart_data_angle_pos_\WCcount _fp \cs_end: } + { \cs:w g__wheelchart_data_angle_shift_\WCcount _fp \cs_end: } + { \cs:w g__wheelchart_data_pos_\WCcount _fp \cs_end: } { - \cs:w g__wheelchart_data_sep_\WCcount _fp\cs_end: + + \cs:w g__wheelchart_data_sep_\WCcount _fp \cs_end: + ( \l__wheelchart_lines_fp == 0 ? @@ -2902,7 +2914,7 @@ \node [ anchor = \l__wheelchart_data_anchor_tl , align = left , / wheelchart / data_style ] at ( g__wheelchart_data_coordinate ) { \pgfkeysvalueof { / wheelchart / data } } ;%a separate \node and not at the end of the \draw with lines_style - %such that the key lines style is not passed to this \node + %so that the key lines style is not passed to this \node } \__wheelchart_def_fp:nn { arc_around_line } { arc~around~line } \__wheelchart_def_fp:nn { arc_data_angle_pos } { arc~data~angle~pos } @@ -2913,14 +2925,16 @@ \fp_gset:Nn \g__wheelchart_half_ex_over_one_cm_fp { 0.5 ex / 1 cm }% \endpgfinterruptpicture% \fp_gset:Nn \g__wheelchart_arc_data_aux_ii_fp { 0 } - \__wheelchart_if_text:nn { arc~data } + \__wheelchart_if_text:nnn { arc~data } {} { - \cs_set:Npn \WCperc { \WCpercentagerounded { \, } { \% } }%such that \WCperc follows the arc if used in arc data + \cs_set:Npn \WCperc { \WCpercentagerounded { \, } { \% } }%so that \WCperc follows the arc if used in arc data %this redefinition of \WCperc is local to the group of arc data \__wheelchart_def_fp:nn { arc_data_pos } { arc~data~pos } \__wheelchart_def_fp:nn { arc_data_sep } { arc~data~sep } \__wheelchart_def_fp:nn { arc_data_line_sep_factor } { arc~data~line~sep~factor } - \cs:w seq_set_split:Nn\pgfkeysvalueof { / wheelchart / arc~data~expand }\cs_end: + \__wheelchart_def_fp:nn { arc_data_lines_pos } { arc~data~lines~pos } + \__wheelchart_def_fp:nn { arc_data_lines_shift } { arc~data~lines~shift } + \cs:w seq_set_split:Nn\pgfkeysvalueof { / wheelchart / arc~data~expand } \cs_end: \l__wheelchart_arc_data_seq { \\ } { \pgfkeysvalueof { / wheelchart / arc~data } } @@ -2928,13 +2942,17 @@ { \fp_set:Nn \l__wheelchart_arc_data_text_pos_fp { - \l__wheelchart_arc_data_pos_fp + 2 * \g__wheelchart_slices_orientation_fp - * ( 2 * ####1 - \seq_count:N \l__wheelchart_arc_data_seq - 1 ) * sign ( \l__wheelchart_arc_data_dir_fp ) + \l__wheelchart_arc_data_pos_fp + 4 * \g__wheelchart_slices_orientation_fp * + ( + ####1 - 1 - \l__wheelchart_arc_data_lines_pos_fp * ( \seq_count:N \l__wheelchart_arc_data_seq - 1 ) + + \l__wheelchart_arc_data_lines_shift_fp + ) + * sign ( \l__wheelchart_arc_data_dir_fp ) * \l__wheelchart_arc_data_line_sep_factor_fp * \g__wheelchart_half_ex_over_one_cm_fp / ( - \cs:w g__wheelchart_outer_radius_\WCcount _fp\cs_end: - - \cs:w g__wheelchart_inner_radius_\WCcount _fp\cs_end: + \cs:w g__wheelchart_outer_radius_\WCcount _fp \cs_end: + - \cs:w g__wheelchart_inner_radius_\WCcount _fp \cs_end: + 2 * \l__wheelchart_arc_data_sep_fp ) }%the sign is needed because \l__wheelchart_arc_data_dir_fp is not necessarily 1 or -1 @@ -2957,9 +2975,9 @@ / wheelchart / arc_data_style } }%get the length of the path - %note the option overlay such that this does not increase the bounding box + %note the option overlay so that this does not increase the bounding box %note the {} at the start of text and the braces around \fp_gset:Nn ... - %such that the compilation does not stall + %so that the compilation does not stall { 0 } { 1 } { \l__wheelchart_plot_variable_tl } @@ -3033,7 +3051,7 @@ { \l__wheelchart_arc_data_text_pos_fp } { \l__wheelchart_arc_data_sep_fp + \g__wheelchart_half_ex_over_one_cm_fp } + \l__wheelchart_counter_or_clockwise_fp * \l__wheelchart_arc_data_dir_fp - * \cs:w c__wheelchart_arc_data_start_factor_\l__wheelchart_arc_data_align_tl _fp\cs_end: + * \cs:w c__wheelchart_arc_data_start_factor_\l__wheelchart_arc_data_align_tl _fp \cs_end: * \l__wheelchart_arc_data_total_angle_plot_false_fp } \path @@ -3188,7 +3206,7 @@ } \bool_if:NT \l__wheelchart_legend_row_bool { \__wheelchart_def_WClegend: } - \__wheelchart_if_text:nn { middle } + \__wheelchart_if_text:nnn { middle } { o } { \node [ align = center , / wheelchart / middle_style ] at ( 0 , 0 ) { \pgfkeysvalueof { / wheelchart / middle } } ; } \pgfkeysvalueof { / wheelchart / legend } \end { scope } @@ -3203,4 +3221,6 @@ \end { scope } } } - }
\ No newline at end of file + } + +\endinput
\ No newline at end of file diff --git a/graphics/pgf/contrib/wheelchart/wheelchart.tex b/graphics/pgf/contrib/wheelchart/wheelchart.tex index 5f0857f1a6..952fc93a81 100644 --- a/graphics/pgf/contrib/wheelchart/wheelchart.tex +++ b/graphics/pgf/contrib/wheelchart/wheelchart.tex @@ -137,7 +137,7 @@ \setcounter{secnumdepth}{2} \title{The \texttt{wheelchart} package\\[12pt]\large Diagrams with circular or other shapes using \tikzname{} and \LaTeX3} \author{Matthias Floré} -\date{Version 3.0 (2024/03/08)}%\\[12pt] +\date{Version 4.0 (2024/07/28)}%\\[12pt] \begin{document} \iftotalpages% \newsavebox{\fancyfootdefaultbox}% @@ -155,7 +155,11 @@ \maketitle \thispagestyle{fancy} \begin{abstract} -\noindent This package is based on the package |tikz| (see \cite{TtTaPGFp}) and can be used to draw various kinds of diagrams such as a bar chart, doughnut chart, infographic, pie chart, ring chart, square chart, sunburst chart, waffle chart and wheel chart with \tikzname. It provides several options to customize the diagrams. It is also possible to specify a plot for the shape of the chart. Furthermore a legend can be added and the table of contents can be displayed as one of these diagrams. Other tools for creating wheel charts or pie charts can be found in \cite{MpMP}, \cite{JhcIparowcltopotPGFm}, \cite{Tumfdb}, \cite{XdPCbupp} and \cite{RSVpaaMfp}.% This is the manual for version . +\noindent This package is based on the package |tikz| (see \cite{TtTaPGFp}) and can be used to draw various kinds of diagrams such as bar charts, doughnut charts, infographics, pie charts, ring charts, square charts, sunburst charts, waffle charts and wheel charts. + +\noindent It provides several options to customize the diagrams. It is also possible to specify a plot for the shape of the chart. Furthermore a legend can be added and the table of contents can be displayed as one of these diagrams. + +\noindent Other tools for creating wheel charts or pie charts can be found in \cite{MpMP}, \cite{JhcIparowcltopotPGFm}, \cite{Tumfdb}, \cite{XdPCbupp} and \cite{RSVpaaMfp}.% This is the manual for version . \end{abstract} \section*{\contentsname} \iftotalpages @@ -257,7 +261,7 @@ The default wheelchart with these data is shown below. \end{tikzpicture} \end{codeexample} \end{command} -\newpage%such that this section has its own block in the header +\newpage%so that this section has its own block in the header \section{Additional macros} \begin{command}{\WCangle\opt{\oarg{number}}\marg{angle pos}\marg{angle shift}\marg{pos}\marg{sep}} This command gives the angle in degrees of the point which is constructed as follows. @@ -670,6 +674,11 @@ In the example below, it is necessary to use |arc data expand=e| and to place |\ \begin{key}{/wheelchart/arc data line sep factor=\marg{factor} (initially 1)} The contents of the key |arc data| can consist of multiple lines separated by |\\|. The \meta{factor} determines the spacing between these lines. \end{key} +\begin{key}{/wheelchart/arc data lines pos=\marg{factor} (initially 0.5)} +\end{key} +\begin{key}{/wheelchart/arc data lines shift=\marg{value} (initially 0)} +The positioning of the lines of the key |arc data| is determined by the index $k-1-\text{|arc data lines pos|}\cdot(N-1)+\text{|arc data lines shift|}$ where $N$ is the number of lines and $k\in\{1,\dots,N\}$. +\end{key} \begin{key}{/wheelchart/arc data pos=\marg{value} (initially 1)} \end{key} \begin{key}{/wheelchart/arc data sep=\marg{value} (initially 1ex/1cm)} @@ -738,7 +747,6 @@ This key accepts a list of keys which will be applied to the node where the cont \begin{codeexample}[width=10cm] \begin{tikzpicture} \wheelchart[ - at={(5,2)}, caption=Caption, caption style={font=\scshape}, caption left=Caption left, @@ -2909,6 +2917,11 @@ The following example is an answer to the question on \url{https://tex.stackexch \item In v2.0, the key |arc data angle shift| was not taken into account for the key |arc| in combination with the key |arc around text|. This is fixed in v3.0. \item In v2.0, the number of items for each slice in the \meta{wheelchart data} which can be accessed with the macros |\WCvarA| and so on was determined by the number of items for the last slice. For example, |data{1}=\WCvarD| in combination with the \meta{wheelchart data} |1/black/A/a,2/gray/B| was not possible with v2.0. This is not a limitation anymore with v3.0. \end{itemize} +\item[] \textbf{Version 4.0 (2024/07/28)} +\begin{itemize} +\item Added the keys |arc data lines pos| and |arc data lines shift|. +\item Solved an incompatibility if |\\| is used in a key such as |data| inside an environment such as |center|. +\end{itemize} \end{itemize} \begin{thebibliography}{9} \bibitem{JhcIparowcltopotPGFm} diff --git a/graphics/pgf/contrib/wordle/README.md b/graphics/pgf/contrib/wordle/README.md index f1977a1ae7..fdfd996870 100644 --- a/graphics/pgf/contrib/wordle/README.md +++ b/graphics/pgf/contrib/wordle/README.md @@ -1,8 +1,33 @@ -wordle is a package to work with Wordle game. ------------------------------------------------------------ -wordle est un package pour travailler avec le jeu du sutom. ------------------------------------------------------------ -Author : Cédric Pierquet -email : cpierquet@outlook.fr -Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt -Source : https://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex
\ No newline at end of file +![v![]()ersion](https://img.shields.io/github/v/tag/AndrewMathas/wordle?color=success&label=version) +<a href="http://www.latex-project.org/lppl.txt"><img src="https://img.shields.io/badge/license-LPPLv1.3c-blueviolet.svg"></a> +<a href="https://www.latex-project.org/"><img src="https://img.shields.io/badge/latex-20B2AA?logo=Latex"></a> + +# Wordle + +A stupidly feature-rich LaTeX package for typesetting **Wordle** puzzles. This package provides a stupidly feature-rich way of creating Wordle puzzles in LaTeX, which [Wikipedia](https://en.wikipedia.org/wiki/Wordle) describes as a hugely popular web-based word game created and developed by Welsh software engineer Josh Wardle. + +This package provides the `wordle` environment, which uses the syntax: + +```tex +% \usepackage{wordle} +\begin{wordle}{ANVIL} + CRANE + NATAL + ANVIL +\end{wordle} +``` + +Ce package fournit un moyen stupidement riche en fonctionnalités de créer des puzzles **Wordle** en LaTeX, que [Wikipedia](https://en.wikipedia.org/wiki/Wordle) décrit comme comme un jeu de lettres en ligne extrêmement populaire, créé et développé par l'ingénieur logiciel gallois Josh Wardle. + +```tex +% \usepackage{wordle} +\begin{GrilleSutom}{REBUS} + ABRIS + ROUTE + REBUS +\end{GrilleSutom} +``` + +### Authors +Andrew Mathas and Cédric Pierquet + diff --git a/graphics/pgf/contrib/wordle/doc/wordle-doc-en.pdf b/graphics/pgf/contrib/wordle/doc/wordle-doc-en.pdf Binary files differdeleted file mode 100644 index aadb07f54b..0000000000 --- a/graphics/pgf/contrib/wordle/doc/wordle-doc-en.pdf +++ /dev/null diff --git a/graphics/pgf/contrib/wordle/doc/wordle-doc-en.tex b/graphics/pgf/contrib/wordle/doc/wordle-doc-en.tex deleted file mode 100644 index 06352f5ad5..0000000000 --- a/graphics/pgf/contrib/wordle/doc/wordle-doc-en.tex +++ /dev/null @@ -1,426 +0,0 @@ -% !TeX TXS-program:compile = txs:///arara -% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} -% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') - -\documentclass[english,a4paper,11pt]{article} -\usepackage[margin=2cm,includefoot]{geometry} -\def\TPversion{0.1.1} -\def\TPdate{03/09/2023} -\usepackage{amssymb,amsfonts,amsmath} -\usepackage[utf8]{inputenc} -%\usepackage[T1]{fontenc} -\usepackage{wordle} -\usepackage{awesomebox} -\usepackage{fontawesome5} -\usepackage{footnote} -\makesavenoteenv{tabular} -\usepackage{enumitem} -\usepackage{tabularray} -\usepackage{fancyvrb} -\usepackage{fancyhdr} -\fancyhf{} -\renewcommand{\headrulewidth}{0pt} -\lfoot{\sffamily\small [wordle]} -\cfoot{\sffamily\small - \thepage{} -} -\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} - -%\usepackage{hvlogos} -\usepackage{xspace} -\usepackage{hologo} -\providecommand\tikzlogo{Ti\textit{k}Z} -\providecommand\TeXLive{\TeX{}Live\xspace} -\providecommand\PSTricks{\textsf{PSTricks}\xspace} -\let\pstricks\PSTricks -\let\TikZ\tikzlogo -\newcommand\TableauDocumentation{% - \begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} - {\LARGE \LaTeX} & & & & &\\ - & {\LARGE \hologo{pdfLaTeX}} & & & & \\ - & & {\LARGE \hologo{LuaLaTeX}} & & & \\ - & & & {\LARGE \TikZ} & & \\ - & & & & {\LARGE \TeXLive} & \\ - & & & & & {\LARGE \hologo{MiKTeX}} \\ - \end{tblr} -} - -\usepackage{hyperref} -\urlstyle{same} -\hypersetup{pdfborder=0 0 0} -\setlength{\parindent}{0pt} -\definecolor{LightGray}{gray}{0.9} - -\usepackage{babel} -%\AddThinSpaceBeforeFootnotes -%\FrenchFootnotes - -\usepackage{listings} - -\usepackage{newverbs} -\newverbcommand{\motcletex}{\color{cyan!75!black}}{} -\newverbcommand{\packagetex}{\color{violet!75!black}}{} - -\usepackage[most]{tcolorbox} -\tcbuselibrary{listingsutf8} -\newtcblisting{DemoCode}[1][]{% - enhanced,width=0.95\linewidth,center,% - bicolor,size=title,% - colback=cyan!2!white,% - colbacklower=cyan!1!white,% - colframe=cyan!75!black,% - listing options={% - breaklines=true,% - breakatwhitespace=true,% - style=tcblatex,basicstyle=\small\ttfamily,% - tabsize=4,% - commentstyle={\itshape\color{gray}}, - keywordstyle={\color{blue}},% - classoffset=0,% - keywords={},% - alsoletter={-},% - keywordstyle={\color{blue}},% - classoffset=1,% - alsoletter={-},% - morekeywords={center,justify},% - keywordstyle={\color{violet}},% - classoffset=2,% - alsoletter={-},% - morekeywords={WordleGrid},% - keywordstyle={\color{green!50!black}},% - classoffset=3,% - morekeywords={Colors,Rounded,Unit,Font,ColorLetters,Letters,Style,Thickness,BorderColor},% - keywordstyle={\color{orange}} - },% - #1 -} - -\tcbset{vignettes/.style={% - nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,% - boxrule=0.75pt,left=7pt,right=1pt,top=0pt,bottom=0.25pt,% - } -} - -\tcbset{vignetteMaJ/.style={% - fontupper={\vphantom{pf}\footnotesize\ttfamily}, - vignettes,colframe=purple!50!black,coltitle=white,colback=purple!10,% - overlay={\begin{tcbclipinterior}% - \fill[fill=purple!75]($(interior.south west)$) rectangle node[rotate=90]{\tiny \sffamily{\textcolor{black}{\scalebox{0.66}[0.66]{\textbf{MàJ}}}}} ($(interior.north west)+(5pt,0pt)$);% - \end{tcbclipinterior}} - } -} - -\newcommand\Cle[1]{{\small\sffamily\textlangle \textcolor{orange}{#1}\textrangle}} -\newcommand\cmaj[1]{\tcbox[vignetteMaJ]{#1}\xspace} - -\begin{document} - -\setlength{\aweboxleftmargin}{0.07\linewidth} -\setlength{\aweboxcontentwidth}{0.93\linewidth} -\setlength{\aweboxvskip}{8pt} - -\pagestyle{fancy} - -\thispagestyle{empty} - -\vspace{2cm} - -\begin{center} - \begin{minipage}{0.75\linewidth} - \begin{tcolorbox}[colframe=yellow,colback=yellow!15] - \begin{center} - \begin{tabular}{c} - {\Huge \texttt{wordle} [en]}\\ - \\ - {\LARGE Grids of Wordle,} \\ - \\ - {\LARGE made with \textsf{Ti\textit{k}Z}.} \\ - \end{tabular} - - \bigskip - - {\small \texttt{Version \TPversion{} -- \TPdate}} - \end{center} - \end{tcolorbox} -\end{minipage} -\end{center} - -\begin{center} - \begin{tabular}{c} - \texttt{Cédric Pierquet}\\ - {\ttfamily c pierquet -- at -- outlook . fr}\\ - \texttt{\url{https://github.com/cpierquet/wordle}} -\end{tabular} -\end{center} - -\vspace{0.25cm} - -{$\blacktriangleright$~~Create Wordle grids Wordle/Sutom\footnotemark\footnotetext{\url{https://en.wikipedia.org/wiki/Wordle}}.} - -\vspace{0.25cm} - -{$\blacktriangleright$~~Specify colors and font\footnotemark\footnotetext{Ideas from \url{ttps://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex}}. - -\vspace{0.5cm} - -\begin{center} -\begin{WordleGrid}{CRAZE} - GRAIL TRACK CRAMP CRABS CRAZY CRAZE -\end{WordleGrid} -\end{center} - -\begin{center} -\begin{WordleGrid}[Rounded=0,Colors={lightgray,orange,teal},Style=alt,Unit=0.5,Letters=false]{LADLE} - FLAIL LAPEL LADLE -\end{WordleGrid} -% -\hspace{5mm} -% -\begin{WordleGrid}[Rounded=0,Colors={lightgray,orange,teal},Style=alt,Unit=0.5]{LADLE} - FLAIL LAPEL LADLE -\end{WordleGrid} -\end{center} - -\vspace{0.25cm} - -%\hfill{}\textit{Merci à Denis Bitouzé et à Gilles Le Bourhis pour leurs retours et idées !} - -\smallskip - -\vfill - -\hrule - -\medskip - -\TableauDocumentation - -\medskip - -\hrule - -\vspace*{1cm} - -\newpage - -\phantomsection -\hypertarget{matoc}{} - -\tableofcontents - -\vfill - -\section{History} - -\verb|v0.1.1|~:~~~~Bugfix with english version. - -\verb|v0.1.0|~:~~~~Initial version. - -\newpage - -\section{The wordle package} - -\subsection{The game} - -\begin{noteblock} -Wordle is a web-based word game created and developed by Welsh software engineer Josh Wardle. Players have six attempts to guess a five-letter word, with feedback given for each guess in the form of colored tiles indicating when letters match or occupy the correct position. - -Every day, a five-letter word is chosen which players aim to guess within six tries. After every guess, each letter is marked as either green, yellow or gray: green indicates that letter is correct and in the correct position, yellow means it is in the answer but not in the right position, while gray indicates it is not in the answer at all. Multiple instances of the same letter in a guess, such as the "o"s in "robot", will be colored green or yellow only if the letter also appears multiple times in the answer; otherwise, excess repeating letters will be colored gray. - -\smallskip - -\hfill{\scriptsize \url{https://en.wikipedia.org/wiki/Wordle}} -\end{noteblock} - -\subsection{The package} - -\begin{noteblock} -This package can display, in a \textsf{tex} file, a wordle grid (with \TikZ{} and within a \motcletex!minipage!), with ability : - -\begin{itemize} - \item to change dimensions and colors ; - \item to pick style for misplaced letters ; - \item to change borders and corners ; - \item to print or not the letters. -\end{itemize} - -It's possible to "play" with other words than five-letter words ! -\end{noteblock} - -\begin{importantblock} -Most of source code, in \hologo{LaTeX3}, is given by thread from \texttt{tex.stackexchange}, proposed by user \textsf{3141592653589793238}. -\end{importantblock} - -\subsection{Loading of the package, used packages} - -\begin{importantblock} -The package \packagetex!wordle! loads within the preamble. - -There's no option, and \packagetex!xcolor! isn't loaded. -\end{importantblock} - -\begin{DemoCode}[listing only] -\documentclass{article} -\usepackage{wordle} - -\end{DemoCode} - -\begin{noteblock} -\packagetex!wordle! loads the following packages and libraries : - -\begin{itemize} - \item \packagetex!tikz!; - \item \packagetex!simplekv! ; - \item \packagetex!xstring!. -\end{itemize} - -It’s mostly compatible with \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} or \textsf{xelatex} compilation ! -\end{noteblock} - -\vfill~ - -\pagebreak - -\section{WordleGrid environment} - -\subsection{Environment} - -\begin{cautionblock} -The environment to display a Wordle grid is \packagetex!WordleGrid!. - -It works with keys, between \texttt{[...]} and needs to know : - -\begin{itemize} - \item the good word ; - \item the different guesses. -\end{itemize} - -The code create the grid and the colors ! -\end{cautionblock} - -\begin{DemoCode}[listing only] -\begin{WordleGrid}[keys]{good word} - guess n°1 - guess n°2 - guess n°3 -\end{WordleGrid} -\end{DemoCode} - -\begin{noteblock} -the grid is created with a \motcletex!minipage!, with automatic width and spacings ! -\end{noteblock} - -\begin{DemoCode}[] -%default output -\begin{WordleGrid}{REBUS} - ARISE - ROUTE - RULES - REBUS -\end{WordleGrid} -\end{DemoCode} - -\subsection{Keys and options} - -\begin{tipblock} -The first argument, mandatory and between \texttt{[...]}, proposes the following \Cle{keys} : - -\begin{itemize} - \item \Cle{Colors} : = colors of the boxes \Cle{back,misplaced,good} ; - - \hfill{}default : \Cle{WordleBack,WordleBad,WordleGood},% - \item \Cle{Rounded} := arc for corners, in mm ; \hfill{}default : \Cle{0.1} - \item \Cle{Unit} := width of cases, in cm ; \hfill{}default : \Cle{1} - \item \Cle{Font} := font for letters ; \hfill{}default : \Cle{\textbackslash LARGE\textbackslash bfseries\textbackslash sffamily} - \item \Cle{ColorLetters} := color for letters ; \hfill{}default : \Cle{white} - \item \Cle{BorderColor} := color fot the border ; \hfill{}default : \Cle{white} - \item \Cle{Letters} := boolean to print letters ; \hfill{}default : \Cle{true} - \item \Cle{Style} := style within \Cle{default / other} to change the style ; \hfill{}default : \Cle{default} - \item \Cle{Thick} := thickness of the borders, in mm. \hfill{}default : \Cle{0.25} -\end{itemize} -\vspace*{-\baselineskip}\leavevmode -\end{tipblock} - -\begin{tipblock} -The second argument, optional and between \texttt{\{...\}} is the correct word. - -\smallskip - -Different guesses are given within the body of the environment (line by line or space separated). -\end{tipblock} - -\subsection{Examples} - -\begin{DemoCode}[] -\begin{WordleGrid}{BURGH} - ABATE - HERBS - BURLY - BURGH -\end{WordleGrid} -% -\hspace{5mm} -% -\begin{WordleGrid}[Style=alt]{BURGH} - ABATE HERBS BURLY BURGH -\end{WordleGrid} -\end{DemoCode} - -\begin{DemoCode}[] -\begin{WordleGrid} - [Thickness=0.3,BorderColor=black,% - Colors={lightgray,orange,teal}]{BURGH} - ABATE - HERBS - BURLY - BURGH -\end{WordleGrid} -% -\hspace{5mm} -% -\begin{WordleGrid} - [Rounded=0,Thickness=0.3,BorderColor=black,% - Colors={lightgray,orange,teal}]{BURGH} - ABATE - HERBS - BURLY - BURGH -\end{WordleGrid} -\end{DemoCode} - -\begin{DemoCode}[] -\begin{WordleGrid}[Unit=2,Font=\Huge\ttfamily,ColorLetters=black]{BURGH} - ABATE - HERBS - BURLY - BURGH -\end{WordleGrid} -\end{DemoCode} - -\begin{DemoCode}[] -\begin{WordleGrid}% - [Unit=0.75,Rounded=0,Colors={cyan,orange,violet},Letters=false]{BURGH} - ABATE - HERBS - BURLY - BURGH -\end{WordleGrid} -\hspace{5mm} -\begin{WordleGrid}% - [Unit=0.75,Rounded=0,Colors={cyan,orange,violet},Style=alt] - {BURGH} - ABATE - HERBS - BURLY - BURGH -\end{WordleGrid} -\hspace{5mm} -\begin{WordleGrid}% - [Unit=0.75,Rounded=0,Colors={cyan,orange,violet},Style=alt,Letters=false] - {BURGH} - ABATE - HERBS - BURLY - BURGH -\end{WordleGrid} -\end{DemoCode} - -\end{document}
\ No newline at end of file diff --git a/graphics/pgf/contrib/wordle/doc/wordle-doc-fr.pdf b/graphics/pgf/contrib/wordle/doc/wordle-doc-fr.pdf Binary files differdeleted file mode 100644 index 3277ca9a99..0000000000 --- a/graphics/pgf/contrib/wordle/doc/wordle-doc-fr.pdf +++ /dev/null diff --git a/graphics/pgf/contrib/wordle/doc/wordle-doc-fr.tex b/graphics/pgf/contrib/wordle/doc/wordle-doc-fr.tex deleted file mode 100644 index f365cbb459..0000000000 --- a/graphics/pgf/contrib/wordle/doc/wordle-doc-fr.tex +++ /dev/null @@ -1,422 +0,0 @@ -% !TeX TXS-program:compile = txs:///arara -% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} -% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') - -\documentclass[french,a4paper,11pt]{article} -\usepackage[margin=2cm,includefoot]{geometry} -\def\TPversion{0.1.1} -\def\TPdate{3 septembre 2023} -\usepackage{amssymb,amsfonts,amsmath} -\usepackage[utf8]{inputenc} -%\usepackage[T1]{fontenc} -\usepackage{wordle} -\usepackage{awesomebox} -\usepackage{fontawesome5} -\usepackage{footnote} -\makesavenoteenv{tabular} -\usepackage{enumitem} -\usepackage{tabularray} -\usepackage{fancyvrb} -\usepackage{fancyhdr} -\fancyhf{} -\renewcommand{\headrulewidth}{0pt} -\lfoot{\sffamily\small [wordle]} -\cfoot{\sffamily\small - \thepage{} -} -\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} - -%\usepackage{hvlogos} -\usepackage{hologo} -\providecommand\tikzlogo{Ti\textit{k}Z} -\providecommand\TeXLive{\TeX{}Live\xspace} -\providecommand\PSTricks{\textsf{PSTricks}\xspace} -\let\pstricks\PSTricks -\let\TikZ\tikzlogo -\newcommand\TableauDocumentation{% - \begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} - {\LARGE \LaTeX} & & & & &\\ - & {\LARGE \hologo{pdfLaTeX}} & & & & \\ - & & {\LARGE \hologo{LuaLaTeX}} & & & \\ - & & & {\LARGE \TikZ} & & \\ - & & & & {\LARGE \TeXLive} & \\ - & & & & & {\LARGE \hologo{MiKTeX}} \\ - \end{tblr} -} - -\usepackage{hyperref} -\urlstyle{same} -\hypersetup{pdfborder=0 0 0} -\setlength{\parindent}{0pt} -\definecolor{LightGray}{gray}{0.9} - -\usepackage{babel} -\AddThinSpaceBeforeFootnotes -\FrenchFootnotes - -\usepackage{listings} - -\usepackage{newverbs} -\newverbcommand{\motcletex}{\color{cyan!75!black}}{} -\newverbcommand{\packagetex}{\color{violet!75!black}}{} - -\usepackage[most]{tcolorbox} -\tcbuselibrary{listingsutf8} -\newtcblisting{DemoCode}[1][]{% - enhanced,width=0.95\linewidth,center,% - bicolor,size=title,% - colback=cyan!2!white,% - colbacklower=cyan!1!white,% - colframe=cyan!75!black,% - listing options={% - breaklines=true,% - breakatwhitespace=true,% - style=tcblatex,basicstyle=\small\ttfamily,% - tabsize=4,% - commentstyle={\itshape\color{gray}}, - keywordstyle={\color{blue}},% - classoffset=0,% - keywords={},% - alsoletter={-},% - keywordstyle={\color{blue}},% - classoffset=1,% - alsoletter={-},% - morekeywords={center,justify},% - keywordstyle={\color{violet}},% - classoffset=2,% - alsoletter={-},% - morekeywords={GrilleSutom},% - keywordstyle={\color{green!50!black}},% - classoffset=3,% - morekeywords={Couleurs,Arrondi,Unite,Police,CouleurLettres,Lettres,Style,Epaisseur,CouleurBordure},% - keywordstyle={\color{orange}} - },% - #1 -} - -\tcbset{vignettes/.style={% - nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,% - boxrule=0.75pt,left=7pt,right=1pt,top=0pt,bottom=0.25pt,% - } -} - -\tcbset{vignetteMaJ/.style={% - fontupper={\vphantom{pf}\footnotesize\ttfamily}, - vignettes,colframe=purple!50!black,coltitle=white,colback=purple!10,% - overlay={\begin{tcbclipinterior}% - \fill[fill=purple!75]($(interior.south west)$) rectangle node[rotate=90]{\tiny \sffamily{\textcolor{black}{\scalebox{0.66}[0.66]{\textbf{MàJ}}}}} ($(interior.north west)+(5pt,0pt)$);% - \end{tcbclipinterior}} - } -} - -\newcommand\Cle[1]{{\small\sffamily\textlangle \textcolor{orange}{#1}\textrangle}} -\newcommand\cmaj[1]{\tcbox[vignetteMaJ]{#1}\xspace} - -\begin{document} - -\setlength{\aweboxleftmargin}{0.07\linewidth} -\setlength{\aweboxcontentwidth}{0.93\linewidth} -\setlength{\aweboxvskip}{8pt} - -\pagestyle{fancy} - -\thispagestyle{empty} - -\vspace{2cm} - -\begin{center} - \begin{minipage}{0.75\linewidth} - \begin{tcolorbox}[colframe=yellow,colback=yellow!15] - \begin{center} - \begin{tabular}{c} - {\Huge \texttt{wordle} [fr]}\\ - \\ - {\LARGE Des grilles de Wordle (Sutom),} \\ - \\ - {\LARGE avec \textsf{Ti\textit{k}Z}.} \\ - \end{tabular} - - \bigskip - - {\small \texttt{Version \TPversion{} -- \TPdate}} - \end{center} - \end{tcolorbox} -\end{minipage} -\end{center} - -\begin{center} - \begin{tabular}{c} - \texttt{Cédric Pierquet}\\ - {\ttfamily c pierquet -- at -- outlook . fr}\\ - \texttt{\url{https://github.com/cpierquet/wordle}} -\end{tabular} -\end{center} - -\vspace{0.25cm} - -{$\blacktriangleright$~~Créer des grilles de Wordle/Sutom\footnotemark\footnotetext{\url{https://fr.wikipedia.org/wiki/Wordle}}.} - -\vspace{0.25cm} - -{$\blacktriangleright$~~Gestion des couleurs, de la taille\footnotemark\footnotetext{Idées venant de \url{ttps://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex}}. - -\vspace{1cm} - -\begin{center} -\begin{GrilleSutom}{LUCIOLE} - LAPINES - LUMIERE - LOURDES - LUCIOLE -\end{GrilleSutom} -\end{center} - -\medskip - -\begin{center} -\begin{GrilleSutom}[Arrondi=0,Couleurs={lightgray,orange,teal},Style=alt,Unite=0.5,Lettres=false]{REBUS} - ABRIS - ROUTE - RUDES - REBUS -\end{GrilleSutom} -% -\hspace{5mm} -% -\begin{GrilleSutom}[Arrondi=0,Couleurs={lightgray,orange,teal},Style=alt,Unite=0.5]{REBUS} - ABRIS - ROUTE - RUDES - REBUS -\end{GrilleSutom} -\end{center} - -\vspace{0.5cm} - -%\hfill{}\textit{Merci à Denis Bitouzé et à Gilles Le Bourhis pour leurs retours et idées !} - -\smallskip - -\vfill - -\hrule - -\medskip - -\TableauDocumentation - -\medskip - -\hrule - -\vspace*{1cm} - -\newpage - -\phantomsection -\hypertarget{matoc}{} - -\tableofcontents - -\vfill - -\section{Historique} - -\verb|v0.1.0|~:~~~~Correction d'un bug avec la version anglaise. - -\verb|v0.1.0|~:~~~~Version initiale. - -\newpage - -\section{Le package wordle} - -\subsection{Le principe du jeu} - -\begin{noteblock} -Wordle est un jeu de lettres en ligne gratuit développé en 2021 par Josh Wardle. Ce jeu est une adaptation directe du jeu télévisé américain Lingo (Motus en France) qui propose de faire deviner un mot par plusieurs tentatives, en indiquant pour chacune d'entre-elles la position des lettres bien placées et mal placées. - -Le but du jeu est de deviner un mot spécifique de cinq lettres en un maximum de six tentatives, en tapant des lettres sur un écran de six lignes de cinq cases chacune. La personne qui joue inscrit sur la première ligne un mot de cinq lettres de son choix et entre sa proposition. Après chaque proposition, les lettres apparaissent en couleurs : le fond gris représente les lettres qui ne se trouvent pas dans le mot recherché, le fond jaune représente les lettres qui se trouvent ailleurs dans le mot, et le fond vert représente les lettres qui se trouvent à la bonne place dans le mot à trouver. - -\smallskip - -\hfill{\scriptsize \url{https://fr.wikipedia.org/wiki/Wordle}} -\end{noteblock} - -\subsection{Le package} - -\begin{noteblock} -Le package propose de quoi afficher, dans son document \LaTeX, une grille de Wordle (ou de Sutom) à l'aide de \TikZ{} et d'une \motcletex!minipage!, avec la possibilité : - -\begin{itemize} - \item de spécifier les dimensions, la couleur ; - \item de choisir le style des lettres mal placées ; - \item de personnaliser les bordure et les coins ; - \item d'afficher ou non les lettres. -\end{itemize} - -Contrairement au jeu \og initial \fg, il est possible de travailler avec des mots de longueur différente de 5 ! -\end{noteblock} - -\begin{importantblock} -Une bonne partie du code, en \hologo{LaTeX3}, est issu d'un fil sur \texttt{tex.stackexchange}, et proposé par l'internaute \textsf{3141592653589793238}. -\end{importantblock} - -\subsection{Chargement du package, packages utilisés} - -\begin{importantblock} -Le package se charge, de manière classique, dans le préambule. - -Il n'existe pas d'option pour le package, et \packagetex!xcolor! n'est pas chargé. -\end{importantblock} - -\begin{DemoCode}[listing only] -\documentclass{article} -\usepackage{wordle} - -\end{DemoCode} - -\begin{noteblock} -\packagetex!wordle! charge les packages suivants : - -\begin{itemize} - \item \packagetex!tikz!; - \item \packagetex!simplekv! ; - \item \packagetex!xstring!. -\end{itemize} - -Il est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} ou \textsf{xelatex}. -\end{noteblock} - -\vfill~ - -\pagebreak - -\section{Environnement GrilleSutom} - -\subsection{Fonctionnement global} - -\begin{cautionblock} -L'environnement dédié à la création de la grille du Sutom est \packagetex!GrilleSutom!. - -Il fonctionne avec un système de clés, entre \texttt{[...]}, et nécessite de préciser : - -\begin{itemize} - \item le bon mot ; - \item les différentes propositions. -\end{itemize} - -Le code se charge de mettre en forme (grâce à une \motcletex!minipage!) la grille et les différentes couleurs d'aide. -\end{cautionblock} - -\begin{DemoCode}[listing only] -\begin{GrilleSutom}[clés]{mot à trouver} - proposition n°1 - proposition n°2 - proposition n°3 -\end{GrilleSutom} -\end{DemoCode} - -\begin{noteblock} -Comme indiqué dans l'introduction, la grille est créée à l'aide d'un environnement \motcletex!minipage!, avec gestion automatique de la largeur et des espacements. -\end{noteblock} - -\begin{DemoCode}[] -%sortie par défaut -\begin{GrilleSutom}{SUTOM} - SAUCE - SAUTS - SUTOM -\end{GrilleSutom} -\end{DemoCode} - -\subsection{Clés et options} - -\begin{tipblock} -Le premier argument, optionnel et entre \texttt{[...]}, propose les \Cle{clés} suivantes : - -\begin{itemize} - \item \Cle{Couleurs} : = couleur des cases, sous la forme \Cle{fond,mal placée,bien placée} ; - - \hfill{}défaut : \Cle{cyan!75!black,yellow,red},% - \item \Cle{Arrondi} := arrondi des coins, en mm ; \hfill{}défaut : \Cle{0.1} - \item \Cle{Unite} := largeur des cases, en cm ; \hfill{}défaut : \Cle{1} - \item \Cle{Police} := police des lettres ; \hfill{}défaut : \Cle{\textbackslash LARGE\textbackslash bfseries\textbackslash sffamily} - \item \Cle{CouleurLettres} := couleur des lettres ; \hfill{}défaut : \Cle{white} - \item \Cle{CouleurBordure} := couleur de la bordure des cases ; \hfill{}défaut : \Cle{white} - \item \Cle{Lettres} := booléen pour afficher les lettre ; \hfill{}défaut : \Cle{true} - \item \Cle{Style} := style parmi \Cle{rond / autre} pour changer le style ; \hfill{}défaut : \Cle{rond} - \item \Cle{Epaisseur} := épaisseur des traits, en mm. \hfill{}défaut : \Cle{0.25} -\end{itemize} -\vspace*{-\baselineskip}\leavevmode -\end{tipblock} - -\begin{tipblock} -Le second argument, obligatoire et entre \texttt{\{...\}} correspond au mot correct à trouver. - -\smallskip - -Les différentes propositions sont à donner (ligne par ligne ou séparées par des espaces) dans le corps de l'environnement. -\end{tipblock} - -\subsection{Exemples} - -\begin{DemoCode}[] -\begin{GrilleSutom}{BOURDON} - BALEINE - BOURBON - BROMURE - BOURDON -\end{GrilleSutom} -% -\hspace{5mm} -% -\begin{GrilleSutom}[Style=alt]{BOURDON} - BALEINE BOURBON BROMURE BOURDON -\end{GrilleSutom} -\end{DemoCode} - -\begin{DemoCode}[] -\begin{GrilleSutom} - [Style=alt,Epaisseur=0.3,CouleurBordure=black,% - Couleurs={lightgray,orange,teal}]% - {BOURDON} - BALEINE BOURBON BROMURE BOURDON -\end{GrilleSutom} -% -\hspace{5mm} -% -\begin{GrilleSutom} - [Arrondi=0,Epaisseur=0.3,CouleurBordure=black,% - Couleurs={lightgray,orange,teal}]% - {BOURDON} - BALEINE BOURBON BROMURE BOURDON -\end{GrilleSutom} -\end{DemoCode} - -\begin{DemoCode}[] -\begin{GrilleSutom}[Unite=2,Police=\Huge\ttfamily,CouleurLettres=black]{BOURDON} - BALEINE - BOURBON - BROMURE - BOURDON -\end{GrilleSutom} -\end{DemoCode} - -\begin{DemoCode}[] -\begin{GrilleSutom}% - [Unite=0.75,Arrondi=0,Couleurs={cyan,orange,violet},% - Style=alt,Lettres=false]{REBUS} - ABRIS - ROUTE - RUDES - REBUS -\end{GrilleSutom} -\hspace{5mm} -\begin{GrilleSutom}% - [Unite=0.75,Arrondi=0,Couleurs={cyan,orange,violet},Style=alt]{REBUS} - ABRIS - ROUTE - RUDES - REBUS -\end{GrilleSutom} -\end{DemoCode} - -\end{document}
\ No newline at end of file diff --git a/graphics/pgf/contrib/wordle/tex/wordle.sty b/graphics/pgf/contrib/wordle/tex/wordle.sty deleted file mode 100644 index 4df1801ba0..0000000000 --- a/graphics/pgf/contrib/wordle/tex/wordle.sty +++ /dev/null @@ -1,298 +0,0 @@ -% Author.........: C. Pierquet -% licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf -% Inspiration....: https://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex - -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{wordle}[2023/09/03 v0.1.1 Wordle grid] -% 0.1.1 Coorection d'un bug sur la version anglaise -% 0.1.0 Version initiale + quelques modèles - -%------Packages utiles -\RequirePackage{tikz} -\RequirePackage{simplekv} -\RequirePackage{xstring} - -%commandes utiles -\usepackage{expl3} -\ExplSyntaxOn - -%boite en [fr] -\cs_new:Npn \l__sutom_boite_lettre:nn #1#2#3 -{ - \ifboolKV[SUTOM]{Lettres}% - {% - \tikz \draw[rounded~corners=\fpeval{#3*\SutomUnit}cm,draw=\SutomBorder,line~width=\SutomWidth~mm,fill=#1] (0,0) rectangle++ (\SutomUnit,\SutomUnit) node[midway,font=\SutomFonte,text=\SutomFonteColor,scale=\SutomUnit] {#2} ; - }% - {% - \tikz \draw[rounded~corners=\fpeval{#3*\SutomUnit}cm,draw=\SutomBorder,line~width=\SutomWidth~mm,fill=#1] (0,0) rectangle++ (\SutomUnit,\SutomUnit) ; - }% -} - -\cs_new:Npn \l__sutom_boite_lettre_rond:nn #1#2#3#4 -{ - \IfStrEq{\SutomStyle}{rond} - {% - \tikz {\draw[rounded~corners=\fpeval{#4*\SutomUnit}cm,draw=\SutomBorder,line~width=\SutomWidth~mm,fill=#1] (0,0) rectangle++ (\SutomUnit,\SutomUnit) ; - \ifboolKV[SUTOM]{Lettres}% - {% - \draw[line~width=\SutomWidth~mm,draw=#2,fill=#2] ({0.5*\SutomUnit},{0.5*\SutomUnit}) circle[radius=\fpeval{0.5*\SutomUnit-0.1*\SutomWidth}] node[font=\SutomFonte,text=\SutomFonteColor,scale=\SutomUnit] {#3} ; - }% - {% - \draw[line~width=\SutomWidth~mm,draw=#2,fill=#2] ({0.5*\SutomUnit},{0.5*\SutomUnit}) circle[radius=\fpeval{0.5*\SutomUnit-0.1*\SutomWidth}]; - }% - }% - }% - {% - \ifboolKV[SUTOM]{Lettres}% - {% - \tikz \draw[rounded~corners=\fpeval{#4*\SutomUnit}cm,line~width=0\SutomWidth~mm,draw=\SutomBorder,fill=#2] (0,0) rectangle++ (\SutomUnit,\SutomUnit) node[midway,font=\SutomFonte,text=\SutomFonteColor,scale=\SutomUnit] {#3} ; - }% - {% - \tikz \draw[rounded~corners=\fpeval{#4*\SutomUnit}cm,line~width=\SutomWidth~mm,draw=\SutomBorder,fill=#2] (0,0) rectangle++ (\SutomUnit,\SutomUnit) ; - }% - }% -} - -%boite en [en] -\cs_new:Npn \l__wordle_boite_lettre:nn #1#2#3 -{ - \ifboolKV[WORDLE]{Letters}% - {% - \tikz \draw[rounded~corners=\fpeval{#3*\SutomUnit}cm,draw=\SutomBorder,line~width=\SutomWidth~mm,fill=#1] (0,0) rectangle++ (\SutomUnit,\SutomUnit) node[midway,font=\SutomFonte,text=\SutomFonteColor,scale=\SutomUnit] {#2} ; - }% - {% - \tikz \draw[rounded~corners=\fpeval{#3*\SutomUnit}cm,draw=\SutomBorder,line~width=\SutomWidth~mm,fill=#1] (0,0) rectangle++ (\SutomUnit,\SutomUnit) ; - }% -} - -\cs_new:Npn \l__wordle_boite_lettre_rond:nn #1#2#3#4 -{ - \IfStrEq{\SutomStyle}{default} - {% - \ifboolKV[WORDLE]{Letters}% - {% - \tikz \draw[rounded~corners=\fpeval{#4*\SutomUnit}cm,line~width=\SutomWidth~mm,draw=\SutomBorder,fill=#2] (0,0) rectangle++ (\SutomUnit,\SutomUnit) node[midway,font=\SutomFonte,text=\SutomFonteColor,scale=\SutomUnit] {#3} ; - }% - {% - \tikz \draw[rounded~corners=\fpeval{#4*\SutomUnit}cm,line~width=\SutomWidth~mm,draw=\SutomBorder,fill=#2] (0,0) rectangle++ (\SutomUnit,\SutomUnit) ; - }% - }% - {% - \tikz {\draw[rounded~corners=\fpeval{#4*\SutomUnit}cm,draw=\SutomBorder,line~width=\SutomWidth~mm,fill=#1] (0,0) rectangle++ (\SutomUnit,\SutomUnit) ; - \ifboolKV[WORDLE]{Letters}% - {% - \draw[line~width=\SutomWidth~mm,draw=#2,fill=#2] ({0.5*\SutomUnit},{0.5*\SutomUnit}) circle[radius=\fpeval{0.5*\SutomUnit-0.1*\SutomWidth}] node[font=\SutomFonte,text=\SutomFonteColor,scale=\SutomUnit] {#3} ; - }% - {% - \draw[line~width=\SutomWidth~mm,draw=#2,fill=#2] ({0.5*\SutomUnit},{0.5*\SutomUnit}) circle[radius=\fpeval{0.5*\SutomUnit-0.1*\SutomWidth}]; - }% - }% - }% -} - -\seq_new:N \l_wordle_seq % the answer -\prop_new:N \l_wordle_prop % count letters in wordle -\seq_new:N \l_words_seq % list of all words -\prop_new:N \l_word_prop % count letters in word -\int_new:N \l_letter_int % index of current letter in word - -% a conditional for nonnegative prop counter in \l_word_prop -\prg_new_protected_conditional:Npnn \if_wordle_letter_nonnegative:n #1 {TF} -{ - \prop_if_in:NnTF \l_word_prop {#1} - { % letter in in prop - \prop_get:NnN \l_word_prop {#1} \l_tmpa_tl - \int_compare:nNnTF {\l_tmpa_tl} < {0} - {\prg_return_false:} {\prg_return_true:} - } - {\prg_return_false:} -} - -% a conditional for comparing letters -\prg_new_protected_conditional:Npnn \if_wordle_letters_agree:n #1 {T, TF} -{ - \str_set:Nx \l_tmpa_str {\seq_item:Nn \l_wordle_seq {\l_letter_int}} - \str_if_eq:nVTF {#1} \l_tmpa_str {\prg_return_true:} {\prg_return_false:} -} - -% add #3 to <prop=#1>.#2 -\cs_new_protected:Npn \wordle__add_to_prop_counter:Nnn #1#2#3 -{ - \prop_put_if_new:Nnn #1 {#2} {0} - \prop_pop:NnN #1 {#2} \l_tmp_a - \prop_put:Nnx #1 {#2} {\int_eval:n {#3+\l_tmp_a}} -} - -% make \l_wordle_prop<x> = #x's in wordle_seq -\cs_new_protected:Npn \count_letters_in_wordle:n #1 -{ - \wordle__add_to_prop_counter:Nnn \l_wordle_prop {#1} {1}% -} - -% first run: subtract correct matches from letter counts -\cs_new:Npn \count_letters_in_word:n #1 -{ - \int_incr:N \l_letter_int - \if_wordle_letters_agree:nT {#1} - { \wordle__add_to_prop_counter:Nnn \l_word_prop {#1} {-1} }% -} - -%commande [fr] -% on the second run we print a coloured wordle word -\cs_new:Npn \write_letters_in_word:n #1 -{ - \int_incr:N \l_letter_int - \if_wordle_letters_agree:nTF {#1} - { \l__sutom_boite_lettre:nn {\SutomBienPlacee}{#1}{\SutomRounded} } - { - % subtract 1 from the prop counter - \wordle__add_to_prop_counter:Nnn \l_word_prop {#1} {-1} - % if the counter is non-negative this is a pseudo match - \if_wordle_letter_nonnegative:nTF {#1} - { \l__sutom_boite_lettre_rond:nn {\SutomCoulFond}{\SutomCoulMalPlacee}{#1}{\SutomRounded} } - { \l__sutom_boite_lettre:nn {\SutomCoulFond}{#1}{\SutomRounded} } - }% -} - -%commande [en] -% on the second run we print a coloured wordle word -\cs_new:Npn \write_letters_in_wordle:n #1 -{ - \int_incr:N \l_letter_int - \if_wordle_letters_agree:nTF {#1} - { \l__wordle_boite_lettre:nn {\SutomBienPlacee}{#1}{\SutomRounded} } - { - % subtract 1 from the prop counter - \wordle__add_to_prop_counter:Nnn \l_word_prop {#1} {-1} - % if the counter is non-negative this is a pseudo match - \if_wordle_letter_nonnegative:nTF {#1} - { \l__wordle_boite_lettre_rond:nn {\SutomCoulFond}{\SutomCoulMalPlacee}{#1}{\SutomRounded} } - { \l__wordle_boite_lettre:nn {\SutomCoulFond}{#1}{\SutomRounded} } - }% -} - -%clés [fr] -\defKV[SUTOM]{% - Couleurs=\def\SutomCouleurs{#1},% - Arrondi=\def\SutomRounded{#1},% - Unite=\def\SutomUnit{#1},% - Police=\def\SutomFonte{#1},% - CouleurLettres=\def\SutomFonteColor{#1},% - Style=\def\SutomStyle{#1},% - Epaisseur=\def\SutomWidth{#1},% - CouleurBordure=\def\SutomBorder{#1} -} - -\setKVdefault[SUTOM]{% - Couleurs={cyan!75!black,yellow,red},% - Arrondi=0.1,% - Unite=1,% - Police=\LARGE\bfseries\sffamily,% - CouleurLettres=white,% - Lettres=true,% - Style=rond,% - Epaisseur=0.25,% - CouleurBordure=white -} - -%environnement [fr] -\NewDocumentEnvironment{GrilleSutom}{ O{} m b }% -{% - \restoreKV[SUTOM]% - \setKV[SUTOM]{#1}% - \StrBefore{\SutomCouleurs}{,}[\SutomCoulFond]% - \StrBetween[1,2]{\SutomCouleurs}{,}{,}[\SutomCoulMalPlacee]% - \StrBehind[2]{\SutomCouleurs}{,}[\SutomBienPlacee]% - \StrLen{#2}[\SutomNbLettres]% - \def\SutomLarg{\fpeval{1.01*\SutomUnit*\SutomNbLettres}}% - \begin{minipage}{\SutomLarg~cm} - \lineskip=0pt% - \parindent=0pt% - % split the answer into letters - \seq_set_split:Nnn \l_wordle_seq {} {#2} - % we need to count the number of times each letter appears in \l_wordle_seq - \prop_clear:N \l_wordle_prop - \tl_map_function:nN {#2} \count_letters_in_wordle:n - % split the solution into words - \regex_split:nnN {\s} {#3} \l_words_seq - % process the words - \seq_map_inline:Nn \l_words_seq - { - \int_zero:N \l_letter_int - \prop_set_eq:NN \l_word_prop \l_wordle_prop - \tl_map_function:nN {##1} \count_letters_in_word:n - \int_zero:N \l_letter_int - \tl_map_function:nN {##1} \write_letters_in_word:n - \par - } -}% -{% - \end{minipage}% -} - -%clés [en] -\definecolor{WordleBack}{HTML}{797D7F} -\definecolor{WordleBad}{HTML}{CAB557} -\definecolor{WordleGood}{HTML}{6AAB64} - -\defKV[WORDLE]{% - Colors=\def\SutomCouleurs{#1},% - Rounded=\def\SutomRounded{#1},% - Unit=\def\SutomUnit{#1},% - Fonte=\def\SutomFonte{#1},% - ColorLetters=\def\SutomFonteColor{#1},% - Style=\def\SutomStyle{#1},% - Thickness=\def\SutomWidth{#1},% - BorderColor=\def\SutomBorder{#1} -} - -\setKVdefault[WORDLE]{% - Colors={WordleBack,WordleBad,WordleGood},% - Rounded=0.1,% - Unit=1,% - Fonte=\LARGE\bfseries\sffamily,% - CouleurLettres=white,% - Letters=true,% - Style=default,% - Thick=0.25,% - BorderColor=white -} - -%environnement [en] -\NewDocumentEnvironment{WordleGrid}{ O{} m b } -{% - \restoreKV[WORDLE]% - \setKV[WORDLE]{#1}% - \StrBefore{\SutomCouleurs}{,}[\SutomCoulFond]% - \StrBetween[1,2]{\SutomCouleurs}{,}{,}[\SutomCoulMalPlacee]% - \StrBehind[2]{\SutomCouleurs}{,}[\SutomBienPlacee]% - \StrLen{#2}[\SutomNbLettres]% - \def\SutomLarg{\fpeval{1.01*\SutomUnit*\SutomNbLettres}}% - \begin{minipage}{\SutomLarg~cm} - \parindent=0pt - \lineskip=0pt - % split the answer into letters - \seq_set_split:Nnn \l_wordle_seq {} {#2} - % we need to count the number of times each letter appears in \l_wordle_seq - \prop_clear:N \l_wordle_prop - \tl_map_function:nN {#2} \count_letters_in_wordle:n - % split the solution into words - \regex_split:nnN {\s} {#3} \l_words_seq - % process the words - \seq_map_inline:Nn \l_words_seq - { - \int_zero:N \l_letter_int - \prop_set_eq:NN \l_word_prop \l_wordle_prop - \tl_map_function:nN {##1} \count_letters_in_word:n - \int_zero:N \l_letter_int - \tl_map_function:nN {##1} \write_letters_in_wordle:n - \par - } -}% -{% - \end{minipage}% -} - -\ExplSyntaxOff - -\endinput
\ No newline at end of file diff --git a/graphics/pgf/contrib/wordle/wordle-doc-en.pdf b/graphics/pgf/contrib/wordle/wordle-doc-en.pdf Binary files differnew file mode 100644 index 0000000000..7845bc31b5 --- /dev/null +++ b/graphics/pgf/contrib/wordle/wordle-doc-en.pdf diff --git a/graphics/pgf/contrib/wordle/wordle-doc-en.tex b/graphics/pgf/contrib/wordle/wordle-doc-en.tex new file mode 100644 index 0000000000..a638ed9496 --- /dev/null +++ b/graphics/pgf/contrib/wordle/wordle-doc-en.tex @@ -0,0 +1,921 @@ +% !TeX TS-program = pdflatex + +\documentclass[svgnames]{report} +\usepackage{wordle} +\usepackage{manfnt} +\usepackage{enumitem} +\setlist[description]{font=\sffamily\bfseries\color{ForestGreen},labelwidth=\textwidth} +\usepackage{booktabs} +\usepackage[a4paper,margin=18mm]{geometry} +\synctex=1 +\parindent=0pt +\parskip=2mm + +\usepackage{cmap} % fix search and cut-and-paste in Acrobat +\setcounter{secnumdepth}{0} + +\usepackage{listings}\lstset{language=[LaTeX]TeX,framerule=2pt} +\lstset{language=[LaTeX]TeX, + texcsstyle=*\bfseries\color{Peru}, + backgroundcolor=\color{Ivory}, + numbers=none, + breaklines=true, + keywordstyle=\color{Sienna}, + commentstyle=\color{BurlyWood}, + tabsize=2, + morekeywords={Wordle,wordle,GrilleSutom}, + resetmargins=true, +} +% hyperref links to ctan +\newcommand\ctan[1]{\href{https://www.ctan.org/pkg/#1}{\texttt{#1}}} + +\newcommand\Section[1]{\subsection{\textcolor{DarkGreen}{#1}}} + +\ExplSyntaxOn +\NewDocumentCommand\option{ omo }{% + \IfNoValueTF{#1}{\textsf{#2}} + {% + \textbf{\textcolor{Crimson}{#2}} + \str_if_empty:nF {#1}{~(default:~\textcolor{DarkRed}{#1})}% + \IfNoValueF{#3}{\hfill\textcolor{Gray}{[accepts:~#3]}}% + }% + \index{#2}% +} +\ExplSyntaxOff + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{imakeidx} +\indexsetup{level=\section*, toclevel=section, noclearpage} +\makeindex[intoc,columns=3] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[skins,listings]{tcolorbox} +\usetikzlibrary{backgrounds, shapes.geometric} % for tikz={framed,...} + +\DeclareTotalTCBox\keyword{ O{} v }{ + fontupper=\sffamily, + nobeforeafter, + skin=tile, + verbatim, + on line, + tcbox raise base, + top=0pt,bottom=0pt,left=0mm,right=0mm, + colback=OldLace, + colupper=ForestGreen, + #1} +{#2} + +\lstdefinestyle{tikz}{style=tcblatex, + classoffset=0, + texcsstyle=*\color{DarkGoldenrod},% + deletetexcs={begin, end}, + moretexcs={,% + node, + draw, + true, + false + },% + classoffset=1, + keywordstyle=\color{ForestGreen},% + morekeywords={wordle,GrilleSutom}, + classoffset=2, + keywordstyle=\color{Crimson},% + morekeywords={ + absent, + align, + border, + borders, + case, + color, + colors, + colour, + colours, + correct, + empty, + font, + frame, + frames, + letters, + lower, + name, + natural, + noalign, + noletters, + params, + present, + rounded, + rows, + scale, + sensitive, + separation, + shape, + shapes, + size, + strict, + style, + style, + text, + thickness, + tikz, + tile, + upper, + }, + classoffset=3, + keywordstyle=\color{DarkOrange},% + morekeywords={ + hard, + standard, + sutom, + } +} + +\DeclareTCBListing{example}{ !O{} }{% + skin=bicolor, + colframe=MediumSeaGreen, + colbacklower=OldLace, + colback=LawnGreen!20, + lefthand width=50mm, + listing style=tikz, + sidebyside, + sidebyside align=center, + sidebyside gap=4mm, + text and listing, + text outside listing, + boxsep = 0pt, + #1 +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\makeatletter +\author{Andrew Mathas and Cédric Pierquet} +\usepackage{tikz} +\usetikzlibrary{shadows.blur} +\tikzset{shadowed/.style={blur shadow={shadow blur steps=5}, + bottom color=ForestGreen!30, + draw=MediumSeaGreen!70, + shade, + font=\normalfont\Huge\bfseries\scshape, + rounded corners=8pt, + top color=SeaGreen, + }, + boxes/.style={draw=SeaGreen, + fill=Cornsilk, + font=\sffamily\small, + inner sep=5pt, + rectangle, + rounded corners=8pt, + text=DarkGreen, + } +} +\newcommand\Wordle{% + \begin{tikzpicture}[remember picture,overlay] + \node[yshift=-3cm] at (current page.north west) + {\begin{tikzpicture}[remember picture, overlay] + \draw[shadowed](30mm,0) rectangle node[white]{wordle} (\paperwidth-30mm,16mm); + \node[anchor=west,boxes] at (4cm,0cm) {\@author}; + \node[anchor=east,boxes] at (\paperwidth-4cm,0) {Version \wordle@version}; + \end{tikzpicture} + }; + \end{tikzpicture} + \vspace*{20mm} +} + +\def\@oddfoot{\textsc{Wordle} --- \wordle@version~(released~\wordle@release)\hfill\thepage} + +\usepackage[colorlinks=true,linkcolor=blue,urlcolor=MediumBlue]{hyperref} +\hypersetup{ + pdfcreator={ Generated by pdfLaTeX }, + pdfinfo={ + Author ={ Andrew Mathas and Cédric Pierquet}, + Keywords={ wordle }, + License ={ LaTeX Project Public License v1.3c or later }, + Subject ={ LaTeXing Wordle puzzles }, + Title ={ Wordle - \wordle@version } + }, +} +\makeatother + +\begin{document} + + \Wordle + + This package provides a stupidly feature-rich way of creating + \keyword{Wordle} puzzles in \LaTeX, which + \href{https://en.wikipedia.org/wiki/Wordle}{Wikipedia} describes as a + hugely popular web-based word game created and developed by Welsh + software engineer Josh Wardle. This package is an enhanced version of + one of the solutions to a question asked by \textcolor{FireBrick}{valerio\_new} + on + \href{https://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex/660056#660056}{tex.stackexchange.com}. + + This package provides the \keyword{wordle} environment, which uses the + syntax: + + \begin{tcblisting}{ + listing only, + skin=bicolor, + colframe=MediumSeaGreen, + colbacklower=OldLace, + colback=LawnGreen!20, + listing style=tikz, + boxsep = 0pt, + } + % \usepackage{wordle} + \begin{wordle}[wordle settings]{solution}[optional tikz commands] + guess1 guess2 ... + \end{wordle} + \end{tcblisting} + \index{environment!wordle} + \index{wordle} + + and the \keyword{GrilleSutom} environment, for \keyword{Sutom}, the French version of + the games: + + \begin{tcblisting}{ + listing only, + skin=bicolor, + colframe=MediumSeaGreen, + colbacklower=OldLace, + colback=LawnGreen!20, + listing style=tikz, + boxsep = 0pt, + } + % \usepackage{wordle} + \begin{GrilleSutom}[sutom settings]{solution}[optional TikZ commands] + guess1 guess2 ... + \end{GrilleSutom} + \end{tcblisting} + \index{environment!GrilleSutom} + \index{GrilleSutom} + \index{sutom} + + The words in the puzzle can be entered on a single lines, or on separate + lines. Here are some examples: + + \begin{example} + \begin{wordle}{ANVIL} + % English version of sutom (wordle) + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + \begin{example} + % French version of wordle (sutom) + \begin{GrilleSutom}{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + As in the online puzzles, the \keyword{wordle} environment + automatically colours the letter tiles + \keyword[colback=WordleCorrect,colupper=White]{green} + when the letter is in the same position as the solution, and as + \keyword[colback=WordlePresent,colupper=White]{gold} when + the letter is in the solution but it is not in the correct position. + Similarly, \keyword{GrilleSutom} colours the correct letters + \keyword[colback=WordleSutomCorrect,colupper=White]{red} + and the present letters + \keyword[colback=WordleSutomPresent,colupper=White]{gold}. + As described below, these colours can be changed to suit your tastes. + + The number of letters in the puzzle is determined by the solution, + being constrained only by the page width. + + \begin{example} + \begin{wordle}[rows=4]{orange} + normal + orders + orange + \end{wordle} + \end{example} + + The letters in the puzzle can be entered in upper case, lower case, or + mixed case. By default, the case of the letters is ignored when + determining the colours of the letter tiles. + + As described below, the \keyword{wordle} and \keyword{GrilleSutom} + environments accept an array of different options that change the + colours, fonts, and shapes of the tile. In addition, you can the case + sensitivity of the environments, add extra rows to the puzzle, disable + special formatting of the \textit{letter tiles}. These options are + given as a comma separated list key-value pairs. They can be set + locally, using the optional argument of the \keyword|wordle| + environment, or they can be set globally (more accurately, in the + current \LaTeX\ group) using the \keyword{\WordleSetup} command + \index{\textbackslash WordleSetup}, or as global package options, via + \keyword{\usepackage[options]{wordle}}. The order of the options does + not matter, except that later options take precedence over earlier + ones, with the exception of \option{tikz} and \option{tile style} keys + which are always applied last. + + The \keyword{wordle} puzzles are drawn using \ctan{TikZ}, with each + letter in the puzzle sitting inside a \ctan{TikZ} node. Many of the + options control the settings of these nodes. + + The descriptions of the options below are grouped according to their + function. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Wordle styles} + + The \option{style} key can be used to change many characteristics of + the tiles in a \keyword{wordle} puzzle, including their colours, the + fonts and so on. The more common settings can be setting using the + \option{style} keyword. \textit{The style should always be set first + because, otherwise, the style settings may override earlier settings.} + + The following styles are supported: + + \textcolor{DarkOrange}{sutom} + \index{style!sutom} + \index{sutom} + + \begin{example} + \begin{wordle}[style=sutom]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + The \textcolor{DarkOrange}{sutom} style is the default + style for the \keyword{GrilleSutom} environment. + + \textcolor{DarkOrange}{standard} + \index{style!standard} + + \begin{example} + \begin{wordle}[style=standard]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + The \textcolor{DarkOrange}{standard} style is the default style for the + \keyword{wordle} environment. + + \textcolor{DarkOrange}{hard} + \index{style!hard} + + \begin{example} + \begin{wordle}[style=hard]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Options for the individual styles of the letter tiles} + + There are four types of letter tiles in \keyword{wordle}: + \option{absent}, \option{present}, \option{correct} and + \option{empty}, corresponding to letters not in the solution, + incorrectly placed letters, correctly placed letters, and empty + tiles, respectively. The options in this section can be used to set + the text, tile and border colours, shapes, and frames of these tiles. + + The letter tiles in a \keyword{wordle} environment are typeset inside + a \ctan{TikZ} \keyword{\node}. The options below control the different + style settings of these nodes. + + \option[--]{colours}[comma separated list of valid colours] + + The \option{colours} option is a short-hand for specifying the colours + of the \option{absent}, \option{present}, \option{correct} and + \option{empty} tiles, in that order. Later colours can be omitted but + the colours should be given in this order, from left to right. + If only one colour is given then this colour is applied to all tiles. + + \begin{example} + \begin{wordle}[colours={LightGray,Orange,Teal}]{cellar} + pounds + taylor + cellar + \end{wordle} + \end{example} + + The colours can also be set individually using \option{absent colour}, + \option{present colour}, \option{correct colour} and \option{empty + colour}. To support north American dialects, is also possible to use + \option{colors}, \option{absent color}, \option{present color}, + \option{correct color} and \option{empty color}. + + \begin{example} + \begin{wordle}[absent colour=DarkGray,present color=Salmon, + correct color=SeaGreen]{cellar} + pounds + taylor + cellar + \end{wordle} + \end{example} + + \option[white]{borders}[comma separated list of valid colours] + + Similar to the \option{colours} option, this is a short-hand for the + setting border colour of the \option{absent}, \option{present}, + \option{correct} and \option{empty} tiles, in that order. + If only one colour is given then this colour is applied to all tiles. + + \begin{example} + \begin{wordle}[borders={red, orange,blue}]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + You can set the border borders of the individual tiles using + \option{absent border}, \option{present border}, \option{correct + border} and \option{empty border} + + \option[false]{frames}[comma separated list of true/false] + + This is a short-hand for adding a rectangular frame around the + \option{absent}, \option{present}, \option{correct} and \option{empty} + tiles, in that order, with the same background colour as the + \option{absent} file. This is only useful for non-square tiles. + + \begin{example} + \begin{wordle}[frames={false,true,true}, shapes=circle]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + You can set the frames of the individual tiles using + \option{absent frame}, \option{present frame}, + \option{correct frame} and \option{empty~frame}. + + \option[rectangle]{shapes}[comma separated list of TikZ shapes] + + Similar to the \option{colours} option, this is a short-hand for the + setting shape colour of the \option{absent}, \option{present}, + \option{correct} and \option{empty} tiles, in that order. + + \begin{example} + \begin{wordle}[shapes={circle, rectangle, circle}]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + You can set the shape shapes of the individual tiles using + \option{absent shape}, \option{present shape}, + \option{correct shape} and \option{empty shape} + You can use the shapes provided by the \ctan{TikZ} + \texttt{shapes.geometric} package, including \texttt{diamond}, + \texttt{ellipse}, \texttt{trapezium} and \texttt{star}; see + section~71.2 of the \ctan{TikZ} manual. + + \begin{example} + % \usepackage{shapes.geometric} + \begin{wordle}[shapes={diamond, ellipse, star}]{LADLE} + FLAIL + LAPEL + * + LADLE + LOVER + \end{wordle} + \end{example} + + \option[white]{text}[comma separated list of valid colours] + + This is a short-hand for the setting the text colours of the + \option{absent}, \option{present}, \option{correct} and \option{empty} + tiles, in that order. + + \begin{example} + \begin{wordle}[text={red, orange,blue}]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + You can set the text borders of the individual tiles using + \option{absent text}, \option{present border}, \option{correct + text} and \option{empty border} + + + \Section{Common tile characteristics} + + The following options apply to all tiles. + + \option[]{noalign} (default) \qquad + \option[]{align} + + The options tweak the vertical alignment of the letters in each row of + the puzzle. This is only likely to be useful if you have lower case + letters in your puzzle. + + \begin{example} + \begin{wordle}[align]{agony} + groan + angry + agony + \end{wordle} + \end{example} + + \begin{example} + \begin{wordle}[noalign]{agony} % the default + groan + angry + agony + \end{wordle} + \end{example} + + \option[\textbackslash Large\textbackslash bfseries\textbackslash sffamily]{font} + [LaTeX font specification] + + Sets the font used by all \keyword{wordle} letters. Any valid sequence + of \LaTeX\ font commands can be used. + + \begin{example} + \begin{wordle}[font=\large\sffamily]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + \option[1mm]{rounded}[a length] + + Set TikZ \texttt{rounded corners} key for the \keyword{wordle} letter tiles. + + \begin{example} + \begin{wordle}[rounded=2mm]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + \option[0.5mm]{separation}[a length] + + Sets the separation distance between the \keyword{wordle} letter + tiles. + + \begin{example} + \begin{wordle}[separation=2mm, borders=black]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + \option[1]{scale}[a number] + + The \option{scale} option rescales the \keyword{wordle} environment. + The \option{scale} alters the dimensions sets by the \option{rounded}, + \option{separation} \option{size} and \option{thickness} options. If + you change the scale, then you will almost certainly want + to change font size font as well, which you can do using the + \option{font} option: + + \begin{example} + \begin{wordle}[scale=1.5, font=\huge\bfseries]{SIZE} + HELP + WISE + SIZE + \end{wordle} + \end{example} + + \option[8mm]{size}[a length] + + The \option{size} option sets the size of the \keyword{wordle} letter + tiles. Unlike the \option{scale} option, \option{size} only changes + the dimensions of the letter tiles. + + \begin{example} + \begin{wordle}[size=10mm, font=\huge\bfseries]{LADLE} + FLAIL LAPEL * LADLE + \end{wordle} + \end{example} + + \option[0.25mm]{thickness}[a length] + + Sets the border thickness of the \keyword{wordle} letter tiles. By + default, the borders of the tiles are white, which makes this setting + hard to see, so the following example changes the border to red. + + \begin{example} + \begin{wordle}[thickness=1mm, borders=red]{LADLE} + FLAIL + LAPEL + LADLE + \end{wordle} + \end{example} + + \option[--]{tile style}[comma separated list of TikZ style keys] + + A comma-separated list of \ctan{Tikz} node keys that are appended to + the style of the \ctan{TikZ} node that contains each of the + \keyword{wordle} letters. Some of the options given above can be set + directly using the \option{tile style} option. When using the + \option{tile style}, be careful not to break the special formatting of + letters provided by the \keyword{wordle} environment.\par + + With most of the \keyword{wordle} options, the latter options take + precedence, however, the \option{tile style} option is applied last, + so it overrides any competing options. + + % TODO: Fix this because it looks like this style is being applied + % twice because the PDF file shows a rotation of 90 = 2*45... + \begin{example} + \begin{wordle}[tile style={rotate=45}]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Extra rows and columns} + + By default, all of the words in a \keyword{wordle} puzzle are assumed + to have the same number of letters as the solution, and the number of + rows in the puzzle is number of words given in the environment. The + options below give more control over the number of rows and columns in + the puzzle. + + \option[]{letters} (default)\qquad + \option[]{noletters} + + By default, the letters in the puzzle are printed. You can hide the + letters from the puzzle, while still keeping the \keyword{wordle} tile + colouring, using \option{noletters}. + + \begin{example} + \begin{wordle}[letters]{CRAZE} % the default + TRACE + CREAM + CRAZE + \end{wordle} + \end{example} + + \begin{example} + \begin{wordle}[noletters]{CRAZE} + TRACE + CREAM + CRAZE + \end{wordle} + \end{example} + + \option[false]{strict}[true/false/--] + + By default, the \keyword{wordle} environment does not check that each + word in the puzzle has the same length as the solution, so missing + and extra letters receive no special processing. + + \begin{example} + \begin{wordle}[strict=false]{CRAZE} % the default + GRAIL + CRAMPS + CRAM + CRABS + \end{wordle} + \end{example} + + The \option{strict} option enforces the word length in the puzzle by + marking missing letters as incorrect and striking out extra letters. + + \begin{example} + \begin{wordle}[strict]{CRAZE} + GRAIL + CRAMPS + CRAM + CRABS + \end{wordle} + \end{example} + + \option[--]{rows} + + By default, a \keyword{wordle} environment displays the words + in the puzzle environment with one word per row. You can add extra + (blank) rows to the puzzle with the \option{rows} option. + + \begin{example} + \begin{wordle}[rows=4]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + The \option{rows} option only adds extra rows to the puzzle if they + are needed. This option does not prevent ``extra'' rows from + appearing. + + \begin{example} + \begin{wordle}[rows=2]{ANVIL} + CRANE + NATAL + ANVIL + \end{wordle} + \end{example} + + + \option[]{*} + + You can disable the special colouring of letter tiles in a + \keyword{wordle} puzzle by adding an asterisk,~\option{*}, as a + \textit{word}, into the puzzle. + + \begin{example} + \begin{wordle}{ANVIL} + CRANE + NATAL + * % disable wordle colouring + ANNUL + ANVIL + \end{wordle} + \end{example} + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Case sensitivity} + \index{case~sensitive} + \index{case~sensitive!lower case} + \index{case~sensitive!natural case} + \index{case~sensitive!upper case} + + By default, the letters are printed in upper and lower case, exactly + as typed, and the letter comparisons are not case sensitive. + + \option[false]{case~sensitive} + + By default the \keyword{wordle} puzzles are not case sensitive, but + you can make them case sensitive using this option. Note that + \keyword{case sensitive} is the same as \keyword{case sensitive=true} + (and the default option is the same as + \keyword{case sensitive=false}). + + \begin{example} + \begin{wordle}[case sensitive=false]{youth} % the default + North + South + Youth + \end{wordle} + \end{example} + + Here is a case sensitive version of this puzzle. + + \begin{example} + \begin{wordle}[case sensitive]{youth} + North + South + Youth + \end{wordle} + \end{example} + + As this puzzle is case sensitive, the \keyword{Y} on the last line is + not marked as being correct because it does not match the \keyword{y} + in the solution. + + \option[]{natural case} (default) \qquad + \option[]{lower case} \qquad + \option[]{upper case} + + The \option{lower case} and \option{upper case} options force all + letters in the puzzle to be in lower or upper case, respectively. + + \begin{example} + \begin{wordle}[lower case]{YOUTH} + North + South + Youth + \end{wordle} + \end{example} + + \begin{example} + \begin{wordle}[upper case]{youth} + North + South + Youth + \end{wordle} + \end{example} + + As these examples show, both of these options disable the case + sensitivity of the tests for colouring the \keyword{wordle} tiles; + that is, they set \option{case sensitive=false}. To balance the + \option{lower case} and \option{upper case} options, the + \option{natural case} option makes the \keyword{wordle} environment + restores the default behaviour, which respects the case of the letters + as typed into the environment. The \option{natural case} option does + not change the \option{case sensitive} setting. + + \begin{example} + \begin{wordle}[natural case]{youth} % the default + North + South + youth + \end{wordle} + \end{example} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Adding \ctan{TikZ} code} + + The \keyword{wordle} environment is a fancy wrapper around a + \keyword{tikzpicture} environment, with some code under the hood that + automatically colours the letter tiles according to how well they + match the solution. The options in this section describe how to access + the underlying \ctan{TikZ} layer. + + \option[]{tikz}[TikZ commands] + + The \option{tikz} option passes \ctan{TikZ} keys to the underlying + \keyword{tikzpicture} environment. The \option{tikz} option is almost + the same as using a \keyword{\tikzset{...}} command before the + \keyword{wordle} environment except that it is applied to the + \keyword{tikpicture} environment, which contains the \keyword{wordle} + puzzle, such that the \option{tikz} keys are applied \textit{after} + all of options above and \textit{before} \option{tile style} is + applied. + + \begin{example} + % \usetikzlibrary{backgrounds} + \begin{wordle}[ + tikz={framed, + background rectangle/.style={ + double,ultra thick, draw=SteelBlue + } + }]{youth} + North South youth + \end{wordle} + \end{example} + + As this example indicates, it is advisable to enclose complicated + \ctan{TikZ} settings inside braces. + + \option[W]{name} + + All of the tiles in a \keyword{wordle} puzzle are given node names of + the form $\langle$\textsf{name}$\rangle$-$\mathsf{r}$-$\mathsf{c}$, + for the tile in row~$\mathsf{r}$ and column~$\mathsf{c}$. By default, + the prefix \textsf{name} is \texttt{W}. Within reason, the + \option{name} prefix can be changed to anything you like using the + \option{name} option. + + One way to use the named nodes for the letter tiles is with + \ctan{TikZ} \texttt{overlay} and \texttt{remember picture} keys: + + \begin{example} + \begin{wordle}[tikz={remember picture}]{CRAZE} + TRACE + CREAM + CRAZE + \end{wordle} + \end{example} + + This makes it possible, for example, to draw arrows to tiles in a + \keyword{wordle} puzzle: + + \begin{example} + \tikz[remember picture]\draw[overlay, very thick, opacity=0.5,->,red](0,0)node{No M!} to [out=90, in=180](W-2-5); + \end{example} + + A second use of the tile node names is in conjunction with \ctan{TikZ} + commands that can be added to a \keyword{wordle} puzzle using the + second optional argument to the environment. As with the \option{tikz} + option, it is advisable to enclose complicated \ctan{TikZ} commands + inside braces. + + \begin{example} + \begin{wordle}[name=M, + tikz={arr/.style={Red,ultra thick,->}} + ]{MACAW} + [{ + \draw[arr](M-1-3.south)--(M-3-2.north)--(M-4-2.north); + \draw[arr](M-1-1.south)--(M-3-5)--(M-4-3.north east); + }] + CRANE HOTLY BASIC MACAW + \end{wordle} + \end{example} + + In practice, we are not convinced that anyone will find a real use for this! + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{The package code} + + The \keyword{wordle} package is a \LaTeX3 package. There are many + comments in the code explaining how the code works. The automatic + colouring of the letter tiles is a fun exercise in \LaTeX3 + programming, which was motivated by a + \href{https://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex/660056#660056}{tex.stackexchange.com} post. + + Bug reports and feature requests can be made on \href{https://github.com/AndrewMathas/Wordle}{github}. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \printindex + +\end{document} diff --git a/graphics/pgf/contrib/wordle/wordle-doc-fr.pdf b/graphics/pgf/contrib/wordle/wordle-doc-fr.pdf Binary files differnew file mode 100644 index 0000000000..09d306b0f3 --- /dev/null +++ b/graphics/pgf/contrib/wordle/wordle-doc-fr.pdf diff --git a/graphics/pgf/contrib/wordle/wordle-doc-fr.tex b/graphics/pgf/contrib/wordle/wordle-doc-fr.tex new file mode 100644 index 0000000000..039bc7a158 --- /dev/null +++ b/graphics/pgf/contrib/wordle/wordle-doc-fr.tex @@ -0,0 +1,767 @@ +% !TeX TS-program = pdflatex + +\documentclass[svgnames]{report} +\usepackage[utf8]{inputenc} +\usepackage{wordle} +\usepackage{manfnt} +\usepackage{enumitem} +\setlist[description]{font=\sffamily\bfseries\color{ForestGreen},labelwidth=\textwidth} +\usepackage{booktabs} +\usepackage[a4paper,margin=18mm]{geometry} +\synctex=1 +\parindent=0pt +\parskip=2mm + +\usepackage{cmap} % fix search and cut-and-paste in Acrobat +\setcounter{secnumdepth}{0} + +\usepackage{listings}\lstset{language=[LaTeX]TeX,framerule=2pt} +\lstset{language=[LaTeX]TeX, + texcsstyle=*\bfseries\color{Peru}, + backgroundcolor=\color{Ivory}, + numbers=none, + breaklines=true, + keywordstyle=\color{Sienna}, + commentstyle=\color{BurlyWood}, + tabsize=2, + morekeywords={Wordle,wordle,GrilleSutom}, + resetmargins=true, +} +% hyperref links to ctan +\newcommand\ctan[1]{\href{https://www.ctan.org/pkg/#1}{\texttt{#1}}} + +\newcommand\Section[1]{\subsection{\textcolor{DarkGreen}{#1}}} + +\ExplSyntaxOn +\NewDocumentCommand\option{ omo }{% + \IfNoValueTF{#1}{\textsf{#2}} + {% + \textbf{\textcolor{Crimson}{#2}} + \str_if_empty:nF {#1}{~(défaut~:~\textcolor{DarkRed}{#1})}% + \IfNoValueF{#3}{\hfill\textcolor{Gray}{[accepte~:~#3]}}% + }% + \index{#2}% +} +\ExplSyntaxOff + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{imakeidx} +\indexsetup{level=\section*, toclevel=section, noclearpage} +\makeindex[intoc,columns=3] + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[skins,listings]{tcolorbox} +\usetikzlibrary{backgrounds, shapes.geometric} % for tikz={framed,...} + +\DeclareTotalTCBox\keyword{ O{} v }{ + fontupper=\sffamily, + nobeforeafter, + skin=tile, + verbatim, + on line, + tcbox raise base, + top=0pt,bottom=0pt,left=0mm,right=0mm, + colback=OldLace, + colupper=ForestGreen, + #1} +{#2} + +\lstdefinestyle{tikz}{style=tcblatex, + classoffset=0, + texcsstyle=*\color{DarkGoldenrod},% + deletetexcs={begin, end}, + moretexcs={,% + node, + draw, + true, + false + },% + classoffset=1, + keywordstyle=\color{ForestGreen},% + morekeywords={wordle,GrilleSutom}, + classoffset=2, + keywordstyle=\color{Crimson},% + morekeywords={ + absent, + Strict, + Taille, + Lignes, + Epaisseur, + align, + border, + borders, + Bords, + Cadres, + Style, + Formes, + Separation, + case, + Police, + Arrondi, + Echelle, + NonLettres, + color, + Couleurs, + CouleurBordures, + CouleurLettres, + bordure, + couleur, + colours, + correct, + vide, + font, + frame, + frames, + letters, + lower, + params, + name, + natural, + noalign, + noletters, + present, + rounded, + rows, + scale, + sensitive, + separation, + shape, + shapes, + size, + strict, + style, + style, + text, + thickness, + tikz, + tile, + upper, + }, + classoffset=3, + keywordstyle=\color{DarkOrange},% + morekeywords={ + hard, + standard, + sutom, + } +} + +\DeclareTCBListing{example}{ !O{} }{% + skin=bicolor, + colframe=MediumSeaGreen, + colbacklower=OldLace, + colback=LawnGreen!20, + lefthand width=50mm, + listing style=tikz, + sidebyside, + sidebyside align=center, + sidebyside gap=4mm, + text and listing, + text outside listing, + boxsep = 0pt, + #1 +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\makeatletter +\author{Andrew Mathas \&\ Cédric Pierquet} +\usepackage{tikz} +\usetikzlibrary{shadows.blur} +\tikzset{shadowed/.style={blur shadow={shadow blur steps=5}, + bottom color=ForestGreen!30, + draw=MediumSeaGreen!70, + shade, + font=\normalfont\Huge\bfseries\scshape, + rounded corners=8pt, + top color=SeaGreen, + }, + boxes/.style={draw=SeaGreen, + fill=Cornsilk, + font=\sffamily\small, + inner sep=5pt, + rectangle, + rounded corners=8pt, + text=DarkGreen, + } +} +\newcommand\Wordle{% + \begin{tikzpicture}[remember picture,overlay] + \node[yshift=-3cm] at (current page.north west) + {\begin{tikzpicture}[remember picture, overlay] + \draw[shadowed](30mm,0) rectangle node[white]{wordle} (\paperwidth-30mm,16mm); + \node[anchor=west,boxes] at (4cm,0cm) {\@author}; + \node[anchor=east,boxes] at (\paperwidth-4cm,0) {Version \wordle@version}; + \end{tikzpicture} + }; + \end{tikzpicture} + \vspace*{20mm} +} + +\def\@oddfoot{\textsc{Wordle} --- \wordle@version~(version~du~\wordle@release)\hfill\thepage} + +\usepackage[colorlinks=true,linkcolor=blue,urlcolor=MediumBlue]{hyperref} +\hypersetup{ + pdfcreator={ Generated by pdfLaTeX }, + pdfinfo={ + Author ={ Andrew Mathas et Cédric Pierquet }, + Keywords={ wordle }, + License ={ LaTeX Project Public License v1.3c or later }, + Subject ={ LaTeXing Wordle puzzles }, + Title ={ Wordle - \wordle@version } + }, +} +\makeatother + +\begin{document} + + \Wordle + + Ce package fournit un moyen \textit{stupidement} riche en fonctionnalités de créer des puzzles \keyword{Wordle} en \LaTeX, que \href{https://en.wikipedia.org/wiki/Wordle}{Wikipedia} décrit comme + comme un jeu de lettres en ligne extrêmement populaire, créé et développé par l'ingénieur logiciel gallois Josh Wardle. Ce paquet + est une version améliorée d'une des solutions à une question posée par \textcolor{FireBrick}{valerio\_new} sur \href{https://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex/660056#660056}{tex.stackexchange.com}. + + Ce paquet fournit l'environnement \keyword{GrilleSutom}, qui utilise la syntaxe : + + \begin{tcblisting}{ + listing only, + skin=bicolor, + colframe=MediumSeaGreen, + colbacklower=OldLace, + colback=LawnGreen!20, + listing style=tikz, + boxsep = 0pt, + } + % \usepackage{wordle} + \begin{GrilleSutom}[params sutom]{solution}[commandes tikz optionnelles] + essai1 essai2 ... + \end{GrilleSutom} + \end{tcblisting} + \index{environnement!GrilleSutom} + \index{GrilleSutom} + \index{sutom} + + et l'environnement \keyword{wordle}, pour la version anglaise du jeu : + + \begin{tcblisting}{ + listing only, + skin=bicolor, + colframe=MediumSeaGreen, + colbacklower=OldLace, + colback=LawnGreen!20, + listing style=tikz, + boxsep = 0pt, + } + % \usepackage{wordle} + \begin{wordle}[params wordle]{solution}[commandes tikz optionnelles] + essai1 essai2 ... + \end{wordle} + \end{tcblisting} + \index{environnement!wordle} + \index{wordle} + + Les mots du puzzle peuvent être saisis sur une seule ligne ou sur des lignes séparées. Voici quelques exemples : + + \begin{example} + %Version fr du wordle (sutom) + \begin{GrilleSutom}{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + \begin{example} + % Version en du sutom (wordle) + \begin{wordle}{SUTOM} + SAUCE + SAUTS + SUTOM + \end{wordle} + \end{example} + + Comme pour les puzzles en ligne, l'environnement \keyword{GrilleSutom} + colore automatiquement les lettres en + \keyword[colback=WordleSutomCorrect,colupper=White]{rouge} + lorsque la lettre se trouve dans la même position que la solution, et en + \keyword[colback=WordlePresent,colupper=White]{or} lorsque la lettre est dans la solution mais qu'elle n'est pas bien placée. + De même, \keyword{GrilleSutom} colore les lettres correctes en + \keyword[colback=WordleCorrect,colupper=White]{vert} + et les lettres actuelles en + \keyword[colback=WordleCorrect,colupper=White]{or}. + Comme décrites ci-dessous, ces couleurs peuvent être modifiées en fonction de vos goûts. + + Le nombre de lettres du puzzle est déterminé par la solution, et n'est limité que par la largeur de la page. + + \begin{example} + \begin{GrilleSutom}[Lignes=4]{orange} + normal + ordres + orange + \end{GrilleSutom} + \end{example} + + Les lettres du puzzle peuvent être saisies en majuscules, en minuscules ou en mélange de majuscules et de minuscules. Par défaut, la casse des lettres est ignorée lors de la détermination des couleurs des cases de lettres. + + Comme décrit ci-dessous, les environnements \keyword{wordle} et \keyword{GrilleSutom} acceptent une liste d'options différentes qui modifient les couleurs, les polices et les formes de la tuile. De plus, vous pouvez modifier la sensibilité à la casse des environnements, ajouter des lignes supplémentaires au puzzle, désactiver la mise en forme spéciale des \textit{cases de lettres}. Ces options sont données sous la forme d'une liste séparée par des virgules de paires \texttt{clé-valeur}. Elles peuvent être définies localement, en utilisant l'argument optionnel de l'environnement \keyword|wordle|, ou globalement (plus précisément, dans le groupe \LaTeX\ actuel) en utilisant la commande \keyword{\ParamsSutom} \index{\textbackslash ParamsSutom}, ou comme options globales du package, via \keyword{\usepackage[options]{wordle}}. L'ordre des options n'a pas d'importance, sauf que les options ultérieures ont priorité sur les options précédentes, à l'exception des clés \option{tikz} et \option{tile style} qui sont toujours appliquées en dernier. + + Les puzzles \keyword{wordle} sont dessinés à l'aide de \ctan{TikZ}, chaque lettre du puzzle étant placée à l'intérieur d'un nœud \ctan{TikZ}. De nombreuses options contrôlent les paramètres de ces nœuds. Les descriptions des options ci-dessous sont regroupées en fonction de leur fonction. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Styles Wordle} + + La clé \option{Style} peut être utilisée pour modifier de nombreuses caractéristiques des cases dans un puzzle \keyword{wordle}, y compris leurs couleurs, les polices et ainsi de suite. Les paramètres les plus courants peuvent être définis à l'aide du mot-clé \option{style}. \textit{Le style doit toujours être défini en premier car, sinon, les paramètres de style peuvent remplacer les paramètres précédents.} + + Les styles suivants sont pris en charge : + + \textcolor{DarkOrange}{sutom} + \index{Style!sutom} + \index{sutom} + + \begin{example} + \begin{GrilleSutom}[Style=sutom]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + En plus de définir les couleurs des cases, les cadres et les formes, le style \textsf{sutom} définit également la taille des cases à 8 mm. Le style \textsf{sutom} est le style par défaut pour l'environnement \keyword{GrilleSutom}. + + \textcolor{DarkOrange}{standard} + \index{style!standard} + + \begin{example} + \begin{GrilleSutom}[Style=standard]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + Le style \textcolor{DarkOrange}{standard} est le style par défaut pour l'environnement \keyword{wordle}. + + \textcolor{DarkOrange}{hard} + \index{style!hard} + + \begin{example} + \begin{GrilleSutom}[Style=hard]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Options pour les styles individuels des cases de lettres} + + Il existe quatre types de cases de lettres dans \keyword{wordle} : + \option{absent}, \option{present}, \option{correct} et + \option{vide}, correspondant respectivement aux lettres qui ne sont pas dans la solution, + aux lettres mal placées, aux lettres correctement placées et aux cases vides. Les options de cette section peuvent être utilisées pour + définir les couleurs du texte, des cases et des bordures, les formes et les cadres de ces cases. + + Les cases de lettres dans un environnement \keyword{wordle} sont composées à l'intérieur + d'un \keyword{\node} \ctan{TikZ}. Les options ci-dessous contrôlent les + différents paramètres de style de ces nœuds. + + \option[--]{Couleurs}[liste de couleurs valides séparées par des virgules] + + L'option \option{Couleurs} est un raccourci pour spécifier les + couleurs des cases \option{absent}, \option{present}, \option{correct} et + \option{vide}, dans cet ordre. Les couleurs suivantes peuvent être omises, mais + les couleurs doivent être données dans cet ordre, de gauche à droite. + Si une seule couleur est donnée, cette couleur est appliquée à toutes les cases. + + \begin{example} + \begin{GrilleSutom}[Couleurs={LightGray,Orange,Teal}]{cellar} + pounds + taylor + cellar + \end{GrilleSutom} + \end{example} + + Les couleurs peuvent également être définies individuellement à l'aide de \option{couleur absent}, \option{couleur present}, \option{couleur correct} et \option{couleur vide}. + + \begin{example} + \begin{GrilleSutom}[couleur absent=DarkGray,couleur present=Salmon, + couleur correct=SeaGreen]{cellar} + pounds + taylor + cellar + \end{GrilleSutom} + \end{example} + + \option[white]{CouleurBordures}[liste de couleurs valides séparées par des virgules] + + de manière similaire à l'option \option{Couleurs}, il s'agit d'un raccourci pour le paramétrage des couleurs des bordures des cases \option{absent}, \option{present}, + \option{correct} et \option{vide}, dans cet ordre. + + Si une seule couleur est donnée, elle est appliquée à toutes les cases. + + \begin{example} + \begin{GrilleSutom}[CouleurBordures={red,orange,blue}]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + Les bordures pour les cases individuelles peuvent être paramétrer via + \option{bordure absent}, \option{bordure present}, \option{bordure correct} et \option{bordure vide}. + + \option[false]{Cadres}[liste de booléens true/false séparées par des virgules] + + Il s'agit d'un raccourci pour ajouter un cadre autour des cases \option{absent}, \option{present}, \option{correct} et \option{vide}, dans cet ordre, avec la même couleur que \option{absent}. C'est utile uniquement pour les cases non carrée. + + \begin{example} + \begin{GrilleSutom}[Cadres={false,true,true},Formes=circle]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + Les cadres pour les cases individuelles peuvent être paramétrer via \option{cadre absent}, \option{cadre present}, + \option{cadre correct} and \option{cadre vide}. + + \option[rectangle]{Formes}[liste de formes TikZ séparées par des virgules] + + De même que pour l'option \option{Couleurs}, c'est un raccourci pour paramétrer les formes des cases \option{absent}, \option{present}, + \option{correct} et \option{vide}, dans cet ordre. + + \begin{example} + \begin{GrilleSutom}[Formes={circle, rectangle, circle}]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + Les formes individuelles peuvent être paramétrer via \option{forme absent}, \option{forme present}, + \option{forme correct} et \option{forme vide}. + + Les formes proposés par le package \ctan{TikZ} + \texttt{shapes.geometric}, incluant \texttt{diamond}, + \texttt{ellipse}, \texttt{trapezium} et \texttt{star} (voir section~71.2 du manuel \ctan{TikZ}). + + \begin{example} + % \usepackage{shapes.geometric} + \begin{GrilleSutom}[Formes={diamond,ellipse,star}]{LADLE} + FLAIL + LAPEL + * + LADLE + LOVER + \end{GrilleSutom} + \end{example} + + \option[white]{CouleurLettres}[liste de couleurs valides séparées par des virgules] + + Il s'agir d'un raccourci pour paramétrer la couleur des lettres des cases \option{absent}, \option{present}, \option{correct} et \option{vide}, dans cet ordre. + + \begin{example} + \begin{GrilleSutom}[CouleurLettres={red,orange,blue}]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + Les cases individuelles peuvent être paramétrer via \option{coultxt absent}, \option{coultxt present}, \option{coultxt correct} et \option{coultxt vide}. + + + \Section{Caractéristiques communes des cases} + + Les options suivantes s'appliquent à toutes les cases. + + \option[]{nonalign} (default) \qquad + \option[]{align} + + Cette option s'occupe de l'alignement vertical des lettres. C'est utile essentiellement lors de l'utilisation de minuscules. + + \begin{example} + \begin{GrilleSutom}[align]{agony} + groan + angry + agony + \end{GrilleSutom} + \end{example} + + \begin{example} + \begin{GrilleSutom}{agony} % nonalign par defaut + groan + angry + agony + \end{GrilleSutom} + \end{example} + + \option[\textbackslash Large\textbackslash bfseries\textbackslash sffamily]{Police} + [Police \LaTeX] + + Cela permet de paramétrer la police de toutes les lettres. Toute commande valide est acceptée. + + \begin{example} + \begin{GrilleSutom}[Police=\large\ttfamily]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + \option[1mm]{Arrondi}[une longueur] + + Cela permet de paramétrer le paramètres \texttt{rounded corners} (de TikZ) pour les cases \keyword{wordle}. + + \begin{example} + \begin{GrilleSutom}[Arrondi=2.5mm]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + \option[0.5mm]{Separation}[une longueur] + + Cela permet de paramétrer la séparation entre les cases du \keyword{wordle}. + + \begin{example} + \begin{GrilleSutom}[Separation=2mm,CouleurBordures=black]{REBUS} + ABRIS + ROUTE + REBUS + \end{GrilleSutom} + \end{example} + + \option[1]{Echelle}[un nombre] + + L'option \option{Echelle} applique un facteur à l'environnement \keyword{wordle}. + Cette option modifie les dimensions définies par les options \option{Arrondi}, + \option{Separation}, \option{Taille} et \option{Epaisseur}. Si vous changez l'échelle, vous voudrez également changer la police de caractères via \option{Police} : + + \begin{example} + \begin{GrilleSutom}[Echelle=1.5,Police=\huge\bfseries]{SIZE} + HELP + WISE + SIZE + \end{GrilleSutom} + \end{example} + + \option[8mm]{Taille}[une longueur] + + L'option \option{Taille} définit la taille des cases. Contrairement à l'option \option{Echelle}, \option{Taille} change uniquement la dimension des cases. + + \begin{example} + \begin{GrilleSutom}[Taille=10mm,Police=\huge\bfseries]{REPU} + ABRI ROUE * REPU + \end{GrilleSutom} + \end{example} + + \option[0.25mm]{Epaisseur}[une longueur]• + + Cela permet de paramétrer la taille des bordures des cases. Par défaut la couleur est blanche, donc pour illustrer cette option elle sera paramétrer en rouge. + + \begin{example} + \begin{GrilleSutom}[Epaisseur=0.75mm,CouleurBordures=red]{LADLE} + FLAIL + LAPEL + LADLE + \end{GrilleSutom} + \end{example} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Lignes et colonnes supplémentaires} + + Par défaut, le nombre de lignes et de colonnes de la grille est fixée par les mots donnés. + + \option[]{Lettres} (défaut)\qquad + \option[]{NonLettres} + + Par dafut, les lettres sont affichées, mais l'option \option{NonLettres} peuvent être cachées. + + \begin{example} + \begin{GrilleSutom}{CRAZE} % the default + TRACE + CREAM + CRAZE + \end{GrilleSutom} + \end{example} + + \begin{example} + \begin{GrilleSutom}[NonLettres]{CRAZE} + TRACE + CREAM + CRAZE + \end{GrilleSutom} + \end{example} + + \option[false]{Strict}[true/false/--] + + Par défaut, l'environnement ne vérifie pas si tous les mots sont la même taille, donc les lettres \textit{en trop} n'ont pas de style particulier. + + \begin{example} + \begin{GrilleSutom}[Strict=false]{CRAZE} % par defaut + GRAIL + CRAMPS + CRAM + CRABS + \end{GrilleSutom} + \end{example} + + L'option booléenne \option{Strict} force un style particulier des lettre \textit{en trop}. + + \begin{example} + \begin{GrilleSutom}[Strict]{CRAZE} + GRAIL + CRAMPS + CRAM + CRABS + \end{GrilleSutom} + \end{example} + + \option[--]{Lignes} + + Par défaut, l'environnement \keyword{wordle} affiche le nombre de lignes en adéquation avec le nombre de mots donnés. L'option \option{Lignes} permet de modifier le nombre de lignes (évenuellement vides). + + \begin{example} + \begin{GrilleSutom}[Lignes=4]{ANVIL} + CRANE + NATAL + ANVIL + \end{GrilleSutom} + \end{example} + + \begin{example} + \begin{GrilleSutom}[Lignes=2]{ANVIL} + CRANE + NATAL + ANVIL + \end{GrilleSutom} + \end{example} + + \option[]{*} + + Le style des case peut être annulé en ajoutant un astérisque,~\option{*}, en tant que mot. + + \begin{example} + \begin{GrilleSutom}{ANVIL} + CRANE + NATAL + * % annule la mise en forme + ANNUL + ANVIL + \end{GrilleSutom} + \end{example} + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Sensibilité à la casse} + \index{case~sensitive} + \index{case~sensitive!lower case} + \index{case~sensitive!natural case} + \index{case~sensitive!upper case} + + Par défaut, les lettres peuvent être écrites en majuscule ou en minuscule, comme saisies par l'utilisateur. + + L'option (voir doc en anglais) \option{case~sensitive} permet de spécifier un paramétrage de la casse. + + \begin{example} + \begin{GrilleSutom}[case sensitive=false]{youth} % par defaut + North + South + Youth + \end{GrilleSutom} + \end{example} + + \begin{example} + \begin{GrilleSutom}[case sensitive]{youth} + North + South + Youth + \end{GrilleSutom} + \end{example} + + Les options \textit{fines} \option{natural case} (défaut), \option{lower case}et \option{upper case} permettent de travailler plus finement sur la casse des lettres correctes et/ou mal placées. + + \begin{example} + \begin{GrilleSutom}[lower case]{YOUTH} + North + South + Youth + \end{GrilleSutom} + \end{example} + + \begin{example} + \begin{GrilleSutom}[upper case]{youth} + North + South + Youth + \end{GrilleSutom} + \end{example} + + \begin{example} + \begin{GrilleSutom}[natural case]{youth} % par defaut + North + South + youth + \end{GrilleSutom} + \end{example} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Style \ctan{TikZ} complémentaire} + + \option[]{tikz}[commandes TikZ] + + \begin{example} + % \usetikzlibrary{backgrounds} + \begin{GrilleSutom}[ + tikz={framed, + background rectangle/.style={ + double,ultra thick, draw=SteelBlue + } + }]{youth} + North South youth + \end{GrilleSutom} + \end{example} + + \pagebreak + + \option[W]{Nom} + + \begin{example} + \begin{GrilleSutom}[tikz={remember picture}]{CRAZE} + TRACE + CREAM + CRAZE + \end{GrilleSutom} + \end{example} + + \begin{example} + \tikz[remember picture]\draw[overlay, very thick, opacity=0.5,->,red](0,0)node{Pas de M !!!} to [out=90, in=180](W-2-5); + \end{example} + + \begin{example} + \begin{GrilleSutom}[name=M, + tikz={arr/.style={red,ultra thick,->}} + ]{MACAW} + [{ + \draw[arr](M-1-3.south)--(M-3-2.north)--(M-4-2.north); + \draw[arr](M-1-1.south)--(M-3-5)--(M-4-3.north east); + }] + CRANE HOTLY BASIC MACAW + \end{GrilleSutom} + \end{example} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \Section{Le code} + + Le package \keyword{wordle} est écrit en \LaTeX3. Beaucoup de commentaires permettent d'expliciter le fonctionnement du code. La coloration automatique des cases est un exercice amusant en \LaTeX3, motivépar un message issu de + \href{https://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex/660056#660056}{tex.stackexchange.com}. + + Le dépôt \href{https://github.com/AndrewMathas/Wordle}{github.com/AndrewMathas/Wordle} est disponible pour signaler tout bug. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \printindex + +\end{document} diff --git a/graphics/pgf/contrib/wordle/wordle.sty b/graphics/pgf/contrib/wordle/wordle.sty new file mode 100644 index 0000000000..a463f22837 --- /dev/null +++ b/graphics/pgf/contrib/wordle/wordle.sty @@ -0,0 +1,670 @@ +% --------------------------------------------------------------- +% wordle --- A latex package for typesetting wordle puzzles +% +% E-mail: andrew.mathas@gmail.com and cpierquet@outlook.fr +% Released under the LaTeX Project Public License v1.3c or later +% See http://www.latex-project.org/lppl.txt +% ---------------------------------------------------------------- + +\NeedsTeXFormat{LaTeX2e} + +% Package version +\def\wordle@version{0.3.0} +\def\wordle@release{2024-08-18} + +\providecommand\DeclareRelease[3]{} +\providecommand\DeclareCurrentRelease[2]{} +\DeclareRelease{\wordle@version}{\wordle@release}{wordle.sty} +\DeclareCurrentRelease{}{\wordle@release} + +\ProvidesExplPackage{wordle} {\wordle@release} {\wordle@version} + {A latex package for typesetting wordle puzzles} + +% ---------------------------------------------------------------- +% Required packages +%\RequirePackage{xcolor} +\RequirePackage{tikz} + +% ---------------------------------------------------------------- +% predefined tile colours + +% from https://www.nytimes.com/games/wordle +\definecolor{WordleAbsent} {HTML} {797D7F} +\definecolor{WordlePresent} {HTML} {F7DA21} +\definecolor{WordleCorrect} {HTML} {6AAB64} +\definecolor{WordleEmpty} {HTML} {F5F5DC} + +\definecolor{WordleHardPresent} {HTML} {95BEFA} +\definecolor{WordleHardCorrect} {HTML} {FB9B00} + +% from https://sutom.nocle.fr/# +\definecolor{WordleSutomAbsent} {HTML} {0077B7} +\definecolor{WordleSutomPresent} {HTML} {FFBB00} +\definecolor{WordleSutomCorrect} {HTML} {EB2152} + +% ---------------------------------------------------------------- +% package variables + +\bool_new:N \l__wordle_case_sensitive_bool % case sensitive mode (false by default) +\bool_new:N \l__wordle_strict_bool % strict mode (false by default) + +\dim_new:N \l__wordle_grid_dim +\dim_new:N \l__wordle_rounded_dim +\dim_new:N \l__wordle_sep_dim +\dim_new:N \l__wordle_size_dim +\dim_new:N \l__wordle_thickness_dim + +\int_new:N \l__wordle_rows_int + +\fp_new:N \l__wordle_scale_fp + +\tl_new:N \l__wordle_align_tl +\tl_new:N \l__wordle_depth_tl +\tl_new:N \l__wordle_font_tl +\tl_new:N \l__wordle_name_tl +\tl_new:N \l__wordle_style_tl +\tl_new:N \l__wordle_tikz_tl +\tl_new:N \l__wordle_tile_style_tl + +\tl_new:N \l__wordle_present_border_tl +\tl_new:N \l__wordle_present_colour_tl +\tl_new:N \l__wordle_present_frame_tl +\tl_new:N \l__wordle_present_shape_tl +\tl_new:N \l__wordle_present_text_tl + +\tl_new:N \l__wordle_correct_border_tl +\tl_new:N \l__wordle_correct_colour_tl +\tl_new:N \l__wordle_correct_frame_tl +\tl_new:N \l__wordle_correct_shape_tl +\tl_new:N \l__wordle_correct_text_tl + +\tl_new:N \l__wordle_empty_border_tl +\tl_new:N \l__wordle_empty_colour_tl +\tl_new:N \l__wordle_empty_frame_tl +\tl_new:N \l__wordle_empty_shape_tl +\tl_new:N \l__wordle_empty_text_tl + +\tl_new:N \l__wordle_absent_border_tl +\tl_new:N \l__wordle_absent_colour_tl +\tl_new:N \l__wordle_absent_frame_tl +\tl_new:N \l__wordle_absent_shape_tl +\tl_new:N \l__wordle_absent_text_tl + + +% ---------------------------------------------------------------- +% Assign up to four style attributes from comma separated list to absent, +% present, correct, empty, respectively. If there is only one entry in +% the list then everything is set equal to that entry +\cs_new_nopar:Npn \__wordle_set_style:nn #1#2 +{ + \seq_set_split:Nnn \l_tmpa_seq {,} {#2} + \int_compare:nNnTF {\seq_count:N \l_tmpa_seq} = {1} + { + \tl_set:co {l__wordle_absent_#1_tl} {#2} + \tl_set:co {l__wordle_present_#1_tl} {#2} + \tl_set:co {l__wordle_correct_#1_tl} {#2} + \tl_set:co {l__wordle_empty_#1_tl} {#2} + } + { + \seq_pop_left:NNT \l_tmpa_seq \l_tmpa_tl { \tl_set:co {l__wordle_absent_#1_tl} {\l_tmpa_tl} } + \seq_pop_left:NNT \l_tmpa_seq \l_tmpa_tl { \tl_set:co {l__wordle_present_#1_tl} {\l_tmpa_tl} } + \seq_pop_left:NNT \l_tmpa_seq \l_tmpa_tl { \tl_set:co {l__wordle_correct_#1_tl} {\l_tmpa_tl} } + \seq_pop_left:NNT \l_tmpa_seq \l_tmpa_tl { \tl_set:co {l__wordle_empty_#1_tl} {\l_tmpa_tl} } + } +} + +% apply the wordle styles +\cs_new_nopar:Npn \__wordle_apply_style:n #1 { + \str_case:enF { #1 } + { + {hard} + { + \__wordle_set_style:nn {border} {white} + \__wordle_set_style:nn {colour} {WordleAbsent,WordleHardPresent,WordleHardCorrect,WordleEmpty} + \__wordle_set_style:nn {frame} {false} + \__wordle_set_style:nn {shape} {rectangle} + \__wordle_set_style:nn {text} {white,white,white,black} + } + + {alt} + { % alt appears in the English version of Cedric's manual for sutom + \__wordle_set_style:nn {border} {white} + \__wordle_set_style:nn {colour} {WordleSutomAbsent,WordleSutomPresent,WordleSutomCorrect,WordleEmpty} + \__wordle_set_style:nn {frame} {false,true,false,false} + \__wordle_set_style:nn {shape} {rectangle,circle,rectangle,circle} + \__wordle_set_style:nn {text} {white,white,white,black} + \tl_set:Nn \l_wordle_font_tl {\LARGE\bfseries\sffamily} + + } + + {sutom} + { + \__wordle_set_style:nn {border} {white} + \__wordle_set_style:nn {colour} {WordleSutomAbsent,WordleSutomPresent,WordleSutomCorrect,WordleEmpty} + \__wordle_set_style:nn {frame} {false,true,false,false} + \__wordle_set_style:nn {shape} {rectangle,circle,rectangle,circle} + \__wordle_set_style:nn {text} {white,white,white,black} + \tl_set:Nn \l_wordle_font_tl {\LARGE\bfseries\sffamily} + } + } + { + % default style + \__wordle_set_style:nn {border} {white} + \__wordle_set_style:nn {colour} {WordleAbsent,WordlePresent,WordleCorrect,WordleEmpty} + \__wordle_set_style:nn {frame} {false} + \__wordle_set_style:nn {shape} {rectangle} + \__wordle_set_style:nn {text} {white,white,white,black} + } +} + +% rescale dimensions +\cs_new_nopar:Npn \__wordle_rescale:n #1 +{ + \fp_set:Nn \l__wordle_scale_fp {#1} + \dim_set:Nn \l__wordle_rounded_dim { \fp_eval:n {#1*\dim_to_decimal_in_mm:n {\l__wordle_rounded_dim }}mm } + \dim_set:Nn \l__wordle_sep_dim { \fp_eval:n {#1*\dim_to_decimal_in_mm:n {\l__wordle_sep_dim }}mm } + \dim_set:Nn \l__wordle_size_dim { \fp_eval:n {#1*\dim_to_decimal_in_mm:n {\l__wordle_size_dim }}mm } + \dim_set:Nn \l__wordle_thickness_dim { \fp_eval:n {#1*\dim_to_decimal_in_mm:n {\l__wordle_thickness_dim}}mm } +} + + +% ---------------------------------------------------------------- +% just in case we're running an old version of latex +\providecommand \IfFormatAtLeastTF { \@ifl@t@r \fmtversion } + +\IfFormatAtLeastTF { 2022-06-01 } + { \ProcessKeyOptions [ wordle ] } + { + \RequirePackage { l3keys2e } + \ProcessKeysOptions { wordle } + } + +% ---------------------------------------------------------------- +% Define keys for the package options and their defaults + +\keys_define:nn { wordle } +{ + % apply puzzle styles: sets colours of absent, present, correct and empty tiles + style .code:n = { + \seq_set_from_clist:Nn \l_tmpa_seq {#1} + \seq_map_inline:Nn \l_tmpa_seq { \__wordle_apply_style:n { \str_lowercase:n{##1}} } + }, + Style .meta:n = { style = #1 }, + style .initial:n = standard, + + % specifying tile colours and shapes + borders .code:n = { \__wordle_set_style:nn {border} {#1} }, + BorderColor .code:n = { \__wordle_set_style:nn {border} {#1} }, + CouleurBordures.code:n = { \__wordle_set_style:nn {border} {#1} }, + + Couleurs .code:n = { \__wordle_set_style:nn {colour} {#1} }, + colours .code:n = { \__wordle_set_style:nn {colour} {#1} }, + + frames .code:n = { \__wordle_set_style:nn {frame} {#1} }, + Cadres .code:n = { \__wordle_set_style:nn {frame} {#1} }, + frames .default:n = true, + shapes .code:n = { \__wordle_set_style:nn {shape} {#1} }, + Formes .code:n = { \__wordle_set_style:nn {shape} {#1} }, + + % text colour + text .code:n = { \__wordle_set_style:nn {text} {#1} }, + CouleurLettres .code:n = { \__wordle_set_style:nn {text} {#1} }, + + % align letters in puzzle + align .code:n = { + \tl_set:Nn \l__wordle_align_tl {\vphantom{azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN}} + \tl_set:Nn \l__wordle_depth_tl {text~depth=0pt} + }, + noalign .code:n = { + \tl_set:Nn \l__wordle_align_tl {} + \tl_set:Nn \l__wordle_depth_tl {} + }, + nonalign .meta:n = { noalign }, + align .initial:n = {true}, + + absent .tl_set:N = \l__wordle_absent_colour_tl, + absent~color .tl_set:N = \l__wordle_absent_colour_tl, + couleur~absent .tl_set:N = \l__wordle_absent_colour_tl, + absent~colour .tl_set:N = \l__wordle_absent_colour_tl, + bordure~absent .tl_set:N = \l__wordle_absent_border_tl, + absent~border .tl_set:N = \l__wordle_absent_border_tl, + absent~frame .tl_set:N = \l__wordle_absent_frame_tl, + cadre~absent .tl_set:N = \l__wordle_absent_frame_tl, + absent~frame .default:n = true, + absent~shape .tl_set:N = \l__wordle_absent_shape_tl, + forme~absent .tl_set:N = \l__wordle_absent_shape_tl, + absent~text .tl_set:N = \l__wordle_absent_text_tl, + coultxt~absent .tl_set:N = \l__wordle_absent_text_tl, + + correct .tl_set:N = \l__wordle_correct_colour_tl, + correct~color .tl_set:N = \l__wordle_correct_colour_tl, + correct~colour .tl_set:N = \l__wordle_correct_colour_tl, + couleur~correct.tl_set:N = \l__wordle_correct_colour_tl, + correct~border .tl_set:N = \l__wordle_correct_border_tl, + bordure~correct.tl_set:N = \l__wordle_correct_border_tl, + correct~frame .tl_set:N = \l__wordle_correct_frame_tl, + cadre~correct .tl_set:N = \l__wordle_correct_frame_tl, + correct~frame .default:n = true, + correct~shape .tl_set:N = \l__wordle_correct_shape_tl, + forme~correct .tl_set:N = \l__wordle_correct_shape_tl, + correct~text .tl_set:N = \l__wordle_correct_text_tl, + coultxt~correct.tl_set:N = \l__wordle_correct_text_tl, + + empty .tl_set:N = \l__wordle_empty_colour_tl, + couleur~vide .tl_set:N = \l__wordle_empty_colour_tl, + empty~color .tl_set:N = \l__wordle_empty_colour_tl, + empty~colour .tl_set:N = \l__wordle_empty_colour_tl, + empty~border .tl_set:N = \l__wordle_empty_border_tl, + bordure~vide .tl_set:N = \l__wordle_empty_border_tl, + empty~frame .tl_set:N = \l__wordle_empty_frame_tl, + cadre~vide .tl_set:N = \l__wordle_empty_frame_tl, + empty~frame .default:n = true, + empty~shape .tl_set:N = \l__wordle_empty_shape_tl, + forme~vide .tl_set:N = \l__wordle_empty_shape_tl, + empty~text .tl_set:N = \l__wordle_empty_text_tl, + coultxt~vide. tl_set:N = \l__wordle_empty_text_tl, + + present .tl_set:N = \l__wordle_present_colour_tl, + couleur~present.tl_set:N = \l__wordle_present_colour_tl, + present~color .tl_set:N = \l__wordle_present_colour_tl, + present~colour .tl_set:N = \l__wordle_present_colour_tl, + present~border .tl_set:N = \l__wordle_present_border_tl, + bordure~present.tl_set:N = \l__wordle_present_border_tl, + present~frame .tl_set:N = \l__wordle_present_frame_tl, + cadre~present .tl_set:N = \l__wordle_present_frame_tl, + present~frame .default:n = true, + present~shape .tl_set:N = \l__wordle_present_shape_tl, + forme~present .tl_set:N = \l__wordle_present_shape_tl, + present~text .tl_set:N = \l__wordle_present_text_tl, + coultxt~present.tl_set:N = \l__wordle_present_text_tl, + + % text font + font .tl_set:N = \l__wordle_font_tl, + Fonte .tl_set:N = \l__wordle_font_tl, + Police .tl_set:N = \l__wordle_font_tl, + font .initial:n = \Large\bfseries\sffamily, + + % tile size + size .dim_set:N = \l__wordle_size_dim, + Taille .dim_set:N = \l__wordle_size_dim, + size .initial:n = 8mm, + + % thickness of tile border + thickness .dim_set:N = \l__wordle_thickness_dim, + Epaisseur .dim_set:N = \l__wordle_thickness_dim, + Thick .code:n = {\dim_set:Nn \l__wordle_thickness_dim {#1mm}}, + thickness .initial:n = 0.25mm, + + % rounded-corner = # + rounded .dim_set:N = \l__wordle_rounded_dim, + Arrondi .dim_set:N = \l__wordle_rounded_dim, + rounded .default:n = 4pt, + Rounded .code:n = {\dim_set:Nn \l__wordle_rounded_dim {#1mm}}, + rounded .initial:n = 1mm, + + % separation between tiles + separation .dim_set:N = \l__wordle_sep_dim, + Separation .dim_set:N = \l__wordle_sep_dim, + separation .initial:n = 0.5mm, + + % rescale tiles + scale .code:n = { \__wordle_rescale:n {#1} }, + Echelle .code:n = { \__wordle_rescale:n {#1} }, + scale .initial:n = 1, + Unit .code:n = { \__wordle_rescale:n {#1} }, + Unite .code:n = { \__wordle_rescale:n {#1} }, + + % letter case + case~sensitive .bool_set:N = \l__wordle_case_sensitive_bool, + case~sensitive .default:n = true, + case~sensitive .initial:n = false, + + % letter visibility + letters .code:n = {\cs_set_eq:NN \__wordle_letter:n \__wordle_letter_natural:n}, + Lettres .code:n = {\cs_set_eq:NN \__wordle_letter:n \__wordle_letter_natural:n}, + noletters .code:n = {\cs_set_eq:NN \__wordle_letter:n \__wordle_letter_none:n}, + NonLettres .code:n = {\cs_set_eq:NN \__wordle_letter:n \__wordle_letter_none:n}, + letters .initial:n = true, + + % forced letter case + natural~case .code:n = { + \cs_set_eq:NN \__wordle_letter:n \__wordle_letter_natural:n + }, + lower~case .code:n = { + \cs_set_eq:NN \__wordle_letter:n \__wordle_letter_lower:n + \bool_set_false:N \l__wordle_case_sensitive_bool + }, + upper~case .code:n = { + \cs_set_eq:NN \__wordle_letter:n \__wordle_letter_upper:n + \bool_set_false:N \l__wordle_case_sensitive_bool + }, + + % puzzle specs: rows and columns + rows .int_set:N = \l__wordle_rows_int, + Lignes .int_set:N = \l__wordle_rows_int, + rows .initial:n = 0, + + strict .bool_set:N = \l__wordle_strict_bool, + Strict .bool_set:N = \l__wordle_strict_bool, + strict .default:n = true, + strict .initial:n = false, + + % tikz settings + tile~style .tl_set:N = \l__wordle_tile_style_tl, + Style~case .tl_set:N = \l__wordle_tile_style_tl, + tile~style .initial:n = , + + name .tl_set:N = \l__wordle_name_tl, + Nom .tl_set:N = \l__wordle_name_tl, + name .initial:n = W, + tikz .tl_set:N = \l__wordle_tikz_tl, + tikz .initial:n = , +} + +% user settings +\NewDocumentCommand\WordleSetup{ m }{ \keys_set:nn { wordle } {#1} } +\NewDocumentCommand\ParamsSutom{ m }{ \keys_set:nn { wordle } {#1} } + +% ---------------------------------------------------------------- +% Define TikZ Wordle styles for the letters. Using tikz styles both +% ensures consistency and has the added advantage of taking care of +% expansion issues with the tile settings +\tikzset{/Wordle/.is~family, /Wordle, + tile/.style = { + /tikz, % change back to using tikz keys + inner~sep = \l__wordle_sep_dim, + minimum~height = \l__wordle_size_dim, + minimum~size = \l__wordle_size_dim, + rounded~corners= \l__wordle_rounded_dim, + line~width = \l__wordle_thickness_dim, + font = \l__wordle_font_tl, + % scale = \fp_to_decimal:N \l__wordle_scale_fp, + text = \tl_use:c {l__wordle_#1_text_tl}, + fill = \tl_use:c {l__wordle_#1_colour_tl}, + shape = \tl_use:c {l__wordle_#1_shape_tl}, + }, + frame/.style = { + /Wordle/tile=#1, + /tikz, % change back to using tikz keys + draw = \tl_use:c{l__wordle_#1_border_tl}, + minimum~size = {\l__wordle_size_dim+\l__wordle_thickness_dim}, + fill = \tl_use:c {l__wordle_#1_colour_tl}, + shape = rectangle, + }, +} + +% apply a TikZ setting +\cs_new_nopar:Npn \__wordle_tikzset:n #1 { \exp_args:Nx \tikzset{#1} } + +% ---------------------------------------------------------------- +% preprocessing of the wordle letters +\cs_new_nopar:Npn \__wordle_letter_none:n #1 {} +\cs_new_nopar:Npn \__wordle_letter_natural:n #1 {#1} +\cs_new_nopar:Npn \__wordle_letter_lower:n #1 { \str_lowercase:n {#1} } +\cs_new_nopar:Npn \__wordle_letter_upper:n #1 { \str_uppercase:n {#1} } + +% by default wordle letters are not processed +\cs_set_eq:NN \__wordle_letter:n \__wordle_letter_natural:n + +% Print a letter in a box as a node. There is slightly different behaviour +% depending on whether the tile is frames or we are in strict mode. The way +% that the entry is printed depends is controlled by \__wordle_letter:n. +\cs_new_nopar:Npn \wordle__boxed_letter:nn #1#2 +{ + % determine the node name, which takes the form <W>-<row>-<col> + \tl_set:No \l_tmpa_tl + { + \l__wordle_name_tl-\int_eval:n{1+\l__wordle_row_index_int}-\int_use:N\l__wordle_letter_index_int + } + + % the construction of the node depends on whether the tile is framed + \tl_if_eq:cnTF {l__wordle_#1_frame_tl} {true} + { + % draw the frame + \node[/Wordle/frame=absent] % frame use the absent fill colour + at ({\l__wordle_letter_index_int*\l__wordle_grid_dim},{-\l__wordle_row_index_int*\l__wordle_grid_dim}){}; + % draw the tile + \node[/Wordle/tile=#1] + (\l_tmpa_tl) at ({\l__wordle_letter_index_int*\l__wordle_grid_dim}, + {-\l__wordle_row_index_int*\l__wordle_grid_dim}) + { \l__wordle_align_tl\__wordle_letter:n {#2} }; + } + { + % draw the tile, with a border + \node[/Wordle/frame=#1, /Wordle/tile=#1] + (\l_tmpa_tl) at ({\l__wordle_letter_index_int*\l__wordle_grid_dim}, + {-\l__wordle_row_index_int*\l__wordle_grid_dim}) + { \l__wordle_align_tl\__wordle_letter:n {#2} }; + } + + % if strict then put a slash through any extra letters + \bool_if:NT \l__wordle_strict_bool + { + \int_compare:nNnT {\l__wordle_letter_index_int} > {\seq_count:N \l__wordle_answer_seq } + { + \draw[red,ultra~thick] (\tl_use:N\l_tmpa_tl.south~west)--(\tl_use:N\l_tmpa_tl.north~east); + } + } +} + +\seq_new:N \l__wordle_answer_seq % the answer +\prop_new:N \l__wordle_answer_counts_prop % count letters in wordle +\seq_new:N \l__wordle_solution_seq % list of all words +\prop_new:N \l__wordle_word_counts_prop % count letters in word +\int_new:N \l__wordle_letter_index_int % index of current letter in word +\int_new:N \l__wordle_row_index_int % TikZ row index in solution + +% a conditional for non-negative prop counter in \l__wordle_word_counts_prop +\prg_new_protected_conditional:Npnn \if__wordle_letter_nonnegative:n #1 {TF} +{ + \prop_if_in:NnTF \l__wordle_word_counts_prop {#1} + { % letter in in prop + \prop_get:NnN \l__wordle_word_counts_prop {#1} \l_tmpa_tl + \int_compare:nNnTF {\l_tmpa_tl} < {0} + {\prg_return_false:} {\prg_return_true:} + } + {\prg_return_false:} +} + +\cs_generate_variant:Nn \str_if_eq:nVTF {xVTF} + +% a conditional for comparing letters +\prg_new_protected_conditional:Npnn \if__wordle_letters_agree:n #1 {T, TF} +{ + \str_set:Nx \l_tmpa_str + {\seq_item:Nn \l__wordle_answer_seq {\l__wordle_letter_index_int}} + + + \bool_if:NTF \l__wordle_case_sensitive_bool + {\str_if_eq:nVTF {#1} \l_tmpa_str {\prg_return_true:} {\prg_return_false:}} + {\str_if_eq:xVTF {\str_uppercase:n{#1}} \l_tmpa_str {\prg_return_true:} {\prg_return_false:}} +} + +% add #3 to <prop=#1>.#2 +\cs_new_nopar:Npn \wordle__add_to_prop_counter:Nnn #1#2#3 +{ + \prop_put_if_new:Nnn #1 {#2} {0} + \prop_pop:NnN #1 {#2} \l_tmp_a + \prop_put:Nnx #1 {#2} {\int_eval:n {#3+\l_tmp_a}} +} + +% make \l__wordle_answer_counts_prop<x> = #x's in wordle_seq +\cs_new_nopar:Npn \wordle__count_letters_in_answer:n #1 +{ + \wordle__add_to_prop_counter:Nnn \l__wordle_answer_counts_prop {#1} {1} +} + +% first run: subtract correct matches from letter counts +\cs_new_nopar:Npn \wordle__count_letters_in_word:n #1 +{ + \int_incr:N \l__wordle_letter_index_int + \if__wordle_letters_agree:nT {#1} + { \wordle__add_to_prop_counter:Nnn \l__wordle_word_counts_prop {#1} {-1} } +} + +% on the second run we print a coloured wordle word +\cs_new_nopar:Npn \wordle__write_letters_in_word:n #1 +{ + \int_incr:N \l__wordle_letter_index_int + \if__wordle_letters_agree:nTF {#1} + { \wordle__boxed_letter:nn {correct} {#1} } + { + % subtract 1 from the prop counter + \wordle__add_to_prop_counter:Nnn \l__wordle_word_counts_prop {#1} {-1} + % if the counter is non-negative this is a pseudo match + \if__wordle_letter_nonnegative:nTF {#1} + { \wordle__boxed_letter:nn {present} {#1} } + { \wordle__boxed_letter:nn {absent} {#1} } + } +} + +\cs_generate_variant:Nn \seq_set_split:Nnn {Nnx} +\cs_generate_variant:Nn \cs_set_nopar:Nn {NV} + +% typeset the word "#1", colouring letters using the wordle convention +\cs_new_nopar:Npn \wordle__mark_word:n #1 +{ + \str_if_eq:nnTF {#1} {*} + { + \cs_set_eq:NN \wordle__process_word:n \wordle__empty_word:n + } + { + \prop_set_eq:NN \l__wordle_word_counts_prop \l__wordle_answer_counts_prop + \tl_map_function:nN {#1} \wordle__count_letters_in_word:n + \int_zero:N \l__wordle_letter_index_int + \tl_map_function:nN {#1} \wordle__write_letters_in_word:n + + % if strict then check lengths + \bool_if:NT \l__wordle_strict_bool + { + \int_while_do:nNnn {\l__wordle_letter_index_int} < {\seq_count:N\l__wordle_answer_seq} + { + \int_incr:N \l__wordle_letter_index_int + \wordle__boxed_letter:nn {absent} {\c_space_tl} + } + } + + % increment the row index + \int_incr:N \l__wordle_row_index_int + } +} + +% typeset the word "#1" by putting boxes around each letter +\cs_new_nopar:Npn \wordle__empty_word:n #1 +{ + \tl_map_inline:nn {#1} + { + \int_incr:N \l__wordle_letter_index_int + \wordle__boxed_letter:nn {empty} {##1} + } + % if strict then check lengths + \bool_if:NT \l__wordle_strict_bool + { + \int_while_do:nNnn {\l__wordle_ltter_index_int} < {\seq_count:N\l__wordle_answer_seq} + { + \int_incr:N \l__wordle_letter_index_int + \wordle__boxed_letter:nn {empty} {\c_space_tl} + } + } + \int_incr:N \l__wordle_row_index_int +} + +\cs_set_eq:NN \wordle__process_word:n \wordle__mark_word:n + +\NewDocumentEnvironment{wordle}{ O{} m O{} b } +{ + % apply wordle environment options + \WordleSetup{#1} + \begin{tikzpicture} + + % apply any tikz settings -- we need to some expansion trickery to do this + \__wordle_tikzset:n {\l__wordle_tikz_tl} + \__wordle_tikzset:n {/Wordle/tile/.append~style={\l__wordle_depth_tl,\l__wordle_tile_style_tl}} + + % set grid dimension = box size + separation + \dim_set:Nn \l__wordle_grid_dim {\l__wordle_size_dim+\l__wordle_sep_dim} + + % split the answer into letters + \bool_if:NTF \l__wordle_case_sensitive_bool + { \seq_set_split:Nnn \l__wordle_answer_seq {} {#2} } + { \seq_set_split:Nnx \l__wordle_answer_seq {} {\str_uppercase:n {#2}} } + + % count the number of times letters appear in \l__wordle_answer_seq + \prop_clear:N \l__wordle_answer_counts_prop + \tl_map_function:nN {#2} \wordle__count_letters_in_answer:n + + % split the solution into words + \regex_split:nnN {\s} {#4} \l__wordle_solution_seq + + % process the words + \int_zero:N \l__wordle_row_index_int + \seq_map_inline:Nn \l__wordle_solution_seq + { + \int_zero:N \l__wordle_letter_index_int + \wordle__process_word:n {##1} + } + + % if required, add extra required blank rows + \int_while_do:nNnn {\l__wordle_row_index_int} < {\l__wordle_rows_int} + { + \int_zero:N \l__wordle_letter_index_int + \int_while_do:nNnn {\l__wordle_letter_index_int} < {\seq_count:N\l__wordle_answer_seq} + { + \int_incr:N \l__wordle_letter_index_int + \wordle__boxed_letter:nn {empty} {\c_space_tl} + } + \int_incr:N \l__wordle_row_index_int + } + + % finally, execute the optional TikZ commands + #3 + + \end{tikzpicture} +}{} + +% wrapper environment for Gridwordle +\NewDocumentEnvironment{GridWordle}{ O{} m O{} b } + { + \begin{wordle}[#1]{#2}[#3]#4]\end{wordle} + } + {} + +% wrapper environment for GrilleSutom +\NewDocumentEnvironment{GrilleSutom}{ O{} m O{} b } + { + \begin{wordle}[style=sutom,#1]{#2}[#3]#4\end{wordle} + } + {} + +\endinput + +% ---------------------------------------------------------------- +% CHANGE LOG +% +% Version 0.3 - \wordle@release +% - merged AM & CP packages, adding styles and streamlining options, french keys +% +% Version 0.2 - \wordle@release +% - added documentation and cleaned some of the options +% +% Version 0.1 - 2022-10-01 +% - initial version +% +% ---------------------------------------------------------------- +% +% Copyright (C) 2022-3 by Andrew Mathas <andrew.mathas@gmail.com> +% and Cédric Pierquet cpierquet@outlook.fr +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License (LPPL), either +% version 1.3c of this license or (at your option) any later +% version. The latest version of this license is in the file: +% +% http://www.latex-project.org/lppl.txt +% +% This work is "maintained" (as per LPPL maintenance status) by +% Andrew Mathas. +% +% This work consists of the files: +% wordle.sty +% wordle.tex |