diff options
author | Norbert Preining <norbert@preining.info> | 2023-05-20 03:02:47 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-05-20 03:02:47 +0000 |
commit | 9cdcfcf8d9333b1d9b34b61ddc21910bbcc04491 (patch) | |
tree | f9143b5812837ab74ec819d0be97721594863346 /macros/latex/contrib | |
parent | dd54bf2a9c9e985917ceb5ced412213cd44eaeae (diff) |
CTAN sync 202305200302
Diffstat (limited to 'macros/latex/contrib')
33 files changed, 4134 insertions, 766 deletions
diff --git a/macros/latex/contrib/counterz/README b/macros/latex/contrib/counterz/README new file mode 100644 index 0000000000..b7376e3a0b --- /dev/null +++ b/macros/latex/contrib/counterz/README @@ -0,0 +1,22 @@ + + +---------------------------------------------------------------------- +`counterz' --- 2023/05/19 Version 1.0.0 + +Copyright (C) 2023 by Christopher McClain +E-mail: christopher.mcclain@mail.wvu.edu + +Released under the LaTeX Project Public License v1.3c or later +See https://www.latex-project.org/lppl.txt +---------------------------------------------------------------------- + +The `counterz' package provides additional tools for manipulating +counters. The package facilitates the use of stealth prefixes for +counter names in order to help distinguish between counters from +multiple input files. The package also provides a means to generate +random counters and save such counter values for future typesetting. + + + + + diff --git a/macros/latex/contrib/counterz/counterz.dtx b/macros/latex/contrib/counterz/counterz.dtx new file mode 100644 index 0000000000..82857faf4c --- /dev/null +++ b/macros/latex/contrib/counterz/counterz.dtx @@ -0,0 +1,1409 @@ +% \iffalse meta-comment +% !TEX program = pdfLaTeX + +%<*internal> +\iffalse +%</internal> + +%<*readme> +---------------------------------------------------------------------- +`counterz' --- 2023/05/19 Version 1.0.0 + +Copyright (C) 2023 by Christopher McClain +E-mail: christopher.mcclain@mail.wvu.edu + +Released under the LaTeX Project Public License v1.3c or later +See https://www.latex-project.org/lppl.txt +---------------------------------------------------------------------- + +The `counterz' package provides additional tools for manipulating +counters. The package facilitates the use of stealth prefixes for +counter names in order to help distinguish between counters from +multiple input files. The package also provides a means to generate +random counters and save such counter values for future typesetting. +%</readme> + +%<*internal> +\fi +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX\else + \expandafter\begingroup +\fi +%</internal> + +%<*install> +\input docstrip.tex +\keepsilent +\askforoverwritefalse + +\preamble +---------------------------------------------------------------------- +`counterz' --- 2023/05/19 Version 1.0.0 Additional tools for counters +E-mail: christopher.mcclain@mail.wvu.edu +Released under the LaTeX Project Public License v1.3c or later +See https://www.latex-project.org/lppl.txt +---------------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2023 by Christopher McClain + +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: + +https://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 Christopher McClain. + +This work consists of the file counterz.dtx +and the derived files counterz.ins, + counterz.pdf and + counterz.sty. + +\endpostamble + +\usedir{tex/latex/counterz} +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} + +%</install> +%<install>\endbatchfile + +%<*internal> +\usedir{source/latex/counterz} +\generate{ + \file{\jobname.ins}{\from{\jobname.dtx}{install}} +} +\nopreamble\nopostamble +\usedir{doc/latex/counterz} +\generate{ + \file{README.txt}{\from{\jobname.dtx}{readme}} +} +\ifx\fmtname\nameofplainTeX + \expandafter\endbatchfile +\else + \expandafter\endgroup +\fi +%</internal> + +%<*package> +\NeedsTeXFormat{LaTeX2e} +%</package> + +%<*driver> +\documentclass{ltxdoc} +\usepackage{\jobname} +\usepackage[numbered]{hypdoc} +\EnableCrossrefs +\DoNotIndex{\addtocounter,\Alph,\alph,\arabic,\begingroup,\boolfalse,\booltrue, + \catcode,\endgroup,\fnsymbol,\gdef,\ifbool,\ifboolexpr,\ifnumequal, + \ifnumgreater,\ifnumless,\immediate,\jobname,\newcommand, + \newcounter,\newbool,\newwrite,\numexpr,\openout,\pdfuniformdeviate, + \providecounter,\ProvidesPackage,\relax,\renewcommand, + \RequirePackage,\Roman,\roman,\setcounter,\the,\unexpanded,\value, + \whileboolexpr,\write} +\CodelineIndex +\RecordChanges +\begin{document} + \newenvironment{codeoutput}{\newline\newline}{\newline\newline} + \DocInput{\jobname.dtx} +\end{document} +%</driver> +% +% \fi +% +%\GetFileInfo{\jobname.sty} +% +%\title{^^A +% The \textsf{counterz} package\thanks{^^A +% This file describes version \fileversion, last revised \filedate.^^A +% }^^A +%} +%\author{^^A +% Christopher McClain\thanks{E-mail: christopher.mcclain@mail.wvu.edu}^^A +%} +%\date{Released \filedate} +% +%\maketitle +% +%\changes{v1.0.0}{2023/05/19}{First public release} +% +% +%\begin{abstract} +% The \textsf{counterz} package provides additional tools for manipulating +% counters. The package facilitates the use of stealth prefixes for +% counter names in order to help distinguish between counters from +% multiple input files. The package also provides a means to generate +% random counters and save such counter values for future typesetting. +%\end{abstract} +% +%\begin{multicols}{2} +% \tableofcontents +%\end{multicols} +% +%\section{Introduction} +% +%\subsection{About} +% +% This project emerged from the author's frequent use of \LaTeX\ counters as +% traditional integer type variables when generating mathematics documents with +% random elements. While pdf\TeX\ primitives such as \cs{pdfuniformdeviate} may +% be used to generate random integers, these integer values will be randomized +% with every typesetting. The \textsf{counterz} package provides a way to save +% the values of counters. Another \textsf{.tex} file is created so that, if +% desired, it can be inputted upon a subsequent typesetting in order to +% initialize the counters with the previously generated values. A boolean +% variable and accompanying commands allow an author to toggle between reusing +% and rerandomizing counters. +% +% One of the consequences of preloading counter values in large projects with +% multiple source files is that one must take care to use distinct counter names +% throughout all of the different files. If the file \textsf{Main.tex} inputs +% \textsf{File1.tex} and \textsf{File2.tex}, and both input files define the +% counter \textit{mycounter}, then this could result in typesetting errors. One +% way to address this problem is to prefix every counter name with the file name +% or some other marker so that the counter names will actually be distinct. For +% example, \textit{File1mycounter} is distinct from \textit{File2mycounter}. +% Very long counter names, however, can make code difficult to read and hinder +% consistent application of this practice. The \textsf{counterz} package +% provides a way to stealthily define and recall such prefixes so that the +% shorter non-prefixed names can be used for the manipulation, recall, and +% typesetting of counters. +% +%\subsection{License} +% +% Copyright \copyright\ 2023 Christopher McClain. This software may be copied, +% distributed, and/or modified under the %terms of the +% \href{https://www.latex-project.org/lppl/}{LaTeX Project Public License}, +% either version 1.3c of this license or any later version. +% +%\subsection{Installation} +% +% This package may be installed by copying the file \textsf{counterz.sty} to +% your local texmf directory. The code and documentation may also be generated +% from \textsf{\jobname.dtx}. Typesetting the documentation requires +% the package \textsf{hypdoc} which is included in \TeX\ distributions and at +% \href{http://www.ctan.org}{The Comprehensive TeX Archive Network}. +% +%\section{User Guide} +% +% To use this package, include the following line in the preamble of your +% document: +% +%\begin{verbatim} +%\usepackage{counterz} +%\end{verbatim} +% The package \textsf{counterz} loads the packages \textsf{etoolbox} and +% \textsf{makecmds}, both of which are included in \TeX\ distributions +% and at \href{http://www.ctan.org}{The Comprehensive TeX Archive Network}. +% +%\subsection{Counter Prefixes} +% +%\DescribeMacro{\setcounterprefix} +%\DescribeMacro{\clearcounterprefix} +% Counter prefixes are stored in an internal macro whose default value is an +% empty string. The command \cs{setcounterprefix}\marg{prefix} is used to change +% this value. For example, to change the prefix to \textit{PurpleMonkey}, use +%\begin{verbatim} +%\setcounterprefix{PurpleMonkey} +%\end{verbatim} +% and to change it from \textit{PurpleMonkey} to \textit{Dishwasher}, use +%\begin{verbatim} +%\setcounterprefix{Dishwasher} +%\end{verbatim} +% The command \cs{clearcounterprefix} returns the prefix to its empty default: +%\begin{verbatim} +%\clearcounterprefix +%\end{verbatim} +% +%\subsection{Manipulating Counters} +% +%\DescribeMacro{\xnewcounter} +%\DescribeMacro{\xprovidecounter} +%\DescribeMacro{\xsetcounter} +%\DescribeMacro{\xaddtocounter} +%\DescribeMacro{\xvalue} +% The command \cs{xnewcounter}\marg{countername} creates a counter with a +% prefixed name. The command \cs{xsetcounter}\marg{countername}\marg{integer} +% assigns the specified value to the counter with the prefixed name. For +% example, suppose that the file \textsf{BoringFile1.tex} contains the +% following: +%\begin{verbatim} +%\xnewcounter{bestcounterever} +%\xsetcounter{bestcounterever}{100} +%\end{verbatim} +% and suppose that the file \textsf{BoringFile2.tex} contains the following: +%\begin{verbatim} +%\xnewcounter{bestcounterever} +%\xsetcounter{bestcounterever}{-29} +%\end{verbatim} +% and, finally, suppose that the file Main.tex contains (in part) the following: +%\begin{verbatim} +%\setcounterprefix{PurpleMonkey} +%\input{BoringFile1} +%\setcounterprefix{Dishwasher} +%\input{BoringFile2} +%\end{verbatim} +% Then typesetting \textsf{Main.tex} will create a counter +% \textit{PurpleMonkeybestcounterever} with the value 100 and a counter +% \textit{Dishwasherbestcounterever} with the value $-29$. By using commands +% \cs{xnewcounter} and \cs{xsetcounter} instead of \cs{newcounter} and +% \cs{setcounter}, \textsf{BoringFile1.tex} and \textsf{BoringFile2.tex} +% may be written independently without considering any counter name conflicts. +% The distinction between the counters is determined by the prefixes defined +% in the file \textsf{Main.tex}. By changing prefixes, \textsf{Main.tex} can +% even input the same file multiple times without conflict. +% +% The commands \cs{xprovidecounter}, \cs{xaddtocounter}, and \cs{xvalue} are +% likewise prefix versions of commands \cs{providecounter}, \cs{addtocounter}, +% and \cs{value}, respectively. When the prefix is empty, the commands expand +% like their standard counterparts. (Note: \cs{providecounter} defines a counter +% if it has not already been defined. See the documentation for the package +% \textsf{makecmds} for details.) +% +%\subsection{Conditional Statements} +% +%\DescribeMacro{\ifctrequal} +%\DescribeMacro{\ifctrless} +%\DescribeMacro{\ifctrmore} +% The command \cs{ifctrequal}\marg{counter1}\marg{counter2}\marg{foo}\marg{bar} +% uses the command \cs{xvalue} to compare the values of the (prefixed) counters +% and then executes \meta{foo} if the values are equal and otherwise executes +% \meta{bar}. The commands \cs{ifctrless} and \cs{ifctrmore} work analogously, +% based on whether the value of prefixed \meta{counter1} is less than that of +% of prefixed \meta{counter2} or more than that of prefixed \meta{counter2}, +% respectively. Consider the example code +%\begin{verbatim} +%\setcounterprefix{TigerTiger} +%\xnewcounter{Small} +%\xsetcounter{Small}{7} +%\xnewcounter{Large} +%\xsetcounter{Large}{11} +%\ifctrequal{Small}{Large}{January}{February} +%\ifctrless{Small}{Large}{March}{April} +%\ifctrmore{Small}{Large}{May}{June} +%\end{verbatim} +% which produces the output +% \begin{codeoutput} +%\setcounterprefix{TigerTiger} +%\xnewcounter{Small} +%\xsetcounter{Small}{7} +%\xnewcounter{Large} +%\xsetcounter{Large}{11} +%\ifctrequal{Small}{Large}{January}{February} +%\ifctrless{Small}{Large}{March}{April} +%\ifctrmore{Small}{Large}{May}{June} +% \end{codeoutput} +% because the value of the counter \textit{TigerTigerSmall} is 7 which is less +% than 11, the value of the counter \textit{TigerTigerLarge}. +% +%\DescribeMacro{\ifctrzero} +%\DescribeMacro{\ifctrneg} +%\DescribeMacro{\ifctrpos} +% The command \cs{ifctrzero}\marg{counter}\marg{foo}\marg{bar} executes +% \meta{foo} if the value of the (prefixed) counter is zero and otherwise +% executes \meta{bar}. The commands \cs{ifctrneg} and \cs{ifctrpos} work +% analogously based on whether the value is negative or positive, respectively. +% The example code +%\begin{verbatim} +%\setcounterprefix{TigerTiger} +%\xprovidecounter{Small} +%\xsetcounter{Small}{7} +%\ifctrzero{Small}{January}{February} +%\ifctrneg{Small}{March}{April} +%\ifctrpos{Small}{May}{June} +%\end{verbatim} +% produces the output +% \begin{codeoutput} +%\setcounterprefix{TigerTiger} +%\xprovidecounter{Small} +%\xsetcounter{Small}{7} +%\ifctrzero{Small}{January}{February} +%\ifctrneg{Small}{March}{April} +%\ifctrpos{Small}{May}{June} +% \end{codeoutput} +% because the value of the counter \textit{TigerTigerSmall} is 7 which is +% positive (and thus nonzero, as well). +% +%\subsection{Displaying Counters} +% +%\DescribeMacro{\xarabic} +%\DescribeMacro{\xroman} +%\DescribeMacro{\xRoman} +%\DescribeMacro{\xalph} +%\DescribeMacro{\xAlph} +%\DescribeMacro{\xfnsymbol} +% The command \cs{xarabic}\marg{counter} is simply a prefix version of the +% standard display command \cs{arabic}. The commands \cs{xroman}, \cs{xRoman}, +% \cs{xalph}, \cs{xAlph}, and \cs{xfnsymbol} are likewise prefix versions of +% the standard display commands \cs{roman}, \cs{Roman}, \cs{alph}, \cs{Alph}, +% and \cs{fnsymbol}, inheriting the restrictions of their parent commands. +% Note that the code +%\begin{verbatim} +%\setcounterprefix{Sneaky} +%\xprovidecounter{Pete} +%\xsetcounter{Pete}{42} +%\arabic{Pete} +%\end{verbatim} +% produces an error because the counter \textit{Pete} is not defined, but the +% code +%\begin{verbatim} +%\setcounterprefix{Sneaky} +%\xprovidecounter{Pete} +%\xsetcounter{Pete}{42} +%\xarabic{Pete} +%\end{verbatim} +% produces the output +% \begin{codeoutput} +%\setcounterprefix{Sneaky} +%\xprovidecounter{Pete} +%\xsetcounter{Pete}{42} +%\xarabic{Pete} +% \end{codeoutput} +% which is the value of the counter \textit{SneakyPete}. The code +%\begin{verbatim} +%\setcounterprefix{Sneaky} +%\xprovidecounter{Pete} +%\xsetcounter{Pete}{42} +%\clearcounterprefix +%\xarabic{Pete} +%\end{verbatim} +% also generates error because the final line is trying to use the +% undefined counter \textit{Pete} after the prefix was returned to its +% default value. +% +% In addition to prefix versions of the standard display commands, the package +% \textsf{counterz} defines some variants of \cs{xarabic} that are useful in +% the display of mathematical expressions. For example, consider the following +% code: +%\begin{verbatim} +%\xprovidecounter{a} +%\xsetcounter{a}{5} +%\xprovidecounter{b} +%\xsetcounter{b}{0} +%\xprovidecounter{c} +%\xsetcounter{c}{-7} +%$\xarabic{a}+\xarabic{b}+\xarabic{c}$ +%\end{verbatim} +% which produces +% \begin{codeoutput} +%\xprovidecounter{a} +%\xsetcounter{a}{5} +%\xprovidecounter{b} +%\xsetcounter{b}{0} +%\xprovidecounter{c} +%\xsetcounter{c}{-7} +%$\xarabic{a}+\xarabic{b}+\xarabic{c}$ +% \end{codeoutput} +% Using \cs{arabicx} causes the expression to +% contain the consecutive pair $+-$. The command +%\DescribeMacro{\xsigned} +% \cs{xsigned}\marg{counter} is like \cs{xarabic} except that nonnegative values +% are preceded by a plus sign ``+''. The code +%\begin{verbatim} +%$\xarabic{a}\xsigned{b}\xsigned{c}$ +%\end{verbatim} +% produces +% \begin{codeoutput} +%$\xarabic{a}\xsigned{b}\xsigned{c}$ +% \end{codeoutput} +% If we wish to suppress the $0$, we can instead use the command +%\DescribeMacro{\xsignednz} +%\DescribeMacro{\xarabicnz} +% \cs{xsignednz}\marg{counter} which is a nonzero version of \cs{xsigned} and, +% if desired or necessary, the command \cs{xarabicnz}\marg{counter} which is a +% nonzero version of \cs{xarabic}. +% The code +%\begin{verbatim} +%$\xarabicnz{a}\xsignednz{b}\xsignednz{c}$ +%\end{verbatim} +% produces +% \begin{codeoutput} +%$\xarabicnz{a}\xsignednz{b}\xsignednz{c}$ +% \end{codeoutput} +%\DescribeMacro{\xnegof} +%\DescribeMacro{\xnegofnz} +%\DescribeMacro{\xnegsigned} +%\DescribeMacro{\xnegsignednz} +% The package also contains variants of these commands for displaying the +% negatives of counters, as demonstrated by the following code: +%\begin{verbatim} +%\xprovidecounter{d} +%\xsetcounter{d}{-2} +%$\xarabic{a}\xsigned{b}\xsigned{c}=\xarabic{d}$\\ +%$\xnegof{d}=\xnegof{a}\xnegsigned{b}\xnegsigned{c}$\\ +%$\xnegofnz{d}=\xnegofnz{a}\xnegsignednz{b}\xnegsignednz{c}$ +%\end{verbatim} +% which produces +%\begin{codeoutput} +%\xprovidecounter{d} +%\xsetcounter{d}{-2} +%$\xarabic{a}\xsigned{b}\xsigned{c}=\xarabic{d}$\\ +%$\xnegof{d}=\xnegof{a}\xnegsigned{b}\xnegsigned{c}$\\ +%$\xnegofnz{d}=\xnegofnz{a}\xnegsignednz{b}\xnegsignednz{c}$ +%\end{codeoutput} +% The preceding commands for displaying values related to counters were created +% by using some other commands that we make available in case they prove useful. +%\DescribeMacro{\xabsof} +%\DescribeMacro{\xsignof} +%\DescribeMacro{\xnegsignof} +% The command \cs{xabsof}\marg{counter} prints the absolute value of +% \meta{counter}. The command \cs{xsignof}\marg{counter} prints a minus sign +% ``-'' if \meta{counter} is negative and otherwise prints a plus sign ``+''. +% (Note that the latter case includes the value zero.) The command +% \cs{xnegsignof}\marg{counter} prints a plus sign ``+'' if \meta{counter} is +% negative and otherwise prints a minus sign ``-''. (Note that the former case +% includes the value zero.) +% +% Additional variants of these commands suppress certain output, as is +% conventional when using integers as coefficients in algebraic expressions. +%\DescribeMacro{\xabsofcoef} +%\DescribeMacro{\xsignofcoef} +%\DescribeMacro{\xnegsignofcoef} +% The command \cs{xabsofcoef}\marg{counter} prints the absolute value of +% \meta{counter} except that it suppresses the values of 1 and 0. The command +% \cs{xsignofcoef}\marg{counter} prints the sign of \meta{counter} if the value +% of \meta{counter} is nonzero. The command \cs{xnegsignofcoef}\marg{counter} +% prints the opposite sign of \meta{counter} if the value of \meta{counter} is +% nonzero. These commands are used to build versions of \cs{xarabic} and +% \cs{xsigned} specific to typesetting coefficients, as we now illustrate. +% +% Consider the following code +%\begin{verbatim} +%\xprovidecounter{a0} +%\xsetcounter{a0}{-10} +%\xprovidecounter{a1} +%\xsetcounter{a1}{1} +%\xprovidecounter{a2} +%\xsetcounter{a2}{-5} +%\xprovidecounter{a3} +%\xsetcounter{a3}{-1} +%\xprovidecounter{a4} +%\xsetcounter{a4}{0} +%\xprovidecounter{a5} +%\xsetcounter{a5}{11} +%$\xarabic{a5}x^5 + \xarabic{a4}x^4 + \xarabic{a3}x^3 + \xarabic{a2}x^2 +% + \xarabic{a1}x + \xarabic{a0} = 42$ +%\end{verbatim} +% and its output +%\begin{codeoutput} +%\xprovidecounter{a0} +%\xsetcounter{a0}{-10} +%\xprovidecounter{a1} +%\xsetcounter{a1}{1} +%\xprovidecounter{a2} +%\xsetcounter{a2}{-5} +%\xprovidecounter{a3} +%\xsetcounter{a3}{-1} +%\xprovidecounter{a4} +%\xsetcounter{a4}{0} +%\xprovidecounter{a5} +%\xsetcounter{a5}{11} +%$\xarabic{a5}x^5 + \xarabic{a4}x^4 + \xarabic{a3}x^3 + \xarabic{a2}x^2 +% + \xarabic{a1}x + \xarabic{a0} = 42$ +%\end{codeoutput} +% We seek a better way to handle the coefficients, especially $1$ and $-1$. +%\DescribeMacro{\xcoef} +%\DescribeMacro{\xsignedcoef} +% The command \cs{xcoef}\marg{counter} prints the value of \meta{counter} except +% that it suppresses the values of 1, 0, and -1, printing a minus sign ``-'' in +% the latter case. The command \cs{xsignedcoef}\marg{counter} is like \cs{xcoef} +% except that positive values are preceded by a plus sign ``+''. We use these to +% write the code +%\begin{verbatim} +%$\xarabic{a5}x^5 + \xarabic{a4}x^4 + \xarabic{a3}x^3 + \xarabic{a2}x^2 +% + \xarabic{a1}x + \xarabic{a0} = 42$\\ +%$\xcoef{a5}\ifctrzero{a5}{}{x^5} \xsignedcoef{a4}\ifctrzero{a4}{}{x^4} +% \xsignedcoef{a3}\ifctrzero{a3}{}{x^3} \xsignedcoef{a2}\ifctrzero{a2}{}{x^2} +% \xsignedcoef{a1}\ifctrzero{a1}{}{x} \xsignednz{a0} = 42$ +%\end{verbatim} +% whose output is +%\begin{codeoutput} +%$\xarabic{a5}x^5 + \xarabic{a4}x^4 + \xarabic{a3}x^3 + \xarabic{a2}x^2 +% + \xarabic{a1}x + \xarabic{a0} = 42$\\ +%$\xcoef{a5}\ifctrzero{a5}{}{x^5} \xsignedcoef{a4}\ifctrzero{a4}{}{x^4} +% \xsignedcoef{a3}\ifctrzero{a3}{}{x^3} \xsignedcoef{a2}\ifctrzero{a2}{}{x^2} +% \xsignedcoef{a1}\ifctrzero{a1}{}{x} \xsignednz{a0} = 42$ +%\end{codeoutput} +%\DescribeMacro{\xnegcoef} +%\DescribeMacro{\xnegsignedcoef} +% The command \cs{xnegcoef}\marg{counter} prints the negative of the value of +% \meta{counter} except that it suppresses the values of 1, 0, and -1, printing +% a ``-'' in the latter case. The command \cs{xnegsignedcoef}\marg{counter} is +% like \cs{xnegcoef} except that positive values are preceded by a plus sign +% ``+''. We use these to write the code +%\begin{verbatim} +%$\xcoef{a5}\ifctrzero{a5}{}{x^5} \xsignedcoef{a4}\ifctrzero{a4}{}{x^4} +% \xsignedcoef{a3}\ifctrzero{a3}{}{x^3} \xsignedcoef{a2}\ifctrzero{a2}{}{x^2} +% \xsignedcoef{a1}\ifctrzero{a1}{}{x} \xsignednz{a0} = 42$\\ +%$\xcoef{a5}\ifctrzero{a5}{}{x^5} \xsignedcoef{a4}\ifctrzero{a4}{}{x^4} +% \xsignedcoef{a2}\ifctrzero{a2}{}{x^2} \xsignednz{a0} +% = \xnegcoef{a3}\ifctrzero{a3}{}{x^3} \xnegsignedcoef{a1}\ifctrzero{a1}{}{x} +% +42$ +%\end{verbatim} +% whose output is +%\begin{codeoutput} +%$\xcoef{a5}\ifctrzero{a5}{}{x^5} \xsignedcoef{a4}\ifctrzero{a4}{}{x^4} +% \xsignedcoef{a3}\ifctrzero{a3}{}{x^3} \xsignedcoef{a2}\ifctrzero{a2}{}{x^2} +% \xsignedcoef{a1}\ifctrzero{a1}{}{x} \xsignednz{a0} = 42$\\ +%$\xcoef{a5}\ifctrzero{a5}{}{x^5} \xsignedcoef{a4}\ifctrzero{a4}{}{x^4} +% \xsignedcoef{a2}\ifctrzero{a2}{}{x^2} \xsignednz{a0} +% = \xnegcoef{a3}\ifctrzero{a3}{}{x^3} \xnegsignedcoef{a1}\ifctrzero{a1}{}{x} +% +42$ +%\end{codeoutput} +% As the reader has probably already observed in the code above, these display +% commands appear to be less efficient than a manual adjustment of signs and +% numbers. For fixed, known values of counters, this assessment is correct. The +% real utility of these commands is not apparent until they are combined with +% randomly generated counter values. +% +%\subsection{Random Counters} +% +%\DescribeMacro{\xrandsetcounter} +%\DescribeMacro{\xrandaddtocounter} +% We first define random versions of \cs{xsetcounter} and \cs{xaddtocounter}. +% The command \cs{xrandsetcounter}\marg{counter}\marg{min}\marg{max} assigns +% to the prefixed \meta{counter} a random integer value between \meta{min} and +% \meta{max}. Analogously, the command +% \cs{xrandaddtocounter}\marg{counter}\marg{min}\marg{max} adds to the prefixed +% \meta{counter} a random integer value between \meta{min} and \meta{max}. The +% following code may be used to produce an expression in the form $ax+b$, where +% $a$ and $b$ are random integers between $-10$ and $10$: +%\begin{verbatim} +%\xprovidecounter{a} +%\xprovidecounter{b} +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ +%\end{verbatim} +% Organized in the following table are sixty instances of output that are +% randomly generated by the typesetting of this document: +%\begin{codeoutput} +%\xprovidecounter{a} +%\xprovidecounter{b} +%\begin{tabular}{rrrrrr} +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ & +%\xrandsetcounter{a}{-10}{10} +%\xrandsetcounter{b}{-10}{10} +%$\xcoef{a}\ifctrzero{a}{\xarabic{b}}{x \xsignednz{b}}$ \\ +%\end{tabular} +%\end{codeoutput} +% +% If our document contains randomly generated counters, but we wish to typeset +% the document again without changing those values, then we need a way to save +% those values. The \textsf{counterz} package offers the following solution: a +% file \textsf{\meta{jobname}.counters.tex} may be created during the +% typesetting process to store the necessary information. For example, if the +% document is named \textsf{Yellowdog.tex}, then the previously generated +% counters and their assigned values will be stored the file +% \textsf{Yellowdog.counters.tex}. +%\DescribeMacro{\opencountersfile} +% The command \cs{opencountersfile} creates and opens the write stream to this +% file. The author only has to include this command once, prior to any commands +% used to save the counter values. +% +%\DescribeMacro{\xsavecounter} +% The command \cs{xsavecounter}\marg{counter} ``saves'' the value of +% \textit{counter} by writing to the file \textsf{\meta{jobname}.counters.tex} +% the relevant \cs{providecounter} and \cs{setcounter} commands. The commands +% written to the file explicitly include the necessary counter prefixes, and +% consequently an author can, if necessary, manually find in the file the +% specific assignment for any counter. The counters file may then be inputted +% near the beginning of a subsequent typesetting to preassign all of the +% values. +% +%\DescribeMacro{\randomizectr} +%\DescribeMacro{\norandomizectr} +%\DescribeMacro{\ifrandomizectr} +% In order to effectively manage the options of randomizing counter values or +% reusing counter values, the \textsf{counterz} package offers the commands +% \cs{randomizectr} and \cs{norandomizectr} that toggle an internal boolean +% variable, and a conditional \cs{ifrandomizectr}\marg{foo}\marg{bar} that +% executes \meta{foo} when the boolean is true and otherwise executes +% \meta{bar}. For example, a document named \textsf{Yellowdog.tex} might +% include the code +%\begin{verbatim} +%\ifrandomizectr{}{input{Yellowdog.counters}} +%\end{verbatim} +% to determine whether to preload previously stored counter values. +% +%\DescribeMacro{\xrandprovidecounter} +%\DescribeMacro{\xrandprovidecounternz} +% The command \cs{xrandprovidecounter}\marg{counter}\marg{min}\marg{max} +% combines the four commands \cs{xprovidecounter}, \cs{ifrandomizectr}, +% \cs{xrandsetcounter}, and \cs{xsavecounter} to define a command that creates +% \meta{counter} if it has not already been defined and, if the document is +% randomized, assigns to \meta{counter} a random integer value between +% \meta{min} and \meta{max} and saves this value to the counters file. The +% command \cs{xrandprovidecounternz} is like \cs{xrandprovidecounter} except +% that the generated value is nonzero. Suppose that \textsf{Neverending.tex} +% contains the code +%\begin{verbatim} +%\randomizectr +%\ifrandomizectr{\opencountersfile}{} +%\setcounterprefix{Southern} +%\xrandprovidecounternz{Oracle}{-10}{10} +%\xcoef{Oracle}x+42 +%\end{verbatim} +% After typesetting once, the resulting document might display an expression +% such as $-9x+42$ and print to \textsf{Neverending.counters.tex} the line +%\begin{verbatim} +%\providecounter {SouthernOracle} \setcounter {SouthernOracle}{-9} +%\end{verbatim} +% After typesetting a second time, the resulting document might display $4x+42$ +% and print to \textsf{Neverending.counters.tex} the line +%\begin{verbatim} +%\providecounter {SouthernOracle} \setcounter {SouthernOracle}{4} +%\end{verbatim} +% If, however, the command \cs{randomizectr} is replaced by \cs{norandomizectr}, +% then a third typesetting will leave both the displayed text and the counters +% file unchanged. (Tip: Users who are concerned about accidental randomization +% might create a terminal prompt with the commands \cs{typeout} and \cs{typein} +% to input the randomization preference, as an added layer of security.) +% +%\StopEventually{^^A +% \PrintChanges +% \PrintIndex +%} +% +%\section{Implementation} +% +% The \textsf{counterz} package loads the two packages \textsf{etoolbox} and +% \textsf{makecmds} for the use of conditional tests (boolean and numerical) +% and the macro \cs{providecounter}. +% +% \begin{macrocode} +%<*package> +\ProvidesPackage{counterz}[2023/05/19 v1.0.0 Additional tools for counters] +\RequirePackage{etoolbox,makecmds} +% \end{macrocode} +% +%\subsection{Counter Prefixes} +% +%\begin{macro}{\@counterz@counterprefix} +%\begin{macro}{\setcounterprefix} +%\begin{macro}{\clearcounterprefix} +% +% The default expansion of \cs{@counterz@counterprefix} is null, but it can be +% changed with the commands \cs{setcounterprefix} and \cs{clearcounterprefix}. +% +% \begin{macrocode} +\newcommand{\@counterz@counterprefix}{} +\newcommand{\setcounterprefix}[1]{\renewcommand{\@counterz@counterprefix}{#1}} +\newcommand{\clearcounterprefix}{\setcounterprefix{}} +% \end{macrocode} +% +%\end{macro} +%\end{macro} +%\end{macro} +% +%\subsection{Manipulating Counters} +% +%\begin{macro}{\xnewcounter} +%\begin{macro}{\xprovidecounter} +%\begin{macro}{\xsetcounter} +%\begin{macro}{\xaddtocounter} +%\begin{macro}{\xvalue} +% +% These commands are prefix versions of commands \cs{newcounter}, +% \cs{providecounter}, \cs{setcounter}, \cs{addtocounter}, and \cs{value}, +% respectively. The creation, modification, or use of the counters is carried +% out on a prefixed version of the specified counter name. When +% \cs{@counterz@counterprefix} is null, the commands expand like their standard +% counterparts. +% +% \begin{macrocode} +\newcommand{\xnewcounter}[1]{\newcounter{\@counterz@counterprefix #1}} +\newcommand{\xprovidecounter}[1]{\providecounter{\@counterz@counterprefix #1}} +\newcommand{\xsetcounter}[2]{\setcounter{\@counterz@counterprefix #1}{#2}} +\newcommand{\xaddtocounter}[2]{\addtocounter{\@counterz@counterprefix #1}{#2}} +\newcommand{\xvalue}[1]{\value{\@counterz@counterprefix #1}} +% \end{macrocode} +% +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +% +%\subsection{Conditional Statements} +% +% The following commands provide if-then-else constructs analogous to those in +% the package \textsf{etoolbox}. The notable difference is that the arguments +% are counter names. The command \cs{xvalue} is used to determine the values of +% the counters, so that the stored prefix is applied to the specified counter +% names before execution. +% +%\begin{macro}{\ifctrequal} +% +% \cs{ifctrequal}\marg{counter1}\marg{counter2}\marg{foo}\marg{bar} executes +% \meta{foo} if the value of \meta{counter1} is equal to the value of +% \meta{counter2} and otherwise executes \meta{bar}. +% +% \begin{macrocode} +\newcommand{\ifctrequal}[4]{\ifnumequal{\xvalue{#1}}{\xvalue{#2}}{#3}{#4}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\ifctrless} +% +% \cs{ifctrless}\marg{counter1}\marg{counter2}\marg{foo}\marg{bar} executes +% \meta{foo} if the value of \meta{counter1} is less than the value of +% \meta{counter2} and otherwise executes \meta{bar}. +% +% \begin{macrocode} +\newcommand{\ifctrless}[4]{\ifnumless{\xvalue{#1}}{\xvalue{#2}}{#3}{#4}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\ifctrmore} +% +% \cs{ifctrmore}\marg{counter1}\marg{counter2}\marg{foo}\marg{bar} executes +% \meta{foo} if the value of \meta{counter1} is more than the value of +% \meta{counter2} and otherwise executes \meta{bar}. +% +% \begin{macrocode} +\newcommand{\ifctrmore}[4]{\ifnumless{\xvalue{#2}}{\xvalue{#1}}{#3}{#4}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\ifctrzero} +% +% \cs{ifctrzero}\marg{counter}\marg{foo}\marg{bar} executes \meta{foo} if +% the value of \meta{counter} is zero and otherwise executes \meta{bar}. +% +% \begin{macrocode} +\newcommand{\ifctrzero}[3]{\ifnumequal{\xvalue{#1}}{0}{#2}{#3}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\ifctrneg} +% +% \cs{ifctrneg}\marg{counter}\marg{foo}\marg{bar} executes \meta{foo} if the +% value of \meta{counter} is negative and otherwise executes \meta{bar}. +% +% \begin{macrocode} +\newcommand{\ifctrneg}[3]{\ifnumless{\xvalue{#1}}{0}{#2}{#3}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\ifctrpos} +% +% \cs{ifctrpos}\marg{counter}\marg{foo}\marg{bar} executes \meta{foo} if the +% value of \meta{counter} is positive and otherwise executes \meta{bar}. +% +% \begin{macrocode} +\newcommand{\ifctrpos}[3]{\ifnumless{\xvalue{#1}}{1}{#3}{#2}} +% \end{macrocode} +% +%\end{macro} +% +%\subsection{Displaying Counters} +% +%\begin{macro}{\xarabic} +%\begin{macro}{\xroman} +%\begin{macro}{\xRoman} +%\begin{macro}{\xalph} +%\begin{macro}{\xAlph} +%\begin{macro}{\xfnsymbol} +% +% These commands include prefix versions of the standard display commands. +% +% \begin{macrocode} +\newcommand{\xarabic}[1]{\arabic{\@counterz@counterprefix #1}} +\newcommand{\xroman}[1]{\roman{\@counterz@counterprefix #1}} +\newcommand{\xRoman}[1]{\Roman{\@counterz@counterprefix #1}} +\newcommand{\xalph}[1]{\alph{\@counterz@counterprefix #1}} +\newcommand{\xAlph}[1]{\Alph{\@counterz@counterprefix #1}} +\newcommand{\xfnsymbol}[1]{\fnsymbol{\@counterz@counterprefix #1}} +% \end{macrocode} +% +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +% The following commands likewise apply the stored prefix to the counter name. +% These commands are designed to aid in the typesetting of counter values within +% algebraic expressions while observing particular conventions about the display +% of numbers and their and their signs. +% +%\begin{macro}{\xabsof} +% +% \cs{xabsof}\marg{counter} prints the absolute value of \meta{counter}. +% +% \begin{macrocode} +\newcommand{\xabsof}[1]{% + \ifctrneg{#1}{% + \the \numexpr 0 - \xvalue{#1} \relax% + }{% + \xarabic{#1}% + }% +} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xsignof} +% +% \cs{xsignof}\marg{counter} prints a minus sign ``-'' if \meta{counter} is +% negative and otherwise prints a plus sign ``+''. Note that the latter case +% includes the value zero. +% +% \begin{macrocode} +\newcommand{\xsignof}[1]{\ifctrneg{#1}{-}{+}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xnegsignof} +% +% \cs{xnegsignof}\marg{counter} prints a plus sign ``+'' if \meta{counter} is +% negative and otherwise prints a minus sign ``-''. Note that the latter case +% includes the value zero. +% +% \begin{macrocode} +\newcommand{\xnegsignof}[1]{\ifctrneg{#1}{+}{-}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xsigned} +% +% \cs{xsigned}\marg{counter} prints the absolute value of \meta{counter}, +% preceded by a plus sign ``+'' or a minus sign ``-'' as defined by +% \cs{xsignof}. +% +% \begin{macrocode} +\newcommand{\xsigned}[1]{\xsignof{#1} \xabsof{#1}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xsignednz} +% +% \cs{xsignednz}\marg{counter} is like \cs{xsigned} but suppresses the number +% zero. +% +% \begin{macrocode} +\newcommand{\xsignednz}[1]{\ifctrzero{#1}{}{\xsigned{#1}}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xarabicnz} +% +% \cs{xarabicnz}\marg{counter} is like \cs{xarabic} but suppresses the number +% zero. +% +% \begin{macrocode} +\newcommand{\xarabicnz}[1]{\ifctrzero{#1}{}{\xarabic{#1}}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xnegsigned} +% +% \cs{xnegsigned}\marg{counter} prints the absolute value of \meta{counter}, +% preceded by a plus sign ``+'' or a minus sign ``-'' as defined by +% \cs{xnegsignof}. +% +% \begin{macrocode} +\newcommand{\xnegsigned}[1]{\xnegsignof{#1} \xabsof{#1}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xnegsignednz} +% +% \cs{xnegsignednz}\marg{counter} is like \cs{xnegsigned} but suppresses the +% number zero. +% +% \begin{macrocode} +\newcommand{\xnegsignednz}[1]{\ifctrzero{#1}{}{\xnegsigned{#1}}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xnegof} +% +% \cs{xnegof}\marg{counter} prints the negative of the value of \meta{counter}. +% +% \begin{macrocode} +\newcommand{\xnegof}[1]{\ifctrpos{#1}{-}{}\xabsof{#1}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xnegofnz} +% +% \cs{xnegofnz}\marg{counter} is like \cs{xnegof} but suppresses the number +% zero. +% +% \begin{macrocode} +\newcommand{\xnegofnz}[1]{\ifctrzero{#1}{}{\xnegof{#1}}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xcoef} +% +% \cs{xcoef}\marg{counter} prints the value of \meta{counter} except that it +% suppresses the values of 1, 0, and -1, printing a ``-'' in the latter case. +% +% \begin{macrocode} +\newcommand{\xcoef}[1]{% + \ifboolexpr{test {\ifnumless{\xvalue{#1}}{-1}}% + or test {\ifnumgreater{\xvalue{#1}}{1}}}{% + \xarabic{#1}% + }{% + }% + \ifnumequal{\xvalue{#1}}{-1}{-}{}% +} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xnegcoef} +% +% \cs{xnegcoef}\marg{counter} prints the value of \meta{counter} except that it +% suppresses the values of 1, 0, and -1, printing a ``-'' in the former case. +% +% \begin{macrocode} +\newcommand{\xnegcoef}[1]{% + \ifboolexpr{test {\ifnumless{\xvalue{#1}}{-1}}% + or test {\ifnumgreater{\xvalue{#1}}{1}}}{% + \xnegof{#1}% + }{% + }% + \ifnumequal{\xvalue{#1}}{1}{-}{}% +} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xabsofcoef} +% +% \cs{xabsofcoef}\marg{counter} prints the absolute value of \meta{counter} +% except that it suppresses the values of 1 and 0. +% +% \begin{macrocode} +\newcommand{\xabsofcoef}[1]{% + \ifboolexpr{test {\ifnumless{\xvalue{#1}}{-1}}% + or test {\ifnumgreater{\xvalue{#1}}{1}}}{% + \xabsof{#1}% + }{% + } +} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xsignofcoef} +% +% \cs{xsignofcoef}\marg{counter} prints the sign of \meta{counter} if +% \meta{counter} is nonzero. +% +% \begin{macrocode} +\newcommand{\xsignofcoef}[1]{\ifctrzero{#1}{}{\xsignof{#1}}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xnegsignofcoef} +% +% \cs{xnegsignofcoef}\marg{counter} prints the opposite sign of \meta{counter} +% if \meta{counter} is nonzero. +% +% \begin{macrocode} +\newcommand{\xnegsignofcoef}[1]{\ifctrzero{#1}{}{\xnegsignof{#1}}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xsignedcoef} +% +% \cs{xsignedcoef}\marg{counter} is like \cs{xcoef} except that positive values +% are preceded by a plus sign ``+''. +% +% \begin{macrocode} +\newcommand{\xsignedcoef}[1]{\xsignofcoef{#1} \xabsofcoef{#1}} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xnegsignedcoef} +% +% \cs{xnegsignedcoef}\marg{counter} is like \cs{xsignedcoef} except using the +% opposite sign. +% +% \begin{macrocode} +\newcommand{\xnegsignedcoef}[1]{\xnegsignofcoef{#1} \xabsofcoef{#1}} +% \end{macrocode} +% +%\end{macro} +% +%\subsection{Random Counters} +% +% The commands \cs{xrandsetcounter} and \cs{xrandaddtocounter} use the pdf\TeX\ +% primitive \cs{pdfuniformdeviate} to provide random versions of +% \cs{xsetcounter} and \cs{xaddtocounter}. +% +%\begin{macro}{\xrandsetcounter} +% +% \cs{xrandsetcounter}\marg{counter}\marg{min}\marg{max} assigns to (the +% prefixed) \meta{counter} a random integer value between \meta{min} and +% \meta{max}. +% +% \begin{macrocode} +\newcommand{\xrandsetcounter}[3]{% + \xsetcounter{#1}{% + \the \numexpr #2+\pdfuniformdeviate \numexpr #3-#2+1 \relax + } +} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xrandaddtocounter} +% +% \cs{xrandaddtocounter}\marg{counter}\marg{min}\marg{max} adds to (the +% prefixed) \meta{counter} a random integer value between \meta{min} and +% \meta{max}. +% +% \begin{macrocode} +\newcommand{\xrandaddtocounter}[3]{% + \xaddtocounter{#1}{% + \the \numexpr #2+\pdfuniformdeviate \numexpr #3-#2+1 \relax + } +} +% \end{macrocode} +% +%\end{macro} +% The following commands are designed to provide a means by which authors can +% generate random values for counters but also preserve those values for future +% typesettings. This is accomplished by storing counters and their values in an +% external file and then inputting the file before a subsequent typesetting. +% +%\begin{macro}{\opencountersfile} +% +% The command \cs{opencountersfile} creates and opens the write stream to the +% file \textsf{\meta{jobname}.counters.tex}, referenced by the macro +% \cs{countersfile}. +% +% \begin{macrocode} +\newcommand{\opencountersfile}{% + \newwrite\countersfile + \immediate\openout\countersfile=\jobname.counters.tex +} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\@counterz@openbrace} +%\begin{macro}{\@counterz@closebrace} +% +% The commands \cs{@counterz@openbrace} and \cs{@counterz@closebrace} +% facilitate the writing of the brace delimiters to \cs{countersfile}. +% +% \begin{macrocode} +\begingroup + \catcode`<=1 \catcode`>=2 + \catcode`{=12 \catcode`}=12 + \gdef\@counterz@openbrace<{> + \gdef\@counterz@closebrace<}> +\endgroup +% \end{macrocode} +% +%\end{macro} +%\end{macro} +% +%\begin{macro}{\xsavecounter} +% +% \cs{xsavecounter}\marg{counter} writes \cs{providecounter} and \cs{setcounter} +% commands to the file \textsf{\meta{jobname}.counters.tex} so that they may be +% inputted as part of a future typesetting. +% +% \begin{macrocode} +\newcommand{\xsavecounter}[1]{% + \immediate\write\countersfile{% + \unexpanded{\providecounter}\@counterz@openbrace% + \@counterz@counterprefix #1\@counterz@closebrace% + \unexpanded{ \setcounter}\@counterz@openbrace% + \@counterz@counterprefix #1\@counterz@closebrace% + \@counterz@openbrace% + \arabic{\@counterz@counterprefix #1}\@counterz@closebrace% + }% +}% +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\randomizectr} +%\begin{macro}{\norandomizectr} +% +% In order to assign a random value to a counter during one typesetting and +% avoid overwriting this value with a random assignment during another +% typesetting, the boolean \textit{@counterz@random} is used to distinguish +% between the two typesettings. The value of \textit{@counterz@random} may +% be changed by the commands \cs{randomizectr} and \cs{norandomizectr}. +% +% \begin{macrocode} +\newbool{@counterz@random} +\newcommand{\randomizectr}{\booltrue{@counterz@random}} +\newcommand{\norandomizectr}{\boolfalse{@counterz@random}} +% \end{macrocode} +% +%\end{macro} +%\end{macro} +% +%\begin{macro}{\ifrandomizectr} +% +% \cs{ifrandomizectr}\marg{foo}\marg{bar} executes \meta{foo} if the boolean +% \textit{@counterz@random} is true and otherwise executes \meta{bar}. +% +% \begin{macrocode} +\newcommand{\ifrandomizectr}[2]{% + \ifbool{@counterz@random}{#1}{#2} +}% +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xrandprovidecounter} +% +% \cs{xrandprovidecounter}\marg{counter}\marg{min}\marg{max} creates +% \meta{counter} if it does not already exist, and if the boolean +% \textit{@counterz@random} is true then \meta{counter} is assigned a +% random integer value between \meta{min} and \meta{max} and then saved. +% +% \begin{macrocode} +\newcommand{\xrandprovidecounter}[3]{% + \xprovidecounter{#1} + \ifrandomizectr{% + \xrandsetcounter{#1}{#2}{#3} + \xsavecounter{#1} + }{% + } +} +% \end{macrocode} +% +%\end{macro} +% +%\begin{macro}{\xrandprovidecounternz} +% +% \cs{xrandprovidecounternz}\marg{counter}\marg{min}\marg{max} does the same +% job as the command \cs{xrandprovidecounter} except that the value of +% \meta{counter} is randomized until it is nonzero. +% +% \begin{macrocode} +\newcommand{\xrandprovidecounternz}[3]{% + \xprovidecounter{#1} + \ifrandomizectr{% + \xsetcounter{#1}{0} + \whileboolexpr{ test {\ifnumequal{\xvalue{#1}}{0}}}{% + \xrandsetcounter{#1}{#2}{#3} + } + \xsavecounter{#1} + }{% + } +} +% \end{macrocode} +% +%\end{macro}% +% +% \begin{macrocode} +%</package> +% \end{macrocode} +%\Finale
\ No newline at end of file diff --git a/macros/latex/contrib/counterz/counterz.ins b/macros/latex/contrib/counterz/counterz.ins new file mode 100644 index 0000000000..7de3d88187 --- /dev/null +++ b/macros/latex/contrib/counterz/counterz.ins @@ -0,0 +1,89 @@ +%% +%% This is file `counterz.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% counterz.dtx (with options: `install') +%% ---------------------------------------------------------------------- +%% `counterz' --- 2023/05/19 Version 1.0.0 Additional tools for counters +%% E-mail: christopher.mcclain@mail.wvu.edu +%% Released under the LaTeX Project Public License v1.3c or later +%% See https://www.latex-project.org/lppl.txt +%% ---------------------------------------------------------------------- +%% + + + + +\input docstrip.tex +\keepsilent +\askforoverwritefalse + +\preamble +---------------------------------------------------------------------- +`counterz' --- 2023/05/19 Version 1.0.0 Additional tools for counters +E-mail: christopher.mcclain@mail.wvu.edu +Released under the LaTeX Project Public License v1.3c or later +See https://www.latex-project.org/lppl.txt +---------------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2023 by Christopher McClain + +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: + +https://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 Christopher McClain. + +This work consists of the file counterz.dtx +and the derived files counterz.ins, + counterz.pdf and + counterz.sty. + +\endpostamble + +\usedir{tex/latex/counterz} +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} + +\endbatchfile + + + +%% +%% Copyright (C) 2023 by Christopher McClain +%% +%% 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: +%% +%% https://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 Christopher McClain. +%% +%% This work consists of the file counterz.dtx +%% and the derived files counterz.ins, +%% counterz.pdf and +%% counterz.sty. +%% +%% +%% End of file `counterz.ins'. diff --git a/macros/latex/contrib/counterz/counterz.pdf b/macros/latex/contrib/counterz/counterz.pdf Binary files differnew file mode 100644 index 0000000000..4b358cbb48 --- /dev/null +++ b/macros/latex/contrib/counterz/counterz.pdf diff --git a/macros/latex/contrib/msu-thesis/README.md b/macros/latex/contrib/msu-thesis/README.md index 97429f6781..c5aeafbc16 100644 --- a/macros/latex/contrib/msu-thesis/README.md +++ b/macros/latex/contrib/msu-thesis/README.md @@ -1,10 +1,10 @@ -# MSU Thesis Class Version 4.0b 2022/12/15 +# MSU Thesis Class Version 4.1 2023/05/18 -Copyright 2011-2022 by Alan Munn <amunn@msu.edu> +Copyright 2011-2023 by Alan Munn <amunn@msu.edu> This is a class file for producing dissertations and theses according to the Michigan State University Graduate School Guidelines for Electronic -Submission of Master's Theses and Dissertations (September 2022). +Submission of Master's Theses and Dissertations (January 2023). The class is based on the `memoir` document class, and therefore inherits all of the functionality of that class. @@ -12,7 +12,7 @@ all of the functionality of that class. # Update on new formatting requirements (Fall 2022) - The msu-thesis development team is displeased to announce a new + The `msu-thesis` development team is displeased to announce a new and "improved" version of the class that conforms to the most recent (September 2022) MSU Thesis Formatting Guide. Among the notable new features are implementation of questionable @@ -42,7 +42,7 @@ Put `msu-thesis.tex`, `msu-thesis.pdf` and the `samples` folder into `<local texmf>/doc/latex/msu-thesis` -The samples folder contains a thesis test-file and +The samples folder contains two thesis test-files and a template. This package may be distributed and/or modified under the conditions of diff --git a/macros/latex/contrib/msu-thesis/docs/msu-thesis.tex b/macros/latex/contrib/msu-thesis/docs/msu-thesis.tex index c5cb0fb826..48701cf2d8 100644 --- a/macros/latex/contrib/msu-thesis/docs/msu-thesis.tex +++ b/macros/latex/contrib/msu-thesis/docs/msu-thesis.tex @@ -2,8 +2,8 @@ \documentclass[11pt]{article} -\def\msuversion{4.0b} -\def\msudate{2022/12/15} +\def\msuversion{4.1} +\def\msudate{2023/05/18} \title{\textbf{Using the MSU Thesis Class}} \author{\textbf{Alan Munn}\\Department of Linguistics, Languages, and Cultures\\Michigan State University\\\texttt{\href{mailto:amunn@msu.edu}{amunn@msu.edu}}} \date{Version \msuversion\\\msudate} @@ -57,7 +57,7 @@ \thispagestyle{empty} \renewcommand{\abstractname}{\sffamily Abstract} -\abstract{\noindent\begin{quote} This is a class file for MSU theses and dissertations. It is based on the \pkg{memoir}\ class, and therefore supports all of the functionality of that class. It should generate a document which meets all the basic formatting requirements laid out by the \href{https://grad.msu.edu/etd/formatting-guide}{Formatting Guide For Submission of Master’s Theses and Doctoral Dissertations}\ (September, 2022) produced by the Graduate School, including requirements for margins, titlepage, page numbering, section titles, sub- and superscript sizes etc.\end{quote}} +\abstract{\noindent\begin{quote} This is a class file for MSU theses and dissertations. It is based on the \pkg{memoir}\ class, and therefore supports all of the functionality of that class. It should generate a document which meets all the basic formatting requirements laid out by the \href{https://grad.msu.edu/etd/formatting-guide}{Formatting Guide For Submission of Master’s Theses and Doctoral Dissertations}\ (January, 2023) produced by the Graduate School, including requirements for margins, titlepage, page numbering, section titles, sub- and superscript sizes etc.\end{quote}} \section{Introduction} Formatting a dissertation according to a University's thesis requirements is not always a simple task in \LaTeX, especially since the requirements are generally aimed at MSWord users. Furthermore, most of the work of formatting a document is supposed to be done by the document class itself, and not by the individual user. Fortunately, Michigan State University's thesis requirements are for the most part sane, and fairly straightforward. The present class file is designed to further make the process easier for \LaTeX\ users, by doing all the heavy lifting for you, so that you can focus on the content and not the formatting. \section{Background} @@ -121,6 +121,7 @@ In addition to all the user functionality defined by \pkg{memoir}, the \pkg{msu- {\bs makededicationpage} & Creates the dedication page.\\ %{\bs makebibliographypage} & Creates the bibliography cover page.\\ {\{abbreviations\}} & Environment for the List of Abbreviations \\ +{msutocdeph} & Counter for setting the TOC depth. Default is 1 (sections+chapters). Set this to 0 to use the simplified (chapters only) format that the thesis office suggests but doesn’t require.\\ \bottomrule \end{tabularx} \caption{Class titling commands} @@ -190,6 +191,14 @@ The \pkg{memoir}\ class replicates the functionality of many independent package \subsection{Captions} \subsubsection{Caption delimiter}\label{captiondelim} Because the thesis office doesn't understand anything about punctuation, it requires the colon that would appear in a caption to also appear in the contents lists. Since they don't care about the colon itself, but just consistency I've removed colons from the captions entirely, since leaving it in makes the contents lists look really stupid. But in case you or your advisor want the colon in captions, you can add the colon back in by adding |\renewcommand{\msucaptiondelim}{:\space}| to your preamble, and the class will make sure the Lists of Tables and Figures match in formatting. If you have other floating objects with captions (e.g., algorithms, listings) you may need to change their delimiter too (see below). How you do this may depend on the particular packages you are using. + +\subsubsection{Simplified vs. full contents} +The thesis guide suggests that you use a simplified table of contents that lists only chapter levels, but that you are welcome to use a more detailed table of contents if you wish. As with most, if not all of the “design” decisions made by the thesis office, this one makes very little typographic sense, and so I have left the default TOC level to be 1, i.e., chapters and sections will be listed in the TOC. If you wish to use the simplified contents format that just lists chapters, add the following to your preamble: + +\begin{quote} +|\setcounter{msutocdepth}{0}| +\end{quote} + \subsubsection{New lists} If you are using other kinds of floats such as listings, you should use the Memoir |\newlistof| command to make the relevant list. The class provides a macro |\msucaptiondelim| which can be used to make sure the formatting of the captions in the list-of-X match the setting you have for Figures and Tables. Here is an example of how you would add a listings list. For lists of algorithms, see section \ref{algorithms} below. The following code goes in your preamble: \begin{quote} @@ -402,10 +411,43 @@ I'm happy to answer emails about formatting issues with the class, especially wh \subsection{Archiving your thesis for the future} Since the current version of the \pkg{msu-thesis}\ class satisfies the Graduate School requirements at any one time, as these requirements change, you may find that if you need to recompile your thesis after you have graduated that the formatting changes. To avoid this, I would recommend saving an archived version of the \pkg{msu-thesis.cls}\ file in the same folder as your thesis file. You only need to do this once you have completely finished your thesis however; there's no need to do it during the writing process. \subsection{Major Version history} -Previous versions of \pkg{msu-thesis}\ (versions 1.0--1.4b) were created for non-electronic submission and should not be used. Versions 1.5--1.6 (the first electronic submission versions) contained a |\makeabstract| command and a separate |msuabstract| environment. These have been removed as of version 1.7. Users who are upgrading from earlier versions to version 1.7 do not need to change these commands however but their use will trigger a warning.) Version 2.0 implemented landscape pages; version 2.1 added support for \pkg{hyperref}. Versions 2.2--2.5 mainly accommodated to the ever changing whims of the MSU Graduate School. Version 2.6 fixed some appendix bugs introduced by the previous whim accommodation. Version 2.7 fixed various small spacing issues, fixed a bug which prevented a new chapter page to be a landscape page, added support for the \pkg{apacite}\ package, and updated degree options. Version 2.8 fixed some spacing and capitalization issues and added support for the public abstract. Version 2.9 removed subscript/superscript size restrictions, added font size options and made small spacing changes to appease the thesis office. Version 3.0 added full support for per-chapter bibliographies and appendices, and automated bibliography spacing for |natbib| and |biblatex| produced bibliographies. Version 3.1 added support for an |{algorithm}| environment and a list of algorithms to combat incompatibilities with the \pkg{algorithm}\ and \pkg{algorithm2e}\ packages. Version 3.2 fixed some lingering problems with per-chapter appendices. Version 3.3 added code to accommodate the insane inconsistencies in formatting requirements that the thesis office requires, including a new contents option which hopefully should never be used, and fixed some numbering problems with per-chapter appendices. Version 3.4 added a starred option to the |\makecopyrightpage| command after complaints about placement. The documentation has also been updated to include more information about caption formatting and removed colons from the default caption format. Version 3.5 added user level way to change the spacing after the author’s name in the abstract, to deal with thesis office inconsistency. Version 3.6 added built-in support for the Key to Abbreviations. Version 3.7 added improved support for \pkg{hyperref}. Version 4.0 implements the new requirements as of September 2022, including adding a |\dualmajor| command. Various spacing changes have been made which will make your document look like you used Word, but this is what the thesis office seems to care about. +Previous versions of \pkg{msu-thesis}\ (versions 1.0--1.4b) were created for non-electronic submission and should not be used. +Versions 1.5--1.6 (the first electronic submission versions) contained a |\makeabstract| command and a separate |msuabstract| environment. +These have been removed as of version 1.7. + Users who are upgrading from earlier versions to version 1.7 do not need to change these commands however but their use will trigger a warning.) Version 2.0 implemented landscape pages; version 2.1 added support for \pkg{hyperref}. +Versions 2.2--2.5 mainly accommodated to the ever changing whims of the MSU Graduate School. +Version 2.6 fixed some appendix bugs introduced by the previous whim accommodation. +Version 2.7 fixed various small spacing issues, fixed a bug which prevented a new chapter page to be a landscape page, added support for the \pkg{apacite}\ package, and updated degree options. +Version 2.8 fixed some spacing and capitalization issues and added support for the public abstract. +Version 2.9 removed subscript/superscript size restrictions, added font size options and made small spacing changes to appease the thesis office. +Version 3.0 added full support for per-chapter bibliographies and appendices, and automated bibliography spacing for |natbib| and |biblatex| produced bibliographies. +Version 3.1 added support for an |{algorithm}| environment and a list of algorithms to combat incompatibilities with the \pkg{algorithm}\ and \pkg{algorithm2e}\ packages. + Version 3.2 fixed some lingering problems with per-chapter appendices. +Version 3.3 added code to accommodate the insane inconsistencies in formatting requirements that the thesis office requires, including a new contents option which hopefully should never be used, and fixed some numbering problems with per-chapter appendices. +Version 3.4 added a starred option to the |\makecopyrightpage| command after complaints about placement. +The documentation has also been updated to include more information about caption formatting and removed colons from the default caption format. +Version 3.5 added user level way to change the spacing after the author’s name in the abstract, to deal with thesis office inconsistency. +Version 3.6 added built-in support for the Key to Abbreviations. +Version 3.7 added improved support for \pkg{hyperref}. +Version 4.0 implements the new requirements as of September 2022, including adding a |\dualmajor| command. +Various spacing changes have been made which will make your document look like you used Word, but this is what the thesis office seems to care about. +Version 4.1 added the |msutocdepth| counter to allow for the chapters-only format that the thesis office recommends. \section{Acknowledgements} -Thanks to Lars Madsen, Ulrike Fischer and Peter Wilson for help with setting up parts of the memoir code for versions 1.0--1.4 (now eliminated due to changed requirements). Thanks to Wolfgang Sternefeld for supplying the \pkg{linguex}\ spacing fix code, Leo Liu for the landscape page numbering code, which greatly simplified my original version. Thanks to Florent Chervet for early \pkg{hyperref} code (up until v.3.6), and Ulrike Fischer for the current \pkg{hyperref} code. Thanks also to the following students who have reported problems over the years: Irina Agafonova, Ali Al-jiboory, Abubakr Ayesh, Julian Blank, Dmitriy Bryndin, Greg Christian, Kyle Crayne, Ciaron Hamilton, Matt Husband, Changkuk Jung, Claire Kopenhafer, Adam Liter, Vanessa Maldonado, William Muir, Eureka Pai, Alicia Parrish, Neil ver Planck, Nick Rekuski, Giacomo Romanini, William Sands, Adam Soliman, Erik Stitt, Eremey Valetov, Matthew Vincent, Michael Wojcik, Stephen Yowono, Ali Zare, and Yisu Zhou. A special thank you to Non Thongprong who graciously provided a copy of his entire thesis which allowed me to debug some especially subtle spacing inconsistencies. +Thanks to Lars Madsen, Ulrike Fischer and Peter Wilson for help with setting up parts of +the memoir code for versions 1.0--1.4 (now eliminated due to changed requirements). Thanks +to Wolfgang Sternefeld for supplying the \pkg{linguex}\ spacing fix code, Leo Liu for the +landscape page numbering code, which greatly simplified my original version. Thanks to +Florent Chervet for early \pkg{hyperref} code (up until v.3.6), and Ulrike Fischer for the +current \pkg{hyperref} code. Thanks also to the following students who have reported +problems over the years: Irina Agafonova, Ali Al-jiboory, Abubakr Ayesh, Julian Blank, +Dmitriy Bryndin, Greg Christian, Kyle Crayne, Ciaron Hamilton, Matt Husband, Changkuk +Jung, Claire Kopenhafer, Adam Liter, Vanessa Maldonado, Ben Miller, William Muir, Eureka +Pai, Alicia Parrish, Neil ver Planck, Nick Rekuski, Giacomo Romanini, William Sands, Adam +Soliman, Erik Stitt, Eremey Valetov, Matthew Vincent, Michael Wojcik, Stephen Yowono, Ali +Zare, and Yisu Zhou. A special thank you to Non Thongprong who graciously provided a copy +of his entire thesis which allowed me to debug some especially subtle spacing +inconsistencies. \appendix \renewcommand{\thesection}{Appendix \Alph{section}} diff --git a/macros/latex/contrib/msu-thesis/msu-thesis.cls b/macros/latex/contrib/msu-thesis/msu-thesis.cls index f347e08d2f..35dcb3c4f9 100644 --- a/macros/latex/contrib/msu-thesis/msu-thesis.cls +++ b/macros/latex/contrib/msu-thesis/msu-thesis.cls @@ -1,6 +1,6 @@ % MSU Thesis Class % -% Copyright 2009-2022 by Alan Munn <amunn@msu.edu> +% Copyright 2009-2023 by Alan Munn <amunn@msu.edu> % % This is a class file for producing dissertations and theses according to the % Michigan State University Graduate School Guidelines @@ -180,11 +180,12 @@ % moment. % Version 4.0 2022/12/13 First version to conform to the updated requirements (September 2022) % Version 4.0b 2022/12/15 Made box for degree name larger +% Version 4.1 2023/05/18 Added msutocdepth to allow minimal chapters only TOC % % Report bugs/problems/questions to <amunn@msu.edu> % -\def\msu@version{4.0b} -\def\msu@date{2023/12/15} +\def\msu@version{4.1} +\def\msu@date{2023/05/18} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{msu-thesis}[\msu@date\space Michigan State University Thesis Class version \msu@version] \newif\ifmsu@dissertation\msu@dissertationtrue % added v2.7 boolean for \msu@thesistype @@ -297,6 +298,8 @@ \newcommand*{\msu@fieldseparator}{\textemdash} % this is between the degree name and field of study \newcommand*{\dualmajor}[2]{\msu@dualmajortrue\gdef\msu@fieldofstudy{#1}\gdef\msu@dualmajor{#2}} \newcommand*{\msu@DUALMAJOR}{Dual Major} +\newcounter{msutocdepth} +\setcounter{msutocdepth}{1} % section level included in the TOC \newcounter{msu@hchap} % global counter for chapters used by hyperref % This may also be solved by using \hypersetup{hypertexnames=false} % hard to tell whether this is a better solution. @@ -360,7 +363,7 @@ % set up TOC -\settocdepth{section} +\setcounter{tocdepth}{\value{msutocdepth}} \setsecnumdepth{subsubsection} \setlength{\cftsectionindent}{.5in} \renewcommand*{\printtoctitle}[1]{\centering\bfseries\msu@contentsname} @@ -488,6 +491,7 @@ \renewcommand\cftchapterpagefont{\msu@tocfont} \renewcommand*{\cftappendixname}{APPENDIX\space} \renewcommand\cftchapteraftersnum{\msutocdelim} + \addtocounter{tocdepth}{-1} } @@ -496,11 +500,11 @@ \cftinsertcode{CHAPAPPR}{ \cftsetindents{section}{.5in}{2.3em} \setlength{\cftchapterindent}{0em} -\setlength{\cftchapternumwidth}{3em} % added 6/24/2022 +%\setlength{\cftchapternumwidth}{3em} % removed 2/1/2023 \setlength{\cftbeforechapterskip}{1.0em \@plus\p@} \renewcommand\cftchapterfont{\msu@chapfont\MakeUppercase} \renewcommand\cftchapterpagefont{\msu@chapfont} - \settocdepth{section} % added 6/24/2022 + \setcounter{tocdepth}{\value{msutocdepth}} } % This code resets the changes made in the APP code back to normal % so that the bibliography will appear correctly in the TOC @@ -509,7 +513,7 @@ \setlength{\cftbeforechapterskip}{1.0em \@plus\p@} \renewcommand\cftchapterfont{\msu@chapfont\MakeUppercase} \renewcommand\cftchapterpagefont{\msu@chapfont} - \settocdepth{section} + \setcounter{tocdepth}{\value{msutocdepth}} } \cftinsertcode{CHAPBIB}{ @@ -517,6 +521,7 @@ \setlength\cftbeforechapterskip{0pt} \renewcommand\cftsectionfont{\msu@tocfont} % fixed 12/13/17 \renewcommand\cftchapterpagefont{\msu@tocfont} + \addtocounter{tocdepth}{-1} } @@ -540,7 +545,7 @@ % \l@chapapp{\msu@tocfont\MakeUppercase{#1}}{#2}{\cftappendixname}} % Format appendix names % -\setlength{\cftchapternumwidth}{3em} +\setlength{\cftchapternumwidth}{3em} % Could this be smaller? \setrmarg{3.5em} % better wrapping of long titles % Added to make sure that chapters within landscape mode have correct pagestyle @@ -734,11 +739,11 @@ % \ifmsu@chapterapp\else \msu@singleappendixtrue % \fi% make sure single appendix doesn't have a number if global 3.1b (always 3.2) - \msu@apppage\cftinserthook{toc}{SINGAPP}\settocdepth{chapter}\@resets@pp\anappendixtrue}% + \msu@apppage\cftinserthook{toc}{SINGAPP}\setcounter{tocdepth}{0}\@resets@pp\anappendixtrue}% {\@ppsaveapp\@pprestoresec\anappendixfalse\cftinserthook{toc}{CHAPAPPR}} % reset aded 2022/04/16 \renewenvironment{appendices}% - {\msu@singleappendixfalse\msu@apppage\ifmsu@chapterapp\cftinserthook{toc}{APPENDICES}\fi\settocdepth{chapter} + {\msu@singleappendixfalse\msu@apppage\ifmsu@chapterapp\cftinserthook{toc}{APPENDICES}\fi\setcounter{tocdepth}{\value{msutocdepth}} \@resets@pp\anappendixtrue}% {\@ppsaveapp\@pprestoresec\anappendixfalse\cftinserthook{toc}{CHAPAPPR}} % reset added 2022/04/16 @@ -771,7 +776,7 @@ \let\bibtocname\bibname % moved inside this page to beat apacite \let\bibpagename\bibname \cftinserthook{toc}{\msu@bibtype} - \settocdepth{section} % changed v2.7 to allow for chapter bibs + \setcounter{tocdepth}{\value{msutocdepth}} % changed v2.7 to allow for chapter bibs % \@setuppart % \msu@preaddbibpagetotochook \msu@addbibheadtotoc @@ -827,6 +832,7 @@ {\AtBeginEnvironment{thebibliography}{\SingleSpacing\setlength{\bibsep}{\baselineskip}}} % natbib {\AtBeginEnvironment{thebibliography}{\SingleSpacing}}} % any other bib package %\topskip=0pt % setting this because the Grad School doesn’t know how to measure -changed back 6/15/17 +\setcounter{tocdepth}{\value{msutocdepth}} \checkandfixthelayout % % set up subscript sizes so that 10 pt is the smallest diff --git a/macros/latex/contrib/msu-thesis/msu-thesis.pdf b/macros/latex/contrib/msu-thesis/msu-thesis.pdf Binary files differindex bdb1416cbd..0e4d61d51c 100644 --- a/macros/latex/contrib/msu-thesis/msu-thesis.pdf +++ b/macros/latex/contrib/msu-thesis/msu-thesis.pdf diff --git a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-chapterbib-testfile.pdf b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-chapterbib-testfile.pdf Binary files differindex dffeb0b1ac..314819f5f8 100644 --- a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-chapterbib-testfile.pdf +++ b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-chapterbib-testfile.pdf diff --git a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-chapterbib-testfile.tex b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-chapterbib-testfile.tex index 9f7948b3f3..f4ee4c9157 100644 --- a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-chapterbib-testfile.tex +++ b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-chapterbib-testfile.tex @@ -15,7 +15,7 @@ \author{Joe Linguist} \fieldofstudy{Linguistics} % This should be in sentence case \date{2021} - +\setcounter{msutocdepth}{0} % default is 1 \begin{document} \frontmatter \maketitlepage diff --git a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-template.tex b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-template.tex index 33580d3f0a..5baa21732d 100644 --- a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-template.tex +++ b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-template.tex @@ -1,5 +1,5 @@ % This is a template for use with the MSU Thesis class -% Version 3.6 2022/08/23 +% Version 4.1 2023/05/18 % % Class options: %[PhD] Doctor of Philosophy (default) @@ -61,6 +61,11 @@ % %\dedication{This thesis is dedicated to someone.} % +% The default TOC format for the class lists both chapters and sections +% The thesis office suggests only listing chapters. If you prefer that format +% uncomment the next line: +%\setcounter{msutocdepth}{0} % sets TOC to list chapters only +% \begin{document} % All the stuff before your actual chapters is called the front matter @@ -68,10 +73,6 @@ % First make the title page \maketitlepage -% if you have public abstract (optional) it should go here -%\begin{publicabstract} -% Public abstract goes here -%\end{publicabstract} % Next make the regular abstract (obligatory) \begin{abstract} @@ -84,9 +85,7 @@ % can't have a copyright page unless you pay ProQuest to register the copyright. % This is simply not the case, so put in your copyright page whether or not you % intend to pay Proquest to register the copyright. -% Furthermore, they have occasionally complained that the copyright mark is aligned -% to the right, even though that has been the format for more than a decade. -% If they want the copyright mark aligned to the left, use \makecopyrightpage* instead. + \makecopyrightpage diff --git a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.pdf b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.pdf Binary files differindex 50ba856441..28628d5403 100644 --- a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.pdf +++ b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.pdf diff --git a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.tex b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.tex index 443dba5a41..68851f93cf 100644 --- a/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.tex +++ b/macros/latex/contrib/msu-thesis/samples/MSU-thesis-testfile.tex @@ -30,9 +30,8 @@ \usepackage{gb4e} \makeatletter %\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} - \makeatother - +\setlength{\cftchapternumwidth}{1.5em} \counterwithin{exx}{chapter} \singlegloss @@ -48,7 +47,10 @@ \renewcommand*{\cftlistingaftersnum}{\msucaptiondelim} \usepackage[bookmarksopenlevel=2,bookmarks=true]{hyperref} % not needed but here for testing +\setcounter{msutocdepth}{0} % default is 1; this puts only chapters in the TOC + \begin{document} + \frontmatter \maketitlepage % public abstract removed v4 @@ -128,7 +130,7 @@ Men & Women & Monsters\\ \end{figure} \lipsum[5] \lipsum[10] -\chapter{A chapter with a really long title to see if the chapter titles wrap correctly} +\chapter[A chapter with a really long title to\\see if the chapter titles wrap correctly]{A chapter with a really long title to see if the chapter titles wrap correctly} \lipsum \begin{figure} \centering diff --git a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf Binary files differindex f0a1742b38..d93d8015fc 100644 --- a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf +++ b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf diff --git a/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex b/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex index 69f35b0424..16a60d4a46 100644 --- a/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex +++ b/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex @@ -4,11 +4,11 @@ \setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Th\'eor\`eme\\de Pythagore,ThemeSol=Solution,AfficheTheme=false,Trame=false,Jointes=false,TrameVisible=false,RayonArc=5pt,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,Eleve=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true,SolutionSeule=false,% % Pour la boite - NbCartes=16,TypeJeu=Loop,Niveau=1,Numero=1,ThemeJeu=Nombres relatifs,Commerce=false, + NbCartes=16,TypeJeu=Boucle,Niveau=1,Numero=1,ThemeJeu=Nombres relatifs,CouleurTheme=black,CouleurNiveau=black,CouleurType=black,CouleurNb=black, % Pour le trivial Trivial=false,Symboles={\faInfinity,\faSignal,\faProjectDiagram,\faHiking,\faRuler,\faLockOpen} }% -\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}} +\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}}% % \newtcolorbox{Mybox}[3]{% enhanced,% @@ -20,7 +20,7 @@ arc=\PfCRayonArc,% overlay unbroken and first={% \coordinate[yshift=-0.5\hauteurtitre] (A1) at (frame.north west);% - \coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);% + \coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);% \coordinate[yshift=-\hauteurtitre] (A) at (frame.north west);% \coordinate[yshift=-\hauteurtitre] (B) at (frame.north east);% \coordinate[xshift=1.5pt,yshift=8mm] (S1) at (frame.south west);% @@ -47,9 +47,9 @@ colbacktitle=TrameCouleur,% }% -\newcommand\PfCTexteJai{J'ai} -\newcommand\PfCTexteJesuis{Je suis\dots} -\newcommand\PfCTexteQuia{Qui a ?} +\newcommand\PfCTexteJai{J'ai}% +\newcommand\PfCTexteJesuis{Je suis\dots}% +\newcommand\PfCTexteQuia{Qui a ?}% \makeatletter \newtcolorbox{MyboxJQ}[2]{% @@ -59,7 +59,7 @@ text fill,% width=\largeurcarte,% height=\hauteurcarte,% - arc=\PfCRayonArc,%\useKV[Cards]{RayonArc},% + arc=\PfCRayonArc,% underlay={% \ifboolKV[Cards]{BackgroundAv}{% \begin{tcbclipinterior} @@ -143,9 +143,9 @@ },% colback=white }% -\makeatother +%\makeatother -\makeatletter +%\makeatletter %https://tex.stackexchange.com/questions/347434/clip-background-image-inside-tcolorbox \newtcolorbox{MyboxSimpleAv}[1]{% enhanced,% @@ -239,8 +239,8 @@ \newlength{\PfCCardsEcartH}%Pour décaler sur une page paire \newlength{\PfCCardsV}%pour retenir en cas de décalage sur une page paire \newlength{\PfCCardsEcartV}%Pour décaler sur une page paire -\setlength{\PfCCardsEcartH}{0pt} -\setlength{\PfCCardsEcartV}{0pt} +\setlength{\PfCCardsEcartH}{0pt}% +\setlength{\PfCCardsEcartV}{0pt}% \NewDocumentEnvironment{Trame}{+b}{% \ifodd\thepage% @@ -280,7 +280,7 @@ \draw (C1)--(D1);% \draw (C2)--(D2);% \draw (C3)--(D3);% - }{} + }{}% % point pour placer les cartes \coordinate[xshift=\margeh+0.5\PfCCardsH,yshift=-0.5\PfCCardsV] (Carte1) at (A);% \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);% @@ -295,51 +295,7 @@ \end{tikzpicture}% }{}% -\NewDocumentEnvironment{Trameold}{+b}{% - \begin{tikzpicture}[remember picture,overlay] - % quadrillages horizontal et vertical - \coordinate[yshift=-\margev] (A) at (current page.north west);% - \coordinate[yshift=-\margev] (B) at (current page.north east);% - \coordinate[yshift=-\hauteurcards] (A1) at (A);% - \coordinate[yshift=-\hauteurcards] (B1) at (B);% - \coordinate[yshift=-\hauteurcards] (A2) at (A1);% - \coordinate[yshift=-\hauteurcards] (B2) at (B1);% - \coordinate[yshift=-\hauteurcards] (A3) at (A2);% - \coordinate[yshift=-\hauteurcards] (B3) at (B2);% - \coordinate[yshift=-\hauteurcards] (A4) at (A3);% - \coordinate[yshift=-\hauteurcards] (B4) at (B3);% - \coordinate[xshift=\margeh] (C) at (current page.north west);% - \coordinate[xshift=\margeh] (D) at (current page.south west);% - \coordinate[xshift=\largeurcards] (C1) at (C);% - \coordinate[xshift=\largeurcards] (D1) at (D);% - \coordinate[xshift=\largeurcards] (C2) at (C1);% - \coordinate[xshift=\largeurcards] (D2) at (D1);% - \coordinate[xshift=\largeurcards] (C3) at (C2);% - \coordinate[xshift=\largeurcards] (D3) at (D2);% - \draw (A)--(B);% - \draw (A1)--(B1);% - \draw (A2)--(B2);% - \draw (A3)--(B3);% - \draw (A4)--(B4);% - \draw (C)--(D);% - \draw (C1)--(D1);% - \draw (C2)--(D2);% - \draw (C3)--(D3);% - % point pour placer les cartes - \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);% - \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);% - \coordinate[xshift=2\largeurcards,yshift=0mm] (Carte3) at (Carte1);% - \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte4) at (Carte1);% - \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte5) at (Carte2);% - \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte6) at (Carte3);% - \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte7) at (Carte4);% - \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte8) at (Carte5);% - \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte9) at (Carte6);% - #1% - \end{tikzpicture}% -}{}% - -\NewDocumentCommand\Cartes{o +m}{%[2][]{% +\NewDocumentCommand\Cartes{o +m}{% \useKVdefault[Cards]% \setKV[Cards]{#1}% \setsepchar[*]{§*/}% @@ -366,20 +322,224 @@ \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}% \setlength{\PfCRayonArc}{\useKV[Cards]{RayonArc}}% \ifboolKV[Cards]{Trivial}{% - \xdef\PfCListeSymbolTrivial{\useKV[Cards]{Symboles}}% - \setsepchar{,}\readlist*\ListeSymbolesTrivial{\PfCListeSymbolTrivial}% - \setlength{\tabcolsep}{0.25\tabcolsep} - \ifboolKV[Cards]{Trame}{% + \CartesTrivial% + }{% + \ifboolKV[Cards]{JaiQuia}{% + \CartesJaiQuia% + }{% + \ifboolKV[Cards]{Loop}{% + \CartesLoop% + }{% + \CartesClassique% + }% + }% + }% +}% + +\NewDocumentCommand\CartesClassique{}{% + \ifboolKV[Cards]{Trame}{% + \clearpage% + \thispagestyle{empty}% + \begin{Trame} + \multido{\i=1+1}{9}{% + \node[] at (Carte\i) {% + \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}% + \ListeCards[\i,1]% + \end{MyboxSimpleAv}% + };% + }% + \end{Trame}% + \ifboolKV[Cards]{AffichageSolution}{% + \clearpage% + \thispagestyle{empty}% + \begin{Trame} + \multido{\i=1+1}{3}{% + \node at (Carte\i) {% + \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}% + \ListeCards[\fpeval{4-\i},2]% + \end{MyboxSimpleAr}% + };% + }% + \multido{\i=4+1}{3}{% + \node at (Carte\i) {% + \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}% + \ListeCards[\fpeval{10-\i},2]% + \end{MyboxSimpleAr}% + };% + }% + \multido{\i=7+1}{3}{% + \node at (Carte\i) {% + \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}% + \ListeCards[\fpeval{16-\i},2]% + \end{MyboxSimpleAr}% + };% + }% + \end{Trame}% + \clearpage% + }{}% + }{% + \ifboolKV[Cards]{SolutionSeule}{}{% + \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}% + \ListeCards[1,1]% + \end{MyboxSimpleAv}% + }% + \ifboolKV[Cards]{AffichageSolution}{% + \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}% + \ListeCards[1,2]% + \end{MyboxSimpleAr}% + }{}% + }% +}% + +\NewDocumentCommand\CartesLoop{}{% + \ifboolKV[Cards]{Trame}{% + \clearpage% + \thispagestyle{empty}% + \begin{Trame} + \multido{\i=1+1}{9}{% + \node at (Carte\i) {% + \begin{Mybox}{\ListeCards[\i,1]}{\useKV[Cards]{Theme}}{\ListeCards[\i,2]}% + \ListeCards[\i,3]% + \end{Mybox}% + };% + }% + \end{Trame}% + \clearpage% + }{% + \begin{Mybox}{\ListeCards[1,1]}{\useKV[Cards]{Theme}}{\ListeCards[1,2]}% + \ListeCards[1,3]% + \end{Mybox}% + }% +}% + +\NewDocumentCommand\CartesJaiQuia{}{% + \ifboolKV[Cards]{Trame}{% + \clearpage% + \thispagestyle{empty}% + \begin{Trame}% + \multido{\i=1+1}{9}{% + \node at (Carte\i) {% + \begin{MyboxJQ}{\ListeCards[\i,1]}{\ListeCards[\i,2]}% + %% + \end{MyboxJQ}% + };% + }% + \end{Trame}% + \clearpage% + \ifboolKV[Cards]{AffichageSolution}{% + \thispagestyle{empty}% + \begin{Trame} + \multido{\i=1+1}{3}{% + \node at (Carte\i) {% + \ifboolKV[Cards]{AfficheTheme}{% + \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}% + \end{MyboxJQAr}% + }{% + \begin{MyboxJQAr}{}% + \end{MyboxJQAr}% + }% + };% + }% + \multido{\i=4+1}{3}{% + \node at (Carte\i) {% + \ifboolKV[Cards]{AfficheTheme}{% + \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}% + \end{MyboxJQAr}% + }{% + \begin{MyboxJQAr}{}% + \end{MyboxJQAr}% + }% + };% + }% + \multido{\i=7+1}{3}{% + \node at (Carte\i) {% + \ifboolKV[Cards]{AfficheTheme}{% + \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}% + \end{MyboxJQAr}% + }{% + \begin{MyboxJQAr}{}% + \end{MyboxJQAr}% + }% + };% + }% + \end{Trame}% + \clearpage% + }{}% + }{% + \begin{MyboxJQ}{\ListeCards[1,1]}{\ListeCards[1,2]}% + %% + \end{MyboxJQ}% + \ifboolKV[Cards]{AffichageSolution}{% + \ifboolKV[Cards]{AfficheTheme}{% + \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}% + \end{MyboxJQAr}% + }{% + \begin{MyboxJQAr}{}% + \end{MyboxJQAr}% + }% + }{}% + }% +}% + +\NewDocumentCommand\CartesTrivial{}{% + \xdef\PfCListeSymbolTrivial{\useKV[Cards]{Symboles}}% + \setsepchar{,}\readlist*\ListeSymbolesTrivial{\PfCListeSymbolTrivial}% + \setlength{\tabcolsep}{0.25\tabcolsep}% + \ifboolKV[Cards]{Trame}{% + \clearpage% + \thispagestyle{empty}% + \begin{Trame}% + \multido{\i=1+1}{9}{% + \node[] at (Carte\i) {% + \begin{MyboxTrivial}% + \begin{center} + \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[9,m]}[hvlines]% + \xintFor* ##1 in{\xintSeq{1}{6}}\do{% + \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\i,\fpeval{1+2*(##1-1)}]\\ + }% + \end{NiceTabular}% + \end{center}% + \end{MyboxTrivial}% + };% + }% + \end{Trame}% + \ifboolKV[Cards]{AffichageSolution}{% \clearpage% \thispagestyle{empty}% \begin{Trame}% - \multido{\i=1+1}{9}{% - \node[] at (Carte\i) {% + \multido{\i=1+1}{3}{% + \node at (Carte\i) {% + \begin{MyboxTrivial}% + \begin{center}% + \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% + \xintFor* ##1 in{\xintSeq{1}{6}}\do{% + \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{4-\i},\fpeval{2*##1}]\\ + }% + \end{NiceTabular}% + \end{center}% + \end{MyboxTrivial}% + };% + }% + \multido{\i=4+1}{3}{% + \node at (Carte\i) {% + \begin{MyboxTrivial}% + \begin{center}% + \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% + \xintFor* ##1 in{\xintSeq{1}{6}}\do{% + \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{10-\i},\fpeval{2*##1}]\\ + }% + \end{NiceTabular}% + \end{center}% + \end{MyboxTrivial}% + };% + }% + \multido{\i=7+1}{3}{% + \node at (Carte\i) {% \begin{MyboxTrivial}% - \begin{center} - \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[9,m]}[hvlines]% + \begin{center}% + \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% \xintFor* ##1 in{\xintSeq{1}{6}}\do{% - \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\i,\fpeval{1+2*(##1-1)}]\\ + \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{16-\i},\fpeval{2*##1}]\\ }% \end{NiceTabular}% \end{center}% @@ -387,219 +547,31 @@ };% }% \end{Trame}% - \ifboolKV[Cards]{AffichageSolution}{% - \clearpage% - \thispagestyle{empty}% - \begin{Trame}% - \multido{\i=1+1}{3}{% - \node at (Carte\i) {% - \begin{MyboxTrivial}% - \begin{center}% - \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% - \xintFor* ##1 in{\xintSeq{1}{6}}\do{% - \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{4-\i},\fpeval{2*##1}]\\ - }% - \end{NiceTabular}% - \end{center}% - \end{MyboxTrivial}% - };% - }% - \multido{\i=4+1}{3}{% - \node at (Carte\i) {% - \begin{MyboxTrivial}% - \begin{center}% - \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% - \xintFor* ##1 in{\xintSeq{1}{6}}\do{% - \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{10-\i},\fpeval{2*##1}]\\ - }% - \end{NiceTabular}% - \end{center}% - \end{MyboxTrivial}% - };% - }% - \multido{\i=7+1}{3}{% - \node at (Carte\i) {% - \begin{MyboxTrivial}% - \begin{center}% - \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% - \xintFor* ##1 in{\xintSeq{1}{6}}\do{% - \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[\fpeval{16-\i},\fpeval{2*##1}]\\ - }% - \end{NiceTabular}% - \end{center}% - \end{MyboxTrivial}% - };% + \clearpage% + }{}% + }{% + \begin{MyboxTrivial}% + \begin{center}% + \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% + \xintFor* ##1 in{\xintSeq{1}{6}}\do{% + \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[1,\fpeval{1+2*(##1-1)}]\\ }% - \end{Trame}% - \clearpage% - }{}% - }{% + \end{NiceTabular}% + \end{center}% + \end{MyboxTrivial}% + \ifboolKV[Cards]{AffichageSolution}{% \begin{MyboxTrivial}% \begin{center}% \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% \xintFor* ##1 in{\xintSeq{1}{6}}\do{% - \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[1,\fpeval{1+2*(##1-1)}]\\ + \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[1,\fpeval{2*##1}]\\ }% \end{NiceTabular}% \end{center}% \end{MyboxTrivial}% - \ifboolKV[Cards]{AffichageSolution}{% - \begin{MyboxTrivial}% - \begin{center}% - \begin{NiceTabular}[width=0.9\largeurcarte]{X[1,m]X[10,m]}[hvlines]% - \xintFor* ##1 in{\xintSeq{1}{6}}\do{% - \rule{0pt}{0.12\hauteurcards}\Block{1-1}{\ListeSymbolesTrivial[##1]}&\ListeCards[1,\fpeval{2*##1}]\\ - }% - \end{NiceTabular}% - \end{center}% - \end{MyboxTrivial}% - }{}% - }% - \setlength{\tabcolsep}{4\tabcolsep}% - }{% - \ifboolKV[Cards]{JaiQuia}{% - \ifboolKV[Cards]{Trame}{% - \clearpage% - \thispagestyle{empty}% - \begin{Trame}% - \multido{\i=1+1}{9}{% - \node at (Carte\i) {% - \begin{MyboxJQ}{\ListeCards[\i,1]}{\ListeCards[\i,2]}% - %% - \end{MyboxJQ}% - };% - }% - \end{Trame}% - \clearpage% - \ifboolKV[Cards]{AffichageSolution}{% - \thispagestyle{empty}% - \begin{Trame} - \multido{\i=1+1}{3}{% - \node at (Carte\i) {% - \ifboolKV[Cards]{AfficheTheme}{% - \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}% - \end{MyboxJQAr}% - }{% - \begin{MyboxJQAr}{}% - \end{MyboxJQAr}% - }% - };% - }% - \multido{\i=4+1}{3}{% - \node at (Carte\i) {% - \ifboolKV[Cards]{AfficheTheme}{% - \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}% - \end{MyboxJQAr}% - }{% - \begin{MyboxJQAr}{}% - \end{MyboxJQAr}% - }% - };% - }% - \multido{\i=7+1}{3}{% - \node at (Carte\i) {% - \ifboolKV[Cards]{AfficheTheme}{% - \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}% - \end{MyboxJQAr}% - }{% - \begin{MyboxJQAr}{}% - \end{MyboxJQAr}% - }% - };% - }% - \end{Trame}% - \clearpage% - }{}% - }{% - \begin{MyboxJQ}{\ListeCards[1,1]}{\ListeCards[1,2]}% - %% - \end{MyboxJQ}% - \ifboolKV[Cards]{AffichageSolution}{% - \ifboolKV[Cards]{AfficheTheme}{% - \begin{MyboxJQAr}{\useKV[Cards]{ThemeJaiQuiA}}% - \end{MyboxJQAr}% - }{% - \begin{MyboxJQAr}{}% - \end{MyboxJQAr}% - }% - }{}% - }% - }{% - \ifboolKV[Cards]{Loop}{% - \ifboolKV[Cards]{Trame}{% - \clearpage% - \thispagestyle{empty}% - \begin{Trame} - \multido{\i=1+1}{9}{% - \node at (Carte\i) {% - \begin{Mybox}{\ListeCards[\i,1]}{\useKV[Cards]{Theme}}{\ListeCards[\i,2]}% - \ListeCards[\i,3]% - \end{Mybox}% - };% - }% - \end{Trame}% - \clearpage% - }{% - \begin{Mybox}{\ListeCards[1,1]}{\useKV[Cards]{Theme}}{\ListeCards[1,2]}% - \ListeCards[1,3]% - \end{Mybox}% - }% - }{% - \ifboolKV[Cards]{Trame}{% - \clearpage% - \thispagestyle{empty}% - \begin{Trame} - \multido{\i=1+1}{9}{% - \node[] at (Carte\i) {% - \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}% - \ListeCards[\i,1]% - \end{MyboxSimpleAv}% - };% - }% - \end{Trame}% - \ifboolKV[Cards]{AffichageSolution}{% - \clearpage% - \thispagestyle{empty}% - \begin{Trame} - \multido{\i=1+1}{3}{% - \node at (Carte\i) {% - \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}% - \ListeCards[\fpeval{4-\i},2]% - \end{MyboxSimpleAr}% - };% - }% - \multido{\i=4+1}{3}{% - \node at (Carte\i) {% - \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}% - \ListeCards[\fpeval{10-\i},2]% - \end{MyboxSimpleAr}% - };% - }% - \multido{\i=7+1}{3}{% - \node at (Carte\i) {% - \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}% - \ListeCards[\fpeval{16-\i},2]% - \end{MyboxSimpleAr}% - };% - }% - \end{Trame}% - \clearpage% - }{}% - }{% - \ifboolKV[Cards]{SolutionSeule}{}{% - \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}% - \ListeCards[1,1]% - \end{MyboxSimpleAv}% - }% - \ifboolKV[Cards]{AffichageSolution}{% - \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}% - \ListeCards[1,2]% - \end{MyboxSimpleAr}% - }{}% - }% - }% - }% + }{}% }% + \setlength{\tabcolsep}{4\tabcolsep}% }% \newcommand\SolutionCarte[2]{% @@ -608,4 +580,174 @@ \end{center} #2 +}% + +%%%%%%%% Boites +\def\BuildBoiteCartesCCCode{% + Longueur=10cm; + Largeur=7cm; + Epaisseur=\useKV[Cards]{NbCartes}*1mm; + pair A[],B[],C[],D[]; + A0=(0,0); + A1-A0=Epaisseur*(1,0); + A2-A1=Largeur*(1,0); + A3-A2=Epaisseur*(1,0); + A4-A3=Largeur*(1,0); + A5-A4=Epaisseur*(1,0); + A6-A5=Longueur*(0,1); + A7-A4=A6-A5; + A8-A3=A6-A5; + A9-A2=A6-A5; + A10-A1=A6-A5; + A11-A0=A6-A5; + A12-A11=A11-A10; + A13-A0=A0-A1; + B1-A1=Epaisseur*(0,-1); + B2-A2=Epaisseur*(0,-1); + B3-A3=Epaisseur*(0,-1); + B4-A4=Epaisseur*(0,-1); + C1=1/3[B1,B2]; + C4=2/3[B1,B2]; + C2-C1=B1-A1; + C3-C4=B1-A1; + C5-A2=(Epaisseur+5mm)*(0,-1); + C6-A3=C5-A2; + D1=1/5[A5,A6]; + D2-D1=(Epaisseur+5mm)*(1,0); + D4=2/5[A5,A6]; + D3-D4=D2-D1; + D5=3/5[A5,A6]; + D6-D5=D3-D4; + D8=4/5[A5,A6]; + D7-D8=D6-D5; + D9=1/3[A10,A9]; + D10=2/3[A10,A9]; + D11-D10=Epaisseur*(0,1); + D12-D9=D11-D10; + D17-A7=Epaisseur*(0,1); + D18-A8=D17-A7; + D19-D18=(1cm,Epaisseur+5mm); + D20-D17=(-1cm,Epaisseur+5mm); + picture Legende,LegendePDF; + pair M[]; + M0=1/2[A8,A7]; + M6=1/2[A3,A4]; + M1=1/6[M0,M6]; + M2=2/6[M0,M6]; + M3=3/6[M0,M6]; + M4=4/6[M0,M6]; + M5=5/6[M0,M6]; +}% + +\NewDocumentCommand\BuildBoiteCartesCommerceC{}{% + \ifluatex + \mplibforcehmode + \begin{mplibcode} + \BuildBoiteCartesCCCode; + % + trace chemin(A11,A12,A13,A0); + trace chemin(D9,A11,A0,1/3[A1,A2]); + trace chemin(D10,A6,A5,2/3[A1,A2]); + trace segment(A1,A10) dashed evenly; + trace segment(A1,1/5[A1,A10]); + trace segment(2/5[A1,A10],3/5[A1,A10]); + trace segment(4/5[A1,A10],A10); + trace marquesegment(1/5[A1,A10],2/5[A1,A10]); + trace marquesegment(3/5[A1,A10],4/5[A1,A10]); + trace segment(A2,A9); + trace segment(A3,A8); + trace segment(A4,A7); + trace segment(1/3[A1,A2],2/3[A1,A2]) dashed evenly; + trace marquesegment(1/3[A1,A2],2/3[A1,A2]); + % languettes basses + trace chemin(B1,B2); + trace chemin(B3,B4,A4); + trace chemin(C1,C2,C3,C4) shifted (B4-B2);; + picture Decoupe[]; + Decoupe1=image( + trace chemin(B2,C5,C6,B3); + trace A2--B2 dashed evenly; + trace A3--B3 dashed evenly; + ); + Decoupe2=image( + trace chemin(B2,C5,C6,A3); + trace A2--B2 dashed evenly; + ); + trace Decoupe1; + trace symetrie(Decoupe2,iso(A2,A3),iso(C5,C6)) shifted(A0-A2); + trace symetrie(Decoupe2 shifted(A4-A2),iso(A0,A11),iso(A5,A6)); + trace symetrie(Decoupe2 shifted(A4-A2),iso(A8,A4)); + % languettes droites + trace polygone(D1,D2,D3,D4); + trace polygone(D5,D6,D7,D8); + % languettes hautes + path cc; + cc=cercles(iso(A10,A9),1/3[A10,A9]); + trace Hachurage((subpath(length cc/2,length cc) of cc)--cycle,60,0.25,1); + trace (subpath(length cc/2,length cc) of cc)--cycle dashed evenly; + trace polygone(D18,D17,D20,D19); + trace chemin(1/3[D18,D17],D18,D19,D20,D17,2/3[D18,D17]); + % label + drawoptions(withcolor \useKV[Cards]{CouleurTheme}); + label(btex \bfseries\Large\useKV[Cards]{ThemeJeu} etex,M2); + drawoptions(withcolor \useKV[Cards]{CouleurNiveau}); + label(btex \bfseries Niveau \useKV[Cards]{Niveau} etex,M3); + label(btex \bfseries Jeu \useKV[Cards]{Numero} etex,M4); + drawoptions(withcolor \useKV[Cards]{CouleurNb}); + label(btex \bfseries\useKV[Cards]{NbCartes} cartes etex,M5); + drawoptions(withcolor \useKV[Cards]{CouleurType}); + label(btex \bfseries\Huge\useKV[Cards]{TypeJeu} etex,M1); + \end{mplibcode} + \else + \begin{mpost}[mpsettings={\BuildBoiteCartesCCCode;}] + trace chemin(A11,A12,A13,A0); + trace chemin(D9,A11,A0,1/3[A1,A2]); + trace chemin(D10,A6,A5,2/3[A1,A2]); + trace segment(A1,A10) dashed evenly; + trace segment(A1,1/5[A1,A10]); + trace segment(2/5[A1,A10],3/5[A1,A10]); + trace segment(4/5[A1,A10],A10); + trace marquesegment(1/5[A1,A10],2/5[A1,A10]); + trace marquesegment(3/5[A1,A10],4/5[A1,A10]); + trace segment(A2,A9); + trace segment(A3,A8); + trace segment(A4,A7); + trace segment(1/3[A1,A2],2/3[A1,A2]) dashed evenly; + trace marquesegment(1/3[A1,A2],2/3[A1,A2]); + % languettes basses + trace chemin(B1,B2); + trace chemin(B3,B4,A4); + trace chemin(C1,C2,C3,C4) shifted (B4-B2);; + picture Decoupe[]; + Decoupe1=image( + trace chemin(B2,C5,C6,B3); + trace A2--B2 dashed evenly; + trace A3--B3 dashed evenly; + ); + Decoupe2=image( + trace chemin(B2,C5,C6,A3); + trace A2--B2 dashed evenly; + ); + trace Decoupe1; + trace symetrie(Decoupe2,iso(A2,A3),iso(C5,C6)) shifted(A0-A2); + trace symetrie(Decoupe2 shifted(A4-A2),iso(A0,A11),iso(A5,A6)); + trace symetrie(Decoupe2 shifted(A4-A2),iso(A8,A4)); + % languettes droites + trace polygone(D1,D2,D3,D4); + trace polygone(D5,D6,D7,D8); + % languettes hautes + path cc; + cc=cercles(iso(A10,A9),1/3[A10,A9]); + trace Hachurage((subpath(length cc/2,length cc) of cc)--cycle,60,0.25,1); + trace (subpath(length cc/2,length cc) of cc)--cycle dashed evenly; + trace polygone(D18,D17,D20,D19); + trace chemin(1/3[D18,D17],D18,D19,D20,D17,2/3[D18,D17]); + \end{mpost} + \fi +}% + +\NewDocumentCommand\BoiteCartes{o}{% + \useKVdefault[Cards]% + \setKV[Cards]{#1}% + \BuildBoiteCartesCommerceC% }%
\ No newline at end of file diff --git a/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex b/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex index 279b7a4ad7..4505b47c48 100644 --- a/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex +++ b/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex @@ -2,7 +2,7 @@ % Defi Table %%% -\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false} +\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false,ValeurMin=1,ValeurMax=10} \defKV[DefiTable]{Graine=\setKV[DefiTable]{Graines}}% \newcommand\MelangeListeNew[2]{% @@ -32,7 +32,36 @@ \reademptyitems% }% +\NewDocumentCommand\JeConstruisLesProduits{mm}{% + \xintFor* ##1 in{\xintSeq{#1}{#2}}\do{% + \xintifForFirst{% + \xdef\ListeDesProduitsFoo{\fpeval{##1}}% + \xintFor* ##2 in{\xintSeq{2}{10}}\do{% + \xdef\ListeDesProduitsFoo{\ListeDesProduitsFoo/\fpeval{##1*##2}}% + }% + }{% + \xintFor* ##2 in{\xintSeq{1}{10}}\do{% + \xdef\JeCoupe{0}% + \xintFor* ##3 in{\xintSeq{#1}{\fpeval{##1-1}}}\do{% + \xintifboolexpr{\fpeval{##1*##2}>\fpeval{##3*10}}{}{% + \modulo{\fpeval{##1*##2}}{##3}\relax% + \xintifboolexpr{\remainder==0}{\xdef\JeCoupe{1}\xintBreakFor}{}% + }% + }% + \xintifboolexpr{\JeCoupe==1}{}{\xdef\ListeDesProduitsFoo{\ListeDesProduitsFoo/\fpeval{##1*##2}}}% + }% + }% + }% + \setsepchar[*]{/}% + \readlist*\ListeDesProduits{\ListeDesProduitsFoo}% + \xdef\NombreDeProduitATester{\ListeDesProduitslen}% +}% + \newcommand\DefiTableNombreLettreduCode[1]{% + \JeConstruisLesProduits{\useKV[DefiTable]{ValeurMin}}{\useKV[DefiTable]{ValeurMax}}% + \MelangeListeNew{\ListeDesProduitsFoo}{\NombreDeProduitATester} +% Les produits mélangés sont :\par + \readlist*\ListeDesProduits{\faa}% \xdef\ListeDesCaracteresFoo{a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/à/é/è/ê/ï/î/ô/ö/ù/ç/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/À/É/È/,/$?$/$;$/./$!$/$:$/-} \savecomparemode% \comparestrict% @@ -79,21 +108,17 @@ \xintifboolexpr{\PfCTotal==\ListeDesLettresUniqueslen}{\xdef\ListeCaracteresUniques{\ListeCaracteresUniques\ListeTotaleDesCaracteres[##1]/}}{}% }% %La liste des caractères uniques à ajouter - \MelangeListeNew{\ListeCaracteresUniques}{\fpeval{42-\ListeDesLettresUniqueslen}}% + \MelangeListeNew{\ListeCaracteresUniques}{\fpeval{\NombreDeProduitATester-\ListeDesLettresUniqueslen}}% %\par La liste des éléments à mélanger est :\par \xdef\ListeDesCaracteresAUtiliser{} \xintFor* ##1 in{\xintSeq{1}{\ListeDesLettresUniqueslen}}\do{% \xdef\ListeDesCaracteresAUtiliser{\ListeDesCaracteresAUtiliser \ListeDesLettresUniques[##1]/}% }% \xdef\ListeDesCaracteresAUtiliser{\ListeDesCaracteresAUtiliser \faa} - \MelangeListeNew{\ListeDesCaracteresAUtiliser}{42} + \MelangeListeNew{\ListeDesCaracteresAUtiliser}{\NombreDeProduitATester} %Finalement, on utilise ces caractères :\par \ignoreemptyitems% \readlist*\ListeFinaleDesCaracteres{\faa} - \xdef\ListeDesProduitsFoo{1/2/3/4/5/6/7/8/9/10/12/14/16/18/20/15/21/24/27/30/28/32/36/40/25/35/45/50/42/48/54/60/49/56/63/70/64/72/80/81/90/100} - \MelangeListeNew{\ListeDesProduitsFoo}{42} - %Les produits mélangés sont :\par - \readlist*\ListeDesProduits{\faa}% \restorecomparemode \reademptyitems } @@ -103,9 +128,9 @@ % 2 la table de décodage \useKVdefault[DefiTable]% \setKV[DefiTable]{#1}% - \ifboolKV[DefiTable]{Creation}{ + \ifboolKV[DefiTable]{Creation}{% \ifboolKV[DefiTable]{Graines}{\PfCGraineAlea{\useKV[DefiTable]{Graine}}}{}% - \DefiTableNombreLettreduCode{#2} + \DefiTableNombreLettreduCode{#2}% \begin{center} \begin{tabular}{|>{\columncolor{gray!15}}c|*{10}{c|}} \hline @@ -114,8 +139,8 @@ }\\\hline% \xintFor* ##1 in{\xintSeq{1}{10}}\do{% ##1\xintFor* ##2 in{\xintSeq{1}{10}}\do{% - &\xintFor* ##3 in{\xintSeq{1}{42}}\do{% - \xintifboolexpr{\fpeval{##1*##2}==\ListeDesProduits[##3]}{\ListeFinaleDesCaracteres[##3]}{}% + &\xintFor* ##3 in{\xintSeq{1}{\NombreDeProduitATester}}\do{% + \xintifboolexpr{\fpeval{##1*##2}==\ListeDesProduits[##3] 'and' any(\useKV[DefiTable]{ValeurMin}<=##2<=\useKV[DefiTable]{ValeurMax},\useKV[DefiTable]{ValeurMin}<=##1<=\useKV[DefiTable]{ValeurMax})}{\ListeFinaleDesCaracteres[##3]}{}% }% }\\\hline% }% @@ -169,7 +194,7 @@ \xintifForFirst{}{&}% \StrMid{\ListeDefiTableTableau[##1]}{##2}{##2}[\DefiTableMaLettre]% \IfStrEq{\DefiTableMaLettre}{*}{}{% - \xintFor* ##3 in{\xintSeq{1}{42}}\do{% + \xintFor* ##3 in{\xintSeq{1}{\NombreDeProduitATester}}\do{% \IfStrEq{\DefiTableMaLettre}{\ListeFinaleDesCaracteres[##3]}{\Block{}{\footnotesize\ListeDesProduits[##3]}}{}% }% }% diff --git a/macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex b/macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex index fea78f1102..38c3915888 100644 --- a/macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex +++ b/macros/latex/contrib/profcollege/latex/PfCModeleBarre.tex @@ -1,15 +1,15 @@ %%% % Modele en barre %%% -\setKVdefault[ClesModeleBarre]{Hauteur=0.5cm,Largeur=1cm,Separation=0,Homogene=false}%Separation pour conserver le lien avec les équations. +\setKVdefault[ClesModeleBarre]{Hauteur=0.5cm,Largeur=1cm,Separation={0},Homogene=false}%Separation pour conserver le lien avec les équations. \defKV[ClesModeleBarre]{Longueur=\setKV[ClesModeleBarre]{Homogene}}% \newtoks\toklistemodelbarresup% -\toklistemodelbarresup{}% \def\UpdateListeModelBarreSup#1\nil{\addtotok\toklistemodelbarresup{#1,}}% \newtoks\toklistemodelbarreinf% -\toklistemodelbarreinf{}% \def\UpdateListeModelBarreInf#1\nil{\addtotok\toklistemodelbarreinf{#1,}}% +\newtoks\toklistemodelbarresep% +\def\UpdateListeModelBarreSep#1\nil{\addtotok\toklistemodelbarresep{#1,}}% \newcommand\ModeleBarre[3][]{% % #1 options @@ -20,6 +20,9 @@ \setsepchar{\\/ }% \readlist\ListeModelBarreSup{#2}% \readlist\ListeModelBarreInf{#3}% + \setsepchar{,}% + \xdef\fooSeparation{\useKV[ClesModeleBarre]{Separation}} + \readlist\ListeModelBarreSep{\fooSeparation}% \toklistemodelbarresup{}% \foreachitem\compteur\in\ListeModelBarreSup{% \foreachitem\valeur\in\ListeModelBarreSup[\compteurcnt]{% @@ -32,10 +35,14 @@ \expandafter\UpdateListeModelBarreInf\valeur\nil% }% }% + \toklistemodelbarresep{}% + \foreachitem\compteur\in\ListeModelBarreSep{% + \expandafter\UpdateListeModelBarreSep\compteur\nil% + }% \ifboolKV[ClesModeleBarre]{Homogene}{% \PfCMPDessineModelBarre{\the\toklistemodelbarresup}{\the\toklistemodelbarreinf}% }{% - \PfCMPDessineModelBarreNonHomogene{\the\toklistemodelbarresup}{\the\toklistemodelbarreinf}% + \PfCMPDessineModelBarreNonHomogene{\the\toklistemodelbarresup}{\the\toklistemodelbarreinf}{\the\toklistemodelbarresep}% }% }% @@ -156,37 +163,42 @@ \end{mplibcode} }% -\newcommand\PfCMPDessineModelBarreNonHomogene[2]{% - \ifluatex% - \mplibforcehmode% - \begin{mplibcode} - Longueur:=\useKV[ClesModeleBarre]{Largeur}; - Hauteur:=\useKV[ClesModeleBarre]{Hauteur}; - Separation:=\useKV[ClesModeleBarre]{Separation}; - - vardef Brique(expr col,nbfois)(text t)= - save $; - picture $; - $=image( - u:=Longueur; - if t="?": - draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly; - else: - remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col; - draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)); - fi; - if nbfois>0: - label(TEX(t),iso((0,0),(u*abs(nbfois),Hauteur))); - else: - label.bot(TEX(t),iso((0,0),(u*abs(nbfois),-Hauteur))); - drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur); - fi; - u:=1cm; - ); - $ - enddef; - - numeric MBnbcolsup;%compte combien de couleurs +\def\PfCMPDessineModelBarreNHCode{% + numeric MBnbcolinf;%compte combien de couleurs + MBnbcolinf=0; + color MBColInf[];%Sauvegarde les couleurs de la barre inf + numeric MBnbinfoinf[];%compte combien d'infos par couleurs. + numeric MBnbcasesinf[][]; + numeric MBnbcasesinftotal; + MBnbcasesinftotal=0; + string MBTextcasesinf[][]; + vardef tata(text t)= + for p_=t: + if color p_: + MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs + MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases + MBnbinfoinf[MBnbcolinf]:=0; + else: + if numeric p_: + MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1; + MBnbcasesinftotal:=MBnbcasesinftotal+p_; + MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_; + else: + MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_; + fi; + fi; + endfor; + enddef; + % + vardef Separation(text t)= + for p_=t: + if p_>0: + nbdecal:=p_; + draw (u*nbdecal,-1.5Hauteur)--(u*nbdecal,1.5Hauteur) withpen pencircle scaled 1.5 dashed evenly withcolor red; + fi; + endfor; + enddef; + numeric MBnbcolsup;%compte combien de couleurs MBnbcolsup=0; color MBColSup[];%Sauvegarde les couleurs de la barre sup numeric MBnbinfosup[];%compte combien d'infos par couleurs. @@ -211,35 +223,64 @@ fi; endfor; enddef; - - toto(#1); +}% - numeric MBnbcolinf;%compte combien de couleurs - MBnbcolinf=0; - color MBColInf[];%Sauvegarde les couleurs de la barre inf - numeric MBnbinfoinf[];%compte combien d'infos par couleurs. - numeric MBnbcasesinf[][]; - numeric MBnbcasesinftotal; - MBnbcasesinftotal=0; - string MBTextcasesinf[][]; - vardef tata(text t)= - for p_=t: - if color p_: - MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs - MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases - MBnbinfoinf[MBnbcolinf]:=0; - else: - if numeric p_: - MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1; - MBnbcasesinftotal:=MBnbcasesinftotal+p_; - MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_; - else: - MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_; - fi; - fi; - endfor; - enddef; +\def\PfCMPDessineModelBarreBriqueCode{% + vardef Brique(expr col,nbfois)(text t)= + save $; + picture $; + $=image( + if t="?": + draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly; + else: + remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col; + draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)); + fi; + if nbfois>0: + label(TEX(t),iso((0,0),(u*abs(nbfois),Hauteur))); + else: + label.bot(TEX(t),iso((0,0),(u*abs(nbfois),-Hauteur))); + drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur); + fi; + ); + $ + enddef; +}% + +\def\PfCMPDessineModelBarreBriqueCodePDF{% + vardef Brique(expr col,nbfois)(text t)= + save $; + picture $; + $=image( + if t="?": + draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly; + else: + remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col; + draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)); + fi; + if nbfois>0: + label(LATEX(t),iso((0,0),(u*abs(nbfois),Hauteur))); + else: + label.bot(LATEX(t),iso((0,0),(u*abs(nbfois),-Hauteur))); + drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur); + fi; + ); + $ + enddef; +}% + +\newcommand\PfCMPDessineModelBarreNonHomogene[3]{% + \ifluatex% + \mplibforcehmode% + \begin{mplibcode} + \PfCMPDessineModelBarreNHCode + \PfCMPDessineModelBarreBriqueCode + Longueur:=\useKV[ClesModeleBarre]{Largeur}; + Hauteur:=\useKV[ClesModeleBarre]{Hauteur}; + u:=Longueur; + + toto(#1); tata(#2); pair VecteurDepla; @@ -267,89 +308,11 @@ endfor; endfor; - if Separation>0: - draw (u*Separation,-1.5Hauteur)--(u*Separation,1.5Hauteur) withpen pencircle scaled 1.5 dashed evenly withcolor red; - fi; - + Separation(#3); \end{mplibcode}% \else - \begin{mpost}[mpsettings={Longueur:=\useKV[ClesModeleBarre]{Largeur};Hauteur:=\useKV[ClesModeleBarre]{Hauteur};Separation:=\useKV[ClesModeleBarre]{Separation};}] - vardef Brique(expr col,nbfois)(text t)= - save $; - picture $; - $=image( - u:=Longueur; - if t="?": - draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) dashed evenly; - else: - remplis polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)) withcolor col; - draw polygone((0,0),(u*abs(nbfois),0),(u*abs(nbfois),Hauteur),(0,Hauteur)); - fi; - if nbfois>0: - label(LATEXProf(t),iso((0,0),(u*abs(nbfois),Hauteur))); - else: - label.bot(LATEXProf(t),iso((0,0),(u*abs(nbfois),-Hauteur))); - drawdblarrow (0,-0.5*Hauteur)--(u*abs(nbfois),-0.5*Hauteur); - fi; - u:=1cm; - ); - $ - enddef; - - numeric MBnbcolsup;%compte combien de couleurs - MBnbcolsup=0; - color MBColSup[];%Sauvegarde les couleurs de la barre sup - numeric MBnbinfosup[];%compte combien d'infos par couleurs. - numeric MBnbcasessup[][]; - numeric MBnbcasessuptotal; - MBnbcasessuptotal=0; - string MBTextcasessup[][]; - vardef toto(text t)= - for p_=t: - if color p_: - MBnbcolsup:=MBnbcolsup+1;% on incrémente le nombre de couleurs - MBColSup[MBnbcolsup]:=p_;% on définit la couleur de la série de cases - MBnbinfosup[MBnbcolsup]:=0; - else: - if numeric p_: - MBnbinfosup[MBnbcolsup]:=MBnbinfosup[MBnbcolsup]+1; - MBnbcasessuptotal:=MBnbcasessuptotal+p_; - MBnbcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_; - else: - MBTextcasessup[MBnbcolsup][MBnbinfosup[MBnbcolsup]]:=p_; - fi; - fi; - endfor; - enddef; - + \begin{mpost}[mpsettings={\PfCMPDessineModelBarreNHCode;\PfCMPDessineModelBarreBriqueCodePDF;Longueur:=\useKV[ClesModeleBarre]{Largeur};Hauteur:=\useKV[ClesModeleBarre]{Hauteur};u:=Longueur;}] toto(#1); - - numeric MBnbcolinf;%compte combien de couleurs - MBnbcolinf=0; - color MBColInf[];%Sauvegarde les couleurs de la barre inf - numeric MBnbinfoinf[];%compte combien d'infos par couleurs. - numeric MBnbcasesinf[][]; - numeric MBnbcasesinftotal; - MBnbcasesinftotal=0; - string MBTextcasesinf[][]; - vardef tata(text t)= - for p_=t: - if color p_: - MBnbcolinf:=MBnbcolinf+1;% on incrémente le nombre de couleurs - MBColInf[MBnbcolinf]:=p_;% on définit la couleur de la série de cases - MBnbinfoinf[MBnbcolinf]:=0; - else: - if numeric p_: - MBnbinfoinf[MBnbcolinf]:=MBnbinfoinf[MBnbcolinf]+1; - MBnbcasesinftotal:=MBnbcasesinftotal+p_; - MBnbcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_; - else: - MBTextcasesinf[MBnbcolinf][MBnbinfoinf[MBnbcolinf]]:=p_; - fi; - fi; - endfor; - enddef; - tata(#2); pair VecteurDepla; @@ -377,10 +340,7 @@ endfor; endfor; - if Separation>0: - draw u*(Separation,-0.75)--u*(Separation,0.75) withpen pencircle scaled 1.5 dashed evenly withcolor red; - fi; - + Separation(#3); \end{mpost} \fi }%
\ No newline at end of file diff --git a/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex b/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex index 81e88648e8..65ec863b11 100644 --- a/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex +++ b/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex @@ -5,7 +5,10 @@ \defKV[ClesFonction]{Traces=\setKV[ClesFonction]{Codes}}% \newtoks\toklistePtsFn%pour la discipline - +\newtoks\tokPfCListeDesFonctions% +\newtoks\tokPfCListeDesNomsFonctions% +\def\UpdatePfCListeDesFonctions#1\nil{\addtotok\tokPfCListeDesFonctions{"#1",}}% +\def\UpdatePfCListeDesNomsFonctions#1\nil{\addtotok\tokPfCListeDesNomsFonctions{"#1",}}% \def\UpdatePtsFn#1/#2/#3/#4\nil{\addtotok\toklistePtsFn{#1,(#2,#3),#4,}}% \def\UpdatePtsFN#1/#2/#3/#4\nil{\addtotok\toklistePtsFn{(#2,#3),}}% @@ -15,7 +18,21 @@ \ifboolKV[ClesFonction]{Trace}{% \useKVdefault[TraceG]% \setKV[TraceG]{#1}% - \MPTraceFonction[#1]{\useKV[ClesFonction]{Calcul}}% + \tokPfCListeDesFonctions{}% + \tokPfCListeDesNomsFonctions{}% + \xdef\PfCFooFn{\useKV[ClesFonction]{Calcul}} + \xdef\PfCFooNomFn{\useKV[TraceG]{NomCourbe}} + \ifx\bla\PfCFooFn\bla% + \else + \readlist*\ListeDesFonctions{\PfCFooFn} + \foreachitem\compteur\in\ListeDesFonctions{\expandafter\UpdatePfCListeDesFonctions\compteur\nil}% + \fi + \ifx\bla\PfCFooNomFn\bla + \else + \readlist*\ListeDesNomsFonctions{\PfCFooNomFn} + \foreachitem\compteur\in\ListeDesNomsFonctions{\expandafter\UpdatePfCListeDesNomsFonctions\compteur\nil}% + \fi + \TraceMultiGraphique{\the\tokPfCListeDesFonctions}{\the\tokPfCListeDesNomsFonctions}% }{% \ifboolKV[ClesFonction]{Points}{% \toklistePtsFn{}% @@ -32,16 +49,14 @@ \xdef\PfCFooListePoints{} \ifboolKV[ClesFonction]{Tangentes}{% \foreachitem\compteur\in\ListePoints{% - % \expandafter\UpdatePtsFn\compteur\nil% \xdef\PfCFooListePoints{\PfCFooListePoints \ListePoints[\compteurcnt,1],(\ListePoints[\compteurcnt,2],\ListePoints[\compteurcnt,3]),\ListePoints[\compteurcnt,4],}% }% }{% \foreachitem\compteur\in\ListePoints{% - % \expandafter\UpdatePtsFN\compteur\nil% \xdef\PfCFooListePoints{\PfCFooListePoints (\ListePoints[\compteurcnt,2],\ListePoints[\compteurcnt,3]),}% }% }% - \MPCourbeNew{\PfCFooListePoints}%\the\toklistePtsFn}% + \MPCourbeNew{\PfCFooListePoints}% }% }{% \setsepchar{,}\ignoreemptyitems% @@ -63,6 +78,281 @@ }% }% +\def\PfCTraceMGCode{% + nbcourbe=\ListeDesFonctionslen; + % + numeric borneinf[],bornesup[],pos[]; + % + vardef RetiensPos(text t)= + n:=0; + for p_=t: + n:=n+1; + pos[n]=p_; + endfor; + enddef; + % + RetiensPos(\useKV[TraceG]{LabelC}); + % + vardef RetiensBorneInf(text t)= + borneinfmin=infinity; + n:=0; + for p_=t: + n:=n+1; + borneinf[n]=p_; + if borneinf[n]<borneinfmin: + borneinfmin:=borneinf[n] + fi; + endfor; + enddef; + % + RetiensBorneInf(\useKV[TraceG]{Bornea}); + % + vardef RetiensBorneSup(text t)= + bornesupmax=-infinity; + n:=0; + for p_=t: + n:=n+1; + bornesup[n]=p_; + if bornesup[n]>bornesupmax: + bornesupmax:=bornesup[n] + fi; + endfor; + enddef;% + % + RetiensBorneSup(\useKV[TraceG]{Borneb}); + % + nbpointsCourbe:=\useKV[TraceG]{NbPointsCourbe}; + xmin=\useKV[TraceG]{Xmin}; + xmax=\useKV[TraceG]{Xmax}; + ymin=\useKV[TraceG]{Ymin}; + ymax=\useKV[TraceG]{Ymax}; + pasx=\useKV[TraceG]{Xstep}; + pasy=\useKV[TraceG]{Ystep}; + xu=1cm/\useKV[TraceG]{Xstep}; + yu=1cm/\useKV[TraceG]{Ystep}; + grillex=\useKV[TraceG]{PasGrilleX}; + grilley=\useKV[TraceG]{PasGrilleY}; + gradx=\useKV[TraceG]{PasGradX}; + grady=\useKV[TraceG]{PasGradY}; + Epaisseur:=\useKV[TraceG]{Epaisseur}; + % + color colortrace[]; + vardef RetiensCouleur(text t)= + n:=0; + for p_=t: + n:=n+1; + colortrace[n]=p_; + endfor; + enddef; + % + RetiensCouleur(\useKV[TraceG]{CouleurTrace}); + % + pair Origine; + Origine=(xmin,ymin)+\useKV[TraceG]{Origine}; + % + boolean Grille,Vide,Graduations,Code,LegendeX,LegendeY; + Grille=\useKV[TraceG]{Grille}; + Vide=\useKV[TraceG]{Vide}; + Graduations=\useKV[TraceG]{Graduations}; + Code=\useKV[TraceG]{Code}; + LegendeX=\useKV[TraceG]{LegendeX}; + LegendeY=\useKV[TraceG]{LegendeY}; + % + vardef sin(expr t) = sind(c*t) enddef; + vardef cos(expr t) = cosd(c*t) enddef; + vardef tan(expr t) = sin(t)/cos(t) enddef; + vardef exp(expr t) = e**t enddef; + vardef ch(expr x)=(exp(x)+exp(-x))/2 enddef; + vardef sh(expr x)=(exp(x)-exp(-x))/2 enddef; + vardef ln(expr t) = mlog(t)/256 enddef; + vardef arcsin(expr x)=%Définition mathématique en radian + pi*angle((sqrt(1-x**2),x))/180 + enddef; + vardef arccos(expr x)=%Définition mathématique en radian + pi*angle((x,sqrt(1-x**2)))/180 + enddef; + def enplace= + xscaled xu yscaled yu shifted (Origine*cm) + enddef; + vardef placepoint(expr q,r)= + (q,r) enplace + enddef; + % + path Cb[]; + % + vardef courbe[](expr a,b,nb)(text texte)= + path Courbe; + for i:=0 upto nb : + x@[i]:=(a+i*(b-a)/nb); + x:=x@[i]; + y@[i]:=texte; + endfor ; + Cb@:=(x@.0*xu,y@.0*yu) + for i:=1 upto nb : + ..(x@[i]*xu,y@[i]*yu) + endfor; + Cb@:=Cb@ shifted (Origine*cm); + Courbe=Cb@; + Courbe + enddef; + % + vardef DessineCourbes(text texto)= + n:=0; + for p_=texto: + n:=n+1; + draw courbe[n](borneinf[n],bornesup[n],100)(scantokens p_) withpen (pencircle scaled Epaisseur) withcolor if unknown colortrace[n]:black else: colortrace[n] fi; + endfor; + enddef; + % + vardef NommeCourbes(text texto)= + n:=0; + for p_=texto: + n:=n+1; + numeric tp; + tp=pos[n]*length Cb[n]; + pair PT,Tangente; + PT:=point (tp) of Cb[n]; + Tangente:=unitvector(direction tp of Cb[n]); + label(TEX(p_) rotated angle(Tangente),PT+2mm*(Tangente rotated 90)); + endfor; + enddef; + % + vardef NommeCourbesPDF(text texto)= + n:=0; + for p_=texto: + n:=n+1; + numeric tp; + tp=pos[n]*length Cb[n]; + pair PT,Tangente; + PT:=point (tp) of Cb[n]; + Tangente:=unitvector(direction tp of Cb[n]); + label(LATEX(p_) rotated angle(Tangente),PT+2mm*(Tangente rotated 90)); + endfor; + enddef; + % + vardef EffectuerTraces= + \useKV[TraceG]{Traces}; + enddef; + % + vardef LegendeCourbe= + if LegendeX=true: + label.ulft(btex \useKV[TraceG]{LabelX} etex,u*(xmax,ypart(Origine))); + fi; + if LegendeY=true: + label.lrt(btex \useKV[TraceG]{LabelY} etex,u*(xpart(Origine),ymax)); + fi; + enddef; +}% + +\NewDocumentCommand\TraceMultiGraphique{mm}{% + % #1 paramètres + % #2 Liste fonctions + \ifluatex + \mplibforcehmode + \begin{mplibcode} + \PfCTraceMGCode + if Grille: + drawoptions(withcolor 0.75white); + for k=xpart(Origine) step grillex until xmax: + trace u*(k,ymin)--u*(k,ymax); + endfor; + for k=xpart(Origine) step -grillex until xmin: + trace u*(k,ymin)--u*(k,ymax); + endfor; + for k=ypart(Origine) step grilley until ymax: + trace u*(xmin,k)--u*(xmax,k); + endfor; + for k=ypart(Origine) step -grilley until ymin: + trace u*(xmin,k)--u*(xmax,k); + endfor; + drawoptions(); + fi; + if Graduations: + for k=gradx step gradx until bornesupmax:%xmax*gradx/grillex: + dotlabel.bot(TEX("\num{"&decimal(k)&"}"),(k*xu+xpart(Origine*cm),ypart(Origine*cm))); + endfor; + for k=-gradx step -gradx until borneinfmin:%xmin*gradx/grillex: + dotlabel.bot(TEX("\num{"&decimal(k)&"}"),(k*xu+xpart(Origine*cm),ypart(Origine*cm))); + endfor; + for k=grady step grady until ymax*grady/grilley: + dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(xpart(Origine*cm),k*yu+ypart(Origine*cm))); + endfor; + for k=-grady step -grady until ymin*grady/grilley: + dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(xpart(Origine*cm),k*yu+ypart(Origine*cm))); + endfor; + fi; +% + drawoptions(withpen pencircle scaled(1)); + drawarrow (u*(0,ymin)--u*(0,ymax)) shifted (u*(xpart(Origine),0)); + drawarrow (u*(xmin,0)--u*(xmax,0)) shifted (u*(0,ypart(Origine))); + label.llft(btex 0 etex,u*Origine); + drawoptions(); + if Vide: + clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax)); + else: + DessineCourbes(#1); + NommeCourbes(#2); + clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax)); + % + if Code: + EffectuerTraces; + fi; + fi; + LegendeCourbe; + \end{mplibcode} + \else + \begin{mpost}[mpsettings={\PfCTraceMGCode}] + if Grille: + drawoptions(withcolor 0.75white); + for k=xpart(Origine) step grillex until xmax: + trace u*(k,ymin)--u*(k,ymax); + endfor; + for k=xpart(Origine) step -grillex until xmin: + trace u*(k,ymin)--u*(k,ymax); + endfor; + for k=ypart(Origine) step grilley until ymax: + trace u*(xmin,k)--u*(xmax,k); + endfor; + for k=ypart(Origine) step -grilley until ymin: + trace u*(xmin,k)--u*(xmax,k); + endfor; + drawoptions(); + fi; + if Graduations: + for k=gradx step gradx until bornesupmax:%xmax*gradx/grillex: + dotlabel.bot(LATEX("\num{"&decimal(k)&"}"),(k*xu+xpart(Origine*cm),ypart(Origine*cm))); + endfor; + for k=-gradx step -gradx until borneinfmin:%xmin*gradx/grillex: + dotlabel.bot(LATEX("\num{"&decimal(k)&"}"),(k*xu+xpart(Origine*cm),ypart(Origine*cm))); + endfor; + for k=grady step grady until ymax*grady/grilley: + dotlabel.lft(LATEX("\num{"&decimal(k)&"}"),(xpart(Origine*cm),k*yu+ypart(Origine*cm))); + endfor; + for k=-grady step -grady until ymin*grady/grilley: + dotlabel.lft(LATEX("\num{"&decimal(k)&"}"),(xpart(Origine*cm),k*yu+ypart(Origine*cm))); + endfor; + fi; +% + drawoptions(withpen pencircle scaled(1)); + drawarrow (u*(0,ymin)--u*(0,ymax)) shifted (u*(xpart(Origine),0)); + drawarrow (u*(xmin,0)--u*(xmax,0)) shifted (u*(0,ypart(Origine))); + label.llft(btex 0 etex,u*Origine); + drawoptions(); + if Vide: + clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax)); + else: + DessineCourbes(#1); + NommeCourbesPDF(#2); + clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax)); + if Code: + EffectuerTraces; + fi; + fi; + LegendeCourbe; + \end{mpost} + \fi +} + \def\MPCourbeNew#1{%#2#3#4#5#6{% \ifluatex \mplibforcehmode diff --git a/macros/latex/contrib/profcollege/latex/PfCPatronPaves.tex b/macros/latex/contrib/profcollege/latex/PfCPatronPaves.tex new file mode 100644 index 0000000000..2be0a20bd0 --- /dev/null +++ b/macros/latex/contrib/profcollege/latex/PfCPatronPaves.tex @@ -0,0 +1,246 @@ +\setKVdefault[ClesPatron]{Cube,Arete=1cm,ListeCouleurs={white},Pave=false,Largeur=2cm,Hauteur=1.5cm,Profondeur=1cm,Codes=false}% +\defKV[ClesPatron]{Traces=\setKV[ClesPatron]{Codes}}% + +\newtoks\toklistepatron% +\def\UpdatetoksPatron#1\nil{\addtotok\toklistepatron{"#1",}}% + +\NewDocumentCommand\Patron{om}{% + \useKVdefault[ClesPatron]% + \setKV[ClesPatron]{#1}% + \newtoks\toklistecouleur% + \xdef\ListeAvantCouleurs{\useKV[ClesPatron]{ListeCouleurs}}% + \readlist*\ListeCouleur{\ListeAvantCouleurs}% + \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}% + \ifboolKV[ClesPatron]{Pave}{% + \toklistepatron{}% + \readlist*\PfCListePatron{#2}% + \foreachitem\compteur\in\PfCListePatron{\expandafter\UpdatetoksPatron\compteur\nil}% + \MPPatronPave{\the\toklistepatron}{\the\toklistecouleur}% + }{% + \ifboolKV[ClesPatron]{Cube}{% + \toklistepatron{}% + \readlist*\PfCListePatron{#2}% + \foreachitem\compteur\in\PfCListePatron{\expandafter\UpdatetoksPatron\compteur\nil}% + \MPPatronCube{\the\toklistepatron}{\the\toklistecouleur}% + }{% + }% + }% +}% + +\def\MPPatronCubeCode{% + Arete=\useKV[ClesPatron]{Arete}; + % + pair C[],M[],N[],O[],P[]; + % + color Col[],CoulDefaut; + CoulDefaut=white; + % + boolean Codes; + Codes=\useKV[ClesPatron]{Codes}; + vardef Patron(text t)= + nblignes:=-1; + nbcol:=0; + nbfaces:=0; + for p_=t: + Long:=length p_; + nblignes:=nblignes+1; + nbcolonnes:=0; + for k=0 upto Long-1: + nbcolonnes:=nbcolonnes+1; + if substring(k,k+1) of p_="x": + nbfaces:=nbfaces+1; + nbcol:=nbcol+1; + if (unknown Col[nbcol]): + else: + if Col[nbcol]=white: + else: + fill ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes))) withcolor Col[nbcol]; + fi; + fi; + trace (unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)); + C[nbfaces]=(center unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes)); + M[nbfaces]=point(0) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes))); + N[nbfaces]=point(1) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes))); + O[nbfaces]=point(2) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes))); + P[nbfaces]=point(3) of ((unitsquare scaled Arete) shifted (Arete*(nbcolonnes,-nblignes))); + fi; + endfor; + endfor; + enddef; + % + vardef EffectuerTraces= + if Codes: + \useKV[ClesPatron]{Traces}; + fi; + enddef; +}% + +\def\MPPatronCube#1#2{% + \ifluatex + \mplibforcehmode + \begin{mplibcode} + \MPPatronCubeCode + % + n:=0; + for p_=#2: + n:=n+1; + if color p_: + Col[n]=p_; + else: + Col[n]=CoulDefaut; + fi; + endfor; + % + Patron(#1); + EffectuerTraces; + \end{mplibcode} + \else + \begin{mpost}[mpsettings={\MPPatronCubeCode;}] + % + n:=0; + for p_=#2: + n:=n+1; + if color p_: + Col[n]=p_; + else: + Col[n]=CoulDefaut; + fi; + endfor; + % + Patron(#1); + EffectuerTraces; + \end{mpost} + \fi +} + +\def\MPPatronPaveCode{% + Largeur=\useKV[ClesPatron]{Largeur}; + Hauteur=\useKV[ClesPatron]{Hauteur}; + Profondeur=\useKV[ClesPatron]{Profondeur}; + % + pair C[],M[],N[],O[],P[]; + % + color Col[],CoulDefaut; + CoulDefaut=white; + % + boolean Codes; + Codes=\useKV[ClesPatron]{Codes}; + numeric DecalCol[]; + vardef LectureLargeur(text t)= + for p_=t: + Long:=length p_; + endfor; + for k=1 upto Long-1: + for p_=t: + if substring(k,k+1) of p_="l": + DecalCol[k]:=Largeur; + elseif substring(k,k+1) of p_="h": + DecalCol[k]:=Hauteur; + elseif substring(k,k+1) of p_="p": + DecalCol[k]:=Profondeur; + fi; + endfor; + endfor; + enddef; + vardef Patron(text t)= + path PathPave; + nblignes:=-1; + nbcol:=0; + nbfaces:=0; + for p_=t: + Long:=length p_; + nbcolonnes:=0; + if substring(0,1) of p_="h": + YEchelle:=Hauteur; + elseif substring(0,1) of p_="l": + YEchelle:=Largeur; + elseif substring(0,1) of p_="p": + YEchelle:=Profondeur; + fi; + nblignes:=nblignes-YEchelle; + for k=1 upto Long-1: + if substring(k,k+1) of p_="l": + nbcol:=nbcol+1; + PathPave:=(unitsquare xscaled Largeur yscaled YEchelle) shifted ((nbcolonnes,nblignes)); + nbfaces:=nbfaces+1; + C[nbfaces]=center PathPave; + M[nbfaces]=point(0) of PathPave; + N[nbfaces]=point(1) of PathPave; + O[nbfaces]=point(2) of PathPave; + P[nbfaces]=point(3) of PathPave; + elseif substring(k,k+1) of p_="h": + nbcol:=nbcol+1; + PathPave:=(unitsquare xscaled Hauteur yscaled YEchelle) shifted ((nbcolonnes,nblignes)); + nbfaces:=nbfaces+1; + C[nbfaces]=center PathPave; + M[nbfaces]=point(0) of PathPave; + N[nbfaces]=point(1) of PathPave; + O[nbfaces]=point(2) of PathPave; + P[nbfaces]=point(3) of PathPave; + elseif substring(k,k+1) of p_="p": + nbcol:=nbcol+1; + PathPave:=(unitsquare xscaled Profondeur yscaled YEchelle) shifted ((nbcolonnes,nblignes)); + nbfaces:=nbfaces+1; + C[nbfaces]=center PathPave; + M[nbfaces]=point(0) of PathPave; + N[nbfaces]=point(1) of PathPave; + O[nbfaces]=point(2) of PathPave; + P[nbfaces]=point(3) of PathPave; + fi; + if (unknown Col[nbcol]): + else: + if Col[nbcol]=white: + else: + fill PathPave withcolor Col[nbcol]; + fi; + fi; + trace PathPave; + nbcolonnes:=nbcolonnes+DecalCol[k]; + endfor; + endfor; + enddef; + % + vardef EffectuerTraces= + if Codes: + \useKV[ClesPatron]{Traces}; + fi; + enddef; +}% + +\def\MPPatronPave#1#2{% + \ifluatex + \mplibforcehmode + \begin{mplibcode} + \MPPatronPaveCode + n:=0; + for p_=#2: + n:=n+1; + if color p_: + Col[n]=p_; + else: + Col[n]=CoulDefaut; + fi; + endfor; + % + LectureLargeur(#1); + Patron(#1); + EffectuerTraces; + \end{mplibcode} + \else + \begin{mpost}[mpsettings={\MPPatronPaveCode;}] + n:=0; + for p_=#2: + n:=n+1; + if color p_: + Col[n]=p_; + else: + Col[n]=CoulDefaut; + fi; + endfor; + % + LectureLargeur(#1); + Patron(#1); + EffectuerTraces; + \end{mpost} + \fi +}%
\ No newline at end of file diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex b/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex index 605cb35397..fbbde59efc 100644 --- a/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex +++ b/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex @@ -1,8 +1,10 @@ %%% % Diff\'erentes représentations graphiques %%% -\setKVdefault[TraceG]{Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Epaisseur=1,Relie=false,RelieSegment=false,Marque=dot,Code=false,Vide=false,NbPointsCourbe=100}% +\setKVdefault[TraceG]{Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},LegendeX=false,LegendeY=false,LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Epaisseur=1,Relie=false,RelieSegment=false,Marque=dot,Code=false,Vide=false,NbPointsCourbe=100}% \defKV[TraceG]{Traces=\setKV[TraceG]{Code}}% +\defKV[TraceG]{LabelX=\setKV[TraceG]{LegendeX}}% +\defKV[TraceG]{LabelY=\setKV[TraceG]{LegendeY}}% \newcommand\TraceGraphique[2][]{% \useKVdefault[TraceG]% @@ -41,11 +43,11 @@ color colorpoint,colortrace; colorpoint=\useKV[TraceG]{CouleurPoint}; colortrace=\useKV[TraceG]{CouleurTrace}; - boolean Grille; + boolean Grille,Graduations,LegendeX,LegendeY; Grille=\useKV[TraceG]{Grille}; - - boolean Graduations; Graduations=\useKV[TraceG]{Graduations}; + LegendeX:=\useKV[TraceG]{LegendeX}; + LegendeY:=\useKV[TraceG]{LegendeY}; boolean Relie; Relie=\useKV[TraceG]{Relie}; @@ -122,9 +124,13 @@ endfor; drawoptions(); fi; - %on labelise les axes + % on labelise les axes + if LegendeX: label.urt(btex \useKV[TraceG]{LabelX} etex,(x.u*(xmax-xmin),ypart(Origine))); + fi; + if LegendeY: label.urt(btex \useKV[TraceG]{LabelY} etex,(xpart(Origine),y.u*(ymax-ymin))); + fi; \end{mplibcode} \else \mpxcommands{% @@ -229,13 +235,12 @@ pair Origine; Origine=(xmin,ymin)+\useKV[TraceG]{Origine}; - boolean Grille,Vide; + boolean Grille,Vide,Graduations,LegendeX,LegendeY; Grille=\useKV[TraceG]{Grille}; Vide=\useKV[TraceG]{Vide}; - - boolean Graduations; Graduations=\useKV[TraceG]{Graduations}; - + LegendeX:=\useKV[TraceG]{LegendeX}; + LegendeY:=\useKV[TraceG]{LegendeY}; vardef sin(expr t) = sind(c*t) enddef; vardef cos(expr t) = cosd(c*t) enddef; @@ -332,11 +337,15 @@ Tangente:=unitvector(direction t of Cb1); label(TEX("\useKV[TraceG]{NomCourbe}") rotated angle(Tangente),PT+2mm*(Tangente rotated 90)); % fin labelisation + if \useKV[TraceG]{Code}: + \useKV[TraceG]{Traces} + fi; clip currentpicture to polygone(u*(xmin,ymin),u*(xmax,ymin),u*(xmax,ymax),u*(xmin,ymax)); + if LegendeX: label.rt(btex \useKV[TraceG]{LabelX} etex,u*(xmax,ypart(Origine))); + fi; + if LegendeY: label.top(btex \useKV[TraceG]{LabelY} etex,u*(xpart(Origine),ymax)); - if \useKV[TraceG]{Code}: - \useKV[TraceG]{Traces} fi; fi; \end{mplibcode} diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty index c80726c53a..7df0da0008 100644 --- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty +++ b/macros/latex/contrib/profcollege/latex/ProfCollege.sty @@ -2,9 +2,9 @@ % licence : Released under the LaTeX Project Public License v1.3c % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e}% -\def\filedate{2023/05/15}% +\def\filedate{2023/05/19}% \let\PfCfiledate\filedate% -\def\fileversion{0.99-z-l}% +\def\fileversion{0.99-z-m}% \let\PfCfileversion\fileversion% \ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]% @@ -217,7 +217,7 @@ \ooalign{$\genfrac{}{}{0pt}{0}{#1}{#2}$\cr\PfCdotover\cr}% }% -\NewDocumentCommand\MultiCol{O{}mm}{% +\NewDocumentCommand\MultiCol{O{}m+m}{% \setsepchar[*]{/}% \readlist*\ListeNombreCol{#2}% \setsepchar[*]{§}% @@ -571,6 +571,7 @@ }%\emoticon }%\raisebox } +\input{PfCPatronPaves} \input{PfCErathostene} \input{PfCDobble} \input{PfCPavage} diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf Binary files differindex f3ed122090..a03368df85 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex index 9301ef24f3..a7c22f749d 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex @@ -5,8 +5,9 @@ % arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') \documentclass[a4paper,french,11pt]{article} -\def\PLversion{2.6.3} -\def\PLdate{9 mai 2023} +\def\PLversion{2.6.4} +\def\PLdate{19 mai 2023} +\usepackage{amsfonts} \usepackage{ProfLycee} \useproflyclib{piton,minted,pythontex} \usepackage[math-style=french]{fourier-otf} @@ -307,8 +308,9 @@ \medskip -{\small\noindent% +{\footnotesize\noindent% {\deblst} résoudre, de manière approchée, des équations\\ +{\deblst} calculer (et représenter) une valeur approchée d'une intégrale\\ {\deblst} tracer \textit{facilement} des repères/grilles/courbes\\ {\deblst} tracer des courbes \textit{lisses} avec gestion des extrema et des dérivées\\ {\deblst} présenter du code \textsf{python} ou \textsf{pseudocode}, une console d'exécution \textsf{Python} \\ @@ -326,11 +328,14 @@ {\deblst} générer des listes d'entiers aléatoires (avec ou sans répétitions)\\ {\deblst} déterminer la mesure principale d'un angle \\ {\deblst} calculer les lignes trigonométriques d'angles \og classiques \fg{} \\ +{\deblst} résoudre une équation diophantienne \og classique \fg{} \\ +{\deblst} travailler avec un peu de géométrie analytique \\ + {\deblst} \ldots} ~ -\hfill{}\textsl{Merci à Anne et quark67 pour ses retours et sa relecture !} +\hfill{}\textsl{Merci à Anne et quark67 pour leurs retours et relectures !} \hfill{}\textsl{Merci à Christophe et Denis pour leurs retours et éclairages !} @@ -394,7 +399,7 @@ Le {package} \ctex{ProfLycee} charge et utilise les {packages} : \begin{itemize} \item \ctex{xcolor} avec l' option \textsf{[table,svgnames]} ; - \item \ctex{tikz}, \ctex{pgf}, \ctex{pgffor}, \ctex{nicefrac} ; + \item \ctex{tikz}, \ctex{pgf}, \ctex{pgffor}, \ctex{nicefrac}, \ctex{nicematrix} ; \item \ctex{tcolorbox} avec l'option \textsf{[most]} ; \item \ctex{xparse}, \ctex{xstring}, \ctex{simplekv}, \ctex{xinttools} ; \item \ctex{listofitems}, \ctex{xintexpr} , \ctex{xintbinhex}, \ctex{xintgcd} ; @@ -595,9 +600,6 @@ Elles sont présentées de manière \textit{succincte}, mais elles sont présent %Valeur approchée d'une intégrale \IntegraleApprochee[clés]{fonction}{a}{b} - -%Équation réduite d'une droite -\EquationReduite[option]{A/xa/ya,B/xb/yb} \end{PresCodeTexPL} \begin{PresCodeTexPL}{listing only} @@ -640,8 +642,6 @@ Elles sont présentées de manière \textit{succincte}, mais elles sont présent \begin{PseudoCodeAlt}(*)[largeur]{commandes tcbox}...\end{PseudoCodeAlt} \end{PresCodeTexPL} -\pagebreak - \begin{PresCodeTexPL}{listing only} %terminal OS \begin{TerminalWin}[largeur]{clés}[options]...\end{TerminalWin} @@ -662,6 +662,42 @@ Elles sont présentées de manière \textit{succincte}, mais elles sont présent \end{PresCodeTexPL} \begin{PresCodeTexPL}{listing only} +%Affichage des coordonnées d'un point (2 ou 3 coordonnées) +\AffPoint[options de formatage](liste des coordonnées) +%Affichage des coordonnées d'un vecteur (2 ou 3 coordonnées) +\AffVecteur[options de formatage]<options nicematrix>(liste des coordonnées) + +%Avec un vecteur normal et un point +\TrouveEqCartPlan[clés](vecteur normal)(point) +%Avec deux vecteurs directeurs et un point +\TrouveEqCartPlan[clés](vecteur dir1)(vecteur dir2)(point) +%Avec trois points +\TrouveEqCartPlan[clés](point1)(point2)(point3) + +%Avec un vecteur directeur et un point +\TrouveEqParamDroite[clés](vecteur directeur)(point) +%Avec deux points +\TrouveEqParamDroite[clés](point1)(point2) + +%Avec un vecteur normal (choix par défaut) et un point +\TrouveEqCartDroite[clés](vecteur normal)(point) +%Avec un vecteur directeur et un point +\TrouveEqCartDroite[clés,VectDirecteur](vecteur directeur)(point1) +%Avec deux points +\TrouveEqCartDroite[clés](point1)(point2) + +%Avec le point et le plan via vect normal + point +\TrouveDistancePtPlan(point)(vec normal du plan)(point du plan) +%Avec le point et le plan via vect normal + point +\TrouveDistancePtPlan(point)(équation cartésienne) +\end{PresCodeTexPL} + +\begin{PresCodeTexPL}{listing only} +%Équation réduite d'une droite +\EquationReduite[option]{A/xa/ya,B/xb/yb} +\end{PresCodeTexPL} + +\begin{PresCodeTexPL}{listing only} %paramètres d'une régression linéaire, nuage de points \CalculsRegLin[clés]{listeX}{listeY} \PointsRegLin[clés]{listeX}{listeY} @@ -756,6 +792,9 @@ Elles sont présentées de manière \textit{succincte}, mais elles sont présent %PGCD présenté \PresentationPGCD[options]{a}{b} + +%Équation diophantienne +\EquationDiophantienne[clés]{equation} \end{PresCodeTexPL} \begin{PresCodeTexPL}{listing only} @@ -1180,80 +1219,6 @@ $\displaystyle\IntegraleApprochee[NbSubDiv=100,AffFormule,Expr={80x\,\text{e}^{- \newpage -\section{Équation réduite d'une droite}\label{eqreduite} - -\subsection{Idée} - -\begin{tipblock} -\cmaj{2.6.3} L'idée est de proposer une commande pour déterminer l'équation réduite d'une droite passant par deux points : -\begin{itemize} - \item en traitant les cas particuliers \textit{horizontale}, \textit{verticale} ; - \item en affichant une méthode de résolution ; - \item en travaillant sous forme exacte fractionnaire (les racines carrées ou autres ne seront pas gérés). -\end{itemize} - -À noter que les calculs et résultats sont traités par la commande de \textit{conversion de fraction} de \ctex{ProfLycee}. -\end{tipblock} - -\begin{warningblock} -La commande se charge de formater (normalement !) correctement les différentes étapes de calculs (il se peut quand même que cela puisse ne pas donner le résultat réellement escompté\ldots) : - -\begin{itemize} - \item en travaillant en fraction ; - \item en mettant les parenthèses nécessaires devant les éventuels nombres négatifs ; - \item en traitant les cas particuliers $m=\pm1$ et $b=0$. -\end{itemize} -\vspace*{-\baselineskip}\leavevmode -\end{warningblock} - -\begin{PresCodeTexPL}{listing only} -\EquationReduite[option]{A/xa/ya,B/xb/yb} -\end{PresCodeTexPL} - -\subsection{Clés et arguments} - -\begin{cautionblock} -Concernant le fonctionnement de la commande : - -\begin{itemize} - \item le premier argument, optionnel et entre \ctex{[...]} et valant \Cle{[d]} par défaut, permet de formater les fractions éventuelles en mode \ctex{\textbackslash displaystyle} ; - \item le second argument, obligatoire et entre \ctex{\{...\}}, permet de donner les coordonnées des points concernés. -\end{itemize} -\vspace*{-\baselineskip}\leavevmode -\end{cautionblock} - -\begin{PresCodePL}{} -\EquationReduite{C/2/0,D/-2/-8} -\end{PresCodePL} - -\subsection{Exemples} - -\begin{PresCodePL}{} -\EquationReduite{I/-4/5,J/-4/12} -\end{PresCodePL} - -\begin{PresCodePL}{} -\EquationReduite{U/-4/5,V/-4/5} -\end{PresCodePL} - -\begin{PresCodePL}{} -\EquationReduite{L/10/7,M/-2/7} -\end{PresCodePL} - -\begin{PresCodePL}{} -\EquationReduite{L/{1/3}/2.5,M/{-5/7}/{3/5}} -\end{PresCodePL} - -\begin{PresCodePL}{} -\EquationReduite{P/4/-4,Q/-2/2} -\end{PresCodePL} - -\begin{PresCodePL}{} -\EquationReduite{G/-4/5,H/10/4} -\end{PresCodePL} - -\newpage - \phantom{t}\par\vfill\par \begin{PART} \begin{center} @@ -3853,6 +3818,436 @@ Les valeurs \Cle{mainlevee=5mm et 0.6pt} donnent des résultats -- à mon sens - \hfill~ \end{PresCodeSortiePL} +\pagebreak + +\phantom{t}\par\vfill\par +\begin{PART} + \begin{center} + \Huge\MakeUppercase{Outils pour la géométrie analytique} + \end{center} +\end{PART} +\par\vfill\par\phantom{t} + +\newpage + +\part{Outils pour la géométrie analytique} + +\section{Affichage de coordonnées}\label{affcoord} + +\subsection{Idée} + +\begin{tipblock} +\cmaj{2.6.4} L'idée est de proposer des commandes pour simplifier la saisie de coordonnées de vecteurs ou de points (plan ou espace), en saisissant les coordonnées \textit{en ligne}. + +\smallskip + +À noter que les calculs et résultats sont traités par la commande de \textit{conversion de fraction} de \ctex{ProfLycee}. +\end{tipblock} + +\begin{warningblock} +Logiquement les commandes (à insérer dans un environnement mathématique) doivent donner des résultats satisfaisants pour tout ce qui est \textit{rationnel}, mais cela ne sera pas pertinent dans le cas de coordonnées irrationnelles\ldots +\end{warningblock} + +\begin{PresCodeTexPL}{listing only} +%Affichage des coordonnées d'un point (2 ou 3 coordonnées) +\AffPoint[options de formatage](liste des coordonnées) + +%Affichage des coordonnées d'un vecteur (2 ou 3 coordonnées) +\AffVecteur[options de formatage]<options nicematrix>(liste des coordonnées) +\end{PresCodeTexPL} + +\begin{warningblock} +Dans cette partie liée à la géométrie analytique, j'ai choisi de saisir les arguments (coordonnées) via les délimiteurs \ctex{(...)} : + +\begin{itemize} + \item avec le séparateur \ctex{,} pour les points ; + \item avec le séparateur \ctex{;} pour les vecteurs. +\end{itemize} + +De ce fait, le code \textit{sait} s'il est face à un point ou à un vecteur, et adapte sa méthode de calcul en conséquence ! +\end{warningblock} + +\subsection{Options et arguments} + +\begin{cautionblock} +Concernant les arguments des commandes : + +\begin{itemize} + \item le premier argument, optionnel et entre \ctex{[...]} permet de spécifier la ou les caractéristiques de formatage des coordonnées, de manière globale ou individuelle, et de manière cohérente avec les options disponibles pour la commande de \textit{conversion en fraction} de \ctex{ProfLycee} : + \begin{itemize} + \item \Cle{d} : pour un formatage en \ctex{dfrac} si nécessaire ; + \item \Cle{t} : pour un formatage en \ctex{tfrac} si nécessaire ; + \item \Cle{n} : pour un formatage en \ctex{nicefrac} si nécessaire ; + \item \Cle{dec} : pour la forme décimale (brute) ; + \item \Cle{dec=k} : pour la forme décimale à $10^{-k}$. + \end{itemize} + Il est possible de spécifier des formatages différents en utilisant une \textit{liste} sous la forme \Cle{f1,f2} ou \Cle{f1,f2,f3} ; + \item l'argument \textit{optionnel} et entre \ctex{<...>} (uniquement pour les vecteurs !) permet de spécifier des options de type \textit{nicematrix} ; + \item l'argument obligatoire, et entre \ctex{\{...\}} est quant à lui la liste des coordonnées, en ligne et au format \textit{naturel xint}. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{cautionblock} + +\begin{noteblock} +Il est donc possible de mettre des \textit{calculs} dans l'argument des coordonnées. + +Il suffit \textit{juste} d'utiliser une syntaxe compréhensible par les commandes du package \ctex{xint}. +\end{noteblock} + +\begin{PresCodePL}{} +%Point, avec affichage classique en dfrac +$\AffPoint(1,2/3)$ \\ +%Point, avec affichage en décimal + dfrac + dfrac +$\AffPoint[dec,d,d](-0.5,1,2/3)$ \\ +%Vecteurs, avec affichages classiques +$\AffVecteur(1;2)$ et $\AffVecteur(1;2;3)$ \\ +%Vecteurs, avec option nicematrix et affichage en décimal + tfrac +$\AffVecteur[dec;t]<cell-space-limits=2pt>(0.5;2/3)$ \\ +%Vecteurs, avec option nicematrix et affichage en décimal +$\AffVecteur[dec]<cell-space-limits=2pt>(0.5;0.6;0.75)$ \\ +%Vecteurs, avec cacluls et affichage classique +$\AffVecteur((2-(-3));(5-6);(1-1))$ +\end{PresCodePL} + +\newpage + +\section{Équation cartésienne d'un plan de l'espace}\label{eqcartplan} + +\subsection{Idée et commande} + +\begin{tipblock} +\cmaj{2.6.4} L'idée est de proposer une commande pour déterminer une équation cartésienne d'un plan dans l'un des cas suivants : + +\begin{itemize} + \item en donnant un vecteur normal et un point ; + \item en donnant deux vecteurs directeurs et un point ; + \item en donnant trois points. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresCodeTexPL}{listing only} +%Avec un vecteur normal et un point +\TrouveEqCartPlan[clés](vecteur normal)(point) +%Avec deux vecteurs directeurs et un point +\TrouveEqCartPlan[clés](vecteur dir1)(vecteur dir2)(point) +%Avec trois points +\TrouveEqCartPlan[clés](point1)(point2)(point3) +\end{PresCodeTexPL} + +\subsection{Clés et arguments} + +\begin{cautionblock} +Concernant les arguments des commandes : + +\begin{itemize} + \item le premier argument, optionnel et entre \ctex{[...]} contient les clés : + \begin{itemize} + \item \Cle{OptionCoeffs} pour spécifier un formatage \textit{global} des coefficients ; \hfill{}défaut : \Cle{d} + \item \Cle{SimplifCoeffs} pour forcer des coefficients simples (entiers et premiers entre eux) ; + + \hfill{}défaut : \Cle{false} + \item \Cle{Facteur} pour spécifier un facteur personnalisé aux simplifications. \hfill{}défaut : \Cle{1} + \end{itemize} + \item les arguments suivants, entre \ctex{(...)} correspondent aux données utilisées (entre 2 et 3). +\end{itemize} + +À noter que les séparateurs \ctex{,} ou \ctex{;} permettent de spécifier point ou vecteur. +\end{cautionblock} + +\begin{PresCodePL}{} +Une équation cartésienne du plan $\mathcal{P}$ de vecteur normal $\vec{n} \AffVecteur(1;2;3)$ et passant par le point A de coordonnées $\AffPoint(4,5,6)$ est $\mathcal{P}$ : $\TrouveEqCartPlan(1;2;3)(4,5,6)$ +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation cartésienne du plan $\mathcal{P}$ de vecteur normal $\vec{n} \AffVecteur[n](1/2;2/3;3/5)$ et passant par le point A de coordonnées $\AffPoint(4,5,6)$ est $\mathcal{P}$ : $\TrouveEqCartPlan(1/2;2/3;3/5)(4,5,6) \Leftrightarrow \TrouveEqCartPlan[SimplifCoeffs](1/2;2/3;3/5)(4,5,6)$ +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation cartésienne du plan $\mathcal{P}$ de vecteur normal $\vec{n} \AffVecteur[n](1;2/3;0)$ et passant par le point A de coordonnées $\AffPoint[dec,dec,d](0.75,0.56,1/3)$ est $\mathcal{P}$ : $\TrouveEqCartPlan(1;2/3;0)(0.75,0.56,1/3) \Leftrightarrow \TrouveEqCartPlan[SimplifCoeffs](1;2/3;0)(0.75,0.56,1/3)$ +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation cartésienne du plan $\mathcal{P}_3$ passant par les points $A\AffPoint(2,0,1)$, $B\AffPoint(3,1,1)$ et $C\AffPoint(1,-2,0)$ est +\[ \mathcal{P}_3 \text{ : } \TrouveEqCartPlan(2,0,1)(3,1,1)(1,-2,0)\] +\end{PresCodePL} + + + +\begin{PresCodePL}{} +Une équation cartésienne du plan $\mathcal{R}$ passant par le points $A\AffPoint(0,0,1)$, $B\AffPoint(4,2,3)$ et $C\AffPoint(-3,1,1)$ est +\[ \mathcal{R} \text{ : } \TrouveEqCartPlan[SimplifCoeffs](0,0,1)(4,2,3)(-3,1,1)\] +\[ \mathcal{R} \text{ : } \TrouveEqCartPlan[SimplifCoeffs,Facteur=-1](0,0,1)(4,2,3)(-3,1,1)\] +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation cartésienne du plan $\mathcal{P}_0$ dirigé par les vecteurs $\AffVecteur(9;7;-8)$ et $\AffVecteur(-2;2;-1)$ et passant par le point $A\AffPoint(5,1,-1)$ est : +\[ \mathcal{P}_0 \text{ : } \TrouveEqCartPlan[SimplifCoeffs](9;7;-8)(-2;2;-1)(5,1,-1)\] +\end{PresCodePL} + +\newpage + +\section{Équation paramétrique d'une droite de l'espace}\label{eqparamdroite} + +\subsection{Idée et commande} + +\begin{tipblock} +\cmaj{2.6.4} L'idée est de proposer une commande pour déterminer un système d'équations paramétriques d'une droite de l'espace dans l'un des cas suivants : + +\begin{itemize} + \item en donnant un vecteur directeur et un point ; + \item en donnant deux points. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresCodeTexPL}{listing only} +%Avec un vecteur directeur et un point +\TrouveEqParamDroite[clés](vecteur directeur)(point) +%Avec deux points +\TrouveEqParamDroite[clés](point1)(point2) +\end{PresCodeTexPL} + +\subsection{Clés et arguments} + +\begin{cautionblock} +Concernant les arguments des commandes : + +\begin{itemize} + \item le premier argument, optionnel et entre \ctex{[...]} contient les clés : + \begin{itemize} + \item \Cle{OptionCoeffs} pour spécifier un formatage \textit{global} des coefficients ; \hfill{}défaut : \Cle{d} + \item \Cle{Reel} pour coder le paramètre réel ; \hfill{}défaut : \Cle{k} + \item le booléen \Cle{Oppose} pour utiliser plutôt l'opposé du vecteur directeur ; \hfill{}défaut : \Cle{false} + \item le booléen \Cle{Rgras} pour utiliser le symbole \textbf{R} ou lieu de $\mathbb{R}$ (si \ctex{amsfonts} est chargé !). + + \hfill{}défaut : \Cle{false} + \end{itemize} + \item les arguments suivants, entre \ctex{(...)} correspondent aux données utilisées. +\end{itemize} + +À noter que les séparateurs \ctex{,} ou \ctex{;} permettent de spécifier point ou vecteur. +\end{cautionblock} + +\begin{PresCodePL}{} +Une équation paramétrique de la droite $(d)$ dirigée par le vecteur $\vec{u}\AffVecteur(2;5;-4)$ et passant par $A\AffPoint(-1,-1,-1)$ est +\[ \TrouveEqParamDroite(2;5;-4)(-1,-1,-1) \] +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation paramétrique de la droite $(d)$ passant par $\AffPoint(2,5,-4)$ et $\AffPoint(-1,-1,-1)$ est +\[ \TrouveEqParamDroite[Oppose](2,5,-4)(-1,-1,-1) \text{ ou } \TrouveEqParamDroite(2,5,-4)(-1,-1,-1) \] +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation paramétrique de la droite $(d)$ dirigée par le vecteur $\vec{u}\AffVecteur(0;-1;3)$ et passant par $O\AffPoint(0,0,0)$ est +\[ \TrouveEqParamDroite(0;-1;3)(0,0,0) \] +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation paramétrique de la droite $(d)$ dirigée par le vecteur $\vec{u}\AffVecteur(-1;2;3)$ et passant par $A\AffPoint(2,0,-3)$ est +\[ \TrouveEqParamDroite[Reel=\ell,Rgras](-1;2;3)(2,0,-3) \] +\end{PresCodePL} + +\newpage + +\section{Équation cartésienne d'une droite du plan}\label{eqcartdroite} + +\subsection{Idée et commande} + +\begin{tipblock} +\cmaj{2.6.4} L'idée est de proposer une commande pour déterminer une équation cartésienne d'une droite du plan dans l'un des cas suivants : + +\begin{itemize} + \item en donnant un vecteur directeur et un point ; + \item en donnant un vecteur normal et un point ; + \item en donnant deux points. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresCodeTexPL}{listing only} +%Avec un vecteur normal (choix par défaut) et un point +\TrouveEqCartDroite[clés](vecteur normal)(point) +%Avec un vecteur directeur et un point +\TrouveEqCartDroite[clés,VectDirecteur](vecteur directeur)(point1) +%Avec deux points +\TrouveEqCartDroite[clés](point1)(point2) +\end{PresCodeTexPL} + +\subsection{Clés et arguments} + +\begin{cautionblock} +Concernant les arguments des commandes : + +\begin{itemize} + \item le premier argument, optionnel et entre \ctex{[...]} contient les clés : + \begin{itemize} + \item \Cle{OptionCoeffs} pour spécifier un formatage \textit{global} des coefficients ; \hfill{}défaut : \Cle{d} + \item le booléen \Cle{SimplifCoeffs} pour forcer des coeffs simples (entiers et premiers entre eux) ; + + \hfill{}défaut : \Cle{false} + \item \Cle{Facteur} pour spécifier un facteur personnalisé aux simplifications ; \hfill{}défaut : \Cle{1} + \item le booléen \Cle{VectDirecteur} pour pour préciser que le vecteur utilisé est directeur.\hfill{}défaut : \Cle{false} + \end{itemize} + \item les arguments suivants, entre \ctex{(...)} correspondent aux données utilisées. +\end{itemize} + +À noter que les séparateurs \ctex{,} ou \ctex{;} permettent de spécifier point ou vecteur. +\end{cautionblock} + +\begin{PresCodePL}{} +Une équation cartésienne de la droite $\mathcal{D}$ de vecteur normal $\vec{n} \AffVecteur(1;2)$ et passant par le point A de coordonnées $\AffPoint(4,5)$ est $\mathcal{D}$ : $\TrouveEqCartDroite[VectNormal](1;2)(4,5)$ +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation cartésienne de la droite $\mathcal{D}$ de vecteur directeur $\vec{u} \AffVecteur[n](1/2;2/3)$ et passant par le point A de coordonnées $\AffPoint(5,6)$ est $\mathcal{D}$ : $\TrouveEqCartDroite[VectDirecteur](1/2;2/3)(5,6) \Leftrightarrow \TrouveEqCartDroite[SimplifCoeffs,VectDirecteur](1/2;2/3)(5,6) \Leftrightarrow \TrouveEqCartDroite[SimplifCoeffs,VectDirecteur,Facteur=-1](1/2;2/3)(5,6)$ +\end{PresCodePL} + +\begin{PresCodePL}{} +Une équation cartésienne de la droite $\mathcal{D}$ passant par les points $\AffPoint(2,4)$ et $\AffPoint(-4,2)$ est \[\mathcal{D} \text{ : } \TrouveEqCartDroite(2,4)(-4,2) \Leftrightarrow \TrouveEqCartDroite[SimplifCoeffs](2,4)(-4,2)\] +\end{PresCodePL} + +\newpage + +\section{Distance d'un point à un plan}\label{distptplan} + +\subsection{Idée et commande} + +\begin{tipblock} +\cmaj{2.6.4} L'idée est de proposer une commande pour déterminer la distance d'un point à un plan : + +\begin{itemize} + \item en donnant le point puis le plan défini par vecteur normal \&{} point ; + \item en donnant le point puis le plan défini par une équation cartésienne. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{PresCodeTexPL}{listing only} +%Avec le point et le plan via vect normal + point +\TrouveDistancePtPlan(point)(vec normal du plan)(point du plan) +%Avec le point et le plan via vect normal + point +\TrouveDistancePtPlan(point)(équation cartésienne) +\end{PresCodeTexPL} + +\begin{noteblock} +Le résultat étant souvent écrit à l'aide d'une racine carrée, le code se charge de simplifier le résultat sous la forme $\frac{a\sqrt{n}}{b}$. + +Dans le cas où les coordonnées ne seraient pas rationnelles, le résultat risque de ne pas être conforme à celui attendu. +\end{noteblock} + +\subsection{Clés et arguments} + +\begin{cautionblock} +Concernant les arguments de cette commande : + +\begin{itemize} + \item si on travaille avec une équation cartésienne, elle est à donner sous la forme \ctex{ax+by+cz=0} ou \ctex{ax+by+cz} + \item les séparateurs \ctex{,} ou \ctex{;} permettent de spécifier point ou vecteur pour les arguments 1 et 3. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{cautionblock} + +\begin{PresCodePL}{} +La distance entre le point $\AffPoint(1,2,3)$ et le plan de vecteur normal $\AffVecteur(-1;-2;3)$ et passant par $\AffPoint(5,0,2)$ vaut +\[ d = \displaystyle\TrouveDistancePtPlan(1,2,3)(-1;-2;3)(5,0,2) \] +\end{PresCodePL} + +\begin{PresCodePL}{} +La distance entre le point $\AffPoint(1,2,3)$ et le plan d'équation $x+2y+2z-7=0$ vaut +\[ d = \displaystyle\TrouveDistancePtPlan(1,2,3)(x+2y-2z+7) \] +\end{PresCodePL} + +\begin{PresCodePL}{} +La distance entre le point $\AffPoint(-7,0,4)$ et le plan d'équation $0,5x+2y-z-1=0$ vaut +\[ d = \displaystyle\TrouveDistancePtPlan(-7,0,4)(0.5x+2y-z-1=0) \] +\end{PresCodePL} + +\begin{PresCodePL}{} +La distance entre le point $H\AffPoint(0,4,8)$ et le plan d'équation $-x+y+z-4=0$ vaut +\[ d = \displaystyle\TrouveDistancePtPlan(0,4,8)(-x+y+z-4=0) \] +\end{PresCodePL} + +\begin{PresCodePL}{} +La distance entre le point $H\AffPoint(0,0,5)$ et le plan d'équation $z-1=0$ vaut +\[ d = \displaystyle\TrouveDistancePtPlan(0,0,5)(z-1=0) \] +\end{PresCodePL} + +\newpage + +\section{Équation réduite d'une droite du plan}\label{eqreduite} + +\subsection{Idée} + +\begin{tipblock} +\cmaj{2.6.3} L'idée est de proposer une commande pour déterminer l'équation réduite d'une droite passant par deux points : +\begin{itemize} + \item en traitant les cas particuliers \textit{horizontale}, \textit{verticale} ; + \item en affichant une méthode de résolution ; + \item en travaillant sous forme exacte fractionnaire (les racines carrées ou autres ne seront pas gérés). +\end{itemize} + +À noter que les calculs et résultats sont traités par la commande de \textit{conversion de fraction} de \ctex{ProfLycee}. +\end{tipblock} + +\begin{warningblock} +La commande se charge de formater (normalement !) correctement les différentes étapes de calculs (il se peut quand même que cela puisse ne pas donner le résultat réellement escompté\ldots) : + +\begin{itemize} + \item en travaillant en fraction ; + \item en mettant les parenthèses nécessaires devant les éventuels nombres négatifs ; + \item en traitant les cas particuliers $m=\pm1$ et $b=0$. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{warningblock} + +\begin{PresCodeTexPL}{listing only} +\EquationReduite[option]{A/xa/ya,B/xb/yb} +\end{PresCodeTexPL} + +\subsection{Clés et arguments} + +\begin{cautionblock} +Concernant le fonctionnement de la commande : + +\begin{itemize} + \item le premier argument, optionnel et entre \ctex{[...]} et valant \Cle{[d]} par défaut, permet de formater les fractions éventuelles en mode \ctex{\textbackslash displaystyle} ; + \item le second argument, obligatoire et entre \ctex{\{...\}}, permet de donner les coordonnées des points concernés. +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{cautionblock} + +\begin{PresCodePL}{} +\EquationReduite{C/2/0,D/-2/-8} +\end{PresCodePL} + +\subsection{Exemples} + +\begin{PresCodePL}{} +\EquationReduite{I/-4/5,J/-4/12} +\end{PresCodePL} + +\begin{PresCodePL}{} +\EquationReduite{U/-4/5,V/-4/5} +\end{PresCodePL} + +\begin{PresCodePL}{} +\EquationReduite{L/10/7,M/-2/7} +\end{PresCodePL} + +\begin{PresCodePL}{} +\EquationReduite{L/{1/3}/2.5,M/{-5/7}/{3/5}} +\end{PresCodePL} + +\begin{PresCodePL}{} +\EquationReduite{P/4/-4,Q/-2/2} +\end{PresCodePL} + +\begin{PresCodePL}{} +\EquationReduite{G/-4/5,H/10/4} +\end{PresCodePL} + \newpage \phantom{t}\par\vfill\par @@ -4418,7 +4813,9 @@ Ces commande permet de tracer les graduations des axes, avec des \Cle{clés} ide \item \Cle{Epaisseur} qui est l'épaisseur des graduations ; \hfill~défaut \Cle{1pt} \item \Cle{Police} qui est le style des labels des graduations ; \hfill~défaut \Cle{\textbackslash{}normalsize\textbackslash{}normalfont} \item \Cle{PosGrad} qui est la position des graduations par rapport à l'axe ; \hfill~défaut \Cle{below} et \Cle{left} - \item \Cle{HautGrad} qui est la position des graduations (sous la forme \Cle{lgt} ou \Cle{lgta/lgtb}) ; \hfill~défaut \Cle{4pt} + \item \Cle{HautGrad} qui est la position des graduations (sous la forme \Cle{lgt} ou \Cle{lgta/lgtb}) ; + + \hfill~défaut \Cle{4pt} \item le booléen \Cle{AffGrad} pour afficher les valeurs (formatés avec \ctex{num} donc dépendant de \ctex{sisetup}) des graduations ; \hfill~défaut \Cle{true} \item le booléen \Cle{AffOrigine} pour afficher la graduation de l'origine ; \hfill~défaut \Cle{true} \item le booléen \Cle{Annee} qui permet de ne pas formater les valeurs des graduations (type \textsf{année}). \hfill~défaut \Cle{false} @@ -4494,7 +4891,9 @@ Cette commande, liée à la commande \ctex{CalculsRegLin} permet de représenter \begin{itemize} \item \Cle{Taille} qui est la taille des points du nuage ; \hfill~défaut \Cle{2pt} \item \Cle{Style} parmi \Cle{o} (rond) ou \Cle{x} (croix) ou \Cle{+} (plus) ; \hfill~défaut \Cle{o} - \item \Cle{Couleur} qui est la couleur (éventuellement \Cle{couleurA/couleurB} pour les ronds). \hfill~défaut \Cle{blue} + \item \Cle{Couleur} qui est la couleur (éventuellement \Cle{couleurA/couleurB} pour les ronds). + + \hfill~défaut \Cle{blue} \end{itemize} \vspace*{-\baselineskip}\leavevmode \end{cautionblock} @@ -4502,14 +4901,12 @@ Cette commande, liée à la commande \ctex{CalculsRegLin} permet de représenter \begin{PresCodeTexPL}{listing only} \def\LLX{1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008, 2009,2010} \def\LLY{1718,1710,1708,1700,1698,1697,1691,1688,1683,1679,1671,1670,1663,1661, 1656,1649} +\end{PresCodeTexPL} +\begin{PresCodeTexPL}{listing only} \begin{tikzpicture}[...] \NuagePointsTikz[Couleur=blue/red]{\LLX}{\LLY} \end{tikzpicture} -~~ -\begin{tikzpicture}[...] - \NuagePointsTikz[Couleur=ForestGreen,Style=x,Taille=6pt]{\LLX}{\LLY} -\end{tikzpicture} \end{PresCodeTexPL} \begin{PresCodeSortiePL}{text only} @@ -4523,6 +4920,18 @@ Cette commande, liée à la commande \ctex{CalculsRegLin} permet de représenter \AxeyTikz{1640,1650,...,1720} \NuagePointsTikz[Couleur=blue/red]{\LLX}{\LLY} \end{tikzpicture} +\end{PresCodeSortiePL} + +\begin{PresCodeTexPL}{listing only} +\begin{tikzpicture}[...] + \NuagePointsTikz[Couleur=ForestGreen,Style=x,Taille=6pt]{\LLX}{\LLY} +\end{tikzpicture} +\end{PresCodeTexPL} + +\begin{PresCodeSortiePL}{text only} +\def\LLX{1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010} +\def\LLY{1718,1710,1708,1700,1698,1697,1691,1688,1683,1679,1671,1670,1663,1661,1656,1649} +\CalculsRegLin{\LLX}{\LLY} \begin{tikzpicture}[x=0.35cm,y=0.07cm,Ox=1992,xmin=1992,xmax=2012,xgrille=2,xgrilles=1,Oy=1640,ymin=1640,ymax=1730,ygrille=10,ygrilles=5] \GrilleTikz \AxesTikz @@ -4711,7 +5120,9 @@ Quelques \Cle{clés} sont disponibles pour cette commande : \item le booléen \Cle{AffMoyenne} qui permet d'afficher ou non la moyenne (sous forme d'un point) ; \hfill~défaut \Cle{false} - \item le booléen \Cle{Pointilles} qui permet d'afficher des pointillés au niveau des paramètres ; \hfill~défaut \Cle{false} + \item le booléen \Cle{Pointilles} qui permet d'afficher des pointillés au niveau des paramètres ; + + \hfill~défaut \Cle{false} \item le booléen \Cle{Valeurs} qui permet d'afficher les valeurs des paramètres au niveau des abscisses. \hfill~défaut \Cle{false} @@ -5452,7 +5863,9 @@ Peu de paramétrage pour ces commandes qui permettent de calculer $A_n^p$ et $\b \begin{itemize} \item les versions étoilées ne formatent pas le résultat grâce à \ctex{\textbackslash num} de \ctex{sinuitx} ; \item le booléen \Cle{Notation} pour avoir la notation au début ; \hfill~défaut \Cle{false} - \item le booléen \Cle{NotationAncien} pour avoir la notation \og ancienne \fg{} des combinaisons au début ; \hfill~défaut \Cle{false} + \item le booléen \Cle{NotationAncien} pour avoir la notation \og ancienne \fg{} des combinaisons au début ; + + \hfill~défaut \Cle{false} \item le booléen \Cle{Formule} permet de présenter la formule avant le résultat ; \hfill~défaut \Cle{false} @@ -5857,8 +6270,6 @@ La présentation est dans un environnement \ctex{ensuremath} donc les \ctex{\$.. \PresentationPGCD[CouleurResultat]{150}{27} \end{PresCodePL} -\pagebreak - \begin{PresCodePL}{} \PresentationPGCD[CouleurResultat,Couleur=ForestGreen]{1250}{450}. @@ -5887,6 +6298,77 @@ $\left[ \PresentationPGCD[AfficheConclusion=false,AfficheDelimiteurs=false]{1234 \newpage +\section{Résolution d'une équation diophantienne}\label{eqdioph} + +\subsection{Idée} + +\begin{tipblock} +L'idée est de proposer une résolution d'équation diophantienne du type $ax+by=c$ avec $(a;b;c) \in \mathbb{Z}^3$. + +\smallskip + +Le \textit{code} se charge de tester les différentes conditions d'existence, et d'adapter la rédaction (fixée et non modifiable\ldots) aux différentes situations : + +\begin{itemize} + \item cas où $\text{PGCD}(a;b)=1$ ;\hfill~existence de solutions + \item cas où $\text{PGCD}(a;b) \neq 1$ et $\text{PGCD}(a;b) \mid c$;\hfill~existence de solutions + \item cas où $\text{PGCD}(a;b) \neq 1$ et $\text{PGCD}(a;b) \not\mid c$.\hfill~pas de solution +\end{itemize} +\vspace*{-\baselineskip}\leavevmode +\end{tipblock} + +\begin{warningblock} +Logiquement le \textit{code} se charge de \textit{parenthéser} de manière automatique pour les nombres négatifs, mais il se peut que certains cas particuliers puissent donner des résultats \og non esthétiques \fg{}\ldots +\end{warningblock} + +\begin{PresCodeTexPL}{listing only} +\EquationDiophantienne[Clés]{equation} +\end{PresCodeTexPL} + +\subsection{Options et clés} + +\begin{cautionblock} +Concernant les Clés disponibles pour cette commande, à donner entre \ctex{[...]} : + +\begin{itemize} + \item la clé \Cle{Lettre} pour spécifier le \textit{nom} de l'équation ; \hfill{}défaut \Cle{E} + \item la clé \Cle{Inconnues} qui paramètre les noms des inconnues, sous la forme \Cle{x/y} ; \hfill{}défaut \Cle{x/y} + \item la clé \Cle{Entier} qui gère le nom de l'entier dans la solution ; \hfill{}défaut \Cle{k} + \item le booléen \Cle{Cadres} pour mettre en valeur les solutions ;\hfill{}défaut \Cle{false} + \item le booléen \Cle{PresPGCD} présenter le calcul du PGCD de $|a|$ et de $|b|$.\hfill{}défaut \Cle{true} +\end{itemize} + +L'argument obligatoire, et entre \ctex{\{...\}} est quant à lui l'équation, en langage \og naturel \fg{} du type \ctex{ax+by=c} (le \textit{code} se charge d'extraire les coefficients, donc pas besoin des signes *). +\end{cautionblock} + +\begin{PresCodePL}{} +\EquationDiophantienne{48x+18y=3} +\end{PresCodePL} + +\begin{PresCodePL}{} +\EquationDiophantienne[PresPGCD=false]{48x+18y=-5} +\end{PresCodePL} + +\pagebreak + +\begin{PresCodePL}{} +\EquationDiophantienne{3x+4y=1} +\end{PresCodePL} + +\pagebreak + +\begin{PresCodePL}{} +\EquationDiophantienne[Cadres,Inconnues=u/v,Entier=l]{48u+18v=12} +\end{PresCodePL} + +\pagebreak + +\begin{PresCodePL}{} +\EquationDiophantienne{47x-18y=1} +\end{PresCodePL} + +\newpage + \phantom{t}\par\vfill\par \begin{PART} \begin{center} @@ -6567,6 +7049,12 @@ La grille, créée en \TikZ, est portée par le rectangle de \og coins \fg{} $(0 \part{Historique} +{\small \bverb|v 2.6.4|~:~~~~Résolution d'une équation diophantienne $ax+by=c$ (page \pageref{eqdioph}) + +{\small \bverb| |~:~~~~Correction de bugs mineurs + +{\small \bverb| |~:~~~~Ajout de commandes en géométrie analytique (pages \pageref{affcoord} et \pageref{eqcartplan} et \pageref{eqparamdroite} et \pageref{eqcartdroite} et \pageref{distptplan}) + {\small \bverb|v 2.6.3|~:~~~~Ajout d'une commande pour déterminer une équation réduite (page \pageref{eqreduite}) {\small \bverb|v 2.6.2|~:~~~~Ajout d'une clé [AffTraitsEq] pour les équations trigo (page \pageref{cercletrigo}) diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty index 322e4ad25d..89b82dd10c 100644 --- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty +++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty @@ -3,8 +3,9 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2023/05/09 2.6.3 Aide pour l'utilisation de LaTeX en lycee] -% 2.6.3 Ajout d'une commande pour l'équation affine d'une droite passant par deux points +\ProvidesPackage{ProfLycee}[2023/05/19 2.6.4 Aide pour l'utilisation de LaTeX en lycee] +% 2.6.4 Correction d'un dysfonctionnement avec les racines (oubli du \num) + Equation diophantienne ax+by=c + Eq cartésiennes (plan & droite) + Corrections de bugs mineurs +% 2.6.3 Ajout d'une commande pour rédiger l'obtention de l'équation affine d'une droite passant par deux points % 2.6.2 Correction de commandes pour la pseudo3d + nouvelle clé pour la trigo % 2.6.1 Ajout de commandes pour du calcul intégral (valeur approchée + tikz) % 2.6.0 Ajout d'une clé [Brut] pour les mesures principales + commande calcul ligne trigo diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-aleatoire.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-aleatoire.tex index 943a28d0fb..c1d167f058 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-aleatoire.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-aleatoire.tex @@ -25,7 +25,7 @@ \setKV[kvensemble]{#1}% \ifboolKV[kvensemble]{Mathpunct}% {\left\lbrace \PLensopt{} \mathpunct{} \StrSubstitute{#2}{/}{\mathpunct{}{\PLenssep}\mathpunct{}} \mathpunct{} \right\rbrace}% - {\left\lbrace \PLensopt{} \StrSubstitute{#2}{/}{{\PLenssep}} \right\rbrace} + {\left\lbrace \PLensopt{} \StrSubstitute{#2}{/}{{\PLenssep}} \right\rbrace}% } %%------TRINOMEALEA diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-analyse.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-analyse.tex index 0e8906ee96..4057fe37dd 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-analyse.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-analyse.tex @@ -334,7 +334,7 @@ \ensuremath{\frac{% \xintifboolexpr{\RacNumSimpl == 1 && \RacRacSimpl == 1}% {1}% - { \xintifboolexpr{\RacNumSimpl == 1}{}{\RacNumSimpl} \xintifboolexpr{\RacRacSimpl == 1}{}{\sqrt{\RacRacSimpl}} }% + { \xintifboolexpr{\RacNumSimpl == 1}{}{\RacNumSimpl} \xintifboolexpr{\RacRacSimpl == 1}{}{\sqrt{\num{\RacRacSimpl}}} }% }% { \RacDenomSimpl }}% }% diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex index 5b83b2a4d0..42e9264e5d 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-arithm.tex @@ -16,12 +16,12 @@ \NewDocumentCommand\ConversionDecBin{ s O{} m }{% \useKVdefault[CONVDECBIN] \setKV[CONVDECBIN]{#2}% on paramètres les nouvelles clés et on les simplifie - \def\resbrut{\xintDecToBin{#3}} - \StrLen{\resbrut}[\nbchiffres] - \def\nbgrp{\fpeval{4*ceil(\nbchiffres/4,0)}} - \IfBooleanTF{#1} - {\num{#3}\ifboolKV[CONVDECBIN]{AffBase}{_{10}}{}=\num[digit-group-size=4]{\resbrut}\ifboolKV[CONVDECBIN]{AffBase}{_{2}}{}} - {\num{#3}\ifboolKV[CONVDECBIN]{AffBase}{_{10}}{}=\num[digit-group-size=4,minimum-integer-digits=\nbgrp]{\resbrut}\ifboolKV[CONVDECBIN]{AffBase}{_{2}}{}} + \def\resbrut{\xintDecToBin{#3}}% + \StrLen{\resbrut}[\nbchiffres]% + \def\nbgrp{\fpeval{4*ceil(\nbchiffres/4,0)}}% + \IfBooleanTF{#1}% + {\num{#3}\ifboolKV[CONVDECBIN]{AffBase}{_{10}}{}=\num[digit-group-size=4]{\resbrut}\ifboolKV[CONVDECBIN]{AffBase}{_{2}}{}}% + {\num{#3}\ifboolKV[CONVDECBIN]{AffBase}{_{10}}{}=\num[digit-group-size=4,minimum-integer-digits=\nbgrp]{\resbrut}\ifboolKV[CONVDECBIN]{AffBase}{_{2}}{}}% } \setKVdefault[CONVBINHEX]{% @@ -43,35 +43,35 @@ %la conversion complète \newcommand\ConversionBinHex[2][]{% - \useKVdefault[CONVBINHEX] + \useKVdefault[CONVBINHEX]% \setKV[CONVBINHEX]{#1}% on paramètres les nouvelles clés et on les simplifie - \def\chbrut{#2} + \def\chbrut{#2}% \StrLen{\chbrut}[\nbchiffres] %nb de chiffres du binaire \xdef\nbgrp{\fpeval{4*ceil(\nbchiffres/4,0)}} %nb de chiffres avec blocs de 4 \xdef\nbblocs{\fpeval{\nbgrp/4}} %nb de blocs %on rajoute des zeros si besoin := OK - \xdef\resinter{\chbrut} - \num[digit-group-size=4]{\chbrut}\ifboolKV[CONVBINHEX]{AffBase}{_{2}}{}= + \xdef\resinter{\chbrut}% + \num[digit-group-size=4]{\chbrut}\ifboolKV[CONVBINHEX]{AffBase}{_{2}}{}=% \ifboolKV[CONVBINHEX]{Details}{% - \ifnum\nbchiffres<\nbgrp - \xdef\nbz{\inteval{\nbgrp-\nbchiffres}} - \xdef\resinter{\PLstrzeros{\nbz}\chbrut} - \num[digit-group-size=4,minimum-integer-digits=\nbgrp]{\resinter}= - \fi + \ifnum\nbchiffres<\nbgrp% + \xdef\nbz{\inteval{\nbgrp-\nbchiffres}}% + \xdef\resinter{\PLstrzeros{\nbz}\chbrut}% + \num[digit-group-size=4,minimum-integer-digits=\nbgrp]{\resinter}=% + \fi% %découpage par blocs et conversion en hexa := OK - \newcount\cpt - \cpt0 - \loop\ifnum \cpt<\nbblocs + \newcount\cpt% + \cpt0% + \loop\ifnum \cpt<\nbblocs% \def\iinit{\fpeval{4*\cpt+1}}% \def\ifinal{\fpeval{4*(\cpt+1)}}% \StrMid{\resinter}{\iinit}{\ifinal}[\blocinter]% - {\underbracket{\blocinter}_{\xintBinToHex{\blocinter}}\,} - \advance\cpt by 1 - \repeat - \!= + {\underbracket{\blocinter}_{\xintBinToHex{\blocinter}}\,}% + \advance\cpt by 1% + \repeat% + \!=% }% - {} - \xintBinToHex{\chbrut}\ifboolKV[CONVBINHEX]{AffBase}{_{16}}{} + {}% + \xintBinToHex{\chbrut}\ifboolKV[CONVBINHEX]{AffBase}{_{16}}{}% } %hexa/bin->dec avec écriture polynomiale @@ -94,62 +94,62 @@ \newcommand\ConversionVersDec[2][]{% \useKVdefault[CONVTODEC] \setKV[CONVTODEC]{#1}% on paramètres les nouvelles clés et on les simplifie - \def\nbdepart{#2} - \StrLen{\nbdepart}[\nbchiffres] - \StrChar{\nbdepart}{1}[\chiffre] + \def\nbdepart{#2}% + \StrLen{\nbdepart}[\nbchiffres]% + \StrChar{\nbdepart}{1}[\chiffre]% %si on est en base 16 \xintifboolexpr{\basedepart == 16}% {% - \nbdepart\ifboolKV[CONVTODEC]{AffBase}{_{\basedepart}}{} = + \nbdepart\ifboolKV[CONVTODEC]{AffBase}{_{\basedepart}}{} =% \ifboolKV[CONVTODEC]{Details}{% \xintHexToDec{\chiffre}\times\basedepart^{\inteval{\nbchiffres-1}}% - \newcount\cpt - \cpt2 - \loop\ifnum \cpt<\inteval{\nbchiffres+1} - \def\puiss{\inteval{\nbchiffres-\cpt}} - \StrChar{\nbdepart}{\cpt}[\chiffre] + \newcount\cpt% + \cpt2% + \loop\ifnum \cpt<\inteval{\nbchiffres+1}% + \def\puiss{\inteval{\nbchiffres-\cpt}}% + \StrChar{\nbdepart}{\cpt}[\chiffre]% \ifboolKV[CONVTODEC]{Zeros}% {% +\xintHexToDec{\chiffre}\times\basedepart^{\puiss}% - } - { - \ifnum\xintHexToDec{\chiffre} > 0 + }% + {% + \ifnum\xintHexToDec{\chiffre} > 0% +\xintHexToDec{\chiffre}\times\basedepart^{\puiss}% - \fi - } - \advance\cpt by 1 - \repeat - = - } - {} - \num{\xintHexToDec{\nbdepart}}\ifboolKV[CONVTODEC]{AffBase}{_{10}}{} + \fi% + }% + \advance\cpt by 1% + \repeat% + =% + }% + {}% + \num{\xintHexToDec{\nbdepart}}\ifboolKV[CONVTODEC]{AffBase}{_{10}}{}% }% - {} + {}% \xintifboolexpr{\basedepart == 2}% {% - \num[digit-group-size=4]{\nbdepart}\ifboolKV[CONVTODEC]{AffBase}{_{\basedepart}}{} = + \num[digit-group-size=4]{\nbdepart}\ifboolKV[CONVTODEC]{AffBase}{_{\basedepart}}{} =% \ifboolKV[CONVTODEC]{Details}{% \chiffre\times\basedepart^{\inteval{\nbchiffres-1}}% - \newcount\cpt - \cpt2 - \loop\ifnum \cpt<\inteval{\nbchiffres+1} - \def\puiss{\inteval{\nbchiffres-\cpt}} - \StrChar{\nbdepart}{\cpt}[\chiffre] + \newcount\cpt% + \cpt2% + \loop\ifnum \cpt<\inteval{\nbchiffres+1}% + \def\puiss{\inteval{\nbchiffres-\cpt}}% + \StrChar{\nbdepart}{\cpt}[\chiffre]% \ifboolKV[CONVTODEC]{Zeros}% {% +\chiffre\times\basedepart^{\puiss}% } { - \ifnum\chiffre > 0 + \ifnum\chiffre > 0% +\chiffre\times\basedepart^{\puiss}% - \fi - } - \advance\cpt by 1 - \repeat - = - } - {} - \num{\xintBinToDec{\nbdepart}}\ifboolKV[CONVTODEC]{AffBase}{_{10}}{} + \fi% + }% + \advance\cpt by 1% + \repeat% + =% + }% + {}% + \num{\xintBinToDec{\nbdepart}}\ifboolKV[CONVTODEC]{AffBase}{_{10}}{}% }% {}% } @@ -157,30 +157,30 @@ \newcommand\ConversionBaseDix[3][]{%1=options,%2=nb,%3=basedep ?? \useKVdefault[CONVTODEC] \setKV[CONVTODEC]{#1}% on paramètres les nouvelles clés et on les simplifie - \def\NBdepart{#2} - \def\basedepart{#3} - \StrLen{\NBdepart}[\nbchiffres] - \StrChar{\NBdepart}{1}[\chiffre] - \NBdepart\ifboolKV[CONVTODEC]{AffBase}{_{\basedepart}}{} = + \def\NBdepart{#2}% + \def\basedepart{#3}% + \StrLen{\NBdepart}[\nbchiffres]% + \StrChar{\NBdepart}{1}[\chiffre]% + \NBdepart\ifboolKV[CONVTODEC]{AffBase}{_{\basedepart}}{} =% \ifboolKV[CONVTODEC]{Details}{% \xintHexToDec{\chiffre}\times\basedepart^{\inteval{\nbchiffres-1}}% - \newcount\cpt - \cpt2 - \loop\ifnum \cpt<\inteval{\nbchiffres+1} - \def\puiss{\inteval{\nbchiffres-\cpt}} - \StrChar{\NBdepart}{\cpt}[\chiffre] + \newcount\cpt% + \cpt2% + \loop\ifnum \cpt<\inteval{\nbchiffres+1}% + \def\puiss{\inteval{\nbchiffres-\cpt}}% + \StrChar{\NBdepart}{\cpt}[\chiffre]% \ifboolKV[CONVTODEC]{Zeros}% {% +\xintHexToDec{\chiffre}\times\basedepart^{\puiss}% - } - { - \ifnum\xintHexToDec{\chiffre} > 0 + }% + {% + \ifnum\xintHexToDec{\chiffre} > 0% +\xintHexToDec{\chiffre}\times\basedepart^{\puiss}% - \fi - } - \advance\cpt by 1 - \repeat - = + \fi% + }% + \advance\cpt by 1% + \repeat% + =% }% {}% \num{\convertbasetobasedix{#2}{#3}}\ifboolKV[CONVTODEC]{AffBase}{_{10}}{}% @@ -231,7 +231,7 @@ } %dernière \xdef\ValQ{\fpeval{trunc(\ValTMP/#3,0)}}\xdef\ValR{\fpeval{\ValTMP-#3*\ValQ}}% - \\ \num{\ValTMP}\uppercase{&}\num{\ValB}\times\num{\ValQ}\uppercase{&}\PLnoeud{\PLConvNoeud2}{\num{\ValR}} + \\ \num{\ValTMP}\uppercase{&}\num{\ValB}\times\num{\ValQ}\uppercase{&}\PLnoeud{\PLConvNoeud2}{\num{\ValR}}% \end{array} \right| \Rightarrow \num{#2}_{10}=\ifboolKV[convfromten]{CouleurRes}{\mathcolor{\PLConvCouleur}{\convertbasedixtobase{#2}{#3}_{#3}}}{\convertbasedixtobase{#2}{#3}_{#3}}}% \ifboolKV[convfromten]{Rect}% {% @@ -263,6 +263,8 @@ AfficheDelimiteurs=true } +\RequirePackage{xintgcd} + \newcommand\PresentationPGCD[3][]{% \useKVdefault[prespgcd]% \setKV[prespgcd]{#1}% @@ -274,7 +276,7 @@ {}% \begin{array}{@{\,}r@{\;=\;}l@{\;+\;}r} %1ère division - \xdef\ValQ{\fpeval{trunc(\ValA/\ValB,0)}}\xdef\ValR{\fpeval{\ValA-\ValB*\ValQ}} + \xdef\ValQ{\fpeval{trunc(\ValA/\ValB,0)}}\xdef\ValR{\fpeval{\ValA-\ValB*\ValQ}}% \num{\ValA}\uppercase{&}\num{\ValB}\times\num{\ValQ}\uppercase{&}% \xintifboolexpr{\ValR == \respgcd}% {\PLnoeud{\PLPGCDNoeud1}{\num{\ValR}}}%noeud si c'est le pgcd @@ -308,4 +310,150 @@ }{}% } +%%===égalité de Bezout +\NewDocumentCommand\AffCoeffBezout{ m }{% + \xintifboolexpr{#1 < 0}% + {\left( \num{#1} \right)}% + {\num{#1}}% +} +\NewDocumentCommand\EgaliteBezout{ O{black} m m }{% + \xintAssign{\xintBezout{#2}{#3}}\to\TmpU\TmpV\TmpD% + \ensuremath{\num{#2} \times \mathcolor{#1}{\AffCoeffBezout{\TmpU}} + \AffCoeffBezout{#3} \times \mathcolor{#1}{\AffCoeffBezout{\TmpV}} = \num{\TmpD}}% +} + +%%===Équations diophantiennes +\RequirePackage{cancel} +\NewDocumentCommand\AffCoeffDioph{ m }{% + \xintifboolexpr{#1 < 0}% + {\left( \num{#1} \right)}% + {\num{#1}}% +} +\NewDocumentCommand\AffCoeffDiophSign{ m }{% + \xintifboolexpr{#1 < 0}% + {\num{#1}}% + {+\num{#1}}% +} + +\defKV[eqdioph]{% + Lettre=\def\LettreSolEDioph{#1},% + Couleur=\def\CouleurSolEDioph{#1},% + Inconnues=\def\InconnuesSolEDioph{#1},% + Entier=\def\KKK{#1} +} + +\setKVdefault[eqdioph]{% + Lettre=E,% + Couleur=black,% + Inconnues=x/y,% + Entier=k,% + Cadres=false,% + PresPGCD=true +} + +\NewDocumentCommand\EquationDiophantienne{ O{} m }{%v2 avec équation en "dur" + \useKVdefault[eqdioph]% + \setKV[eqdioph]{#1}% + \setlength{\parindent}{0pt}% + %extractions des paramètres + \StrBefore[1]{\InconnuesSolEDioph}{/}[\XXX]% + \StrBehind[1]{\InconnuesSolEDioph}{/}[\YYY]% + \StrBefore{#2}{\XXX}[\AA]% + \StrBetween{#2}{\XXX}{\YYY}[\BB]% + \StrBehind{#2}{=}[\CC]% + \IfStrEq{\AA}{}% + {\def\AA{1}}{}% + \IfStrEq{\AA}{-}% + {\def\AA{-1}}{}% + \StrLen{\BB}[\lgtB]% + \xintifboolexpr{ \lgtB > 1 }%+b ou -b + {% + \StrDel{\BB}{+}[\BB]% + }% + {% + \IfStrEq{\BB}{-}% + {\def\BB{-1}}{}% + \IfStrEq{\BB}{+}% + {\def\BB{1}}{}% + }% + %Calcul du PGCD + \xdef\PGCDD{\xinteval{gcd(\AA,\BB)}}% + On cherche à résoudre l'équation diophantienne :\[ \num{\AA}\XXX + \AffCoeffDioph{\BB}\YYY=\num{\CC} \xintifboolexpr{ \PGCDD == 1 'or' \xintiiRem{\CC}{\PGCDD} != 0 }{\qquad (\LettreSolEDioph)}{} \]% + \ifboolKV[eqdioph]{PresPGCD}% + {D'après l'algorithme d'Euclide : \PresentationPGCD[Rectangle=false]{\xinteval{abs(\AA)}}{\xinteval{abs(\BB)}}.}% + {Le PGCD de \num{\AA} et de \num{\BB} vaut \num{\PGCDD}.}% + \par\smallskip + \xintifboolexpr{ \xintiiRem{\CC}{\PGCDD} == 0 }%solutions obligatoires + {% + \xintifboolexpr{ \PGCDD == 1}% + {% + Les entiers \num{\xinteval{abs(\AA)}} et \num{\xinteval{abs(\BB)}} sont premiers entre eux, donc l'équation $(\LettreSolEDioph)$ admet une infinité de solutions.\par + \xdef\AAA{\AA}\xdef\BBB{\BB}\xdef\CCC{\CC}% + }% + {% + Le PGCD de \num{\AA} et \num{\BB} divise \num{\CC}, donc on peut simplifier l'équation diophantienne par \num{\PGCDD}.% + \xdef\AAA{\xintiieval{\AA/\PGCDD}}\xdef\BBB{\xintiieval{\BB/\PGCDD}}\xdef\CCC{\xintiieval{\CC/\PGCDD}}% + % + \[ \num{\AA}\XXX+\AffCoeffDioph{\BB}\YYY=\num{\CC} \underset{\div\num{\PGCDD}}{\Longleftrightarrow} \num{\AAA}\XXX+\AffCoeffDioph{\BBB}\YYY=\num{\CCC} \qquad (\LettreSolEDioph) \]% + Les entiers \num{\AAA} et \num{\BBB} sont premiers entre eux, donc l'équation $(\LettreSolEDioph)$ admet une infinité de solutions.\par + }% + \xintAssign{\xintBezout{\AAA}{\BBB}}\to\TmpU\TmpV\TmpD + % + On détermine une solution particulière de $(E)$ : \[ \num{\AAA} \times \mathcolor{\CouleurSolEDioph}{\AffCoeffBezout{\TmpU}} + \AffCoeffBezout{\BBB} \times \mathcolor{\CouleurSolEDioph}{\AffCoeffBezout{\TmpV}} = \num{\TmpD} + \xintifboolexpr{ \CCC != 1}% + {% + \underset{\times\AffCoeffDioph{\CCC}}{\implies} + \num{\AAA} \times \mathcolor{\CouleurSolEDioph}{\AffCoeffDioph{\xinteval{\TmpU*\CCC}}} + \AffCoeffBezout{\BBB} \times \mathcolor{\CouleurSolEDioph}{\AffCoeffDioph{\xinteval{\TmpV*\CCC}}} = \num{\CCC} + }% + {}% + \qquad ({\LettreSolEDioph}_0) + \]% + % + Par soustraction : + % + \[% + {\renewcommand\arraystretch{1.25}% + \begin{array}{ @{\,} c @{\,} c @{\;\times\;} c @{\;+\;} c @{\;\times\;} c @{\;=\;} c } + & \num{\AAA} & \XXX & \AffCoeffDioph{\BBB} & \YYY & \num{\CCC} \\ + -~~~~~ & \num{\AAA} & \mathcolor{\CouleurSolEDioph}{\AffCoeffDioph{\xinteval{\TmpU*\CCC}}} & \AffCoeffDioph{\BBB} & \mathcolor{\CouleurSolEDioph}{\AffCoeffDioph{\xinteval{\TmpV*\CCC}}} & \num{\CCC} \\ \hline + & \num{\AAA} & \left( \XXX \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpU*\CCC}}} \right)& \AffCoeffDioph{\BBB} & \left( \YYY \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpV*\CCC}}} \right) & 0\\ + \end{array}} + \]% + \xdef\TmpPartieA{\XXX \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpU*\CCC}}}}% + \xdef\TmpPartieB{\YYY \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\TmpV*\CCC}}}}% + % + On en déduit que $\num{\AAA} \times \underbrace{\left( \TmpPartieA \right)}_{\text{entier}} = \num{\xinteval{-\BBB}} \times \left( \TmpPartieB \right)$, et donc que $\num{\AAA} \mid \num{\xinteval{-\BBB}} \times \left( \TmpPartieB \right)$.\par\smallskip + Or \num{\xinteval{abs(\AAA)}} et \num{\xinteval{abs(\BBB)}} sont premiers entre eux, donc d'après le théorème de Gauss, on a $\num{\AAA} \mid \TmpPartieB$.\par + Il existe donc un entier $\KKK$ tel que $\TmpPartieB = \num{\AAA} \times \KKK$, ce qui donne + $\ifboolKV[eqdioph]{Cadres} + {\boxed{\YYY = \mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpV}}} \AffCoeffDiophSign{\AAA}\KKK}} + {\YYY = \mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpV}}} \AffCoeffDiophSign{\AAA}\KKK} + $.\par + En remplaçant, on obtient : + % + \begin{align*} + \num{\AAA} \times \left( \TmpPartieA \right) = \num{\xinteval{-\BBB}} \times \left( \TmpPartieB \right) & \implies \num{\AAA} \times \left( \TmpPartieA \right) = \num{\xinteval{-\BBB}} \times \big( \underbrace{\mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpV}}} \AffCoeffDiophSign{\AAA}\KKK}_{\mathclap{\YYY}} \mathcolor{\CouleurSolEDioph}{\AffCoeffDiophSign{\xinteval{-\CCC*\TmpV}}} \big) \\ + & \implies \num{\AAA} \times \left( \TmpPartieA \right) = \num{\xinteval{-\BBB}} \times \left( \num{\AAA}\KKK \right) \\ + & \implies \TmpPartieA = \num{\xinteval{-\BBB}}\KKK \\ + & \implies \ifboolKV[eqdioph]{Cadres} + {\boxed{\XXX = \mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpU}}} \AffCoeffDiophSign{\xinteval{-\BBB}}\KKK}} + {\XXX = \mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpU}}} \AffCoeffDiophSign{\xinteval{-\BBB}}\KKK} + \end{align*} + % + Ainsi, si $\XXX$ et $\YYY$ sont solutions de $(\LettreSolEDioph)$, alors il existe un entier $\KKK$ tel que ${\XXX=\mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpU}}} \AffCoeffDiophSign{\xinteval{-\BBB}}\KKK}$ et ${\YYY=\mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpV}}} \AffCoeffDiophSign{\AAA}\KKK}$.\par\medskip + Réciproquement, soit $\KKK$ un entier quelconque : + % + \begin{align*} + \num{\AAA} \times \left( \mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpU}}} \AffCoeffDiophSign{\xinteval{-\BBB}}\KKK \right) + \AffCoeffDioph{\BBB} \times \left( \mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpV}}} \AffCoeffDiophSign{\AAA}\KKK \right) & = \num{\AAA} \times \mathcolor{\CouleurSolEDioph}{\AffCoeffDioph{\xinteval{\CCC*\TmpU}}} + \cancel{\AffCoeffDioph{\AAA} \times \AffCoeffDioph{\xinteval{-\BBB}} \KKK} + \AffCoeffDioph{\BBB} \times \mathcolor{\CouleurSolEDioph}{\AffCoeffDioph{\xinteval{\CCC*\TmpV}}} + \cancel{\AffCoeffDioph{\BBB} \times \AffCoeffDioph{\AAA} \KKK} \\ + & = \underbrace{\num{\AAA} \times \mathcolor{\CouleurSolEDioph}{\AffCoeffDioph{\xinteval{\CCC*\TmpU}}} + \AffCoeffDioph{\BBB} \times \mathcolor{\CouleurSolEDioph}{\AffCoeffDioph{\xinteval{\CCC*\TmpV}}}}_{=\,\num{\CCC} \text{ d'après } ({\LettreSolEDioph}_0)} \\ + & = \num{\CCC} + \end{align*} + % + On en déduit que $\left(\mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpU}}} \AffCoeffDiophSign{\xinteval{-\BBB}}\KKK \mathpunct{}; \mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpV}}} \AffCoeffDiophSign{\AAA}\KKK \right)$ est solution de $(\LettreSolEDioph)$.\par\medskip + En conclusion, les solutions de $(E)$ sont donc les couples $\left(\mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpU}}} \AffCoeffDiophSign{\xinteval{-\BBB}}\KKK \mathpunct{}; \mathcolor{\CouleurSolEDioph}{\num{\xinteval{\CCC*\TmpV}}} \AffCoeffDiophSign{\AAA}\KKK \right)$, avec $\KKK$ un entier relatif. + }% + {% + Le PGCD de \num{\AA} et \num{\BB} ne divise pas \num{\CC}, donc l'équation $(\LettreSolEDioph)$ n'admet aucune solution. + }% +} + \endinput
\ No newline at end of file diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex index 93e0e09191..1758c015fd 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-geom.tex @@ -135,5 +135,493 @@ mainlevee/.default={5mm et 0.6pt} } +%%Equations Cartésiennes + Affichages coordonnées +\RequirePackage{nicematrix} +\NewDocumentCommand\AffCoeffSgn{ s O{} m m D<>{} }{% + \IfStrEq{#5}{}%si argument vide, on convertit en fraction + {% + \xintifboolexpr{\xinteval{#3} == 0}% + {}%on n'affiche rien si le coeff est nul + {%sinon on teste >0 puis else + \xintifboolexpr{\xinteval{#3} > 0}% + {% + \IfBooleanTF{#1}{}{+}% + \xintifboolexpr{\xinteval{#3} == 1}% + {#4}% + {\ConversionFraction[#2]{#3}#4}% + }% + {% + \xintifboolexpr{\xinteval{#3} == -1}% + {-#4\relax}% + {\ConversionFraction[#2]{#3}#4}% + }% + }% + }% + %sinon on met en brut + {% + #3#4 + }% +} + +\NewDocumentCommand\AffCoeffSgnSimpl{ s O{} m D<>{} }{% + \IfStrEq{#4}{}%si argument vide, on convertit en fraction + {% + \xintifboolexpr{\xinteval{#3} == 0}% + {}%on n'affiche rien si le coeff est nul + {%sinon on teste >0 puis else + \xintifboolexpr{\xinteval{#3} > 0}% + {% + \IfBooleanTF{#1}{}{+}% + \xintifboolexpr{\xinteval{#3} == 1}% + {#3}% + {+\ConversionFraction[#2]{#3}}% + }% + {% + \xintifboolexpr{\xinteval{#3} == -1}% + {#3\relax}% + {\ConversionFraction[#2]{#3}}% + } % + }% + }% + %sinon on met en brut + {% + #3 + }% +} + +\defKV[eqcartplan]{% + OptionCoeffs=\def\eqcartplformat{#1},% + Facteur=\def\eqcartplfact{#1} +} + +\setKVdefault[eqcartplan]{% + OptionCoeffs={d},% + SimplifCoeffs=false,% + Facteur=1 +} + +\NewDocumentCommand\TrouveEqCartPlan{ O{} r() r() d() }{%test commande générique avec VP ou PPP ou PVV + \restoreKV[eqcartplan]% revenir au valeurs par défaut + \setKV[eqcartplan]{#1}% lit les arguments optionnels + \IfNoValueTF{#4}%c'est Vect+Point + {% + \setsepchar{;}\readlist*\CoordVecNorm{#2}% + \setsepchar{,}\readlist*\CoordPt{#3}% + \itemtomacro\CoordVecNorm[1]\vecnx% + \itemtomacro\CoordVecNorm[2]\vecny% + \itemtomacro\CoordVecNorm[3]\vecnz% + \itemtomacro\CoordPt[1]\xpta% + \itemtomacro\CoordPt[2]\ypta% + \itemtomacro\CoordPt[3]\zpta% + %calculs + \xdef\coeffd{-((\xpta)*(\vecnx)+(\ypta)*(\vecny)+(\zpta)*(\vecnz))}% + \xdef\PPCMDenom{\xinteval{lcm([\xintDenominator{\xintIrr{\xinteval{\vecnx}}},\xintDenominator{\xintIrr{\xinteval{\vecny}}},\xintDenominator{\xintIrr{\xinteval{\vecnz}}},\xintDenominator{\xintIrr{\xinteval{\coeffd}}}])}}% + \xdef\PGCDsiEntiers{1}% + \xintifboolexpr{\xinteval{isint(\vecnx)}*\xinteval{isint(\vecny)}*\xinteval{isint(\vecnz)}*\xinteval{isint(\coeffd)} == 1}%tous les coeffs sont entiers + {% + \xdef\PGCDsiEntiers{\xinteval{gcd([\xinteval{\vecnx},\xinteval{\vecny},\xinteval{\vecnz},\xinteval{\coeffd}])}}% + }% + {}% + %affichages + \ifboolKV[eqcartplan]{SimplifCoeffs}% + {% + \AffCoeffSgn*[\eqcartplformat]{(\vecnx)*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartplformat]{(\vecny)*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgn[\eqcartplformat]{(\vecnz)*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{z} \AffCoeffSgnSimpl*[\eqcartplformat]{\coeffd*\PPCMDenom/\PGCDsiEntiers} = 0% + }% + {% + \AffCoeffSgn*[\eqcartplformat]{\vecnx}{x} \AffCoeffSgn[\eqcartplformat]{\vecny}{y} \AffCoeffSgn[\eqcartplformat]{\vecnz}{z} \AffCoeffSgnSimpl*[\eqcartplformat]{\coeffd} = 0% + }% + }%sinon c'est Point+Point+Point ou vectdir+vectdir+point + {% + \IfSubStr{#2}{,}%c'est point+point+point + {% + \setsepchar{,}\readlist*\CoordPtA{#2}% + \setsepchar{,}\readlist*\CoordPtB{#3}% + \setsepchar{,}\readlist*\CoordPtC{#4}% + \itemtomacro\CoordPtA[1]\ptxa% + \itemtomacro\CoordPtA[2]\ptya% + \itemtomacro\CoordPtA[3]\ptza% + \itemtomacro\CoordPtB[1]\ptxb% + \itemtomacro\CoordPtB[2]\ptyb% + \itemtomacro\CoordPtB[3]\ptzb% + \itemtomacro\CoordPtC[1]\ptxc% + \itemtomacro\CoordPtC[2]\ptyc% + \itemtomacro\CoordPtC[3]\ptzc% + %calculs + \xdef\vecxab{(\ptxb-\ptxa)}% + \xdef\vecyab{(\ptyb-\ptya)}% + \xdef\veczab{(\ptzb-\ptza)}% + \xdef\vecxac{(\ptxc-\ptxa)}% + \xdef\vecyac{(\ptyc-\ptya)}% + \xdef\veczac{(\ptzc-\ptza)}% + %coeffs a/b/c + \xdef\coeffa{(\vecyab*\veczac-\veczab*\vecyac)}% + \xdef\coeffb{(\vecxac*\veczab-\vecxab*\veczac)}% + \xdef\coeffc{(\vecxab*\vecyac-\vecxac*\vecyab)}% + %coeffd + \xdef\coeffd{(-(\ptxa)*\vecyab*\veczac-(\ptza)*\vecxab*\vecyac-(\ptya)*\vecxac*\veczab+(\ptza)*\vecyab*\vecxac+(\ptxa)*\veczab*\vecyac+(\ptya)*\vecxab*\veczac)}% + %pour simplifier + \xdef\PPCMDenom{\xinteval{lcm([\xintDenominator{\xintIrr{\xinteval{\coeffa}}},\xintDenominator{\xintIrr{\xinteval{\coeffb}}},\xintDenominator{\xintIrr{\xinteval{\coeffc}}},\xintDenominator{\xintIrr{\xinteval{\coeffd}}}])}}% + \xdef\PGCDsiEntiers{1}% + \xintifboolexpr{\xinteval{isint(\coeffa)}*\xinteval{isint(\coeffb)}*\xinteval{isint(\coeffc)}*\xinteval{isint(\coeffd)} == 1}%tous les coeffs sont entiers + {% + \xdef\PGCDsiEntiers{\xinteval{gcd([\xinteval{\coeffa},\xinteval{\coeffb},\xinteval{\coeffc},\xinteval{\coeffd}])}}% + }% + {}% + %affichages + \ifboolKV[eqcartplan]{SimplifCoeffs}% + {% + \AffCoeffSgn*[\eqcartplformat]{\coeffa*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartplformat]{\coeffb*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgn[\eqcartplformat]{\coeffc*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{z} \AffCoeffSgnSimpl*[\eqcartplformat]{\coeffd*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers} = 0% + }% + {% + \AffCoeffSgn*[\eqcartplformat]{\coeffa}{x} \AffCoeffSgn[\eqcartplformat]{\coeffb}{y} \AffCoeffSgn[\eqcartplformat]{\coeffc}{z} \AffCoeffSgnSimpl*[\eqcartplformat]{\coeffd} = 0% + }% + }% + {% + \setsepchar{;}\readlist*\CoordVecA{#2}% + \setsepchar{;}\readlist*\CoordVecB{#3}% + \setsepchar{,}\readlist*\CoordPtC{#4}% + \itemtomacro\CoordVecA[1]\vecxab% + \itemtomacro\CoordVecA[2]\vecyab% + \itemtomacro\CoordVecA[3]\veczab% + \itemtomacro\CoordVecB[1]\vecxac% + \itemtomacro\CoordVecB[2]\vecyac% + \itemtomacro\CoordVecB[3]\veczac% + \itemtomacro\CoordPtC[1]\ptxc% + \itemtomacro\CoordPtC[2]\ptyc% + \itemtomacro\CoordPtC[3]\ptzc% + %coeff a/b/c + \xdef\coeffa{((\vecyab)*(\veczac)-(\vecyac)*(\veczab))}% + \xdef\coeffb{((\veczab)*(\vecxac)-(\veczac)*(\vecxab))}% + \xdef\coeffc{((\vecxab)*(\vecyac)-(\vecxac)*(\vecyab))}% + %coeffd + \xdef\coeffd{-((\ptxc)*\coeffa+(\ptyc)*\coeffb+(\ptzc)*\coeffc)}% + %pour simplifier + \xdef\PPCMDenom{\xinteval{lcm([\xintDenominator{\xintIrr{\xinteval{\coeffa}}},\xintDenominator{\xintIrr{\xinteval{\coeffb}}},\xintDenominator{\xintIrr{\xinteval{\coeffc}}},\xintDenominator{\xintIrr{\xinteval{\coeffd}}}])}}% + \xdef\PGCDsiEntiers{1}% + \xintifboolexpr{\xinteval{isint(\coeffa)}*\xinteval{isint(\coeffb)}*\xinteval{isint(\coeffc)}*\xinteval{isint(\coeffd)} == 1}%tous les coeffs sont entiers + {% + \xdef\PGCDsiEntiers{\xinteval{gcd([\xinteval{\coeffa},\xinteval{\coeffb},\xinteval{\coeffc},\xinteval{\coeffd}])}}% + }% + {}% + %affichages + \ifboolKV[eqcartplan]{SimplifCoeffs}% + {% + \AffCoeffSgn*[\eqcartplformat]{\coeffa*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartplformat]{\coeffb*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgn[\eqcartplformat]{\coeffc*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers}{z} \AffCoeffSgnSimpl*[\eqcartplformat]{\coeffd*(\eqcartplfact)*\PPCMDenom/\PGCDsiEntiers} = 0% + }% + {% + \AffCoeffSgn*[\eqcartplformat]{\coeffa}{x} \AffCoeffSgn[\eqcartplformat]{\coeffb}{y} \AffCoeffSgn[\eqcartplformat]{\coeffc}{z} \AffCoeffSgnSimpl*[\eqcartplformat]{\coeffd} = 0% + }% + }% + }% +} + +\defKV[eqcartdroite]{% + OptionCoeffs=\def\eqcartdteformat{#1},% + Facteur=\def\eqcartdtefact{#1} +} + +\setKVdefault[eqcartdroite]{% + OptionCoeffs={d},% + SimplifCoeffs=false,% + VectDirecteur=false,% + Facteur=1 +} + +\NewDocumentCommand\TrouveEqCartDroite{ O{} r() r() }{%vect/point ou point/point + \restoreKV[eqcartdroite]% revenir au valeurs par défaut + \setKV[eqcartdroite]{#1}% lit les arguments optionnels + %on teste si c'est point/point + \IfSubStr{#2}{;}%c'est vecteur+point, sinon c'est point+point + {% + \setsepchar{;}\readlist*\CoordVec{#2}% + \setsepchar{,}\readlist*\CoordPt{#3}% + \itemtomacro\CoordVec[1]\vecnx% + \itemtomacro\CoordVec[2]\vecny% + \itemtomacro\CoordPt[1]\xpta% + \itemtomacro\CoordPt[2]\ypta% + %calculs + \ifboolKV[eqcartdroite]{VectDirecteur}% + {% + \xdef\coeffd{((\xpta)*(\vecny)-(\ypta)*(\vecnx))}% + }% + {% + \xdef\coeffd{-((\xpta)*(\vecnx)+(\ypta)*(\vecny))}% + }% + \xdef\PPCMDenom{\xinteval{lcm([\xintDenominator{\xintIrr{\xinteval{\vecnx}}},\xintDenominator{\xintIrr{\xinteval{\vecny}}},\xintDenominator{\xintIrr{\xinteval{\coeffd}}}])}}% + \xdef\PGCDsiEntiers{1}% + \xintifboolexpr{\xinteval{isint(\vecnx)}*\xinteval{isint(\vecny)}*\xinteval{isint(\coeffd)} == 1}%tous les coeffs sont entiers + {% + \xdef\PGCDsiEntiers{\xinteval{gcd([\xinteval{\vecnx},\xinteval{\vecny},\xinteval{\coeffd}])}}% + }% + {}% + %affichages + \ifboolKV[eqcartdroite]{SimplifCoeffs}% + {% + \ifboolKV[eqcartdroite]{VectDirecteur}% + {% + \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecnx)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers} = 0% + }% + {% + \AffCoeffSgn*[\eqcartdteformat]{(\vecnx)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecny)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers} = 0% + }% + }% + {% + \ifboolKV[eqcartdroite]{VectDirecteur}% + {% + \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)}{x} \AffCoeffSgn[\eqcartdteformat]{\vecnx}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd} = 0% + }% + {% + \AffCoeffSgn*[\eqcartdteformat]{\vecnx}{x} \AffCoeffSgn[\eqcartdteformat]{\vecny}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd} = 0% + }% + }% + }% + {% + \setsepchar{,}\readlist*\CoordPtA{#2}% + \setsepchar{,}\readlist*\CoordPtB{#3}% + \itemtomacro\CoordPtA[1]\xpta% + \itemtomacro\CoordPtA[2]\ypta% + \itemtomacro\CoordPtB[1]\xptb% + \itemtomacro\CoordPtB[2]\yptb% + \xdef\vecnx{((\xptb)-(\xpta))}% + \xdef\vecny{((\yptb)-(\ypta))}% + %calculs + \xdef\coeffd{((\xpta)*(\vecny)-(\ypta)*(\vecnx))}% + \xdef\PPCMDenom{\xinteval{lcm([\xintDenominator{\xintIrr{\xinteval{\vecnx}}},\xintDenominator{\xintIrr{\xinteval{\vecny}}},\xintDenominator{\xintIrr{\xinteval{\coeffd}}}])}}% + \xdef\PGCDsiEntiers{1}% + \xintifboolexpr{\xinteval{isint(\vecnx)}*\xinteval{isint(\vecny)}*\xinteval{isint(\coeffd)} == 1}%tous les coeffs sont entiers + {% + \xdef\PGCDsiEntiers{\xinteval{gcd([\xinteval{\vecnx},\xinteval{\vecny},\xinteval{\coeffd}])}}% + }% + {}% + %affichages + \ifboolKV[eqcartdroite]{SimplifCoeffs}% + {% + \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecnx)*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd*(\eqcartdtefact)*\PPCMDenom/\PGCDsiEntiers} = 0% + }% + {% + \AffCoeffSgn*[\eqcartdteformat]{-(\vecny)}{x} \AffCoeffSgn[\eqcartdteformat]{(\vecnx)}{y} \AffCoeffSgnSimpl*[\eqcartdteformat]{\coeffd} = 0% + }% + }% +} + +\NewDocumentCommand\AffVecteur{ O{d} D<>{} r() }{% + \setsepchar{;}\readlist*\CoordVec{#3}% + \xintifboolexpr{\CoordVeclen == 2}% + {% + \IfSubStr{#1}{;}%si l'option est globale... + {% + \setsepchar{;}\readlist*\OptVec{#1}% + \itemtomacro\OptVec[1]\optvecx% + \itemtomacro\OptVec[2]\optvecy% + }% + {% + \xdef\optvecx{#1}\xdef\optvecy{#1}% + }% + \itemtomacro\CoordVec[1]\vecx% + \itemtomacro\CoordVec[2]\vecy% + \begin{pNiceMatrix}[#2] \ConversionFraction[\optvecx]{\vecx} \\ \ConversionFraction[\optvecy]{\vecy} \end{pNiceMatrix}% + }% + {}% + \xintifboolexpr{\CoordVeclen == 3}% + {% + \IfSubStr{#1}{;}%si l'option est globale... + {% + \setsepchar{;}\readlist*\OptVec{#1}% + \itemtomacro\OptVec[1]\optvecx% + \itemtomacro\OptVec[2]\optvecy% + \itemtomacro\OptVec[3]\optvecz% + }% + {% + \xdef\optvecx{#1}\xdef\optvecy{#1}\xdef\optvecz{#1}% + }% + \itemtomacro\CoordVec[1]\vecx% + \itemtomacro\CoordVec[2]\vecy% + \itemtomacro\CoordVec[3]\vecz% + \begin{pNiceMatrix}[#2] \ConversionFraction[\optvecx]{\vecx} \\ \ConversionFraction[\optvecy]{\vecy} \\ \ConversionFraction[\optvecz]{\vecz} \end{pNiceMatrix}% + }% + {}% +} + +\NewDocumentCommand\AffPoint{ O{d} r() }{% + \setsepchar{,} + \readlist*\CoordPt{#2}% + \xintifboolexpr{\CoordPtlen == 2}% + {% + \IfSubStr{#1}{,}%si l'option est globale... + {% + \setsepchar{,}\readlist*\OptPt{#1}% + \itemtomacro\OptPt[1]\optptx% + \itemtomacro\OptPt[2]\optpty% + }% + {% + \xdef\optptx{#1}\xdef\optpty{#1}% + }% + \itemtomacro\CoordPt[1]\ptx% + \itemtomacro\CoordPt[2]\pty% + \left( \ConversionFraction[\optptx]{\ptx} ; \ConversionFraction[\optpty]{\pty} \right)% + }% + {}% + \xintifboolexpr{\CoordPtlen == 3}% + {% + \IfSubStr{#1}{,}%si l'option est globale... + {% + \setsepchar{,}\readlist*\OptPt{#1}% + \itemtomacro\OptPt[1]\optptx% + \itemtomacro\OptPt[2]\optpty% + \itemtomacro\OptPt[3]\optptz% + }% + {% + \xdef\optptx{#1}\xdef\optpty{#1}\xdef\optptz{#1}% + }% + \itemtomacro\CoordPt[1]\ptx% + \itemtomacro\CoordPt[2]\pty% + \itemtomacro\CoordPt[3]\ptz% + \left( \ConversionFraction[\optptx]{\ptx} ; \ConversionFraction[\optpty]{\pty} ; \ConversionFraction[\optptz]{\ptz} \right)% + }% + {}% +} + +%%Équation paramétrique de droite +\defKV[eqparamdroite]{% + OptionCoeffs=\def\eqparamdteformat{#1},% + Reel=\def\eqparamdtereel{#1} +} + +\setKVdefault[eqparamdroite]{% + OptionCoeffs={d},% + Reel=k,% + Aligne=false,% + Oppose=false,% + Rgras=false +} + +\NewDocumentCommand\AffVarDteParam{ m m }{% + \xdef\restmp{\ConversionFraction[\eqparamdteformat]{#1} \AffCoeffSgn[\eqcartdteformat]{#2}{\eqparamdtereel}}% + \xintifboolexpr{\xinteval{#1} == 0 'and' \xinteval{#2} == 0}{\xdef\restmp{0}}{}% + \xintifboolexpr{\xinteval{#1} == 0 'and' \xinteval{#2} != 0}{\xdef\restmp{\AffCoeffSgn*[\eqcartdteformat]{#2}{\eqparamdtereel}}}{}% + \restmp% +} + +\NewDocumentCommand\AffVarDteParamAlign{ m m }{% + \xdef\restmp{\ConversionFraction[\eqparamdteformat]{#1} & \AffCoeffSgn[\eqcartdteformat]{#2}{\eqparamdtereel}}% + \xintifboolexpr{\xinteval{#1} == 0 'and' \xinteval{#2} == 0}{\xdef\restmp{0 & }}{}% + \xintifboolexpr{\xinteval{#1} == 0 'and' \xinteval{#2} != 0}{\xdef\restmp{ & \AffCoeffSgn*[\eqcartdteformat]{#2}{\eqparamdtereel}}}{}% + \restmp% +} + +\NewDocumentCommand\TrouveEqParamDroite{ O{} r() r() }{%vect/point ou point/point + \restoreKV[eqparamdroite]% revenir au valeurs par défaut + \setKV[eqparamdroite]{#1}% lit les arguments optionnels + %on teste si c'est point/point + \IfSubStr{#2}{;}%c'est vecteur+point, sinon c'est point+point + {% + \setsepchar{;}\readlist*\CoordVec{#2}% + \setsepchar{,}\readlist*\CoordPt{#3}% + \itemtomacro\CoordVec[1]\vecdirx% + \itemtomacro\CoordVec[2]\vecdiry% + \itemtomacro\CoordVec[3]\vecdirz% + \itemtomacro\CoordPt[1]\xpta% + \itemtomacro\CoordPt[2]\ypta% + \itemtomacro\CoordPt[3]\zpta% + }% + {% + \setsepchar{,}\readlist*\CoordPtA{#2}% + \setsepchar{,}\readlist*\CoordPtB{#3}% + \itemtomacro\CoordPtA[1]\xpta% + \itemtomacro\CoordPtA[2]\ypta% + \itemtomacro\CoordPtA[2]\zpta% + \itemtomacro\CoordPtB[1]\xptb% + \itemtomacro\CoordPtB[2]\yptb% + \itemtomacro\CoordPtB[2]\zptb% + \ifboolKV[eqparamdroite]{Oppose}% + {% + \xdef\vecdirx{((\xpta)-(\xptb))}% + \xdef\vecdiry{((\ypta)-(\yptb))}% + \xdef\vecdirz{((\zpta)-(\zptb))}% + }% + {% + \xdef\vecdirx{((\xptb)-(\xpta))}% + \xdef\vecdiry{((\yptb)-(\ypta))}% + \xdef\vecdirz{((\zptb)-(\zpta))}% + }% + }% + \ifboolKV[eqparamdroite]{Aligne}% + {% + \left\lbrace\begin{array}{@{\,}l@{\;=\;}l@{\;}r} + x & \AffVarDteParamAlign{\xpta}{\vecdirx} \\ + y & \AffVarDteParamAlign{\ypta}{\vecdiry} \\ + z & \AffVarDteParamAlign{\zpta}{\vecdirz} \\ + \end{array}\right. + \text{, } \eqparamdtereel \in \ifboolKV[eqparamdroite]{Rgras}{\textbf{R}}{\mathbb{R}}% + }% + {% + \begin{dcases} + x = \AffVarDteParam{\xpta}{\vecdirx} \\ + y = \AffVarDteParam{\ypta}{\vecdiry} \\ + z = \AffVarDteParam{\zpta}{\vecdirz} \\ + \end{dcases} + \text{, } \eqparamdtereel \in \ifboolKV[eqparamdroite]{Rgras}{\textbf{R}}{\mathbb{R}}% + }% +} + +\NewDocumentCommand\TrouveDistancePtPlan{ r() r() d() }{%pt+vect+pt + \IfNoValueTF{#3}%c'est Point + Equation // sinon c'est point + vectnorm + point + {% + \StrDel{#2}{=0}[\tmpeq]% + %%\tmpeq \text{ et }% + \setsepchar{,}\readlist*\CoordPtA{#1}% + \itemtomacro\CoordPtA[1]\xa% + \itemtomacro\CoordPtA[2]\ya% + \itemtomacro\CoordPtA[3]\za%. + %calcul de d + \StrSubstitute{\tmpeq}{x}{(0)}[\tmpcoeffd]% + \StrSubstitute{\tmpcoeffd}{y}{(0)}[\tmpcoeffd]% + \StrSubstitute{\tmpcoeffd}{z}{(0)}[\tmpcoeffd]% + \xdef\coeffd{\tmpcoeffd}% + %%d=\xinteval{\coeffd} \text{ et }% + %calcul de a + \StrSubstitute{\tmpeq}{x}{(1)}[\tmpcoeffa]% + \StrSubstitute{\tmpcoeffa}{y}{(0)}[\tmpcoeffa]% + \StrSubstitute{\tmpcoeffa}{z}{(0)}[\tmpcoeffa]% + \xdef\vectx{(\tmpcoeffa)-(\coeffd)}% + %%a=\xinteval{\vectx} \text{ et }% + %calcul de b + \StrSubstitute{\tmpeq}{x}{(0)}[\tmpcoeffb]% + \StrSubstitute{\tmpcoeffb}{y}{(1)}[\tmpcoeffb]% + \StrSubstitute{\tmpcoeffb}{z}{(0)}[\tmpcoeffb]% + \xdef\vecty{(\tmpcoeffb)-(\coeffd)}% + %%b=\xinteval{\vecty} \text{ et }% + %calcul de c + \StrSubstitute{\tmpeq}{x}{(0)}[\tmpcoeffc]% + \StrSubstitute{\tmpcoeffc}{y}{(0)}[\tmpcoeffc]% + \StrSubstitute{\tmpcoeffc}{z}{(1)}[\tmpcoeffc]% + \xdef\vectz{(\tmpcoeffc)-(\coeffd)}% + %c=\xinteval{\vectz} \text{ et }% + %calcul du numérateur + \StrSubstitute{\tmpeq}{x}{(\xa)}[\resnum]% + \StrSubstitute{\resnum}{y}{(\ya)}[\resnum]% + \StrSubstitute{\resnum}{z}{(\za)}[\resnum]% + %%\text{num}=\xinteval{\resnum} \text{ et } + %le carré + \xdef\restmp{(\resnum)**2/((\vectx)**2+(\vecty)**2+(\vectz)**2)}% + %%\text{resultatcarré}=\xinteval{\restmp} \text{ et }% + }% + {% + \setsepchar{,}\readlist*\CoordPtA{#1}% + \setsepchar{;}\readlist*\CoordVec{#2}% + \setsepchar{,}\readlist*\CoordPtB{#3}% + \itemtomacro\CoordPtA[1]\xa% + \itemtomacro\CoordPtA[2]\ya% + \itemtomacro\CoordPtA[3]\za% + \itemtomacro\CoordVec[1]\vectx% + \itemtomacro\CoordVec[2]\vecty% + \itemtomacro\CoordVec[3]\vectz% + \itemtomacro\CoordPtB[1]\xb% + \itemtomacro\CoordPtB[2]\yb% + \itemtomacro\CoordPtB[3]\zb% + \def\restmp{((\vectx)*((\xb)-(\xa))+(\vecty)*((\yb)-(\ya))+(\vectz)*((\zb)-(\za)))**2/((\vectx)**2+(\vecty)**2+(\vectz)**2)}% + }% + \SimplificationRacine{\restmp}% +} \endinput
\ No newline at end of file diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex index 270e99e3cc..2d7e0716e6 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex @@ -14,53 +14,53 @@ \xintFloatToDecimal{\xintfloateval{binomial(#1,#3)*#2^#3*(1-#2)^(#1-#3)}} } \newcommand\CalcBinomC[4]{%npab - \def\BorneInf{#3}\def\BorneSup{#4} + \def\BorneInf{#3}\def\BorneSup{#4}% \ifthenelse{\equal{#3}{*}}% - {\def\BorneInf{0}} - {} + {\def\BorneInf{0}}% + {}% \ifthenelse{\equal{#4}{*}}% - {\def\BorneSup{#1}} - {} - \xintFloatToDecimal{\xintfloateval{add(binomial(#1,i)*#2^i*(1-#2)^(#1-i), i=\BorneInf..\BorneSup)}} + {\def\BorneSup{#1}}% + {}% + \xintFloatToDecimal{\xintfloateval{add(binomial(#1,i)*#2^i*(1-#2)^(#1-i), i=\BorneInf..\BorneSup)}}% } \newcommand\CalcGeomP[2]{%pk - \xintFloatToDecimal{\xintfloateval{(1-#1)^(#2-1)*(#1)}} + \xintFloatToDecimal{\xintfloateval{(1-#1)^(#2-1)*(#1)}}% } \newcommand\CalcGeomC[3]{%pab - \def\BorneInf{#2}\def\BorneSup{#3} + \def\BorneInf{#2}\def\BorneSup{#3}% \ifthenelse{\equal{#2}{*}}% - {\def\BorneInf{1}} - {} + {\def\BorneInf{1}}% + {}% \ifthenelse{\equal{#3}{*}}% - {\def\BorneSup{\fpeval{trunc(1/#1*10,0)}}} - {} - \xintFloatToDecimal{\xintfloateval{add((1-#1)^(i-1)*(#1), i=\BorneInf..\BorneSup)}} + {\def\BorneSup{\fpeval{trunc(1/#1*10,0)}}}% + {}% + \xintFloatToDecimal{\xintfloateval{add((1-#1)^(i-1)*(#1), i=\BorneInf..\BorneSup)}}% } \newcommand\CalcHypergeomP[4]{%Nnmk - \xintFloatToDecimal{\xintfloateval{binomial(#3,#4)*binomial(#1-#3,#2-#4)/binomial(#1,#2)}} + \xintFloatToDecimal{\xintfloateval{binomial(#3,#4)*binomial(#1-#3,#2-#4)/binomial(#1,#2)}}% } \newcommand\CalcHypergeomC[5]{%Nnmab - \def\BorneInf{#4}\def\BorneSup{#5} + \def\BorneInf{#4}\def\BorneSup{#5}% \ifthenelse{\equal{#4}{*}}% - {\def\BorneInf{0}} - {} + {\def\BorneInf{0}}% + {}% \ifthenelse{\equal{#5}{*}}% - {\def\BorneSup{#1}} - {} - \xintFloatToDecimal{\xintfloateval{add(binomial(#3,i)*binomial(#1-#3,#2-i)/binomial(#1,#2), i=\BorneInf..\BorneSup)}} + {\def\BorneSup{#1}}% + {}% + \xintFloatToDecimal{\xintfloateval{add(binomial(#3,i)*binomial(#1-#3,#2-i)/binomial(#1,#2), i=\BorneInf..\BorneSup)}}% } \newcommand\CalcPoissP[2]{%lk - \xintFloatToDecimal{\xintfloateval{exp(-#1)*#1^#2/factorial(#2)}} + \xintFloatToDecimal{\xintfloateval{exp(-#1)*#1^#2/factorial(#2)}}% } \newcommand\CalcPoissC[3]{%lab - \def\BorneInf{#2}\def\BorneSup{#3} + \def\BorneInf{#2}\def\BorneSup{#3}% \ifthenelse{\equal{#2}{*}}% - {\def\BorneInf{0}} - {} + {\def\BorneInf{0}}% + {}% \ifthenelse{\equal{#3}{*}}% - {\def\BorneSup{10*#1}} - {} - \xintFloatToDecimal{\xintfloateval{add(exp(-#1)*#1^i/factorial(i), i=\BorneInf..\BorneSup)}} + {\def\BorneSup{10*#1}}% + {}% + \xintFloatToDecimal{\xintfloateval{add(exp(-#1)*#1^i/factorial(i), i=\BorneInf..\BorneSup)}}% } %utiles idée de https://tex.stackexchange.com/questions/355574/im-searching-for-a-table-with-cdf-of-standard-normal-distribution \xintdeffloatvar a_1,a_2,a_3,a_4,a_5,a_6 := @@ -72,170 +72,170 @@ \newcommand\CalcNormC[4]{%msab %def des bornes de l'intervalle suivant l'absence de a ou de b... - \def\BorneInf{#3}\def\BorneSup{#4} + \def\BorneInf{#3}\def\BorneSup{#4}% \ifthenelse{\equal{#3}{*}}% - {\def\BorneInf{#4-10*#2}} - {} + {\def\BorneInf{#4-10*#2}}% + {}% \ifthenelse{\equal{#4}{*}}% - {\def\BorneSup{#3+10*#2}} - {} - \xintFloatToDecimal{\xintfloateval{Phi((\BorneSup-#1)/#2)-Phi((\BorneInf-#1)/#2)}} + {\def\BorneSup{#3+10*#2}}% + {}% + \xintFloatToDecimal{\xintfloateval{Phi((\BorneSup-#1)/#2)-Phi((\BorneInf-#1)/#2)}}% } %calculs "simples" fiabilite \newcommand\CalcExpoC[3]{%lab \def\BorneInf{#2}\def\BorneSup{#3} \ifthenelse{\equal{#2}{*}}% - {\def\BorneInf{0}} - {} + {\def\BorneInf{0}}% + {}% \ifthenelse{\equal{#3}{*}}% - {\def\BorneSup{100/#1}} - {} - \xintFloatToDecimal{\xintfloateval{exp(-#1*\BorneInf)-exp(-#1*\BorneSup)}} + {\def\BorneSup{100/#1}}% + {}% + \xintFloatToDecimal{\xintfloateval{exp(-#1*\BorneInf)-exp(-#1*\BorneSup)}}% } %calculs formatés \NewDocumentCommand{\BinomP}{ s O{3} m m m }{%*=sci,2=prec,3=n,4=p,5=k \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(binomial(#3,#5)*#4^#5*(1-#4)^(#3-#5),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(binomial(#3,#5)*#4^#5*(1-#4)^(#3-#5),#2)}}}% }% {% - \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(binomial(#3,#5)*#4^#5*(1-#4)^(#3-#5),#2)}}} - } + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(binomial(#3,#5)*#4^#5*(1-#4)^(#3-#5),#2)}}}% + }% } \NewDocumentCommand{\BinomC}{ s O{3} m m m m }{%*=sci,2=prec,3=n,4=p,5=a,6=b - \def\BorneInf{#5}\def\BorneSup{#6} + \def\BorneInf{#5}\def\BorneSup{#6}% \ifthenelse{\equal{#5}{*}}% - {\def\BorneInf{0}} - {} + {\def\BorneInf{0}}% + {}% \ifthenelse{\equal{#6}{*}}% - {\def\BorneSup{#3}} - {} + {\def\BorneSup{#3}}% + {}% \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#3,i)*#4^i*(1-#4)^(#3-i), i=\BorneInf..\BorneSup),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#3,i)*#4^i*(1-#4)^(#3-i), i=\BorneInf..\BorneSup),#2)}}}% }% {% - \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#3,i)*#4^i*(1-#4)^(#3-i), i=\BorneInf..\BorneSup),#2)}}} - } + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#3,i)*#4^i*(1-#4)^(#3-i), i=\BorneInf..\BorneSup),#2)}}}% + }% } \NewDocumentCommand{\GeomP}{ s O{3} m m }{%*=sci,2=prec,3=p,4=k \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round((1-#3)^(#4-1)*(#3),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round((1-#3)^(#4-1)*(#3),#2)}}}% }% {% - \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round((1-#3)^(#4-1)*(#3),#2)}}} - } + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round((1-#3)^(#4-1)*(#3),#2)}}}% + }% } \NewDocumentCommand{\GeomC}{ s O{3} m m m }{%*=sci,2=prec,3=p,4=a,5=b - \def\BorneInf{#4}\def\BorneSup{#5} + \def\BorneInf{#4}\def\BorneSup{#5}% \ifthenelse{\equal{#4}{*}}% - {\def\BorneInf{1}} - {} + {\def\BorneInf{1}}% + {}% \ifthenelse{\equal{#5}{*}}% - {\def\BorneSup{\fpeval{trunc(1/#3*10,0)}}} - {} + {\def\BorneSup{\fpeval{trunc(1/#3*10,0)}}}% + {}% \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add((1-#3)^(i-1)*(#3), i=\BorneInf..\BorneSup),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add((1-#3)^(i-1)*(#3), i=\BorneInf..\BorneSup),#2)}}}% }% {% - \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add((1-#3)^(i-1)*(#3), i=\BorneInf..\BorneSup),#2)}}} + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add((1-#3)^(i-1)*(#3), i=\BorneInf..\BorneSup),#2)}}}% } } \NewDocumentCommand{\HypergeomP}{ s O{3} m m m m }{%*=sci,2=prec,3=N,4=n,5=m,6=k \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(binomial(#5,#6)*binomial(#3-#5,#4-#6)/binomial(#3,#4),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(binomial(#5,#6)*binomial(#3-#5,#4-#6)/binomial(#3,#4),#2)}}}% }% {% - \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(binomial(#5,#6)*binomial(#3-#5,#4-#6)/binomial(#3,#4),#2)}}} + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(binomial(#5,#6)*binomial(#3-#5,#4-#6)/binomial(#3,#4),#2)}}}% } } \NewDocumentCommand{\HypergeomC}{ s O{3} m m m m m }{%*=sci,2=prec,3=N,4=n,5=m,6=a,7=b - \def\BorneInf{#6}\def\BorneSup{#7} + \def\BorneInf{#6}\def\BorneSup{#7}% \ifthenelse{\equal{#6}{*}}% - {\def\BorneInf{0}} - {} + {\def\BorneInf{0}}% + {}% \ifthenelse{\equal{#7}{*}}% - {\def\BorneSup{#3}} - {} + {\def\BorneSup{#3}}% + {}% \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#5,i)*binomial(#3-#5,#4-i)/binomial(#3,#4), i=\BorneInf..\BorneSup),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#5,i)*binomial(#3-#5,#4-i)/binomial(#3,#4), i=\BorneInf..\BorneSup),#2)}}}% }% {% \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#5,i)*binomial(#3-#5,#4-i)/binomial(#3,#4), i=\BorneInf..\BorneSup),#2)}}} - } + }% } \NewDocumentCommand{\PoissonP}{ s O{3} m m }{%*=sci,2=prec,3=lbda,4=k \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3)*#3^#4/factorial(#4),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3)*#3^#4/factorial(#4),#2)}}}% }% {% - \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3)*#3^#4/factorial(#4),#2)}}} - } + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3)*#3^#4/factorial(#4),#2)}}}% + }% } \NewDocumentCommand{\PoissonC}{ s O{3} m m m }{%*=ing,2=prec,3=lbda,4=a,5=b - \def\BorneInf{#4}\def\BorneSup{#5} + \def\BorneInf{#4}\def\BorneSup{#5}% \ifthenelse{\equal{#4}{*}}% - {\def\BorneInf{0}} - {} + {\def\BorneInf{0}}% + {}% \ifthenelse{\equal{#5}{*}}% - {\def\BorneSup{10*#3}} - {} + {\def\BorneSup{10*#3}}% + {}% \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(exp(-#3)*#3^i/factorial(i), i=\BorneInf..\BorneSup),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(exp(-#3)*#3^i/factorial(i), i=\BorneInf..\BorneSup),#2)}}}% }% {% - \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(exp(-#3)*#3^i/factorial(i), i=\BorneInf..\BorneSup),#2)}}} - } + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(exp(-#3)*#3^i/factorial(i), i=\BorneInf..\BorneSup),#2)}}}% + }% } \NewDocumentCommand{\NormaleC}{ s O{3} m m m m }{% %*=ing,2=prec,3=mu,4=sigma,5=a,6=b %def des bornes de l'intervalle suivant l'absence de a ou de b... - \def\BorneInf{#5}\def\BorneSup{#6} + \def\BorneInf{#5}\def\BorneSup{#6}% \ifthenelse{\equal{#5}{*}}% - {\def\BorneInf{#6-10*#4}} - {} + {\def\BorneInf{#6-10*#4}}% + {}% \ifthenelse{\equal{#6}{*}}% - {\def\BorneSup{#5+10*#4}} - {} + {\def\BorneSup{#5+10*#4}}% + {}% \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(Phi((\BorneSup-#3)/#4)-Phi((\BorneInf-#3)/#4),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(Phi((\BorneSup-#3)/#4)-Phi((\BorneInf-#3)/#4),#2)}}}% }% {% - \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(Phi((\BorneSup-#3)/#4)-Phi((\BorneInf-#3)/#4),#2)}}} - } + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(Phi((\BorneSup-#3)/#4)-Phi((\BorneInf-#3)/#4),#2)}}}% + }% } \NewDocumentCommand{\ExpoC}{ s O{3} m m m }{%*=ing,2=prec,3=lbda,4=a,5=b - \def\BorneInf{#4}\def\BorneSup{#5} + \def\BorneInf{#4}\def\BorneSup{#5}% \ifthenelse{\equal{#4}{*}}% - {\def\BorneInf{0}} - {} + {\def\BorneInf{0}}% + {}% \ifthenelse{\equal{#5}{*}}% - {\def\BorneSup{100/#3}} - {} + {\def\BorneSup{100/#3}}% + {}% \IfBooleanTF{#1}% {% - \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3*\BorneInf)-exp(-#3*\BorneSup),#2)}}} + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3*\BorneInf)-exp(-#3*\BorneSup),#2)}}}% }% {% \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintFloatToDecimal{\xintfloateval{round(exp(-#3*\BorneInf)-exp(-#3*\BorneSup),#2)}}}} - } + }% } %%------ARBRESPROBAS diff --git a/macros/latex/contrib/yb-book/LICENSE.txt b/macros/latex/contrib/yb-book/LICENSE.txt index bd949ffdab..5744f745f0 100644 --- a/macros/latex/contrib/yb-book/LICENSE.txt +++ b/macros/latex/contrib/yb-book/LICENSE.txt @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2021-2022 Yegor Bugayenko +Copyright (c) 2021-2023 Yegor Bugayenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal diff --git a/macros/latex/contrib/yb-book/yb-book.dtx b/macros/latex/contrib/yb-book/yb-book.dtx index 2ca33cb55e..49953412a4 100644 --- a/macros/latex/contrib/yb-book/yb-book.dtx +++ b/macros/latex/contrib/yb-book/yb-book.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % (The MIT License) % -% Copyright (c) 2021-2022 Yegor Bugayenko +% Copyright (c) 2021-2023 Yegor Bugayenko % % Permission is hereby granted, free of charge, to any person obtaining a copy % of this software and associated documentation files (the 'Software'), to deal @@ -50,11 +50,13 @@ %<class>\NeedsTeXFormat{LaTeX2e} %<class>\ProvidesClass{yb-book} %<*class> -[02.10.2022 0.2.0 YB Branded Book Style] +[19.05.20230 0.2.1 YB Branded Book Style] %</class> %<*driver> \documentclass{ltxdoc} \usepackage[tt=false, type1=true]{libertine} +\usepackage{microtype} +\AddToHook{env/verbatim/begin}{\microtypesetup{protrusion=false}} \usepackage{href-ul} \usepackage{graphicx} \PageIndex @@ -426,19 +428,18 @@ Hello, world! \fancyhf{} \fancyhead[L,C,LO,CO]{} \fancyhead[R,RO]{ - \begin{textblock}{4}(11.5,1)\begin{tikzpicture} - \node [color=gray, rotate=270, - font=\ttfamily\scriptsize, text width=5in] at (0,0) { + \begin{textblock}{4}(11.5,1) + \tikz \node [color=gray, rotate=270,font=\ttfamily\scriptsize, text width=5in] at (0,0) { Copyright \textcopyright{} \the\year{} by \theauthor{}. All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. This particular manuscript is - printed for \textbf{\thereviewer}} and may be used only + printed for \textbf{\thereviewer{}} and may be used only for one-time review. The manuscript has to be destroyed after the review. - }; - \end{tikzpicture}\end{textblock} + } + \end{textblock} } \fancyfoot[C,CO]{\small\ttfamily page \#\thepage{} of \pageref{LastPage}} diff --git a/macros/latex/contrib/yb-book/yb-book.ins b/macros/latex/contrib/yb-book/yb-book.ins index a84a03f901..e72072dbba 100644 --- a/macros/latex/contrib/yb-book/yb-book.ins +++ b/macros/latex/contrib/yb-book/yb-book.ins @@ -1,6 +1,6 @@ %% (The MIT License) %% -%% Copyright (c) 2021-2022 Yegor Bugayenko +%% Copyright (c) 2021-2023 Yegor Bugayenko %% %% Permission is hereby granted, free of charge, to any person obtaining a copy %% of this software and associated documentation files (the 'Software'), to deal @@ -26,7 +26,7 @@ \preamble (The MIT License) -Copyright (c) 2021-2022 Yegor Bugayenko +Copyright (c) 2021-2023 Yegor Bugayenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal @@ -48,8 +48,8 @@ SOFTWARE. \endpreamble \generate{\file{yb-book.cls}{\from{yb-book.dtx}{class}}} \obeyspaces -\Msg{*** To finish the installation you have to move the ".cls"} -\Msg{*** file into a directory searched by TeX. To produce the} -\Msg{*** documentation run the file ".dtx" through LaTeX. If any} -\Msg{*** questions, submit a new GitHub issue.} +\Msg{To finish the installation you have to move the ".cls"} +\Msg{file into a directory searched by TeX. To produce the} +\Msg{documentation run the file ".dtx" through LaTeX. If any} +\Msg{questions, submit a new GitHub issue.} \endbatchfile diff --git a/macros/latex/contrib/yb-book/yb-book.pdf b/macros/latex/contrib/yb-book/yb-book.pdf Binary files differindex fa56f44647..e12566d90c 100644 --- a/macros/latex/contrib/yb-book/yb-book.pdf +++ b/macros/latex/contrib/yb-book/yb-book.pdf |