From 6d6c3b4ee419b9f485a213d2ece28b06e9ca2f7c Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 20 May 2021 03:00:38 +0000 Subject: CTAN sync 202105200300 --- macros/latex/contrib/alterqcm/README.md | 55 + macros/latex/contrib/alterqcm/doc/article_post.pdf | Bin 0 -> 794330 bytes macros/latex/contrib/alterqcm/doc/doc-aq-main.pdf | Bin 0 -> 315801 bytes .../doc/latex/180px-Gustave_Moreau_007.jpg | Bin 0 -> 12450 bytes .../alterqcm/doc/latex/240px-Mort_du_fossoyeur.jpg | Bin 0 -> 22368 bytes .../doc/latex/The_Wounded_Angel_-_Hugo_Simberg.jpg | Bin 0 -> 43567 bytes .../contrib/alterqcm/doc/latex/doc-aq-def.tex | 177 + .../contrib/alterqcm/doc/latex/doc-aq-excomp.tex | 257 + .../contrib/alterqcm/doc/latex/doc-aq-first.tex | 67 + .../contrib/alterqcm/doc/latex/doc-aq-globales.tex | 758 + .../contrib/alterqcm/doc/latex/doc-aq-greek.tex | 53 + .../alterqcm/doc/latex/doc-aq-installation.tex | 57 + .../contrib/alterqcm/doc/latex/doc-aq-locales.tex | 130 + .../contrib/alterqcm/doc/latex/doc-aq-main.tex | 164 + .../latex/contrib/alterqcm/doc/latex/doc-aq-mc.tex | 209 + .../contrib/alterqcm/doc/latex/doc-aq-points.tex | 39 + .../contrib/alterqcm/doc/latex/doc-aq-problem.tex | 25 + .../latex/contrib/alterqcm/examples/iut/qcm-1.tex | 4 + .../latex/contrib/alterqcm/examples/iut/qcm-10.tex | 5 + .../latex/contrib/alterqcm/examples/iut/qcm-2.tex | 5 + .../latex/contrib/alterqcm/examples/iut/qcm-3.tex | 4 + .../latex/contrib/alterqcm/examples/iut/qcm-4.tex | 4 + .../latex/contrib/alterqcm/examples/iut/qcm-5.tex | 4 + .../latex/contrib/alterqcm/examples/iut/qcm-6.tex | 4 + .../latex/contrib/alterqcm/examples/iut/qcm-7.tex | 4 + .../latex/contrib/alterqcm/examples/iut/qcm-8.tex | 4 + .../latex/contrib/alterqcm/examples/iut/qcm-9.tex | 4 + .../alterqcm/examples/latex/AntillesESjuin2006.tex | 77 + .../latex/contrib/alterqcm/examples/latex/alea.tex | 31 + .../contrib/alterqcm/examples/latex/annexe.tex | 21 + .../contrib/alterqcm/examples/latex/correct.tex | 27 + .../contrib/alterqcm/examples/latex/example_2.tex | 36 + .../contrib/alterqcm/examples/latex/example_3.tex | 64 + .../alterqcm/examples/latex/lang_chinese.tex | 55 + .../alterqcm/examples/latex/lang_german.tex | 56 + .../contrib/alterqcm/examples/latex/language.tex | 90 + .../contrib/alterqcm/examples/latex/points.tex | 23 + .../latex/contrib/alterqcm/examples/latex/sep.tex | 31 + .../alterqcm/examples/latex/test_language.tex | 51 + .../alterqcm/examples/latex/transparent-final.tex | 40 + .../alterqcm/examples/latex/transparent-init.tex | 41 + .../latex/contrib/alterqcm/examples/latex/verb.tex | 150 + macros/latex/contrib/alterqcm/latex/alterqcm.sty | 683 + macros/latex/contrib/covington/README | 4 + macros/latex/contrib/covington/covington.pdf | Bin 486803 -> 487245 bytes macros/latex/contrib/covington/covington.sty | 8 +- macros/latex/contrib/covington/covington.tex | 21 +- macros/latex/contrib/easybook/easybook.dtx | 194 +- macros/latex/contrib/easybook/easybook.pdf | Bin 311905 -> 312209 bytes macros/latex/contrib/pgfmath-xfp/README.md | 30 + macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.dtx | 503 + macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.pdf | Bin 0 -> 260671 bytes macros/latex/contrib/pm-isomath/README.txt | 2 +- macros/latex/contrib/pm-isomath/pm-isomath.dtx | 451 +- macros/latex/contrib/pm-isomath/pm-isomath.pdf | Bin 624109 -> 653361 bytes macros/latex/contrib/powerdot/README | 100 +- .../contrib/powerdot/doc/lyx/powerdot-example.tex | 318 +- .../latex/contrib/powerdot/doc/lyx/powerdot.layout | 922 +- macros/latex/contrib/powerdot/doc/manifest.txt | 166 +- macros/latex/contrib/powerdot/doc/powerdot.pdf | Bin 545004 -> 546181 bytes .../latex/contrib/powerdot/run/powerdot-default.ps | 218 +- macros/latex/contrib/powerdot/source/powerdot.dtx | 17520 ++++++++++--------- macros/latex/contrib/projlib/ProjLib-doc-cn.pdf | Bin 221440 -> 222025 bytes macros/latex/contrib/projlib/ProjLib-doc-cn.tex | 110 +- macros/latex/contrib/projlib/ProjLib-doc-en.pdf | Bin 144643 -> 145010 bytes macros/latex/contrib/projlib/ProjLib-doc-en.tex | 110 +- macros/latex/contrib/projlib/ProjLib.dtx | 596 +- macros/latex/contrib/projlib/ProjLib.ins | 36 +- macros/latex/contrib/projlib/README.md | 30 +- macros/latex/contrib/siunitx/CHANGELOG.md | 20 +- macros/latex/contrib/siunitx/siunitx-code.pdf | Bin 1432693 -> 1437526 bytes macros/latex/contrib/siunitx/siunitx-emulation.dtx | 19 + macros/latex/contrib/siunitx/siunitx-emulation.pdf | Bin 0 -> 484705 bytes macros/latex/contrib/siunitx/siunitx-number.dtx | 19 +- macros/latex/contrib/siunitx/siunitx-symbol.dtx | 32 +- macros/latex/contrib/siunitx/siunitx-table.dtx | 67 +- macros/latex/contrib/siunitx/siunitx.dtx | 2 +- macros/latex/contrib/siunitx/siunitx.pdf | Bin 601047 -> 600972 bytes macros/latex/contrib/siunitx/siunitx.tex | 4 +- 79 files changed, 14666 insertions(+), 10345 deletions(-) create mode 100644 macros/latex/contrib/alterqcm/README.md create mode 100644 macros/latex/contrib/alterqcm/doc/article_post.pdf create mode 100644 macros/latex/contrib/alterqcm/doc/doc-aq-main.pdf create mode 100644 macros/latex/contrib/alterqcm/doc/latex/180px-Gustave_Moreau_007.jpg create mode 100644 macros/latex/contrib/alterqcm/doc/latex/240px-Mort_du_fossoyeur.jpg create mode 100644 macros/latex/contrib/alterqcm/doc/latex/The_Wounded_Angel_-_Hugo_Simberg.jpg create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-def.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-excomp.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-first.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-globales.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-greek.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-installation.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-locales.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-main.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-mc.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-points.tex create mode 100644 macros/latex/contrib/alterqcm/doc/latex/doc-aq-problem.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-1.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-10.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-2.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-3.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-4.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-5.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-6.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-7.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-8.tex create mode 100644 macros/latex/contrib/alterqcm/examples/iut/qcm-9.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/AntillesESjuin2006.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/alea.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/annexe.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/correct.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/example_2.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/example_3.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/lang_chinese.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/lang_german.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/language.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/points.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/sep.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/test_language.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/transparent-final.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/transparent-init.tex create mode 100644 macros/latex/contrib/alterqcm/examples/latex/verb.tex create mode 100644 macros/latex/contrib/alterqcm/latex/alterqcm.sty create mode 100644 macros/latex/contrib/pgfmath-xfp/README.md create mode 100644 macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.dtx create mode 100644 macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.pdf create mode 100644 macros/latex/contrib/siunitx/siunitx-emulation.pdf (limited to 'macros/latex/contrib') diff --git a/macros/latex/contrib/alterqcm/README.md b/macros/latex/contrib/alterqcm/README.md new file mode 100644 index 0000000000..c8c034d4da --- /dev/null +++ b/macros/latex/contrib/alterqcm/README.md @@ -0,0 +1,55 @@ +# alterqcm + +Release 4.42c 2021/05/17 + +## Purpose Description + +The 'alterqcm' package is a LaTeX2e package, for making Multiple Choices Questionnaires + in a table with two columns. The aim is to provide some useful macros to build + QCM in tables. These macros may be used by only LaTeX TeX users. + + +## Licence + +The packages may be modified and distributed under the terms and +conditions of the [LaTeX Project Public +License](https://www.latex-project.org/lppl/), version 1.3 or greater. + +## Installation + +You can experiment with the alterqcm package by placing all of the distribution + files in the directory containing your current tex file. + +You can also place all of the distribution files in the directory : +/texmf/tex/latex/tkz. + +## How to use it + +\usepackage[your-language]{alterqcm} if "your-language" is french, english, german, greek, russian, italian or chinese, It's possible to use the option "unknown" is "your-language" is not in the last list. + +## Features + +- A special environment allows you to define questions and possible answers; +- You can specify which answers are correct and which are not. +- works with utf8 and pdflatex and xelatex (with some languages); +- allows to use 'longtable'; +- makes automatically adjustment; +- generates a 'grid' that the students will have to fill in; +- generates a 'mask' with correct answers to print a slide. +- article_post.pdf is a file for Greek users. + + +## Documentation + +Documentation for `alterqcm` is available on CTAN and in your TeX distribution. The documentation is in English. + +## History + +- 4.41 and 4.42 Correction of bugs and addition of new languages. + +- 4.1 A fix in the definition of \AQquestion + +- 4.0 Added full linguistic support + +- 3.7 Correction of bug + add the macro \AQpoints \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/article_post.pdf b/macros/latex/contrib/alterqcm/doc/article_post.pdf new file mode 100644 index 0000000000..be3c103baa Binary files /dev/null and b/macros/latex/contrib/alterqcm/doc/article_post.pdf differ diff --git a/macros/latex/contrib/alterqcm/doc/doc-aq-main.pdf b/macros/latex/contrib/alterqcm/doc/doc-aq-main.pdf new file mode 100644 index 0000000000..056e1885e2 Binary files /dev/null and b/macros/latex/contrib/alterqcm/doc/doc-aq-main.pdf differ diff --git a/macros/latex/contrib/alterqcm/doc/latex/180px-Gustave_Moreau_007.jpg b/macros/latex/contrib/alterqcm/doc/latex/180px-Gustave_Moreau_007.jpg new file mode 100644 index 0000000000..ab4d879cfe Binary files /dev/null and b/macros/latex/contrib/alterqcm/doc/latex/180px-Gustave_Moreau_007.jpg differ diff --git a/macros/latex/contrib/alterqcm/doc/latex/240px-Mort_du_fossoyeur.jpg b/macros/latex/contrib/alterqcm/doc/latex/240px-Mort_du_fossoyeur.jpg new file mode 100644 index 0000000000..70d5f0d0f5 Binary files /dev/null and b/macros/latex/contrib/alterqcm/doc/latex/240px-Mort_du_fossoyeur.jpg differ diff --git a/macros/latex/contrib/alterqcm/doc/latex/The_Wounded_Angel_-_Hugo_Simberg.jpg b/macros/latex/contrib/alterqcm/doc/latex/The_Wounded_Angel_-_Hugo_Simberg.jpg new file mode 100644 index 0000000000..0befd93b07 Binary files /dev/null and b/macros/latex/contrib/alterqcm/doc/latex/The_Wounded_Angel_-_Hugo_Simberg.jpg differ diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-def.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-def.tex new file mode 100644 index 0000000000..5261f75cd8 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-def.tex @@ -0,0 +1,177 @@ +\section{Tools: The environment \tkzname{alterqcm} and the macro \tkzcname{AQquestion}} +\subsection{Environment \tkzname{alterqcm}} + + +\bigskip +\begin{NewEnvBox}{alterqcm} + +\noindent Here is the list of available \tkzname{options} classified by category. + +\medskip +\begin{tabular}{@{}Il Il Il@{}} + \toprule + \thead +Options &Default & Definition \\ \midrule +\tbody +\multicolumn{2}{c}{\emph{\texttt{Dimensions}}} \\ \cmidrule(r){1-2} +\TOenvline{lq} {100mm} {width of the question column } +\TOenvline{pq} {0pt} {vertical shift of the question } \cmidrule(r){1-2} +\multicolumn{2}{c}{\emph{\texttt{Numbers}}} \\ \cmidrule(r){1-2} +\TOenvline{bonus} {{0,5}} {points for a correct answer } +\TOenvline{malus} {{0,25}} {points for wrong answer } +\TOenvline{numbreak} {0} {to take over a split board } +\TOenvline{points} {empty}{ points awarded to the qcm in the margin} \cmidrule(r){1-2} +\multicolumn{2}{c}{\emph{\texttt{Macros}}} \\ \cmidrule(r){1-2} +\TOenvline{symb} {\$\BS square\$} {symbol in front of the proposal } +\TOenvline{corsymb}{\$\BS blacksquare\$}{symbol in front of the proposal } +\TOenvline{numstyle} {\BS arabic} {style of question numbering } +\TOenvline{propstyle} {\BS alph} {style of proposal numbering } +\TOenvline{size} {\BS normalsize} {font size } +\TOenvline{afterpreskip}{\BS medskip} {skip after the presentation } +\cmidrule(r){1-2} +\multicolumn{2}{c}{\emph{\texttt{Booleans}}} \\ \cmidrule(r){1-2} +\TOenvline{long} {true} {longtable instead of tabular } +\TOenvline{sep} {true} {proposal separator} +\TOenvline{pre} {false} {MCQ presentation } +\TOenvline{VF} {false} {MCQ in the form True or False } +\TOenvline{numprop} {false} {proposal numbering } +\TOenvline{num} {true} {style of question numbering } +\TOenvline{nosquare} {false} {sremoving the square of proposals } +\TOenvline{title} {false} {title suppression } +\TOenvline{correction}{false} {allows you to create an answer sheet } +\TOenvline{alea} {false} {randomly place proposals } \cmidrule(r){1-2} +\multicolumn{2}{c}{\emph{\texttt{Texts}}} \\ \cmidrule(r){1-2} +\TOenvline{tone} {Questions} {column title 1 } +\TOenvline{ttwo} {R\'eponses} {column title 2 } +\TOenvline{language} {french} {french, english, german, greek, russian, italian, chinese, unknown } + \bottomrule +\end{tabular} + +\medskip + +To create a \textcolor{red}{\texttt{MCQ}} use a \textcolor{red}{\texttt{alterqcm}} environment as well as the \textcolor{red}{ \addbs{AQquestion}} macro defined in the next section. +\end{NewEnvBox} + +\subsection{The macro \tkzcname{AQquestion}} +\Imacro{AQquestion} + +\begin{NewMacroBox}{AQquestion}{\oarg{local options}{\var{quest}}\{{\var{$\mathrm{prop}_1$}},\ldots,{\var{$\mathrm{prop}_n$}}\}} +This macro uses two arguments, the first defines the question, the second is a list that defines the propositions. + +\medskip +\begin{tabular}{@{}Il Il Il@{}} \toprule \thead +arguments & default & definition \\ +\midrule +\tbody +\TAline{quest} {} {issue definition} +\TAline{$\mathrm{prop}_i$} {} {i\th\ proposition} \bottomrule +\end{tabular} + +\medskip +Here is the list of options related to this macro. + +\medskip +\begin{tabular}{@{}Il Il Il@{}} \toprule \thead +options & default & definition \\ \midrule +\tbody +\TOline{pq} {0pt} {adjustment of the position of the question} +\TOline{br} {1 } {ranked list of correct answers } \bottomrule +\end{tabular} + +\medskip + +\end{NewMacroBox} + + + + + \subsection{Using the \tkzname{minipage} environment to change the width of the table} +\Ienv{minipage} + +\tkzHandBomb\ \begin{minipage}[c][][t]{.4\linewidth} +\begin{tkzltxexample}[small] +\begin{center} +\begin{minipage}{9cm} +\begin{alterqcm}[lq=5cm] + ... + \end{alterqcm} +\end{minipage} +\end{center} +\end{tkzltxexample} +\end{minipage} + +\begin{minipage}[c][][t]{.6\linewidth} +\begin{alterqcm}[lq=5cm] +\AQquestion{Among the following proposals, which of the following allows for + to affirm that the exponential function admits for asymptote the right + from the equation $y = 0$?} +{% +{$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$},% +{$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$},% +{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}% +} + +\AQquestion[]{exp$(\ln x) = x$ for any $x$ belonging to } +{% +{$\mathbf{R}$},% +{$\big]0~;~+ \infty\big[$},% +{$\big[0~;~+\infty\big[$}% +}\end{alterqcm} +\end{minipage} +% + +\subsection{Temporary modification of \tkzcname{textwidth}} +\Imacro{textwidth} + It is possible to use tables and other structures in the question code or proposals. An example is shown below: + \newlength{\oldtextwidth} +\tkzHandBomb\ \begin{tkzltxexample}[small] + \newlength{\oldtextwidth} +\end{tkzltxexample} + +\medskip + \setlength{\oldtextwidth}{\textwidth} + \setlength{\textwidth}{14cm} +\begin{alterqcm}[language=english,lq=88mm,symb=$\Box$] + \AQquestion{the matrix + \( M=\begin{pmatrix} + 0 & 1 \\ + 1 & 1 \\ +\end{pmatrix} \) has for square}% +{% +{\(\begin{pmatrix} + 0 & 1 \\ + 1 & 4 \\ +\end{pmatrix}\)},% +{\(\begin{pmatrix} + 1 & 2 \\ + 2 & 5 \\ + \end{pmatrix}\)} +} +\end{alterqcm} +\setlength{\textwidth}{\oldtextwidth} + +\medskip +\begin{tkzltxexample}[small] + \setlength{\oldtextwidth}{\textwidth} + \setlength{\textwidth}{14cm} + \begin{alterqcm}[language=english,lq=88mm,symb=$\Box$] + \AQquestion{la matrice % + \( M=\begin{pmatrix} + 0 & 1 \\ + 1 & 1 \\ + \end{pmatrix} \) a pour carré}% + {% + {\(\begin{pmatrix} + 0 & 1 \\ + 1 & 4 \\ + \end{pmatrix}\)},% + {\(\begin{pmatrix} + 1 & 2 \\ + 2 & 5 \\ + \end{pmatrix}\)} + } + \end{alterqcm} + \setlength{\textwidth}{\oldtextwidth} +\end{tkzltxexample} + +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-excomp.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-excomp.tex new file mode 100644 index 0000000000..5d49ddf3fe --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-excomp.tex @@ -0,0 +1,257 @@ +\section{Additional examples} +\subsection{The symbolists: use of the macro \tkzcname{includegraphics}} +\Imacro{includegraphics} + +\begin{alterqcm}[lq=8cm,numprop=true,sep] +\AQquestion[pq=2 cm]{Among the three paintings opposite, which is the one painted by \textbf{Gustave Moreau}\vfill}% +{{% +\hfil\includegraphics[scale=.20]{The_Wounded_Angel_-_Hugo_Simberg.jpg}\hfil +},{% +\hfil\includegraphics[scale=.4]{180px-Gustave_Moreau_007.jpg}\hfil +},{% +\hfil\includegraphics[scale=.4]{240px-Mort_du_fossoyeur.jpg}\hfil}}% + \AQquestion[pq=1 cm]{The following picture was painted by which of these three painters?\\ +\hfil\includegraphics[height=3in]{240px-Mort_du_fossoyeur.jpg}\hfil}% +{{Gustav Klimt},{Carlos Schwabe},{Odilon Redon}} +\end{alterqcm} + +\begin{tkzltxexample}[small] + \begin{alterqcm}[lq=8cm,numprop=true,sep] + \AQquestion[pq=2 cm]{Of the three paintings, which is the one painted by \textbf{Gustave Moreau}\vfill}% + {{% + \hfil\includegraphics[scale=.25]{The_Wounded_Angel_-_Hugo_Simberg.jpg}\hfil + },{% + \hfil\includegraphics[scale=.5]{180px-Gustave_Moreau_007.jpg}\hfil + },{% + \hfil\includegraphics[scale=.4]{240px-Mort_du_fossoyeur.jpg}\hfil}} + \AQquestion[pq=1 cm]{The following painting, was painted by which of these three painters?\\ + \hfil\includegraphics[height=3in]{240px-Mort_du_fossoyeur.jpg}\hfil}% + {{Gustav Klimt},{Carlos Schwabe},{Odilon Redon}} + \end{alterqcm} +\end{tkzltxexample} + +\subsection{Using a \tkzname{tikzpicture} environment in a question} +\Ienv{tikzpicture} + +\medskip + +\begin{alterqcm}[lq=120mm,pre=true,pq=3mm] + \AQmessage{\begin{minipage}{15cm} +\vspace*{6pt} +The three trees given below represent probabilistic situations. % + The numbers shown on the various arrows are probabilities, and,%. + in the second level, conditional probabilities. Thus for the given tree % + in question 1 : $0,35 = P(A)$ and $0,1 = P_{\text{A}}(E)$. +\vspace*{6pt} +\end{minipage} +} +\AQquestion{The probability of event E is equal to : \\ +\begin{tikzpicture}[yscale=1.2] +[parent anchor=east,child anchor=west,grow=east] +\tikzstyle{every node}=[text=Maroon,fill=fondpaille,font=\small] +\tikzstyle{every child}=[level distance=25mm] +\tikzstyle{edge from parent}=[draw,->,thin] +\tikzstyle{level 2}=[sibling distance=12mm] +\node {} +[grow=right] +child {node {B} + child { node {F} + edge from parent node {$0,5$}} + child { node {E} + edge from parent node {$0,5$} + } + edge from parent node {$0,65$} + } +child {node {A} + child { node {F} + edge from parentnode {$0,9$}} + child { node {E} + edge from parent node {$0,1$}} + edge from parent node {$0,35$} + }; +\end{tikzpicture}} +{{$0,5$},% +{$0,1$},% +{$0,6$},% +{$0,36$}} +\end{alterqcm} + +\begin{tkzltxexample}[small] + \begin{alterqcm}[lq=120mm,pre=true,pq=3mm] + \AQmessage{The three trees given below represent probabilistic situations. + The numbers shown on the different arrows are probabilities, and, + in the second level, conditional probabilities. Thus for the given tree + in question 1: $0,35 = P(A)$ and $0,1 = P_{\text{A}}(E)$.} + \AQquestion{The probability of event E is equal to : \\ + \begin{tikzpicture} + ... + \end{tikzpicture}} + {{$0,5$},% + {$0,1$},% + {$0,6$},% + {$0,36$}} + \end{alterqcm} +\end{tkzltxexample} + +\begin{tkzexample}[vbox] +\begin{alterqcm}[lq=8cm,numprop=true,sep] +\AQquestion{Among the figures opposite, indicate the one that is a rhombus. :} +{{\hspace{1cm} \begin{minipage}{5cm} \begin{tikzpicture} + \draw (0,0)--(1.5,0)--(2,1)--(.5,1)--cycle; +\end{tikzpicture} \end{minipage}}, +{\hspace{1cm} \begin{minipage}{5cm} \begin{tikzpicture} + \draw[rotate=30] (0,0) rectangle (1.5,1); \end{tikzpicture} \end{minipage}}, +{\hspace{1cm} \begin{minipage}{5cm} \begin{tikzpicture} + \draw (0,0) rectangle (1,1); \end{tikzpicture} \end{minipage} }} +\end{alterqcm} +\end{tkzexample} + +\subsection{Use of a \tkzname{array} environment in the proposals} +\Ienv{array} + +It is possible to use tables and other structures in the question code or proposals. An example is shown below: + +\medskip + + +\begin{tkzexample}[vbox] +\begin{alterqcm}[lq=88mm,symb=$\Box$] +\AQquestion{The couple $(1~;~-1)$ is a solution of } +{% +{$ \left\lbrace +\begin{array}{ll} + 0,75a + 0,5b &= 0,25 \\ + 0,25a + 0,5b &=-0,25 +\end{array}\right.$}, +{$ \left\{ +\begin{array}{ll} + a &= 0,75a +0,5b \\ + b &= 0,25a +0,5b +\end{array}\right.$}, +{$ \left\lbrace +\begin{array}{ll} + 0,75a - 0,5b &= 0,25 \\ + 0,5a + 0,25b &=-0,25 +\end{array}\right.$} +} +\end{alterqcm}\end{tkzexample} + + +\subsection{Use of code \tkzname{verbatim} in questions and proposals} +\Ienv{verbatim} + +Here is an example from Pascal Bertolino. It is preferable to use as Pascal did the macro \tkzcname{texttt}, otherwise avoid the use of the mode +|verbatim|. We will see on the next page how to proceed if this mode is really necessary. + +\begin{alterqcm}[lq=80mm,title=false,long] + +%-------------------------------------------------------------- +\AQquestion{What was the precursor language of the C language?} +{{Fortran}, + {Language B}, + {Basic}} + +%-------------------------------------------------------------- +\verbdef\argprop|int a = 3 ^ 4 ;| +\AQquestion{\argprop} +{{raises 3 to the power of 4}, + {makes an exclusive OR between 3 and 4}, + {is not a C}} + +%-------------------------------------------------------------- +\AQquestion{What is the correct syntax to shift the integer 8 bits to the left? \texttt{a} ?} +{{\texttt{b = lshift(a, 8) ;}}, + {\texttt{b = 8 << a ;}}, + {\texttt{b = a << 8 ;}}} +%-------------------------------------------------------------- +\verbdef\argprop|{ printf ("hello") ; return 0 ; \}| +\AQquestion{The complete program: \\ +\texttt{int main() \\ +~~\argprop}} +{{displays \texttt{hello}}, + {gives an error to the compilation}, + {gives an error in execution}} +%-------------------------------------------------------------- +\verbdef\arg|float tab[10]| +\verbdef\propa|*tab|\global\let\propa\propa +\verbdef\propb|&tab|\global\let\propb\propb +\verbdef\propc|tab|\global\let\propc\propc +\AQquestion{Let's say the declaration \arg ; \\The first real in the table is \ldots} +{{\propa}, + {\propb}, + {\propc}} + +%-------------------------------------------------------------- +\AQquestion{The line \texttt{printf("\%c", argv[2][0]) ;} + of \texttt{main} of \texttt{monProg} run like this : +\texttt{monProg parametre }} +{{displays \texttt{p}}, + {displays nothing}, + {can cause a crash}} +%-------------------------------------------------------------- +\AQquestion{What is the memory size of a \texttt{long int} ?} +{{4 octets}, + {8 octets}, + {ça dépend \ldots}} +%-------------------------------------------------------------- +\AQquestion{Following the declaration \texttt{int * i} ;} +{{\texttt{*i} is an address}, + {\texttt{*i} is an integer}, + {\texttt{*i} is a pointer}} +%-------------------------------------------------------------- +\AQquestion{One of the following choices is not a standard C library} +{{\texttt{stdlib}}, + {\texttt{stdin}}, + {\texttt{math}}} + +\end{alterqcm} + +\medskip +Let's look at the source code + +the simplest way is often to use the command \tkzcname{texttt} + +\begin{tkzexample}[code only] + \AQquestion{Following the declaration \texttt{int * i} ;} + {{\texttt{*i} is an address}, + {\texttt{*i} is an integer}, + {\texttt{*i} is a pointer}} +\end{tkzexample} + +\begin{tkzexample}[code only] +\AQquestion{The line \texttt{printf("\%c", argv[2][0]) ;} + of \texttt{main} of \texttt{monProg} run like this : +\texttt{monProg parametre }} +{{displays \texttt{p}}, + {displays nothing}, + {can cause a crash}} +\end{tkzexample} + +Alternatively, we can load the \tkzname{verbdef} package: +\tkzNamePack{verbdef} + +\tkzcname{usepackage\{verbdef\}} + +\begin{tkzexample}[code only] + \verbdef\argprop|int a = 3 ^ 4 ;| + \AQquestion{\argprop} + {{raises 3 to the power of 4}, + {does an exclusive OR between 3 and 4}, + {is not a C-instruction}} +\end{tkzexample} + +More than one variable may be required: + +\begin{tkzexample}[code only] + \verbdef\arg|float tab[10]| + \verbdef\propa|*tab|\global\let\propa\propa + \verbdef\propb|&tab|\global\let\propb\propb + \verbdef\propc|tab|\global\let\propc\propc + \AQquestion{Either the declaration \arg ; \\ + The first real in the table is \ldots} + {{\propa}, + {\propb}, + {\propc}} +\end{tkzexample} + +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-first.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-first.tex new file mode 100644 index 0000000000..5a9cf2fdb6 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-first.tex @@ -0,0 +1,67 @@ +\section{How to use: first example} + +You need to load the \NamePack{alterqcm.sty} with |\usepackage[english]{alterqcm}|, if you want to use the english language. With some languages like Greek or Chinese you need to compile with Xe\LaTeX\ otherwise you can compile with Lua\LaTeX\ or PDF\LaTeX\ . + +Just use an environment \tkzname{alterqcm} and the macro \tkzcname{AQquestion}, here is an example : + + + \noindent +\begin{minipage}[c][][t]{.40\linewidth} +\begin{tkzexample}[code only,small] + \documentclass[12pt]{article} + \usepackage[english]{alterqcm} + % or french ... + \usepackage{fullpage} + \parindent0pt + \begin{document} + \begin{alterqcm} + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} + \end{alterqcm} + \end{document}\end{tkzexample} +\end{minipage}\hfill \noindent +\begin{minipage}[c][][b]{.50\linewidth} +\textbf{alterqcm.sty} creates a new environment \textbf{alterqcm} which allows for a two-column table. One column on the left for the questions, the other for the different proposals. The propositions are given in a list : + +\tkzname{\{\{Proposition 1\},\\\{Proposition 2\},\\\{Proposition 3\}\}}. + + The number of propositions is between \tkzname{2} and \tkzname{5}. +\end{minipage} + +\medskip +The result is: + +\bigskip + \begin{alterqcm} + \AQquestion{Question} + {% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}% + } + \end{alterqcm} + +\medskip + The total width of the array is equal to \tkzcname{textwidth}. By default the question column has the width \tkzname{100mm} plus a few millimeters ... introduced by the table. The width of the answers is equal to \tkzcname{textwidth} minus the width of the first column. \Imacro{textwidth} + +The important point is that the height of the lines in the proposals is calculated automatically so that, on the one hand, the text of the proposals is placed correctly without touching the lines and, on the other hand, the text of the corresponding question can be included in its box. Precise positioning is obtained with the option \tkzname{pq}. + +\subsection{Packages loaded by \tkzname{alterqcm.sty}} +The list of loaded packages is as follows: + +\begin{tkzexample}[code only] + \RequirePackage{xkeyval}[2005/11/25] + \RequirePackage{calc} + \RequirePackage{ifthen,forloop} + \RequirePackage{array} + \RequirePackage{multirow} + \RequirePackage{pifont} +\end{tkzexample} + + +\tkzHandBomb\ You will need to load \tkzname{longtable.sty} if you wish to use the \tkzname{long} option for one of your arrays. + +\tkzHandBomb\ You also need the macro \tkzcname{square}, it is either defined in the package \tkzname{fourier} or in the package. +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-globales.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-globales.tex new file mode 100644 index 0000000000..4c952a7fe3 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-globales.tex @@ -0,0 +1,758 @@ +\section{Global Environment Options \tkzname{alterqcm}} + +\subsection{\tkzname{lq} : changing the width of the first column } +\IoptEnv{alterqcm}{lq} + +\begin{alterqcm}[long,lq=110mm] +\AQquestion{Of the following proposals, which one allows of + to assert that the exponential function admits for asymptote + the equation line $y = 0$ ?} +{{$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$}, +{$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$}, +{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}} + +\AQquestion{exp$(\ln x) = x$ for any $x$ belonging to } +{{$\mathbb{R}$}, +{$\big]0~;~+ \infty\big[$}, +{$\big[0~;~+\infty\big[$} +} +\end{alterqcm} + +\medskip +Let's look at the code needed to get this table. We need to place +\tkzcname{usepackage}\{alterqcm\} in the preamble. Note that only the width of the question column is provided |lq=100mm| and that this is optional. The number of propositions is here \textbf{3} but it can vary from one question to another. + +\begin{tkzexample}[code only,small] + \begin{alterqcm}[long,lq=110mm] + \AQquestion{Of the following proposals, which one allows of + to assert that the exponential function admits for asymptote + the equation line $y = 0$ ?} + {{$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$}, + {$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$}, + {$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}} + + \AQquestion[]{exp$(\ln x) = x$ for any $x$ belonging to } + {{$\mathbb{R}$}, + {$\big]0~;~+ \infty\big[$}, + {$\big[0~;~+\infty\big[$} + } + \end{alterqcm}\end{tkzexample} + + + +\subsection{\tkzname{pq} : global use } + \IoptEnv{alterqcm}{pq} + +This time, it is necessary to move several questions, I placed a pq=2mm globally, that is to say like this~: + +\tkzcname{begin\{alterqcm\}[lq=85mm,pq=2mm]}. + +\textbf{All} questions are affected by this option but some questions were well placed and should remain so, so locally I give them back a |pq=0mm|. + +\medskip +\begin{alterqcm}[lq=85mm,pq=2mm] +\AQquestion{A bivariate statistical series. The values of $x$ are 1, 2, 5, 7, 11, 13 and a least squares regression line equation of $y$ to $x$ is $y = 1.35x +22.8$. The coordinates of the mean point are :} +{{$(6,5;30,575)$}, +{$(32,575 ; 6,5)$}, +{$(6,5 ; 31,575)$}} + +\AQquestion{For any real $x$, the number \[\dfrac{\text{e}^x - 1}{\text{e}^x + 2}\hskip12pt \text{equal to :} \] } +{{$-\dfrac{1}{2}$}, +{$\dfrac{\text{e}^{-x} - 1}{\text{e}^{-x} + 2}$}, +{$\dfrac{1 - \text{e}^{-x}}{1 + 2\text{e}^{-x}}$} +} +\AQquestion{With I $= \displaystyle\int_{\ln 2}^{\ln 3} \dfrac{1}{\text{e}^x - 1}\,\text{d}x$ and J $ = \displaystyle\int_{\ln 2}^{\ln 3} \dfrac{\text{e}^x}{\text{e}^x - 1}\,\text{d}x$ \\ then the number I $-$ J equals} +{{$\ln \dfrac{2}{3}$}, +{$\ln \dfrac{3}{2}$}, +{$\dfrac{3}{2}$} +} +\end{alterqcm} + +\begin{tkzexample}[code only,small] + \begin{alterqcm}[lq=85mm,pq=2mm] + \AQquestion{For any real $x$, the number \[\dfrac{\text{e}^x - 1} + {\text{e}^x + 2}\hskip12pt \text{equal to :} \] } + {{$-\dfrac{1}{2}$}, + {$\dfrac{\text{e}^{-x} - 1}{\text{e}^{-x} + 2}$}, + {$\dfrac{1 - \text{e}^{-x}}{1 + 2\text{e}^{-x}}$}} + \end{alterqcm} +\end{tkzexample} + + +\subsection{\tkzname{TF} : True or False} +\IoptEnv{alterqcm}{TF} +V or F in french vrai ou faux ! +There are only two proposals and the candidate must choose between \textbf{True} or \textbf{False} ou bien si vous préférez \textbf{Correct} and \textbf{Wrong}. This time the syntax has been streamlined. It is no longer necessary to write the list of proposals and it is enough to position \tkzname{VF} by placing in the options \tkzname{$VF$}. + + +\begin{minipage}[t][][b]{.45\linewidth} +Let $f$ be a function defined and derivable on the interval $\big[-3~;~+\infty\big[$, increasing over the intervals $\big[-3~;~-1\big]$ et $\big[2~;~+\infty\big[$ and decreasing over the interval $\big[-1~;~2\big]$. + + We note $f'$ its derivative function over the interval $[-3~;~+\infty[$. + +The $\Gamma$ curve representative of the $f$ function is plotted below in an orthogonal coordinate system $\big(O,~\vec{\imath},~\vec{\jmath}\big)$. + +It passes through point A$(-3~;~0)$ and admits for asymptote the $\Delta$ line of equation $y = 2x -5$. +\end{minipage} +\hfill +\begin{minipage}[t][][b]{.45\linewidth} +\null +\begin{tikzpicture}[scale=0.5,>=latex] + \draw[very thin,color=gray] (-3,-2) grid (10,8); + \draw[->] (-3,0) -- (10,0) node[above left] {\small $x$}; + \foreach \x in {-3,-2,-1,1,2,...,9} + \draw[shift={(\x,0)}] (0pt,1pt) -- (0pt,-1pt)node[below] { $\x$}; + \draw[->] (0,-2) -- (0,8) node[below right] {\small $y$}; + \foreach \y/\ytext in {-2,-1,1,2,...,7} + \draw[shift={(0,\y)}] (1pt,0pt) -- (-1pt,0pt) node[left] { $\y$}; + \draw (2,-1) -- (6,7); + \node[above right] at (-3,0) {\textbf{A}}; + \node[above right] at (0,0) {\textbf{O}}; + \node[below right] at (4,3) {$\mathbf{\Delta}$}; + \node[above right] at (4,5) {$\mathbf{\Gamma}$}; + \draw plot[smooth] coordinates{% + (-3,0)(-2,4.5)(-1,6.5)(0,5.5)(1,3.5)(2,3)(3,3.4)(4,4.5)(5,6)(6,7.75)}; +\end{tikzpicture} +\end{minipage} + + +\begin{alterqcm}[VF,lq=125mm] + \AQquestion{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion{The $F$ function has a maximum in $2$} + \AQquestion{$\displaystyle\int_{0}^2 f'(x)\,\text{d}x = - 2$} +\end{alterqcm} + +\begin{tkzexample}[code only, small] + \begin{minipage}[t][][b]{.45\linewidth} + Let $f$ be a function defined and derivable on the interval $\big[-3~;~+\infty\big[$, + increasing over the interval $\big[-3~;~-1\big]$ and $\big[2~;~+\infty\big[$ + and decreasing over the interval $\big[-1~;~2\big]$. + + We note $f'$ its derivative function over the interval $[-3~;~+\infty[$. + + The $\Gamma$ curve representative of the $f$ function is plotted below + in an orthogonal system $\big(O,~\with{\imath},~\jmath}\big)$. + + It passes through the point A$(-3~;~0)$ and admits for asymptote the line + $\Delta$ of equation $y = 2x -5$. + \end{minipage} + \begin{minipage}[t][][b]{.45\linewidth} + \null +\begin{tikzpicture}[scale=0.5,>=latex] + \draw[very thin,color=gray] (-3,-2) grid (10,8); + \draw[->] (-3,0) -- (10,0) node[above left] {\small $x$}; + \foreach \x in {-3,-2,-1,1,2,...,9} + \draw[shift={(\x,0)}] (0pt,1pt) -- (0pt,-1pt)node[below] { $\x$}; + \draw[->] (0,-2) -- (0,8) node[below right] {\small $y$}; + \foreach \y/\ytext in {-2,-1,1,2,...,8} + \draw[shift={(0,\y)}] (1pt,0pt) -- (-1pt,0pt) node[left] { $\y$}; + \draw (-0.5,-2) -- (10,8); + \node[above right] at (-3,0) {\textbf{A}}; + \node[above right] at (0,0) {\textbf{O}}; + \node[below right] at (4,3) {$\mathbf{\Delta}$}; + \node[above right] at (4,5) {$\mathbf{\Gamma}$}; + \draw plot[smooth] coordinates{% + (-3,0)(-2,4.5)(-1,6.5)(0,5.5)(1,3.5)(2,3)(3,3.4)(4,4.5)(5,6)(6,7.75)}; + \end{tikzpicture} + \end{minipage} + \begin{alterqcm}[VF,lq=125mm] + \AQquestion{For all $x \in ]-\infty~;~2],~f'(x) \geqslant 0$.} + \AQquestion{The $F$ function has a maximum in $2$} + \AQquestion{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} +\end{tkzexample} + +\subsection{\tkzname{symb} : symbol change } +\IoptEnv{alterqcm}{symb} + + If your fonts don't have the symbol |$\square$| or |$\blacksquare$| you can use the one provided by the package or create one yourself. \tkzcname{altersquare}, \tkzcname{dingsquare} and \tkzcname{dingchecksquare} are provided by alterqcm. + Here is how these macros are defined. + +\begin{tkzexample}[code only,small] + \newcommand*{\altersquare}{\mbox{\vbox{\hrule\hbox to 6pt{\vrule height 5.2pt \hfil\vrule}\hrule}}}\end{tkzexample} + +\medskip you either get \altersquare\ or... : + +\begin{tkzexample}[code only,small] + \newcommand*{\dingsquare}{\ding{114}} \end{tkzexample} + +\medskip which results in \dingsquare\ and finally to replace |$\blacksquare$| + +\begin{tkzexample}[code only,small] + \newcommand*{\dingchecksquare}{\mbox{\ding{114}% + \hspace{-.7em}\raisebox{.2ex}[1ex]{\ding{51}}}} \end{tkzexample} + +\medskip Let it be \dingchecksquare\ as a result. + + +\begin{tkzexample}[code only,small] + + \begin{alterqcm}[lq=90mm,symb=\altersquare] + ... \end{alterqcm}\end{tkzexample} + +\medskip +Full example : + +\medskip +\begin{tkzexample}[vbox] + \begin{alterqcm}[VF,lq=125mm,symb = \dingsquare] + \AQquestion{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion{The $F$ function has a maximum in $2$} + \AQquestion{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm}\end{tkzexample} + + +\subsection{\tkzname{pre, bonus, malus} : automatic presentation } +\IoptEnv{alterqcm}{pre}\IoptEnv{alterqcm}{bonus}\IoptEnv{alterqcm}{malus} +As you can see below, a presentation is given of the exercise with the grading. + +\bigskip +\begin{minipage}[c][][t]{.45\linewidth} +\begin{tkzexample}[code only,small] + \begin{alterqcm}[lq=6cm,pre=true,bonus=1,malus={0,5}] + \AQquestion{Question} + {{Proposition 1}, + {Proposition 2}} + \end{alterqcm}\end{tkzexample} +\end{minipage}\hfill +\begin{minipage}[c][][t]{.45\linewidth} + \begin{alterqcm}[lq=3cm,pre=true,bonus=1,malus={0,5}] + \AQquestion{Question} + {{Proposition 1}, + {Proposition 2}} + \end{alterqcm} +\end{minipage} + +\vspace{1cm} + +\subsection{\tkzname{sep} : rule between proposals} +\IoptEnv{alterqcm}{sep} + +\tkzname{sep=true} creates a rule between the proposals. + +\begin{minipage}[c][][t]{.45\linewidth} +\begin{tkzexample}[code only,small] + \begin{alterqcm}[lq=3cm,sep=true] + \AQquestion{Question} + etc.. +\end{alterqcm}\end{tkzexample} +\end{minipage}\hfill +\begin{minipage}[c][][t]{.45\linewidth} + \begin{alterqcm}[lq=3cm,sep=true] + \AQquestion{Question} + {{Proposition 1}, + {Proposition 2}} + \end{alterqcm} +\end{minipage} + +\subsection{\tkzname{num, numstyle} : deletion and style of numbering } +\IoptEnv{alterqcm}{num}\IoptEnv{alterqcm}{numstyle} +\subsubsection{\tkzname{num=false}} +\tkzname{num=false} makes the numbering of the questions disappear. + +\begin{minipage}[c][][t]{.45\linewidth} +\begin{tkzexample}[code only, small] + \begin{alterqcm}[lq=3cm,num=false] + \AQquestion{Question} + etc... + \end{alterqcm} +\end{tkzexample} +\end{minipage}\hfill +\begin{minipage}[c][][t]{.45\linewidth} + \begin{alterqcm}[lq=3cm,num=false] + \AQquestion{Question} + {% + {Proposition 1}, + {Proposition 2}} + \end{alterqcm} +\end{minipage} + +\subsubsection{\tkzname{numstyle}} + +\tkzname{numstyle}=\tkzcname{alph} changes the style of question numbering. The usual styles are valid here. + +\begin{minipage}[c][][t]{.45\linewidth} +\begin{tkzexample}[code only, small] + \begin{alterqcm}[lq=3cm,numstyle=\alph] + \AQquestion{Question} + etc... + \end{alterqcm} +\end{tkzexample} +\end{minipage} +\hfill +\begin{minipage}[c][][t]{.45\linewidth} + \begin{alterqcm}[lq=3cm,numstyle=\alph] + \AQquestion{Question} + {% + {Proposition 1}, + {Proposition 2}} + \end{alterqcm} +\end{minipage} + +\subsection{\tkzname{title, tone, ttwo} : deletion and modification of the title line } +\IoptEnv{alterqcm}{title}\IoptEnv{alterqcm}{tone}\IoptEnv{alterqcm}{ttwo} + +\tkzname{title=false} deletes the column headings. + +\begin{minipage}[c][][t]{.45\linewidth} +\begin{tkzexample}[code only,vbox] + \begin{alterqcm}[lq=3cm,title=false] + \AQquestion{Question} + etc... + \end{alterqcm}\end{tkzexample} +\end{minipage}\hfill +\begin{minipage}[c][][t]{.45\linewidth} + \begin{alterqcm}[lq=3cm,title=false] + \AQquestion{Question} + {% + {Proposition 1}, + {Proposition 2}% + } + \end{alterqcm} +\end{minipage} + + +\medskip +\tkzname{tone=titre n°1} and \tkzname{ttwo=titre n°2} change the table headers + +\begin{minipage}[c][][t]{.45\linewidth} +\begin{tkzexample}[code only] + \begin{alterqcm}[lq=3cm,tone=titre n°1,ttwo=titre n°2] + \AQquestion{Question} + etc... + \end{alterqcm}\end{tkzexample} +\end{minipage}\hfill +\begin{minipage}[c][][t]{.45\linewidth} + \begin{alterqcm}[lq = 3cm,tone = titre n°1,ttwo = titre n°2] + \AQquestion{Question} + {{Proposition 1}, + {Proposition 2} + } + \end{alterqcm} +\end{minipage} + +\subsection{\tkzname{noquare} : square suppression } +\IoptEnv{alterqcm}{nosquare} + +\tkzname{nosquare=true} fait disparaître le carré ou encore la numérotation des propositions. + +\begin{minipage}[c][][t]{.45\linewidth} +\begin{tkzexample}[code only,small] + \begin{alterqcm}[lq=3cm,nosquare=true] + \AQquestion{Question} + etc... + \end{alterqcm}\end{tkzexample} +\end{minipage}\hfill +\begin{minipage}[c][][t]{.45\linewidth} + \begin{alterqcm}[lq=3cm,nosquare=true] + \AQquestion{Question} + {% + {Proposition 1}, + {Proposition 2} + } + \end{alterqcm} +\end{minipage} + +\medskip +\tkzname{numprop=true} number the proposals and \tkzname{propstyle= ...} changes the numbering style. + +Default, \tkzname{propstyle=\textbackslash alph} + +\begin{minipage}[c][][t]{.45\linewidth} +\begin{tkzexample}[code only,small] + \begin{alterqcm}[lq=3cm,numprop = true,propstyle = \Roman] + \AQquestion{Question} + etc... + \end{alterqcm}\end{tkzexample} +\end{minipage}\hfill +\begin{minipage}[c][][t]{.45\linewidth} + \begin{alterqcm}% + [lq=3cm, + numprop = true, + propstyle = \Roman] + \AQquestion{Question} + {% + {Proposition 1}, + {Proposition 2}% + } + \end{alterqcm} +\end{minipage} + +\subsection{\tkzname{alea} : random positioning of proposals } +\IoptEnv{alterqcm}{alea} + +It is preferable between two compilations to delete the auxiliary files. + +\textcolor{red}{\lefthand} Be careful, in random mode, it is not possible to obtain an answer corresponding to the initial assignment. + +\begin{tkzexample}[small] + \begin{alterqcm}[lq=55mm,alea] + \AQquestion[pq=1mm]{If the $f$ function is strictly increasing on $\mathbf{R}$ then the equation $f(x) = $0 admits :} + {{At least one solution},% + {At most one solution},% + {Exactly one solution}} + \end{alterqcm} +\end{tkzexample} + +\subsection{\tkzname{english}, \tkzname{german}, \tkzname{greek}, \tkzname{italian}, \tkzname{russian}, \tkzname{chinese}\ and \tkzname{unknown} : language change } +\IoptEnv{alterqcm}{english}\IoptEnv{alterqcm}{german}\IoptEnv{alterqcm}{french} + +The order given above is that of creation. +Thanks to Apostolos Syropoulos and Anastasios Dimou for enabling the use of Greek language. + + \begin{tkzexample}[code only,small] + \begin{alterqcm}[language=french,lq=55mm,alea] + \end{tkzexample} + + \begin{alterqcm}[language=french,lq=55mm,alea] + \AQquestion[pq=1mm]{If the $f$ function is strictly increasing on $\mathbf{R}$ + then the equation equation $f(x) = $0 admits...} + {{At least one solution},% + {At most one solution},% + {Exactly one solution}} + \end{alterqcm} + + \begin{tkzexample}[code only,small] + \begin{alterqcm}[language=german,lq=55mm,alea] \end{tkzexample} + +\begin{alterqcm}[language=german,lq=55mm,alea] +\AQquestion[pq=1mm]{Wenn die Funktion $f$ % + auf $\mathbf{R}$ streng monoton wächst, dann +hat die Gleichung $f(x) = 0$:} +{{mindestens ein Lösung},% +{höchstens eine Lösung},% +{genau eine Lösung}} +\end{alterqcm} + + +\begin{alterqcm}[language=chinese,VF,lq=125mm,symb = \dingsquare,pre=true] +\def\aq@pre{对于以下提出的各个问题,仅有一个答案是正确的,请选择你认为正确的答案(不需要提供理由)。} + \AQquestion{$x \in ]-3~;~2]$的情形下,$f'(x) \geq 0$。} + \AQquestion{$F$ 函数的最大值为$2$。} + \AQquestion{$\displaystyle\int_{0}^2 f’(x)\:\text{d}x = - 2$} + \end{alterqcm} + + \begin{alterqcm}[language=chinese,pre=true] + \AQquestion{问题}{% + {选择1}, + {选择2}, + {选择3}} + \end{alterqcm} + + +There's a section devoted solely to the "greek" option. + + +How to use \tkzname{unknown} : You need to call the package with the option "unknown" then yo need to redefine some macros. + +\begin{tkzexample}[code only,small] +\usepackage[unknown]{alterqcm} +% userdefined language: unknown=spanish +\def\aqlabelforquest{Preguntas}% +\def\aqlabelforrep{Respuestas}% +\def\aqtextfortrue{\textbf{V}} +\def\aqtextforfalse{\textbf{F}} +\def\txttv{V}% V(erdadero) +\def\txttf{F}% F(also) +\def\aqfoottext{Continúa en la página siguiente\dots} +\def\aqpretxt{\vspace*{6pt}Para cada una de las preguntas siguientes, sólo una de las respuestas propuestas es verdadera. Debe elegir la respuesta correcta sin justificación.}% +\def\aqpretxtVF{Para cada una de las afirmaciones de abajo, marque la casilla \textbf{V} (la afirmación es verdadera) o la casilla \textbf{F} (la afirmación es falsa).}% + +\begin{alterqcm}[language=unknown] + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} +\end{alterqcm} + + \end{tkzexample} +\begingroup +\def\aqlabelforquest{Preguntas}% +\def\aqlabelforrep{Respuestas}% +\def\aqtextfortrue{\textbf{V}} +\def\aqtextforfalse{\textbf{F}} +\def\txttv{V}% V(erdadero) +\def\txttf{F}% F(also) +\def\aqfoottext{Continúa en la página siguiente\dots} +\def\aqpretxt{\vspace*{6pt}Para cada una de las preguntas siguientes, sólo una de las respuestas propuestas es verdadera. Debe elegir la respuesta correcta sin justificación.}% +\def\aqpretxtVF{Para cada una de las afirmaciones de abajo, marque la casilla \textbf{V} (la afirmación es verdadera) o la casilla \textbf{F} (la afirmación es falsa).}% + + \begin{alterqcm}[language=unknown] + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} + \end{alterqcm} + \endgroup + + +\newpage +\subsection{\tkzname{long} : use of longtable} +\IoptEnv{alterqcm}{long}\Ienv{longtable} + +A table can arrive at the end of the page and be cut or simply be very long. +This option allows you to use instead of a \tkzname{tabular} an environnement \tkzname{longtable}. + + +Here is an example from Pascal Bertolino. + +\begin{alterqcm}[lq=80mm,long] + +%-------------------------------------------------------------- +\AQquestion{What was the precursor language of the C language?} +{{Fortran}, + {language B}, + {Basic}} + +%-------------------------------------------------------------- +\verbdef\argprop|int a = 3 ^ 4 ;| +\AQquestion{\argprop} +{{raises 3 to the power of 4}, + {makes an exclusive OR between 3 and 4}, + {is not a C}} + +%-------------------------------------------------------------- +\AQquestion{What is the correct syntax to shift the integer 8 bits to the left? \texttt{a} ?} +{{\texttt{b = lshift(a, 8) ;}}, + {\texttt{b = 8 << a ;}}, + {\texttt{b = a << 8 ;}}} + +%-------------------------------------------------------------- +\verbdef\argprop|{ printf ("hello") ; return 0 ; \}| +\AQquestion{The complete program : \\ + \texttt{int main() \\ + ~~\argprop}} +{{display \texttt{hello}}, + {gives an error to the compilation}, + {gives an error in execution}} + +%-------------------------------------------------------------- +\verbdef\arg|float tab[10]| +\verbdef\propa|*tab|\global\let\propa\propa +\verbdef\propb|&tab|\global\let\propb\propb +\verbdef\propc|tab|\global\let\propc\propc +\AQquestion{Let's say the statement \arg ; \\The first real in the table is \ldots} +{{\propa}, + {\propb}, + {\propc}} + +%-------------------------------------------------------------- +\AQquestion{The line \texttt{printf("\%c", argv[2][0]) ;} of \texttt{main} of \texttt{monProg} run like this : +\texttt{monProg parametre }} +{{displays \texttt{p}}, + {displays nothing}, + {can cause a crash}} +%-------------------------------------------------------------- +\AQquestion{What is the memory size of a \texttt{long int} ?} +{{4 octets}, + {8 octets}, + {it depends \ldots}} +%-------------------------------------------------------------- +\AQquestion{Following the declaration \texttt{int * i} ;} +{{\texttt{*i} is an address}, + {\texttt{*i} is an integer}, + {\texttt{*i} is a pointer}} +%-------------------------------------------------------------- +\AQquestion{One of the following choices is not a standard library of the C} +{{\texttt{stdlib}}, + {\texttt{stdin}}, + {\texttt{math}}} + %-------------------------------------------------------------- +\end{alterqcm} + +The beginning of the code is simply + +\begin{tkzltxexample}[small] + \begin{alterqcm}[lq=80mm,long] + \AQquestion{What was the precursor language of the C language?} + {{Fortran}, + {language B}, + {Basic}} + \end{alterqcm} +\end{tkzltxexample} + +\medskip +It is possible to modify the text that is placed at the end of the table. Just modify the command \tkzcname{aqfoottext}. + +\begin{tkzltxexample}[small] + \def\aqfoottext{continued on next page\ldots} +\end{tkzltxexample} + +\subsection{\tkzname{numbreak} : split a mcq } +This option allows either to continue the numbering of the previous table. +This option was necessary before the use of the \tkzname{long} option. + for tables split by a page break. It can now be used + for a series of tables grouped together to obtain a single MCQ. + +\begin{alterqcm}[lq=80mm,title=false,num=false,long] + \AQquestion{What was the precursor language of the C language?} + {{Fortran}, + {language B}, + {Basic}} + +\verbdef\argprop|int a = 3 ^ 4 ;| +\AQquestion{\argprop} + {{raises 3 to the power of 4}, + {makes an exclusive OR between 3 and 4}, + {is not a C-instruction}} +\end{alterqcm} + +\begin{alterqcm}[lq=80mm,title=false,num=false,numbreak=2,long] +\AQquestion{After the declaration \texttt{int * i} ;} +{{\texttt{*i} is an address}, + {\texttt{*i} is an integer}, + {\texttt{*i} is a pointer}} + +\AQquestion{One of the following choices is not a standard C library} +{{\texttt{stdlib}}, + {\texttt{stdin}}, + {\texttt{math}}} +\end{alterqcm} + +the code for the beginning is : + +\begin{tkzltxexample}[small] + \begin{alterqcm}[lq=80mm,title=false,num=false,long] + \AQquestion{What was the precursor language of the C language?} + {{Fortran}, + {language B}, + {Basic}} + + \verbdef\argprop|int a = 3 ^ 4 ;| + \AQquestion{\argprop} + {{raises 3 to the power of 4}, + {makes an exclusive OR between 3 and 4}, + {is not a C-instruction}} + \end{alterqcm} +\end{tkzltxexample} + +For the second part, we set \tkzname{numbreak} to $2$ because the first board had $2$ questions. In a future version, we will not have to count the questions anymore. + +\begin{tkzltxexample}[small] + \begin{alterqcm}[lq=80mm,title=false,num=false,numbreak=2,long] + \AQquestion{Following the declaration \texttt{int * i} ;} + {{\texttt{*i} is an address}, + {\texttt{*i} is an integer}, + {\texttt{*i} is a pointer}} + + \AQquestion{One of the following choices is not a standard C library} + {{\texttt{stdlib}}, + {\texttt{stdin}}, + {\texttt{math}}} + \end{alterqcm} +\end{tkzltxexample} + +\subsection{\tkzname{correction} : Correction of a mcq} + \IoptEnv{alterqcm}{correction} + + It is possible to create an answer key by using the \tkzname{correction} option and indicating the correct answer(s) using a local parameter \tkzname{br}. + Here is an example: + + \begin{alterqcm}[VF,lq=125mm,correction, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br=1]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br=2]{The $F$ function has a maximum in $2$} + \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + \begin{tkzltxexample}[] + \begin{alterqcm}[VF,lq=125mm,correction, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br=1]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br=2]{The $F$ function has a maximum in $2$} + \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} +\end{tkzltxexample} + +\subsection{Modification du symbole \tkzname{corsymb}} + \IoptEnv{alterqcm}{corsymb} + +\tkzcname{dingchecksquare} is provided by alterqcm. + Here is how this macro is defined. + +\begin{tkzexample}[code only,small] + \newcommand*{\dingchecksquare}{\mbox{\ding{114}% + \hspace{-.7em}\raisebox{.2ex}[1ex]{\ding{51}}}} \end{tkzexample} + +\medskip Let's consider checksquare as a result. + +\begin{tkzexample}[code only,small] + \begin{alterqcm}[lq=90mm,symb=\altersquare,corsymb=\dingchecksquare] + ... + \end{alterqcm} +\end{tkzexample} + +\medskip +Full example : + +\medskip + \begin{alterqcm}[VF,lq=125mm,correction, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br=1]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br=2]{The $F$ function has a maximum in $2$} + \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + +\begin{tkzexample}[code only] + \begin{alterqcm}[VF,lq=125mm,correction, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br=1]{For any $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br=2]{The $F$ function has a maximum in $2$} + \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} +\end{tkzexample} + +\subsection{\tkzname{br=\{\ldots\}} : corrected with several correct answers} +\Iopt{AQquestion}{br} + +A list of correct answers is given +\begin{tkzexample}[vbox,small] +\begin{alterqcm}[correction] +\AQquestion[br={1,3}]{Question} +{% +{Proposition 1}, +{Proposition 2}, +{Proposition 3}% +} +\end{alterqcm} +\end{tkzexample} + +\subsection{\tkzname{transparent} : creation of a transparent slide showing the answers.} + \IoptEnv{alterqcm}{transparent} + + This macro makes it possible to create a document identical to the original but without the questions and with a circle indicating the good proposals. + + \begin{tkzexample}[vbox,small] + \begin{alterqcm}[transparent,correction,corsymb=\dingchecksquare,lq=100mm] + \AQquestion[br=2,pq=3mm]{Which of the following proposals is that + which allows us to affirm that the exponential function admits for asymptote the equation line $y = 0$ ?} + {{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}, + {$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$}, + {$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$} + } + + \AQquestion[br={1,3}]{exp$(\ln x) = x$ for any $x$ belonging to } + {{$\mathbf{R}$}, + {$\big]0~;~+ \infty\big[$}, + {$\big[0~;~+\infty\big[$} + } + + \AQquestion[br={1,2}]{exp$(\ln x) = x$ for any $x$ belonging to } + {{$\mathbf{R}$}, + {$\big]0~;~+ \infty\big[$}, + {$\big[0~;~+\infty\big[$} + }\AQquestion[br=2,pq=3mm]{Which of the following proposals is that + which allows us to affirm that the exponential function admits for asymptote + the equation line $y = 0$ ?} + {{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}, + {$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$}, + {$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$} + } + \end{alterqcm} +\end{tkzexample} +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-greek.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-greek.tex new file mode 100644 index 0000000000..598a22c3e1 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-greek.tex @@ -0,0 +1,53 @@ +\section{Greek version [Apostolos Syropoulos \& Anastasios Dimou]} + +\subsection{Εισαγωγή} +Ο Alain Matthes μας έχει συνηθίσει σε ενδιαφέροντα πακέτα για το \LaTeX\ , που είναι μάλιστα πολύ σχετικά με τα δικά μας προγράμματα, το στυλ και το ύφος τους. Ένα τέτοιο παράδειγμα είναι και το \texttt{tkz-tab}, που παρουσιάστηκε πέρυσι στο \texttt{https://tassosdimou.gr/variation-table}. + +Το πακέτο \textsf{alterqcm} είναι ακόμη ένα πακέτο του Alain Matthes για το \LaTeX\, που θα μας βοηθήσει στη κατασκευή καλαίσθητων διαγωνισμάτων με ερωτήσεις πολλαπλής επιλογής και σωστού-λάθους. + +Το \textsf{alterqcm} τροποποιήθηκε από τους Απόστολο Συρόπουλο και Τάσσο Δήμου έτσι, ώστε να προσαρμοστεί στα δεδομένα του ελληνικού εκπαιδευτικού συστήματος. + + Το άρθρο αναπτύσσει με λεπτομέρειες και πολλά παραδείγματα τις δυνατότητες του \textsf{alterqcm}. Δίνει οδηγίες για τη χρήση του και στο τέλος θα δοθούν μερικά παραδείγματα διαγωνισμάτων. + +\subsection{Εγκατάσταση του πακέτου} +Θα υποδείξουμε έναν απλό τρόπο εγκατάστασης του πακέτου. Δημιουργούμε ένα φάκελο, στον οποίο θα αποθηκευτούν όλα τα αρχεία, που θα επεξεργαστούμε, μελετώντας το \textsf{alterqcm}. Με άλλα λόγια, στον φάκελο αυτόν αποθηκεύουμε τα αρχεία \texttt{.tex}, τις εικόνες που θα χρησιμοποιηθούν και το αρχείο \texttt{alterqcm.sty}, που θα κατεβάσουμε από τη διεύθυνση \texttt{https://ctan.org/pkg/alterqcm?lang=en}. Το πακέτο θα φορτωθεί με την επιλογή \texttt{greek}, δηλαδή θα δώσουμε την εντολή: +\begin{verbatim} +\usepackage[greek]{alterqcm} +\end{verbatim} +Όλα τα αρχεία θα έχουν την κλασσική δομή των αρχείων \texttt{.tex}. + +Στο πρώτο μέρος, το προοίμιο, θα τοποθετήσουμε τα: +\begin{verbatim} +\documentclass[11pt,a4paper]{article} +\usepackage{xltxtra} +\usepackage{xgreek} +\usepackage{mathtools} +\usepackage{amsthm} +\usepackage{amssymb} +\usepackage{unicode-math} +\usepackage{xkeyval} +\usepackage{multirow,longtable} +\usepackage[greek]{alterqcm} +\usepackage{tkz-tab} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\parindent=0pt +\setmainfont[Mapping=tex-text,Ligatures=Common]{Minion Pro} +\setmathfont[Scale=MatchUppercase]{Asana Math} +\end{verbatim} + +Apostolos Syropoulos, and Anastasios Dimou + +\begin{alterqcm} + \AQquestion{Ερώτηση}{% + {Επιλογή 1}, + {Επιλογή 2}, + {Επιλογή 3} + } + \end{alterqcm} + + \begin{alterqcm}[language=greek,VF,lq=60mm] + \AQquestion[]{Ισχύει ότι $(α+β)^2=α^2+β^2$} + \AQquestion[]{Αν $α\cdot β\geq 0$, τότε $\sqrt{α\cdot β}=\sqrt{α}\cdot\sqrt{β}$ } + \AQquestion[]{Είναι $|α|=α,\,\text{για κάθε}\ + x\in\mathbb{R}$} + \end{alterqcm} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-installation.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-installation.tex new file mode 100644 index 0000000000..192d63a7e8 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-installation.tex @@ -0,0 +1,57 @@ +\section{Installation} + +\subsection{Without \tkzNameDist{TeXlive} or \tkzNameDist{MikTeX}} +Create a folder and put your files, images and the \tkzname{alterqcm.sty} file in it. All you have to do is compile ... + +\subsection{With \tkzNameDist{TeXlive} on \tkzNameSys{Linux} or \tkzNameSys{OS X}} + +\tkzname{alterqcm} is present on the \tkzname{CTAN} servers and is part of \tkzname{TeXLive} so \tkzname{tlmgr} or \tkzname{TeX Live Utility} will allow you to install it. If \tkzname{alterqcm} is not yet part of your distribution, this section shows you how to install it, it is also necessary if you want to install a beta or custom version of \tkzname{alterqcm}. + +The easiest way is to create a folder \tikz[remember picture,baseline=(n1.base)]\node [fill=blue!30,draw] (n1) {prof};\footnote{or another name} with as path: \colorbox{blue!20}{ texmf/tex/latex/prof}. Here are the paths to this folder on both my computers: + +\medskip +\begin{itemize}\setlength{\itemsep}{5pt} + +\item with \tkzNameSys{OS X} \colorbox{blue!30}{\textbf{/Users/ego/Library/texmf}}; + +\item with \tkzNameSys{OUnbuntu} \colorbox{blue!30}{\textbf{/home/ego/texmf}}. +\end{itemize} + +I guess if you put your packages somewhere else, you know why! The concept is to place the package on a path that your distribution knows. + + +\medskip +\begin{enumerate} +\item Download the file \tikz[remember picture,baseline=(n2.base)]\node [fill=blue!20,draw] (n2) {alterqcm.sty}; from one of the servers of the \tkzname{CTAN}. + +\item Place the file \tikz[remember picture,baseline=(n2.base)]\node [fill=blue!20,draw] (n2) {alterqcm.sty}; in the folder \tkzname{latex} or in a personal folder \tikz[baseline=(tk.base)]\node [fill=blue!30,draw] (tk) {prof};. +\begin{itemize}\setlength{\itemsep}{5pt} + +\item \colorbox{blue!30}{\textbf{\textasciitilde/Library/texmf/latex}}; + +\item \colorbox{blue!30}{\textbf{\textasciitilde/Library/texmf/latex/prof}}. +\end{itemize} + +\end{enumerate} + + +\subsection{With \tkzNameDist{MikTeX} under \tkzNameSys{Windows XP}} + + +I don't know much about this system, but a user of my packages \tkzimp{Wolfgang Buechel} was kind enough to send me the following~: + +To add \tkzname{alterqcm.sty} to MiKTeX~: + +\begin{itemize}\setlength{\itemsep}{10pt} + \item add a folder \tkzname{prof} to the folder + \textcolor{blue!60!black}{\texttt{[MiKTeX-dir]/tex/latex}} + \item copy the file \tkzname{alterqcm.sty} to the folder \tkzname{prof}, + \item update MiKTeX, to do this in the DOS shell run the command \textbf{\textcolor{red}{|mktexlsr -u|}} + + or choose \textcolor{red!50}{|Start/Programs/Miktex/Settings/General|} + + then press the \textbf{\textcolor{red}{|Refresh FNDB|}}. +\end{itemize} + +\endinput + diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-locales.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-locales.tex new file mode 100644 index 0000000000..63aa4ee13b --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-locales.tex @@ -0,0 +1,130 @@ +\section{Local options of the macro \tkzcname{AQquestion}} + +\subsection{Local use of \tkzname{pq}} +\Iopt{AQquestion}{pq} + The following table is obtained with the options |lq=85mm| and |size=\wide|. The questions are misplaced. The local option \tkzname{pq} solves this problem, the text can be moved 1mm upwards with \tkzcname{AQquestion[pq=1mm]}. + and by |6mm| for the second. + +\medskip + + + \begin{alterqcm}[lq=55mm,size=\large] + +\AQquestion{If the function $f$ is strictly increasing on $\mathbf{R}$ then the equation $f(x) = 0$ admits :} +{{At least one solution}, +[At most one solution], +{Exactly one solution} +} +\AQquestion{If the $f$ function is continuous and positive on $[a~ ;~ b]$ and $\mathcal{C}_{f}$ its representative curve in an orthogonal system. In units of area, the area $\mathcal{A}$ of the domain delimited by $\mathcal{C}_{f}$, the abscissa axis and the lines of equations $x = a$ 5 and $x = b$ is given by the formula : } +{% +{$\mathcal{A}= \displaystyle \int_{b}^a f(x)\ \text{d}x$}, +{$\mathcal{A}= \displaystyle \int_{a}^b f(x)\ \text{d}x$}, +{$\mathcal{A} = f(b) - f(a)$}} +\end{alterqcm} + +\medskip +\tkzname{Here is the corrected version} + +\begin{alterqcm}[lq=55mm,size=\large] +\AQquestion[pq=1mm]{If the $f$ function is strictly increasing on +$\mathbf{R}$ then the equation $f(x) = 0$ admits...} +{{At least one solution}, +{At most one solution}, +{Exactly one solution} +} +\AQquestion[pq=6mm]{If the $f$ function is continuous and positive on $[a~ ;~ b]$ + and $\mathcal{C}_{f}$ its representative curve in an orthogonal system. + In area units, the $\mathcal{A}$ area of the domain delimited by $\mathcal{C}_{f}$, the abscissa axis and the lines of equations $x = a$ and $x = b$ is given by the formula: } +{{$\mathcal{A}= \displaystyle \int_{b}^a f(x)\ \text{d}x$}, +{$\mathcal{A}= \displaystyle \int_{a}^b f(x)\ \text{d}x$}, +{$\mathcal{A} = f(b) - f(a)$} +} +\end{alterqcm} + +\medskip +\begin{tkzexample}[code only, small] + \begin{alterqcm}[lq=55mm,size=\large] + \AQquestion[pq=1mm]{If the $f$ function is strictly increasing on $\mathbf{R}$ + then the equation $f(x) =0 $ admits... + {{{At least one solution}, + [At most one solution], + {Exactly one solution}} +\end{tkzexample} + +\medskip +\begin{tkzexample}[code only, small] + \AQquestion[pq=6mm]{If the $f$ function is continuous and positive on $[a~ ;~ b]$ and $\mathcal{C}_{f}$ its representative curve in an orthogonal system. + In units of area, the area $\mathcal{A}$ of the domain delimited by $\mathcal{C}_{f}$, the abscissa axis and the lines of equations $x = a$ and $x = b$ is given by the formula: } + {{$\mathcal{A}= \displaystyle \int_{b}^a f(x)\ \text{d}x$}, + {$\mathcal{A}= \displaystyle \int_{a}^b f(x)\ \text{d}x$}, + {$\mathcal{A} = f(b) - f(a)$}} + \end{alterqcm} +\end{tkzexample} + +\subsection{Global and local use of \tkzname{pq}}\ + \Iopt{AQquestion}{pq} \IoptEnv{alterqcm}{pq} +This time, it is necessary to move several questions, I placed a |pq=2mm| globally, that is to say like this :\tkzcname{begin\{alterqcm\}[lq=85mm,pq=2mm]}. \textbf{All} questions are affected by this option but some questions were well placed and should remain so, so locally I give them back a |pq=0mm|. + +\medskip +\begin{alterqcm}[lq=85mm,pq=2mm] +\AQquestion{A bivariate statistical series. The values of $x$ are 1, 2, 5, 7, 11, 13 and a least squares regression line equation of $y$ to $x$ is $y = 1.35x +22.8$. The coordinates of the mean point are :} +{{$(6,5;30,575)$}, +{$(32,575 ; 6,5)$}, +{$(6,5 ; 31,575)$}} + +\AQquestion[pq=0mm]{$(u_{n})$ is an arithmetic sequence of reason $-5$.\\ Which of these statements is true? } +{{For all $n,~ u_{n+1} - u_{n} = 5$}, +{$u_{10}= u_{2}+ 40$}, +{$u_{3} = u_{7} + 20$} +} +\AQquestion[pq=0mm]{Equality $\ln (x^2 - 1) = \ln (x - 1) + \ln (x+1)$ is true} +{{For all $x$ in $]- \infty~;~-1[ \cup]1~;~+ \infty[$}, +{For all $x$ in $\mathbf{R} - \{-1~ ;~ 1\}$.}, +{For all $x$ in $]1~ ;~+\infty[$} +} +\AQquestion{For all $x$, the number \[\dfrac{\text{e}^x - 1}{\text{e}^x + 2}\hskip12pt \text{equal to :} \] } +{{$-\dfrac{1}{2}$}, +{$\dfrac{\text{e}^{-x} - 1}{\text{e}^{-x} + 2}$}, +{$\dfrac{1 - \text{e}^{-x}}{1 + 2\text{e}^{-x}}$} +} +\AQquestion{Let I $= \displaystyle\int_{\ln 2}^{\ln 3} \dfrac{1}{\text{e}^x - 1}\,\text{d}x$ and J $ = \displaystyle\int_{\ln 2}^{\ln 3} \dfrac{\text{e}^x}{\text{e}^x - 1}\,\text{d}x$ \\ then the number I $-$ J is equal to} +{{$\ln \dfrac{2}{3}$}, +{$\ln \dfrac{3}{2}$}, +{$\dfrac{3}{2}$} +} +\end{alterqcm} + +\medskip +\begin{tkzexample}[code only,vbox,small] + \begin{alterqcm}[lq=85mm,pq=2mm] + \AQquestion[pq=0mm]{Equality $\ln (x^2 - 1) = \ln (x - 1) + \ln (x+1)$ + is true} + {{For all $x$ in $]- \infty~;~-1[ \cup]1~;~+ \infty[$}, + {For all $x$ in $\mathbf{R} - \{-1~ ;~ 1\}$.}, + {For all $x$ in $]1~ ;~+\infty[$}} + \AQquestion{For any real $x$, the number \[\dfrac{\text{e}^x - 1} + {\text{e}^x + 2}\hskip12pt \text{equal to :} \] } + {{$-\dfrac{1}{2}$}, + {$\dfrac{\text{e}^{-x} - 1}{\text{e}^{-x} + 2}$}, + {$\dfrac{1 - \text{e}^{-x}}{1 + 2\text{e}^{-x}}$}} + \end{alterqcm} + \end{tkzexample} + + +\subsection{\tkzname{correction} and \tkzname{br} : rank of good answer} +\Iopt{AQquestion}{br} \Iopt{AQquestion}{correction} +First of all, it is necessary to ask for an answer key. To do this, just include the option \tkzname{correction} which is a boolean, thus set to \tkzname{true}. Then in each question, it is necessary to give the list of correct answers. For example, with \tkzname{br=1} or \tkzname{br=\{1,3\}}. + +Here is the previous year's correction: + +\medskip +\begin{tkzexample}[vbox,small] +\begin{alterqcm}[VF,correction,lq=125mm] + \AQquestion[br=1]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br=2]{The $F$ function has a maximum in $2$} + \AQquestion[br=2]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} +\end{alterqcm} +\end{tkzexample} + + +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-main.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-main.tex new file mode 100644 index 0000000000..e406bb4062 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-main.tex @@ -0,0 +1,164 @@ +% !TEX TS-program = xelatex +% encoding : utf8 +% TKZdoc-aq.tex +% Copyright (C) 2021 Alain Matthes +% Copyright (C) 2019 Alain Matthes, Apostolos Syropoulos, and Anastasios Dimou +% Copyright (C) 2020 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status `maintained'. +% The Current Maintainer of this work is Alain Matthes +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% doc altermqcm.sty encodage : utf8 % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Créé par Alain Matthes le 30/05/2020 % +% Copyright (c) 2020 __ AlterMundus __ All rights reserved. % +% version : 4.42 % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Fichier .tex de présentation du package alterqcm.sty +% d'après le code de DTK. +\documentclass[DIV=15, + fontsize=10, + headinclude=false, + index=totoc, + footinclude=false, + twoside, + headings=small + ]{tkz-doc} +\usepackage{etoc} +\gdef\tkznameofpack{alterqcm} +\gdef\tkzversionofpack{4.42c} +\gdef\tkzdateofpack{2021/01/21} +\gdef\tkznameofdoc{doc-alterqcm} +\gdef\tkzversionofdoc{4.42c} +\gdef\tkzdateofdoc{2021/01/21} +\gdef\tkzauthorofpack{Alain Matthes} +\gdef\tkzadressofauthor{} +\gdef\tkznamecollection{AlterMundus} +\gdef\tkzurlauthor{} +\gdef\tkzengine{xelatex} +\gdef\tkzurlauthorcom{http://altermundus.fr} +%\usepackage{xgreek} +\usepackage[dvipsnames,svgnames]{xcolor} +\usepackage{fancybox} +\usepackage{stmaryrd} +\usepackage{array,multirow,longtable} +\usepackage{tkz-tab,tkz-euclide,tkzexample} +\usepackage[english]{alterqcm} +\usepackage[colorlinks]{hyperref} +\hypersetup{ linkcolor=Gray, + citecolor=Green, + filecolor=Mulberry, + urlcolor=NavyBlue, + menucolor=Gray, + runcolor=Mulberry, + linkbordercolor=BrickRed, + citebordercolor=Green, + filebordercolor=Mulberry, + urlbordercolor=NavyBlue, + menubordercolor=Gray, + runbordercolor=Mulberry, + pdfsubject={qcm}, + pdfauthor={Alain Matthes}, + pdftitle={alterqcm}, + pdfkeywords={qcm, mathematics, table}, + pdfcreator={LaTeX} + } + +\usepackage{mathtools} +\usepackage{unicode-math,fourier-otf} +\setmainfont{Linux Libertine O} +\setmathfont[Scale=MatchUppercase]{Asana Math} +\setmonofont[Scale=MatchLowercase]{Consolas} +\usepackage{shortvrb,verbdef,fancyvrb,pifont} +\usepackage{multirow,multido,booktabs} +\usepackage[autolanguage]{numprint} +\usepackage{xeCJK} +\usepackage{textcomp} +\usepackage[all]{nowidow} +\widowpenalty10000 +\clubpenalty10000 +% %<––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\renewcommand*{\Ienv}[1]{\index{% +Environnement_1@\texttt{Environnement}!\texttt{#1}}} +\renewcommand*{\NameSys}[1]{% +\index{Système d'exploitation !#1@\texttt{#1}}} +%\usepackage[parfill]{parskip} +%\renewcommand{\labelitemi}{\lefthand} +%<––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\setlength\parindent{0pt} +\RequirePackage{makeidx} +%\def\tkzFileSavedPrefix{AQ} +\makeindex +\AtBeginDocument{\MakeShortVerb{\|}} +\def\lefthand{} +%\def\tkzHandBomb{} +\begin{document} +%<––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +\author{\tkzauthorofpack} +\title{\tkznameofpack} +\date{\today} +\clearpage +\thispagestyle{empty} +\maketitle +\clearpage +\tkzSetUpColors[background=white,text=darkgray] +\let\rmfamily\ttfamily +\nameoffile{\tkznameofpack} + +\defoffile{\tkzname{\tkznameofpack} (v 4.42 2020/08/17) Macros to support the creation of multiple-choice questionnaires in two-column tables. \tkzimp{Apostolos Syropoulos}, and \tkzimp{Anastasios Dimou} have adapted the package to use Greek. With the help of \tkzimp{Wolfgang Büchel} I added German, Russian and Italian. Finally it was \tkzimp{LianTze Lim} and \tkzimp{Chennan Zhang} who helped me with the Chinese translation. You can use another language with "unknown " option. With some languages, you need to compile with Xe\LaTeX. + \tkzname{alterqcm} is present on the \tkzname{CTAN} servers and is part of \tkzname{TeXLive} so \tkzname{tlmgr} or \tkzname{TeX Live Utility} will allow you to install it. + You will also find \tkzname{alterqcm} in \tkzname{MikTeX} under \tkzname{Windows XP}. +} + +\presentation + +\vspace*{2cm} + +\lefthand\ I thank \tkzimp{Jean-Côme Charpentier}, \tkzimp{Manuel Pégourié-Gonnard}, \tkzimp{Franck Pastor}, \tkzimp{Ulrike Fischer} and \tkzimp{Josselin Noirel} for the different ideas and advices that allowed me to make this package. Thanks also to \tkzimp{Wolfgang Büchel} for his corrections and scripts. + +\vfill +You can send your remarks, and reports on errors you have found. + at the following address \href{mailto:al.ma@mac.com}{\textcolor{blue}{Alain} Matthes} + + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either version 1.3 + of this license or (at your option) any later version. + +This work has the LPPL maintenance status `maintained'. + +The Current Maintainer of this work is Alain Matthes. + + +\clearpage\newpage +\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} + +\tableofcontents +%<–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––> +%\include{doc-aq-installation} +\include{doc-aq-first} +\include{doc-aq-def} +\include{doc-aq-globales} +\include{doc-aq-locales} +\include{doc-aq-mc} +\include{doc-aq-excomp} +\include{doc-aq-points} +\include{doc-aq-problem} +\include{doc-aq-greek} +\clearpage\newpage +\begin{multicols}{2} +\small\printindex +\end{multicols} +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-mc.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-mc.tex new file mode 100644 index 0000000000..4d4cebeeb9 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-mc.tex @@ -0,0 +1,209 @@ +\section{Complementary macros} + +\subsection{\tkzcname{AQmessage} : two-column message} + +It allows to insert in the table on the two columns, additional information for the candidate. + +In the following table, it is necessary to give indications and clarifications on the statement. This is done using the command \tkzcname{AQmessage}. I have used the package \tkzname{tkz-tab.sty} for this message as well as \emph{\texttt{AQmessage}} for some proposals, in order to make the proposal fit on several lines. This is necessary if one does not want to leave the table or if one does not want to restrict the space given to the questions. +This shows that many environments can be used in questions, messages and proposals at the same time. + +\begin{NewMacroBox}{AQmessage}{{\var{texte}}} + +\begin{tabular}{@{}Il Il Il@{}} \toprule \thead +argument & default & definition \\ \midrule +\tbody +\TAline{texte} {} {corps du message} +\bottomrule +\end{tabular} + +\medskip +\emph{This macro uses only one argument~: the text of the message. It can contain any kind of environment except, unfortunately, an array designed with \tkzname{tablor}. However, it is possible to import an array designed with \tkzname{tablor} with the macro \tkzcname{includegraphics}\footnotemark.} +\end{NewMacroBox}\Imacro{includegraphics} + +\footnotetext{package macro \tkzname{graphicx}} + +\begin{alterqcm}[lq=80mm,pre=false] +\AQmessage{\begin{minipage}{15cm} +\vspace*{6pt} + Let $f$ be a function defined and derivable over the interval $]-5~;~+\infty[$ whose table of variations is given below : +\begin{center}\begin{tikzpicture} +\def\tkzTabDefaultWritingColor{brown} +\def\tkzTabDefaultBackgroundColor{orange!20} +\tkzTabInit{$x$/1,$f(x)$/3} {$-5$,$-1$,$0$,$2$,$+\infty$} +\tkzTabVar{-/$-\infty$ /,+/$-3$/,-/$-5$/,+/4/,-/{4,5}/} +\end{tikzpicture}\end{center} + We designate by $\mathcal{C}$ the curve representative of $f$. + \vspace*{6pt} +\end{minipage} +} +\AQquestion{In the interval $]-5~;~+\infty[$, the equation $f(x) = -2$ admits } +{{only one solution}, +{two solutions}, +{four solutions}} +\end{alterqcm} + +\begin{tkzexample}[code only] + \begin{alterqcm}[lq=95mm,pre=false] + \AQmessage{ Let $f$ be a function defined and derivable on the interval%. + $]-5~;~+\infty[$ whose table of variations is given below: + \begin{center}\begin{tikzpicture} + \tkzTabInit{$x$/1,$f(x)$/3} {$-5$,$-1$,$0$,$2$,$+\infty$} + \tkzTabVar{-/$-\infty$ ,+/$-3$,-/$-5$,+/$4$,-/${4,5}$}% + \end{tikzpicture}\end{center} + It is designated by $\mathcal{C}$ the curve representative of $f$.} +\AQquestion{Over the interval $]-5~;~+\infty[$,the equation $f(x) = -2$ admits} + {{only one solution}, + {two solutions}, + {four solutions}} + \end{alterqcm}\end{tkzexample} + + +\subsection{\tkzcname{AQms} : use of invisible line} + +\begin{NewMacroBox}{AQms}{(height,depth)} + \begin{tabular}{@{}Il Il Il@{}} \toprule \thead + argument & default & definition \\ \midrule + \tbody + \TAline{height} {} {line height} + \TAline{depth} {} {line depth} + \bottomrule + \end{tabular} + +\medskip +\emph{It's an invisible line useful if it is necessary to make more space around a proposal.} + +\textcolor{red}{\emph{\texttt{ It should not be used!}}} + +\end{NewMacroBox} +\footnotetext{ see the macro \tkzcname{strut}} + +\begin{tkzexample}[code only,width=\textwidth-1pt] + \def\AQms(#1,#2){\vrule height #1pt depth #2pt width 0pt} + \end{tkzexample} + +\begin{tkzexample}[width=8cm] + \begin{minipage}[]{7.5cm} + \begin{alterqcm}% + [lq=4cm] + \AQquestion{Question} + {% + {Proposition 1}, + {Proposition 2\AQms(16,14)}, + {Proposition 3}} + \end{alterqcm} + \end{minipage} +\end{tkzexample} + +\subsection{\tkzcname{InputQuestionList} : Multiple choice from a list of files} + +\begin{NewMacroBox}{InputQuestionList}{\var{path}\var{prefix}\var{list of integers}} + +\begin{tabular}{@{}Il Il Il@{}} \toprule \thead + argument & default & definition \\ \midrule + \tbody +\TAline{path} {} {path that leads to the folder containing the files} \TAline{prefix} {} {file names : .tex} +\TAline{list of integers}{}{list of integers corresponding to the files} +\bottomrule + \end{tabular} + + \medskip +\emph{This macro allows you to insert questions recorded in files into a table. A file can contain one or more questions with the corresponding propositions. \tkzname{path} is the path to the folder containing the files. \tkzname{prefix} is used to name the files, an integer uniquely determines the file.} + +\end{NewMacroBox} + +Let's say the file \tkzname{qcm-1.tex} + +\begin{tkzltxexample}[] +\AQquestion{What was the precursor language of the C language?} +{{Fortran}, + {language B}, + {Basic}} +\end{tkzltxexample} + +\medskip +Either the file \tkzname{qcm-2.tex} + +\begin{tkzltxexample}[] +\verbdef\argprop|int a = 3 ^ 4 ;| +\AQquestion{\argprop} +{{raises 3 to the power of 4}, + {makes an exclusive OR between 3 and 4}, + {is not a C}} +\end{tkzltxexample} + +\bigskip +Suppose we create a series of files in a folder \textbf{|iut|} with the following names \newline + \tkzname{qcm-1.tex}, \tkzname{qcm-2.tex}, \ldots ,\tkzname{qcm-$n$.tex}. The prefix to name these files is \tkzname{qcm-}. + +The path to this folder is for example +|/examples/latex/iut/|. + +The result is: + +\newcommand*{\listpath}{/Users/ego/Desktop/waiting/alterqcm_new/examples/iut/} + +\begin{alterqcm}[lq=80mm] + \InputQuestionList{\listpath}{qcm-}{2,1} +\end{alterqcm} + +\begin{tkzexample}[code only] +\newcommand*{\listpath}{/Users/ego/Desktop/waiting/alterqcm_new/examples/iut/} +\begin{alterqcm}[lq=80mm] + \InputQuestionList{\listpath}{qcm-}{2,1} +\end{alterqcm} +\end{tkzexample} + +\subsection{The command \tkzcname{AQannexe}} + + +\begin{NewMacroBox}{AQannexe}{\oarg{local options}\var{start}\var{end}\var{col}} +\begin{tabular}{@{}Il Il Il@{}} \toprule \thead +arguments & default & definition \\ \midrule +\tbody +\TAline{start} {} {first row number} +\TAline{end} {} {last row number} +\TAline{col} {} {number of proposals} + \bottomrule +\end{tabular} + +\medskip +\emph{This macro uses three arguments. These are three integers. \tkzname{start} is the row of the first row, \tkzname{end} is the final row and \tkzname{col} is the number of propositions. } + +\medskip +\begin{tabular}{@{}Il Il Il@{}} \toprule \thead +Options & default & definition \\ \midrule +\tbody +\TOline{VF} {false} { true or false; displays T and F } +\TOline{propstyle} {\BS arabic} { proposal numbering style } \\ +\bottomrule +\end{tabular} + +\medskip +\emph{\tkzname{VF} allows to display V and F to identify the proposals but it is necessary that \tkzname{col} is equal to two} + +\medskip + +\end{NewMacroBox} + +\begin{tkzltxexample}[] + \documentclass{article} + \usepackage[utf8]{inputenc} + \usepackage[T1]{fontenc} + \usepackage{lmodern} + \usepackage{alterqcm,fullpage} + \thispagestyle{empty} + + \begin{document} + NAME: + + FIRST NAME: + + \vspace{1cm}{ \Large + \AQannexe{1}{10}{2}\hspace{2cm} + \AQannexe[propstyle=\alph]{11}{20}{3}} + \end{document} +\end{tkzltxexample} + +\AQannexe{1}{10}{2}\hspace{2cm} +\AQannexe[propstyle=\alph]{11}{20}{3} +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-points.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-points.tex new file mode 100644 index 0000000000..faee7df399 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-points.tex @@ -0,0 +1,39 @@ +\section{Points assigned to an MCQ} + +It is possible to assign points to an MCQ using the rudimentary macro \tkzcname{AQpoints}. + + +\subsection{Example} + + +\begin{tkzltxexample}[] +\AQpoints{10} +\begin{alterqcm}[symb = \dingsquare, lq=7cm] + \AQquestion{If \numprint{3,24} is the truncation of $x$ to the hundredth..., then we're sure that :} +{% + {\begin{minipage}[t]{\linewidth-1cm} + $3,235\leqslant x <3,245$\\ + \end{minipage}} , + {\begin{minipage}[t]{\linewidth-1cm} + $3,24\leqslant x <3,25$\\ + \end{minipage}} , + {\begin{minipage}[t]{\linewidth-1cm} + $x$ is closer to \numprint{3,24} than \numprint{3,25} + \end{minipage}}} +\end{alterqcm} +\end{tkzltxexample} + +\medskip +\AQpoints{10} + \begin{alterqcm}[symb = \dingsquare, lq=7cm] + \AQquestion{Si \numprint{3,24} is the truncation of $x$ to the hundredth..., then we're sure that :} + {{\begin{minipage}[t]{\linewidth-1cm}$3,235\leqslant x <3,245$\\ + \end{minipage}} , + {\begin{minipage}[t]{\linewidth-1cm} $3,24\leqslant x <3,25$\\ + \end{minipage}} , + {\begin{minipage}[t]{\linewidth-1cm} + $x$ is closer to \numprint{3,24} than \numprint{3,25} + \end{minipage}}} + +\end{alterqcm} +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/doc/latex/doc-aq-problem.tex b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-problem.tex new file mode 100644 index 0000000000..1615fbf841 --- /dev/null +++ b/macros/latex/contrib/alterqcm/doc/latex/doc-aq-problem.tex @@ -0,0 +1,25 @@ +\section{Known issues and FAQs} + +\subsection{Incompatibility with \tkzname{colortbl.sty}} + + The problem is that \tkzname{colortbl.sty} is sometimes incompatible with the command \tkzname{multicolumn}. The text used in the \tkzname{multicolumn} command should contain only one paragraph. + Simply do not use the \tkzname{AQmessage} command. One solution is to interrupt the quiz to display what you want and then resume the table. + + \subsection{FAQ} + \subsubsection{Translation of commands} + Some commands can be translated or modified such as : \tkzcname{aq@pre} and \tkzcname{aq@preVF}, all you have to do is use \tkzcname{renewcommand} + +\begin{tkzltxexample}[] +\makeatletter + \renewcommand{\aq@pre}{Pour chacune des questions ci-dessous, une seule des + r\'eponses propos\'ees est exacte. Vous devez cocher la r\'eponse exacte + sans justification. + Une bonne r\'eponse rapporte \textbf{\cmdAQ@global@bonus\ point}. Une + mauvaise r\'eponse enl\`eve \textbf{\cmdAQ@global@malus\ point}. L'absence + de r\'eponse ne rapporte ni n'enl\`eve aucun point. Si le total des points + est n\'egatif, la note globale attribu\'ee \`a l'exercice est \textbf{0}.}% +\makeatother +\end{tkzltxexample} + + +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-1.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-1.tex new file mode 100644 index 0000000000..c3a1f8469b --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-1.tex @@ -0,0 +1,4 @@ +\AQquestion{What was the precursor language C ?} +{{Fortran}, + {Language B}, + {Basic}} diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-10.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-10.tex new file mode 100644 index 0000000000..ae3ca6f928 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-10.tex @@ -0,0 +1,5 @@ +\AQquestion{La syntaxe complète de la fonction \texttt{main} est \ldots}% +{{\texttt{int main(int argc, char* argv)}}, + {\texttt{int main(int argc, char argv*[])}}, + {\texttt{int main(int argc, char* argv[])}}} +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-2.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-2.tex new file mode 100644 index 0000000000..c7ff4541fc --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-2.tex @@ -0,0 +1,5 @@ +\verbdef\arg|int a = 3 ^ 4 ;| +\AQquestion{\arg} +{{raises 3 to the power of 4}, + {makes an exclusive OR between 3 and 4}, + {is not a C}} diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-3.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-3.tex new file mode 100644 index 0000000000..48a3c89c2d --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-3.tex @@ -0,0 +1,4 @@ +\AQquestion{What's the correct syntax for shifting the integer \texttt{a} eight bits to the left?} +{{\texttt{b = lshift(a, 8) ;}}, + {\texttt{b = 8 << a ;}}, + {\texttt{b = a << 8 ;}}} diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-4.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-4.tex new file mode 100644 index 0000000000..100cc38032 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-4.tex @@ -0,0 +1,4 @@ +\AQquestion{The complete program:\\ +\texttt{int main() \\ +~~\{ printf ("hello") ; return 0 ; \}}} +{{affiche \texttt{hello}},{gives an error at compile time},{gives an error at runtime}}\endinput \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-5.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-5.tex new file mode 100644 index 0000000000..7176687b27 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-5.tex @@ -0,0 +1,4 @@ +\AQquestion{La ligne \texttt{printf("\%c", argv[2][0]) ;} du \texttt{main} de \texttt{monProg} exécuté ainsi : \texttt{monProg parametre}} +{{affiche \texttt{p}}, + {n'affiche rien}, + {peut provoquer un plantage}} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-6.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-6.tex new file mode 100644 index 0000000000..2f5fa10760 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-6.tex @@ -0,0 +1,4 @@ +\AQquestion{Quelle est la taille en mémoire d'un \texttt{long int} ?} +{{4 octets}, + {8 octets}, + {ça dépend \ldots}} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-7.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-7.tex new file mode 100644 index 0000000000..e6f5f60edf --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-7.tex @@ -0,0 +1,4 @@ +\AQquestion{Following the declaration \texttt{int * i} ;} +{{\texttt{*i} is an address}, + {\texttt{*i} is an integer}, + {\texttt{*i} is a pointer}} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-8.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-8.tex new file mode 100644 index 0000000000..d3f8d52a51 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-8.tex @@ -0,0 +1,4 @@ +\AQquestion{After the declaration \texttt{char tab[12]} ;} +{{\texttt{\&tab} is the address of the table}, + {\texttt{\&tab} is the pointer to the array}, + {\texttt{\&tab} means nothing}} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/iut/qcm-9.tex b/macros/latex/contrib/alterqcm/examples/iut/qcm-9.tex new file mode 100644 index 0000000000..85af22ff5b --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/iut/qcm-9.tex @@ -0,0 +1,4 @@ +\AQquestion{Un des choix suivants n'est pas une bibliothèque standard du C} +{{\texttt{stdlib}}, + {\texttt{stdin}}, + {\texttt{math}}} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/AntillesESjuin2006.tex b/macros/latex/contrib/alterqcm/examples/latex/AntillesESjuin2006.tex new file mode 100644 index 0000000000..0a7203e926 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/AntillesESjuin2006.tex @@ -0,0 +1,77 @@ +\documentclass[11pt]{article} +\usepackage{xkeyval,array,multirow,amsmath,amssymb} +\usepackage{fullpage,longtable} +\usepackage[english]{alterqcm} +\usepackage[english]{babel} + +\begin{document} +\begin{alterqcm}[lq=90mm,pre=true,long] + +\AQquestion{Among the following propositions, which one allows to affirm that the exponential function admits for asymptote the equation line $y = 0$?} +{{$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$}, +{$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$}, +{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}} + +\AQquestion{Among the following propositions, which is the one that allows to affirm that the inequation $\ln (2x + 1) \geqslant \ln (x + 3)$ admits the interval $\big[2~;~+\infty\big[$ as a set of solution? } +{{\begin{minipage}{5cm}the ln function is positive on $\big[1~;~+\infty\big[$\end{minipage}}, +{$\displaystyle\lim_{x \to +\infty} \ln x = + \infty$}, +{\begin{minipage}{5cm}the $\ln$ function is increasing on $\big]0~;~+\infty\big[$\end{minipage}} +} + +\AQquestion{Among the following propositions, which one allows us to assert that a primitive of the function $f$ defined on $\mathbb{R}$ by $x \mapsto (x + 1)\text{e}^x$ is the function $g~:~x~ \mapsto~ x~ \text{e}^x$~? } +{{for all real $x,~f'(x) = g(x)$}, +{for all real $x,~g'(x) = f(x)$}, +{\begin{minipage}{5.5cm} for all real $x,~g(x) = f'(x) + k$, $k$ some kind of real \end{minipage}}} + +\AQquestion[pq=2mm]{ The equation $2\text{e}^{2x} - 3\text{e}^x + 1 = $0 admits for set solution} +{{$\left\{\dfrac{1}{2}~;~1\right\}$}, +{$\left\{0~;~\ln \dfrac{1}{2}\right\}$}, +{$\big\{0~;~\ln 2\big\}$} +} + +\AQquestion[pq=2mm]{For all $n \in \mathbb{N}$ } +{{$\displaystyle\lim_{x \to +\infty} \frac{\text{e}^x}{x^n} = 1$}, +{$\displaystyle\lim_{x \to +\infty} \frac{\text{e}^x}{x^n} = +\infty$}, +{$\displaystyle\lim_{x \to +\infty} \frac{\text{e}^x}{x^n} = 0$}} + +\AQquestion[pq=1pt]{Let $f$ be the function set to $\big]0~;~+\infty\big[$ par $f(x) = 2\ln x - 3x + 4$. In a benchmark, an equation of the tangent to the curve representing $f$ at abscissa point 1 is :} +{{$y = - x + 2$}, +{$y = x + 2$}, +{$y = - x - 2$} +} + +\AQquestion[pq=2mm]{The mean value over $\big[1; 3\big]$ of the $f$ function defined by : $f(x) = x^2 + 2x$ is:} +{{$\dfrac{50}{3}$}, +{$\dfrac{25}{3}$}, +{$6$} +} +\AQquestion{ exp$(\ln x) = x$ for any $x$ belonging to } +{{$\mathbb{R}$}, +{$\big]0~;~+ \infty\big[$}, +{$\big[0~;~+\infty\big[$} +} +\AQquestion[pq=1pt]{Let $f$ be the function set to $\big]0~;~+\infty\big [$ per $f(x) = 2\ln x - 3x + 4$. In a benchmark, an equation of the tangent to the curve representing $f$ at abscissa point 1 is :} +{{$y = - x + 2$}, +{$y = x + 2$}, +{$y = - x - 2$} +} + +\AQquestion[pq=2mm]{The mean value over $\big[1; 3\big]$ of the $f$ function defined by : $f(x) = x^2 + 2x$ is:} +{{$\dfrac{50}{3}$}, +{$\dfrac{25}{3}$}, +{$6$} +} +\AQquestion{ exp$(\ln x) = x$ for any $x$ belonging to } +{{$\mathbb{R}$}, +{$\big]0~;~+ \infty\big[$}, +{$\big[0~;~+\infty\big[$} +} +\end{alterqcm} +\end{document} + +% AntillesESjuin2006 + +% encoding : utf8 +% format : pdflatex +% engine : pdfetex +% author : Alain Matthes \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/alea.tex b/macros/latex/contrib/alterqcm/examples/latex/alea.tex new file mode 100644 index 0000000000..1a562632a4 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/alea.tex @@ -0,0 +1,31 @@ +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{fourier} +\usepackage{alterqcm} +\usepackage{fullpage} +\thispagestyle{empty} + +\begin{document} +\begin{minipage}{12cm} + \begin{alterqcm}[lq=55mm,alea,sep] + \AQquestion[pq=1mm]{If the function $f$ is strictly increasing on $\mathbf{R}$ then the equation $f(x) = 0$ admits :} + {{At least one solution},% + {Only one solution},% + {Exactly one solution}} + \end{alterqcm} + + \vspace{1cm} + \begin{alterqcm}[lq=55mm,alea,sep=false] + \AQquestion[pq=1mm]{If the function $f$ is strictly increasing on $\mathbf{R}$ then the equation $f(x) = 0$ admits :} + {{At least one solution},% + {Only one solution},% + {Exactly one solution}} + \end{alterqcm} +\end{minipage} + +\end{document} + +% utf8 +% pdflatex +% Alain Matthes \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/annexe.tex b/macros/latex/contrib/alterqcm/examples/latex/annexe.tex new file mode 100644 index 0000000000..d4ff4f388a --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/annexe.tex @@ -0,0 +1,21 @@ +\documentclass[a4paper]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{fourier} +\usepackage{alterqcm} +\usepackage{fullpage} +\thispagestyle{empty} + +\begin{document} +{\Large +NAME: + +FIRST NAME: + +\bfseries +\vspace{1cm} +\AQannexe[propstyle=\bfseries\arabic]{1}{10}{4}% + \hspace{2cm} +\AQannexe[propstyle=\bfseries\alph]{11}{20}{3}} +\end{document} + diff --git a/macros/latex/contrib/alterqcm/examples/latex/correct.tex b/macros/latex/contrib/alterqcm/examples/latex/correct.tex new file mode 100644 index 0000000000..93bbee4815 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/correct.tex @@ -0,0 +1,27 @@ +\documentclass[10pt]{article} +\usepackage[utf8]{inputenc} +\usepackage[upright]{fourier} +\usepackage{amsmath,amssymb,stmaryrd} +\usepackage{fullpage} +\usepackage{alterqcm} +\usepackage[frenchb]{babel} +\parindent=0pt +\newlength{\oldtextwidth} +\begin{document} + \setlength{\oldtextwidth}{\textwidth} + \setlength{\textwidth}{14cm} + \begin{alterqcm}[VF, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} +\setlength{\textwidth}{\oldtextwidth} +\end{document} +% encoding : utf8 +% format : pdflatex +% engine : pdfetex +% author : Alain Matthes \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/example_2.tex b/macros/latex/contrib/alterqcm/examples/latex/example_2.tex new file mode 100644 index 0000000000..da5f94b482 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/example_2.tex @@ -0,0 +1,36 @@ +\documentclass[11pt]{article} +\usepackage{amsmath,amssymb,stmaryrd,calc}%}% pour geqslant qui existe ds fourier +\usepackage{xkeyval} +\usepackage{multirow,longtable} +\usepackage[% + a4paper,% + textwidth=16cm, + top=2cm,% + bottom=2cm,% + headheight=25pt,% + headsep=12pt,% + footskip=25pt]{geometry}% + +\usepackage{alterqcm} +% on charge le package +% longtable en cas de débordement du tableau +% amsmath car les exemples sont des annales du bac en mathématiques. +\usepackage[frenchb]{babel} +\parindent=0pt +\begin{document} + + + +\begin{alterqcm}[lq=80mm,long] +\AQquestion{Among the following propositions, which one allows to affirm that the exponential function admits for asymptote the equation line $y = 0$?} +{{$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$}, +{$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$}, +{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}} + +\AQquestion[]{exp$(\ln x) = x$ for any $x$ belonging to } +{{$\mathbf{R}$}, +{$\big]0~;~+ \infty\big[$}, +{$\big[0~;~+\infty\big[$} +}\end{alterqcm} + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/example_3.tex b/macros/latex/contrib/alterqcm/examples/latex/example_3.tex new file mode 100644 index 0000000000..606e30a251 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/example_3.tex @@ -0,0 +1,64 @@ +\documentclass[11pt]{article} +\usepackage{xltxtra} +\usepackage{xgreek} +\usepackage{amsmath,amssymb,stmaryrd,calc}%}% pour geqslant qui existe ds fourier +\usepackage{xkeyval} +\usepackage{multirow,longtable} +\usepackage[% + a4paper,% + textwidth=16cm, + top=2cm,% + bottom=2cm,% + headheight=25pt,% + headsep=12pt,% + footskip=25pt]{geometry}% +\usepackage[greek]{alterqcm} +\usepackage{tikz} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\parindent=0pt +\begin{document} +\setmainfont[Mapping=tex-text,Ligatures=Common]{Minion Pro} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\nogreekalph +\begin{minipage}[t][][b]{.45\linewidth} + Έστω $f$ ορισμένη και παραγωγίσιμη στο διάστημα $\big[-3,\,+\infty\big)$, + αύξουσα στα διαστήματα $\big[-3,\,-1\big]$ και $\big[2,\,+\infty\big)$ + και φθίνουσα στο διάστημα $\big[-1,\,2\big]$. +Έστω $f^{\prime}$ η παράγωγός της στο διάστημα $[-3,\,+\infty)$. + Η γραφική παράσταση $\Gamma$ της $f$ είναι σχεδιασμένη στο διπλανό σχήμα ως προς ένα ορθογώνιο σύστημα αξόνων $\big(O,~\vec{\imath},~\vec{\jmath}\big)$. + Διέρχεται από το σημείο A$(-3,\,0)$ και δέχεται ως ασύμπτωτη της ευθεία + $(\delta)$ με εξίσωση $y = 2x -5$. +\end{minipage} +\begin{minipage}[t][][b]{.45\linewidth} + \null + \begin{tikzpicture}[scale=0.5,>=latex] + \draw[very thin,color=gray] (-3,-2) grid (10,8); + \draw[->] (-3,0) -- (10,0) node[above left] {\small $x$}; + \foreach \x in {-3,-2,-1,1,2,...,9} + \draw[shift={(\x,0)}] (0pt,1pt) -- (0pt,-1pt)node[below] { $\x$}; + \draw[->] (0,-2) -- (0,8) node[below right] {\small $y$}; + \foreach \y/\ytext in {-2,-1,1,2,...,8} + \draw[shift={(0,\y)}] (1pt,0pt) -- (-1pt,0pt) node[left] { $\y$}; + \draw (-0.5,-2) -- (10,8); + \node[above right] at (-3,0) {\textbf{A}}; + \node[above right] at (0,0) {\textbf{O}}; + \node[below right] at (4,3) {$\mathbf{\Delta}$}; + \node[above right] at (4,5) {$\mathbf{\Gamma}$}; + \draw plot[smooth] coordinates{% + (-3,0)(-2,4.5)(-1,6.5)(0,5.5)(1,3.5)(2,3)(3,3.4)(4,4.5)(5,6)(6,7.75)}; + \end{tikzpicture} +\end{minipage} + +\vspace{20pt} +\begin{alterqcm}[VF,pre=true,lq=125mm] + \AQquestion{Για κάθε $x \in (-\infty,\,2],\;f^{\prime}(x) \geqslant 0$.} + \AQquestion{Η συνάρτηση $F$ παρουσιάζει μέγιστο στο $2$} + \AQquestion{$\displaystyle\int_{0}^2 f’(x)\:\text{d}x = - 2$} +\end{alterqcm} +%\greekalph %%% <---------------------------------------------- + +\end{document} diff --git a/macros/latex/contrib/alterqcm/examples/latex/lang_chinese.tex b/macros/latex/contrib/alterqcm/examples/latex/lang_chinese.tex new file mode 100644 index 0000000000..9bc9f9f653 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/lang_chinese.tex @@ -0,0 +1,55 @@ +% !TEX TS-program = xelatex +\documentclass[12pt]{article} +\usepackage{xeCJK} +\usepackage[chinese]{alterqcm} +\usepackage{mathtools} +\usepackage{unicode-math} +\usepackage{fourier-otf} +\usepackage[chinese]{alterqcm} +\usepackage{fullpage}% +\parindent=0pt +\newlength{\oldtextwidth} +\def\nogreekalph{} +\begin{document} + + +\begin{alterqcm}[VF,lq=125mm,symb = \dingsquare,pre=true] +\AQquestion{$x \in ]-3~;~2]$的情形下,$f'(x) \geq 0$。} +\AQquestion{$F$ 函数的最大值为$2$。} +\AQquestion{$\displaystyle\int_{0}^2 f’(x)\:\text{d}x = - 2$} +\end{alterqcm} + +\begin{alterqcm}[pre=true] +\AQquestion{问题}{% +{选择1}, +{选择2}, +{选择3}} +\end{alterqcm} + + \begin{alterqcm}[VF, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + \begin{alterqcm}[VF,pre, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + +\end{document} + +% utf8 +% xelatex +% Alain Matthes + diff --git a/macros/latex/contrib/alterqcm/examples/latex/lang_german.tex b/macros/latex/contrib/alterqcm/examples/latex/lang_german.tex new file mode 100644 index 0000000000..ad8b1c2ed3 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/lang_german.tex @@ -0,0 +1,56 @@ +\documentclass[12pt]{article} + +\usepackage{mathtools} +\usepackage{unicode-math} +\usepackage{fourier-otf} +\setmainfont[Mapping=tex-text,Ligatures=Common]{Minion Pro} \setmathfont[Scale=MatchUppercase]{Asana Math} +\usepackage{alterqcm} +\usepackage{fullpage}% +\usepackage[french]{babel} +\parindent=0pt +\newlength{\oldtextwidth} +\def\nogreekalph{} +\begin{document} + + + +\begin{alterqcm}[language=german,pre] + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} +\end{alterqcm} + +\begin{alterqcm}[language=english,pre] + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} +\end{alterqcm} + + \begin{alterqcm}[VF, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + \begin{alterqcm}[VF,pre, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + +\end{document} + +% utf8 +% pdflatex or lulatex +% Alain Matthes \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/language.tex b/macros/latex/contrib/alterqcm/examples/latex/language.tex new file mode 100644 index 0000000000..46a21949ef --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/language.tex @@ -0,0 +1,90 @@ +% !TEX TS-program = xelatex +\documentclass[12pt]{article} +\usepackage{mathtools} +\usepackage{unicode-math} +\usepackage{fourier-otf} +\setmainfont[Mapping=tex-text,Ligatures=Common]{Minion Pro} \setmathfont[Scale=MatchUppercase]{Asana Math} +\usepackage[german]{alterqcm} +\usepackage{fullpage}% +\usepackage[french]{babel} +\parindent=0pt +\newlength{\oldtextwidth} +\def\nogreekalph{} +\begin{document} + + + +\begin{alterqcm} + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} +\end{alterqcm} + +\begin{alterqcm}[pre] + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} +\end{alterqcm} + + \begin{alterqcm}[VF, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + \begin{alterqcm}[VF,pre, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + + \begin{alterqcm}[language=english] + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} +\end{alterqcm} + +\begin{alterqcm} [language=greek] + \AQquestion{Ερώτηση}{% + {Επιλογή 1}, + {Επιλογή 2}, + {Επιλογή 3} + } + \end{alterqcm} + + \setlength{\oldtextwidth}{\textwidth} + \setlength{\textwidth}{14cm} + \begin{alterqcm}[language=greek,VF, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + \begin{alterqcm}[language=english,VF, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + \setlength{\textwidth}{\oldtextwidth} + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/points.tex b/macros/latex/contrib/alterqcm/examples/latex/points.tex new file mode 100644 index 0000000000..df54754de5 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/points.tex @@ -0,0 +1,23 @@ +\documentclass[a4paper,10 pt]{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[upright]{fourier} +\usepackage{alterqcm} +\usepackage[np]{numprint} +\usepackage[francais]{babel} + +\begin{document} +\AQpoints[0.5 cm]{10} + +\begin{alterqcm}[symb = \dingsquare, lq=6cm] +\AQquestion{Si \np{3,24} is truncating $x$ to the hundredth, so we're sure that:} +{{\begin{minipage}[t]{\linewidth-1cm}$3,235\leqslant x <3,245$\\ + \end{minipage}} , + {\begin{minipage}[t]{\linewidth-1cm} $3,24\leqslant x <3,25$\\ + \end{minipage}} , + {\begin{minipage}[t]{\linewidth-1cm} + $x$ is nearer to 3.24 than it is to... \np{3,25} + \end{minipage}}} +\end{alterqcm} + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/sep.tex b/macros/latex/contrib/alterqcm/examples/latex/sep.tex new file mode 100644 index 0000000000..83bd6c4b81 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/sep.tex @@ -0,0 +1,31 @@ +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{fourier} +\usepackage{alterqcm} +\usepackage{fullpage} +\thispagestyle{empty} + +\begin{document} + + +\begin{alterqcm}[lq=55mm,alea,sep] +\AQquestion[pq=1mm]{If the function $f$ is strictly increasing on $\mathbf{R}$ then the equation $f(x) = 0$ admits :} +{{At least one solution},% +{At most one solution},% +{Exactly one solution}} +\end{alterqcm} + +\vspace{1cm} +\begin{alterqcm}[lq=55mm,alea,sep=false] +\AQquestion[pq=1mm]{If the function $f$ is strictly increasing on $\mathbf{R}$ then the equation $f(x) = 0$ admits :} +{{At least one solution},% +{At most one solution},% +{Exactly one solution}} +\end{alterqcm} + +\end{document} + +% utf8 +% pdflatex +% Alain Matthes \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/test_language.tex b/macros/latex/contrib/alterqcm/examples/latex/test_language.tex new file mode 100644 index 0000000000..f6debc0a57 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/test_language.tex @@ -0,0 +1,51 @@ +% !TEX TS-program = lualatex +\documentclass[12pt]{article} +\usepackage{mathtools} +\usepackage{unicode-math} +\usepackage{fourier-otf} +\setmainfont[Mapping=tex-text,Ligatures=Common]{Minion Pro} \setmathfont[Scale=MatchUppercase]{Asana Math} +\usepackage{alterqcm} +\usepackage{fullpage}% +\usepackage[german]{babel} +\parindent=0pt +\newlength{\oldtextwidth} +\def\nogreekalph{} +\begin{document} + + + +\begin{alterqcm}[language=german,pre] + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} +\end{alterqcm} + +\begin{alterqcm}[language=english,pre] + \AQquestion{Question}{% + {Proposition 1}, + {Proposition 2}, + {Proposition 3}} +\end{alterqcm} + + \begin{alterqcm}[VF, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + + \begin{alterqcm}[VF,pre, + correction, + lq = 100mm, + symb = \dingsquare, + corsymb = \dingchecksquare] + \AQquestion[br={1}]{For all $x \in ]-3~;~2],~f'(x) \geqslant 0$.} + \AQquestion[br={2}]{The $F$ function has a maximum in $2$} + \AQquestion[br={2}]{$\displaystyle\int_{0}^2 f'(x)\:\text{d}x = - 2$} + \end{alterqcm} + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/transparent-final.tex b/macros/latex/contrib/alterqcm/examples/latex/transparent-final.tex new file mode 100644 index 0000000000..942ab45cac --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/transparent-final.tex @@ -0,0 +1,40 @@ +\documentclass[11pt]{article} +\usepackage[utf8]{inputenc}% sauf si vous avez changé l'encodage +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amsmath,amssymb,stmaryrd,calc}%}% pour geqslant qui existe ds fourier +\usepackage{xkeyval} +\usepackage{multirow,longtable} +\usepackage[% + a4paper,% + textwidth=16cm, + top=2cm,% + bottom=2cm,% + headheight=25pt,% + headsep=12pt,% + footskip=25pt]{geometry}% + +\usepackage{alterqcm} +% on charge le package +% longtable en cas de débordement du tableau +% amsmath car les exemples sont des annales du bac en mathématiques. +\usepackage[frenchb]{babel} +\parindent=0pt +\begin{document} + +\begin{alterqcm}[transparent,correction,corsymb=\dingchecksquare,lq=100mm] + \AQquestion[br=3,pq=3mm]{Among the following propositions, which one allows us to affirm that the exponential function admits for asymptote the line of equation $y = 0$ ?} + {{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}, + {$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$}, + {$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$} + } + + \AQquestion[br=2]{exp$(\ln x) = x$ for any $x$ belonging to } + {{$\mathbf{R}$}, + {$\big]0~;~+ \infty\big[$}, + {$\big[0~;~+\infty\big[$} + } +\end{alterqcm} + + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/transparent-init.tex b/macros/latex/contrib/alterqcm/examples/latex/transparent-init.tex new file mode 100644 index 0000000000..b2609ac4b0 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/transparent-init.tex @@ -0,0 +1,41 @@ +\documentclass[11pt]{article} +\usepackage[utf8]{inputenc}% sauf si vous avez changé l'encodage +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage{amsmath,amssymb,stmaryrd,calc}%}% pour geqslant qui existe ds fourier +\usepackage{xkeyval} +\usepackage{multirow,longtable} +\usepackage[% + a4paper,% + textwidth=16cm, + top=2cm,% + bottom=2cm,% + headheight=25pt,% + headsep=12pt,% + footskip=25pt]{geometry}% + +\usepackage{alterqcm} +% on charge le package +% longtable en cas de débordement du tableau +% amsmath car les exemples sont des annales du bac en mathématiques. +\usepackage[frenchb]{babel} +\parindent=0pt +\begin{document} + +\begin{alterqcm}[correction,corsymb=\dingchecksquare,lq=100mm] +\AQquestion[br=3,pq=3mm]{Among the following propositions, which one allows us to affirm that the exponential function admits for asymptote the line of equation $y = 0$ ?} +{{$\displaystyle\lim_{x \to +\infty} \dfrac{\text{e}^x}{x} = + \infty$}, +{$\displaystyle\lim_{x \to +\infty} \text{e}^x = + \infty$}, +{$\displaystyle\lim_{x \to -\infty} \text{e}^x = 0$} +} + +\AQquestion[br=2]{exp$(\ln x) = x$ for any $x$ belonging to } +{{$\mathbf{R}$}, +{$\big]0~;~+ \infty\big[$}, +{$\big[0~;~+\infty\big[$} +} + +\end{alterqcm} + + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/examples/latex/verb.tex b/macros/latex/contrib/alterqcm/examples/latex/verb.tex new file mode 100644 index 0000000000..846b3212c0 --- /dev/null +++ b/macros/latex/contrib/alterqcm/examples/latex/verb.tex @@ -0,0 +1,150 @@ + +\documentclass[10pt]{article} + +\usepackage[french]{alterqcm} +\usepackage{fullpage} +\usepackage{longtable} +\usepackage{shortvrb} +\usepackage[french]{babel} + +\pagestyle{empty} +\AtBeginDocument{\MakeShortVerb{\|}} % link to shortvrb +%-------------------------------------------------------------- +\begin{document} +%-------------------------------------------------------------- +\parindent=0pt +\begin{center} +C Language Control \\ + +\vspace{5mm} +Name : \hspace{5cm} +First name : \\ + +\vspace{5mm} +{\small For each question, 3 answers are proposed. One and only one is correct. It's up to you to find it and to choose the corresponding box. +Correct answer = +1 point. No answer = 0 point. Wrong answer = -0.5 point.} +\begin{alterqcm}[lq=90mm,title,num=true,alea,long] +% rajouter ou enlever l'option correction pour voir ou non les corrections :-) +%-------------------------------------------------------------- + +\AQquestion{What was the precursor language of the C language?} +{{Fortran},% + {Langage B},% + {Basic},% + {X},% + {Y}} +%-------------------------------------------------------------- +\verbdef\arg|int a = 3 ^ 4 ;| +\AQquestion{\arg} +{{raises 3 to the power of 4}, + {makes an exclusive OR between 3 and 4}, + {is not an instruction C}} +%-------------------------------------------------------------- +\AQquestion{What is the correct syntax to shift the integer 8 bits to the left? \texttt{a} ?} +{{\texttt{b = lshift(a, 8) ;}}, + {\texttt{b = 8 << a ;}}, + {\texttt{b = a << 8 ;}}} +%-------------------------------------------------------------- +\AQquestion{The complete program: \\ +\texttt{int main() \\ +~~\{ printf ("bonjour") ; return 0 ; \}}} +{{displays \texttt{bonjour}}, + {gives an error to the compilation}, + {gives an error in execution}} +%-------------------------------------------------------------- +\verbdef\arg|float tab[10]| +\verbdef\propa|*tab|\global\let\propa\propa +\verbdef\propb|&tab|\global\let\propb\propb +\verbdef\propc|tab|\global\let\propc\propc +\AQquestion{Let's say the declaration \arg ; \\The first real in the table is \ldots} +{{\propa}, + {\propb}, + {\propc}} +%-------------------------------------------------------------- +\AQquestion{The line \texttt{printf("\%c", argv[2][0]) ;} of \texttt{main} of \texttt{monProg} exécuté ainsi : \texttt{monProg parametre}} +{{displays \texttt{p}}, + {displays nothing}, + {can cause a crash}} +%-------------------------------------------------------------- +\AQquestion{What is the memory size of a \texttt{long int} ?} +{{4 octets}, + {8 octets}, + {it depends \ldots}} +%-------------------------------------------------------------- +\AQquestion{Following the declaration \texttt{int * i} ;} +{{\texttt{*i} is an address}, + {\texttt{*i} is an integer}, + {\texttt{*i} is a pointer}} +%-------------------------------------------------------------- +\AQquestion{Following the declaration \texttt{char tab[12]} ;} +{{\texttt{\&tab} is the address of the table}, + {\texttt{\&tab} is the pointer to the array}, + {\texttt{\&tab} means nothing}} + +%-------------------------------------------------------------- +\AQquestion{One of the following choices is not a standard C library} +{{\texttt{stdlib}}, + {\texttt{stdin}}, + {\texttt{math}}} +%-------------------------------------------------------------- +\AQquestion{The full syntax of the \texttt{main} function is \ldots} +{{\texttt{int main(int argc, char* argv)}}, + {\texttt{int main(int argc, char argv*[])}}, + {\texttt{int main(int argc, char* argv[])}}} +%-------------------------------------------------------------- +\AQquestion{Le programme complet : +\texttt{int main()\\ +\{ char a[2]="x" ; char b[2]="y" ; \\ +~~return (a[0] == b[0]) ; \} +}} +{{has 0 error}, + {contains 1 error}, + {has 2 errors}} + +%-------------------------------------------------------------- +\AQquestion{To free a dynamically allocated memory area in C, use the function \ldots} +{{\texttt{delete}}, + {\texttt{clear}}, + {\texttt{free}}} + +%-------------------------------------------------------------- +\AQquestion{The expression \texttt{val char[32] ; }} +{{is syntactically incorrect}, + {declares a chain}, + {declares a table}} + + %-------------------------------------------------------------- +\verbdef\arga|char s[10] ; int i ;| +\verbdef\argb|scanf("%d, %s", \&i, s) ;| +\AQquestion{We count in the following lines :\\ +\arga \\ +\argb} +{{0 compilation error}, + {1 compilation error}, + {2 compilation errors}} +%-------------------------------------------------------------- +\AQquestion{A global variable is \ldots} +{{\texttt{static}}, + {stored in the stack}, + {initialized with default zeros}} +%-------------------------------------------------------------- +\AQquestion{The scope of a local variable is \ldots} +{{the function}, + {the module}, + {the block}} +%-------------------------------------------------------------- +\verbdef\argprop|int a = 3 ^ 4 ;| +\AQquestion{The line \texttt{int c = argv[1] + argv[2] ;} + of \texttt{main} of \texttt{monProg} run like this : +|int a = 3 ^ 4 ;| } +{{assigns 579 to \texttt{c}}, + {gives an error to the compilation}, + {assigns an undetermined value to \texttt{c}}} + \end{alterqcm} +\end{center} +\end{document} + +% utf8 +% pdflatex +% Pascal Bertolino Alain Matthes +% \ No newline at end of file diff --git a/macros/latex/contrib/alterqcm/latex/alterqcm.sty b/macros/latex/contrib/alterqcm/latex/alterqcm.sty new file mode 100644 index 0000000000..3ea1a35f68 --- /dev/null +++ b/macros/latex/contrib/alterqcm/latex/alterqcm.sty @@ -0,0 +1,683 @@ +%% alterqcm.sty +%% Copyright (C) 2021n Alain Matthes +%% Copyright (C) 2019 Alain Matthes, Apostolos Syropoulos, and Anastasios Dimou +%% Copyright (C) 2009 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status `maintained'. +% The Current Maintainer of this work is Alain Matthes +%<-------------------------> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{alterqcm}[2021/05/17 v4.42c] +\newcount\aqlocall@ng% to set language specific strings: + % 0 stands for French, 1 for English, 2 for German, 3 for Greek ,4 for russian, 5 for italien, 6 for chinese +\aqlocall@ng=0% +%<-------------------------> + % name of new LANGUAGE + % codenumber(s) of new LANGUAGE(S), 4, 5, ...; + % 0..6 = french, english,... + % title of columns for QUESTIONS + % title of columns for ANSWERS + % Continuation ... +\DeclareOption{french}{% +\def\aqlabelforquest{Questions}% +\def\aqlabelforrep{R\'eponses}% +\def\aqfoottext{suite sur la page suivante\ldots}}% + +%<-------------------------> +\DeclareOption{english}{% +\aqlocall@ng=1% +\def\aqlabelforquest{Questions}% +\def\aqlabelforrep{Answers}% +\def\aqfoottext{Continued on the next page\ldots}}% +%<-------------------------> +\DeclareOption{german}{% +\aqlocall@ng=2% +\def\aqlabelforquest{Fragen}% +\def\aqlabelforrep{Antworten}% +\def\aqfoottext{Fortsetzung nächste Seite\ldots}}% +%<-------------------------> +\DeclareOption{greek}{% +\aqlocall@ng=3% +\def\aqlabelforquest{Ερωτήσεις}% +\def\aqlabelforrep{Απαντήσεις}% +\def\aqfoottext{Συνεχίζεται στην επόμενη σελίδα\ldots}}% +%<-------------------------> +\DeclareOption{russian}{% +\aqlocall@ng=4% +\def\aqlabelforquest{Вопросы}% +\def\aqlabelforrep{Ответы}% +\def\aqfoottext{Продолжение на следующей странице\ldots}}% +%<-------------------------> +\DeclareOption{italian}{% +\aqlocall@ng=5% +\def\aqlabelforquest{Domande} +\def\aqlabelforrep{Risposte} +\def\aqfoottext{Continua alla pagina successiva\ldots}} +%<-------------------------> +\DeclareOption{chinese}{% +\aqlocall@ng=6% +\def\aqlabelforquest{问题}% +\def\aqlabelforrep{答案}% +\def\aqfoottext{请翻页\ldots}}% +%<-------------------------> +\DeclareOption{unknown}{% +\aqlocall@ng=7% +\def\aqlabelforquest{unknown}% +\def\aqlabelforrep{unknown}% +\def\aqfoottext{unknown}}% +%<-------------------------> +\ExecuteOptions{french} +\ProcessOptions\relax +\RequirePackage{xkeyval}[2005/11/25] +\RequirePackage{calc} +\RequirePackage{ifthen} +\RequirePackage{array} +\RequirePackage{multirow} +\RequirePackage{pifont}% v1.00 +%<---------------------------------------------------------------> +% from RANDOM.TEX v.1 (Donald Arseneau) +%<---------------------------------------------------------------> +\newcount\aq@randomi % the random number seed (while executing) +\newcounter{aq@identRow} +\newcounter{aq@identCol} +\newcount\aq@tmp +\def\aqutil@empty{} +\global\aq@randomi\catcode`\@ % scratch variable during definitions +\catcode`\@=11 + +\def\nextrandom{\begingroup + \ifnum\aq@randomi<\@ne % then initialize with time + \global\aq@randomi\time + \global\multiply\aq@randomi388 \global\advance\aq@randomi\year + \global\multiply\aq@randomi31 \global\advance\aq@randomi\day + \global\multiply\aq@randomi97 \global\advance\aq@randomi\month + \message{Randomizer initialized to \the\aq@randomi.}% + \nextrandom \nextrandom \nextrandom + \fi + \count@ii\aq@randomi + \divide\count@ii 127773 % modulus = multiplier * 127773 + 2836 + \count@\count@ii + \multiply\count@ii 127773 + \global\advance\aq@randomi-\count@ii % random mod 127773 + \global\multiply\aq@randomi 16807 + \multiply\count@ 2836 + \global\advance\aq@randomi-\count@ + \ifnum\aq@randomi<\z@ \global\advance\aq@randomi 2147483647\relax\fi + \endgroup +} + +\countdef\count@ii=2 % use only in boxes! +\ifx\@tempcnta\undefined \csname newcount\endcsname \@tempcnta \fi +\ifx\@tempcntb\undefined \csname newcount\endcsname \@tempcntb \fi + +\def\setrannum#1#2#3{% count register, minimum, maximum + \@tempcnta#3\advance\@tempcnta-#2\advance\@tempcnta\@ne + \@tempcntb 2147483645 % = m - 2 = 2^{31} - 3 + \divide\@tempcntb\@tempcnta + \getr@nval + \advance\aq@ranval#2\relax + #1\aq@ranval +} + +\def\getr@nval{% The values in \@tempcnta and \@tempcntb are parameters + \nextrandom + \aq@ranval\aq@randomi \advance\aq@ranval\m@ne \divide\aq@ranval\@tempcntb + \ifnum\aq@ranval<\@tempcnta\else \expandafter\getr@nval \fi +} + +\catcode`\@=\aq@randomi +\global\aq@randomi=0 +\newcount\aq@ranval +%<---------------------------------------------------------------> +\newtoks\aq@tdml@a +\newtoks\aq@tdml@b +\newcount\aq@alea +\newcount\aq@n@arg +\newbox\aq@tempbox +\newdimen\aq@hauteurquest +\newdimen\aq@hauteurprop +\newdimen\aq@wdquest +\newdimen\aq@wdprop +\newdimen\aq@dimtmpa +\newdimen\aq@dimtmpb +\newdimen\aq@dimtmp +\newcounter{AQ@numquestion}\setcounter{AQ@numquestion}{0}% +\newcounter{aq@numb} +\newcounter{AQ@numprop}\setcounter{AQ@numprop}{0}% v0.93 +\newcounter{alea@numfirst} +\newcounter{alea@numlast} +\newcommand\points[1]{% +\marginpar{% +\begin{tabular}{|c|} + \hline + \textbf{#1}\\ + \hline\\ + \hline +\end{tabular}}}% +\newcommand\aqheightadvance{4pt}% U. Fischer tex.stackexchange +\newcommand\aqdepthadvance{3pt}% +%<-------------------------> +% Début Code QCM +% New MC Code (Multiple Choice) +%<-------------------------> +% modif 4.3 +\define@choicekey*[AQ]{global}{language}[\val\aq@nr]{french, + english, + german, + greek, + russian, + italian, + chinese, + unknown + }{% +\edef\AQ@global@language{\aq@nr} +\let\aqlocall@ng\aq@nr +\ifcase\aq@nr\relax +\def\cmdAQ@global@tone{Questions} +\def\cmdAQ@global@ttwo{R\'eponses} +\def\aqfoottext{Suite sur la page suivante\ldots} +\renewcommand{\aq@pre}{Pour chacune des questions ci-dessous, une seule des r\'eponses propos\'ees est exacte. Vous devez cocher la r\'eponse exacte sans justification. +Une bonne r\'eponse rapporte \textbf{\cmdAQ@global@bonus\ point}. Une mauvaise r\'eponse enl\`eve \textbf{\cmdAQ@global@malus\ point}. L'absence de r\'eponse ne rapporte ni n'enl\`eve aucun point. Si le total des points est n\'egatif, la note globale attribu\'ee \`a l'exercice est \textbf{0}.}% +% +\renewcommand{\aq@preVF}{Pour chacune des affirmations ci-dessous, cocher la case V (l'affirmation est vraie) ou la case F (l'affirmation est fausse) sur l'ANNEXE, \`a rendre avec la copie. Les r\'eponses ne seront pas justifi\'ees. +Une bonne r\'eponse rapporte \textbf{\cmdAQ@global@bonus\ point}. Une mauvaise r\'eponse enl\`eve \textbf{\cmdAQ@global@malus\ point}. L'absence de r\'eponse ne rapporte ni n'enl\`eve aucun point. Si le total des points est n\'egatif, la note globale attribu\'ee \`a l'exercice est \textbf{0}.}% +\or +\def\cmdAQ@global@tone{Questions} +\def\cmdAQ@global@ttwo{Answers} +\def\aqfoottext{Continued on the next page\ldots} +\renewcommand{\aq@pre}{For each of the questions below, only one of the proposed answers is true. You must choose the right answer without justification.}% +\renewcommand{\aq@preVF}{For each of the statements below, check the \textbf{T} box (the statement is true) or the \textbf{F} box (the statement is false).}% +\or +\def\cmdAQ@global@tone{Fragen} +\def\cmdAQ@global@ttwo{Antworten} +\def\aqfoottext{Fortsetzung nächste Seite\ldots} +\renewcommand{\aq@pre}{Bei jeder der unterstehenden Fragen ist nur eine der vorgeschlagenen Antworten richtig. Kreuzen Sie die richtige Antwort ohne Begründung an.}% +\renewcommand{\aq@preVF}{Bei jeder der unterstehenden Aussagen kreuzen Sie \textbf{R} (für die richtige Aussage) oder \textbf{F} (für die falsche Aussage) an.}% +\or +\def\cmdAQ@global@tone{Ερωτήσεις} +\def\cmdAQ@global@ttwo{Απαντήσεις} +\def\aqfoottext{Συνεχίζεται στην επόμενη σελίδα\ldots} +\renewcommand{\aq@pre}{Από τις επόμενες προτάσεις επιλέξετε αυτήν, που θεωρείτε σωστή.}% +\renewcommand{\aq@preVF}{Να επιλέξετε \textbf{Σ}(ωστό), αν θεωρείτε την πρόταση που δίνεται παρακάτω σωστή, ή \textbf{Λ}(άθος) αν την θεωρείτε λανθασμένη.}% +\or +\def\cmdAQ@global@tone{Вопросов} +\def\cmdAQ@global@ttwo{Ответы} +\def\aqfoottext{Продолжение на следующей странице\ldots} +\renewcommand{\aq@pre}{На каждый из приведенных ниже вопросов верным является только один из предложенных ответов. +Проверьте правильный ответ без обоснования.}% +\renewcommand{\aq@preVF}{Для каждого из приведенных ниже утверждений проверьте П (для правильного утверждения) и Ф (для неверного утверждения).}% +\or +\def\cmdAQ@global@tone{Domande} +\def\cmdAQ@global@ttwo{Risposte} +\def\aqfoottext{Continua alla pagina successiva\ldots} +\renewcommand{\aq@pre} % only one answer is true; choose right answer +{Per ciascuna delle domande che seguono, solo una delle risposte proposte è vera. È necessario scegliere la risposta giusta senza alcuna giustificazione.}% +\renewcommand{\aq@preVF} % only one answer is true; check corresponding box +{Per ciascuna delle seguenti affermazioni, selezionare la casella \textbf{V} (l'affermazione è vera) o la casella \textbf{F} (l'affermazione è falsa).}% +\or +\def\cmdAQ@global@tone{问题} +\def\cmdAQ@global@ttwo{答案} +\def\aqfoottext{请翻页\ldots} +\renewcommand{\aq@pre}{对于以下提出的各个问题,仅有一个答案是正确的,请选择你认为正确的答案(不需要提供理由)。}% +\renewcommand{\aq@preVF}{对于以下各项陈述,根据陈述内容的正误选择相应的选项(正确的选择“正”,错误的选择“误”)。}% +\or +\def\cmdAQ@global@tone{\aqlabelforquest} +\def\cmdAQ@global@ttwo{\aqlabelforrep} +\def\aqfoottext{unknown\ldots} +\renewcommand{\aq@pre}{\aqpretxt}% +\renewcommand{\aq@preVF}{\aqpretxtVF}% +\fi% +} +\def\aqpretxt{}% +\def\aqpretxtVF{}% +\define@cmdkey [AQ] {global} {lq}{} +\define@cmdkey [AQ] {global} {pq}{} +\define@cmdkey [AQ] {global} {points}{} +\define@cmdkey [AQ] {global} {symb}{} +\define@cmdkey [AQ] {global} {corsymb}{} +\define@cmdkey [AQ] {global} {bonus}{} +\define@cmdkey [AQ] {global} {malus}{} +\define@cmdkey [AQ] {global} {numstyle}{} +\define@cmdkey [AQ] {global} {propstyle}{} +\define@cmdkey [AQ] {global} {size}{} +\define@cmdkey [AQ] {global} {tone}{} +\define@cmdkey [AQ] {global} {ttwo}{} +\define@cmdkey [AQ] {global} {numbreak}{} +\define@cmdkey [AQ] {global} {afterpreskip}{} +\define@boolkey [AQ] {global} {transparent}[true]{} +\define@boolkey [AQ] {global} {VF} [true]{} +\define@boolkey [AQ] {global} {sep} [true]{} +\define@boolkey [AQ] {global} {pre} [true]{} +\define@boolkey [AQ] {global} {title} [true]{} +\define@boolkey [AQ] {global} {long} [true]{} +\define@boolkey [AQ] {global} {num} [true]{} +\define@boolkey [AQ] {global} {numprop} [false]{} +\define@boolkey [AQ] {global} {nosquare} [false]{} +\define@boolkey [AQ] {global} {correction} [true]{} +\define@boolkey [AQ] {global} {alea} [true]{} +\presetkeys [AQ] {global} { + lq = 100mm, + pq = 0pt, + points = {}, + sep = false, + pre = false, + bonus = {0,5}, + malus = {0,25}, + VF = false, + long = false, + symb = $\square$, + corsymb = $\blacksquare$, + afterpreskip = \medskip, + num = true, + transparent = false, + nosquare = false, + correction = false,%v1.00 + numstyle = \arabic, + propstyle = \alph,% v0.93 + numprop = false,% v0.93 + size = {}, %3.7 same size la fonte + title = true, + ttwo = \aqlabelforrep, + tone = \aqlabelforquest, + numbreak = 0, + alea = false}{} +\define@cmdkey[AQ]{local}{pq}{} +\define@cmdkey[AQ]{local}{br}{} +\presetkeys[AQ]{local}{br=5,pq= \cmdAQ@global@pq}{}% + +\ifcase\aqlocall@ng +\newcommand{\aq@pre}{Pour chacune des questions ci-dessous, une seule des r\'eponses propos\'ees est exacte. Vous devez cocher la r\'eponse exacte sans justification. +Une bonne r\'eponse rapporte \textbf{\cmdAQ@global@bonus\ point}. Une mauvaise r\'eponse enl\`eve \textbf{\cmdAQ@global@malus\ point}. L'absence de r\'eponse ne rapporte ni n'enl\`eve aucun point. Si le total des points est n\'egatif, la note globale attribu\'ee \`a l'exercice est \textbf{0}.}% +% +\newcommand{\aq@preVF}{Pour chacune des affirmations ci-dessous, cocher la case V (l'affirmation est vraie) ou la case F (l'affirmation est fausse) sur l'ANNEXE, \`a rendre avec la copie. Les r\'eponses ne seront pas justifi\'ees. +Une bonne r\'eponse rapporte \textbf{\cmdAQ@global@bonus\ point}. Une mauvaise r\'eponse enl\`eve \textbf{\cmdAQ@global@malus\ point}. L'absence de r\'eponse ne rapporte ni n'enl\`eve aucun point. Si le total des points est n\'egatif, la note globale attribu\'ee \`a l'exercice est \textbf{0}.}% +\or +\newcommand{\aq@pre}{For each of the questions below, only one of the proposed answers is true. You must choose the right answer without justification.}% +\newcommand{\aq@preVF}{For each of the statements below, check the \textbf{T} box (the statement is true) or the \textbf{F} box (the statement is false).}% +\or +\newcommand{\aq@pre}{Bei jeder der unterstehenden Fragen ist nur eine der vorgeschlagenen Antworten richtig. Kreuzen Sie die richtige Antwort ohne Begründung an.}% +\newcommand{\aq@preVF}{Bei jeder der unterstehenden Aussagen kreuzen Sie \textbf{R} (für die richtige Aussage) oder \textbf{F} (für die falsche Aussage) an.}% +\or +\newcommand{\aq@pre}{Από τις επόμενες προτάσεις επιλέξετε αυτήν, που θεωρείτε σωστή.}% +\newcommand{\aq@preVF}{Να επιλέξετε \textbf{Σ}(ωστό), αν θεωρείτε την πρόταση που δίνεται παρακάτω σωστή, ή \textbf{Λ}(άθος) αν την θεωρείτε λανθασμένη.}% +\or %--- wjb +\newcommand{\aq@pre}{На каждый из приведенных ниже вопросов верным является только один из предложенных ответов. +Проверьте правильный ответ без обоснования.}% +\newcommand{\aq@preVF}{Для каждого из приведенных ниже утверждений проверьте П (для правильного утверждения) и Ф (для неверного утверждения).}% +% Insert text(s) for NEW LANGUAGE(S), e.g. Italian +\or +\newcommand{\aq@pre} % only one answer is true; choose right answer +{Per ciascuna delle domande che seguono, solo una delle risposte proposte è vera. È necessario scegliere la risposta giusta senza alcuna giustificazione.}% +\newcommand{\aq@preVF} % only one answer is true; check corresponding box +{Per ciascuna delle seguenti affermazioni, selezionare la casella \textbf{V} (l'affermazione è vera) o la casella \textbf{F} (l'affermazione è falsa).}% +\or %% TODO 中文 +\newcommand{\aq@pre}{对于以下提出的各个问题,仅有一个答案是正确的,请选择你认为正确的答案(不需要提供理由)。}% +\newcommand{\aq@preVF}{对于以下各项陈述,根据陈述内容的正误选择相应的选项(正确的选择“正”,错误的选择“误”)。}% +\or % unknown +\newcommand{\aq@pre}{\aqpretxt}% +\newcommand{\aq@preVF}{\aqpretxtVF}% +\fi +% +\newcommand*{\AQms}{\aq@ms}% +\def\aq@ms(#1,#2){\vrule height #1pt depth #2pt width 0pt} +\newcommand*{\altersquare}{\mbox{\vbox{\hrule\hbox to 6pt{\vrule height 5.2pt \hfil\vrule}\hrule}}}% +\@ifundefined{square}{\let\square\altersquare}{}% + +\newcommand*{\dingsquare}{\ding{114}}% +\newcommand*{\dingchecksquare}{\mbox{\ding{114}\hspace{-.7em}\raisebox{.2ex}[1ex]{\ding{51}}}} +\newcommand*{\aq@style@title}{\textbf}% +\newcommand*{\aq@style@numquest}{\textbf}% +\newcommand*{\aq@style@numrep}{\textbf}% +\newcommand{\aq@title}{% +\hline% + \hfil{\aq@style@title{\cmdAQ@global@tone}}\hfil% + & \hfil{\aq@style@title{\cmdAQ@global@ttwo}}\hfil\\ \hline% + \ifAQ@global@long \endfirsthead +\hline + \hfil{\aq@style@title{\cmdAQ@global@tone}}\hfil% + & \hfil{\aq@style@title{\cmdAQ@global@ttwo}}\hfil\\ \hline% +\endhead +& \raisebox{-1em}\hfill{\emph{\aqfoottext}} \\ \hline +\endfoot +\endlastfoot\fi +}% + +\newcommand{\AQmessage}[1]{% +\multicolumn{2}{|l|}{% +\begin{minipage}{\textwidth-\tabcolsep*2-\arrayrulewidth*2}% +#1 +\end{minipage}}\\ \hline% +}% + +\newcommand{\aq@melange}{% +\setrannum{\aq@alea}{1}{\value{aq@numb}}% + \ifcase\aq@alea% + \or + \global\let\aq@tempfirst\aq@arga + \or + \global\let\aq@tempfirst\aq@argb + \or + \global\let\aq@tempfirst\aq@argc + \or + \global\let\aq@tempfirst\aq@argd + \or + \global\let\aq@tempfirst\aq@arge + \fi +\setcounter{alea@numfirst}{\aq@alea}% +\setrannum{\aq@alea}{1}{\value{aq@numb}}% + \ifcase\aq@alea% + \or + \global\let\aq@templast\aq@arga + \or + \global\let\aq@templast\aq@argb + \or + \global\let\aq@templast\aq@argc + \or + \global\let\aq@templast\aq@argd + \or + \global\let\aq@templast\aq@arge + \fi +\setcounter{alea@numlast}{\aq@alea}% +\global\let\aq@temp\aq@tempfirst% +\global\let\aq@tempfirst\aq@templast% +\global\let\aq@templast\aq@temp% +\global\expandafter\let\csname aq@arg\alph{alea@numfirst}% +\endcsname\aq@tempfirst% +\global\expandafter\let\csname aq@arg\alph{alea@numlast}% +\endcsname\aq@templast% +}% +%<-------------------------> +\newcommand{\aq@hauteurbox}[1]{% +\setbox\aq@tempbox=% +\vbox{\parbox[t]{\textwidth-\tabcolsep*4-\arrayrulewidth*3-\cmdAQ@global@lq}% +{\cmdAQ@global@symb\quad\mbox{#1}}}% \cmdAQ@global@symb remplace $\square$ +\aq@dimtmpa\ht\aq@tempbox\relax% +\aq@dimtmpb\dp\aq@tempbox\relax% +\advance\aq@dimtmpa by\aq@dimtmpb}% +%<-------------------------> +\newcommand{\aq@adjust}[1]{% +\setbox\aq@tempbox=% +\vbox{% +\parbox[t]{\cmdAQ@global@lq}{\aq@style@numquest{\number\value{AQ@numquestion}.}\hspace{3pt}#1}}% +\aq@dimtmpa\ht\aq@tempbox +\aq@dimtmpb\dp\aq@tempbox +\aq@wdquest\wd\aq@wdquest +\advance\aq@dimtmpa by\aq@dimtmpb\relax% +\aq@hauteurquest=\aq@dimtmpa +\aq@hauteurbox{\aq@arga}% +\aq@hauteurprop=\aq@dimtmpa +\aq@hauteurbox{\aq@argb}% +\advance\aq@hauteurprop by\aq@dimtmpa\relax% +\ifnum\value{aq@numb}>2\relax +\aq@hauteurbox{\aq@argc}% +\advance\aq@hauteurprop by\aq@dimtmpa\relax\fi +\ifnum\value{aq@numb}>3\relax +\aq@hauteurbox{\aq@argd}% +\advance\aq@hauteurprop by\aq@dimtmpa\relax\fi +\ifnum\value{aq@numb}>4\relax +\aq@hauteurbox{\aq@arge}% +\advance\aq@hauteurprop by\aq@dimtmpa\relax\fi +\ifdim\aq@hauteurquest<\aq@hauteurprop% +\global\aq@dimtmp=0pt +\aq@dimtmpa\ht\aq@tempbox +\aq@dimtmpb\dp\aq@tempbox +\advance\aq@dimtmpa by3pt +\advance\aq@dimtmpb by2pt +\vrule height\aq@dimtmpa depth\aq@dimtmpb width0pt +\else +\advance\aq@hauteurquest by-\aq@hauteurprop +\divide\aq@hauteurquest by\theaq@numb\relax +\divide\aq@hauteurquest by2\relax% +\global\aq@dimtmp=\aq@hauteurquest\fi +}% +%<-------------------------> +\newcommand{\aq@prop}[2]{% +\setbox\aq@tempbox=\vbox{#1}% +\aq@wdprop\wd\aq@tempbox +\aq@dimtmpa\ht\aq@tempbox\advance\aq@dimtmpa by\aqheightadvance\advance\aq@dimtmpa by\aq@dimtmp\relax +\aq@dimtmpb\dp\aq@tempbox\advance\aq@dimtmpb by\aqdepthadvance\advance\aq@dimtmpb by\aq@dimtmp\relax +\ifAQ@global@VF\hfil\fi +\ifAQ@global@transparent\def\cmdAQ@global@corsymb{$\bigcirc$}% +\def\cmdAQ@global@symb{}\fi +\ifAQ@global@numprop\stepcounter{AQ@numprop}% +{\aq@style@numrep{(\cmdAQ@global@propstyle{AQ@numprop})}}% +\else + \ifAQ@global@nosquare + \else% + \ifAQ@global@correction + \def\@stop{1} + \@for\goodrep:=\cmdAQ@local@br\do{% + \ifnum\@stop<6 % + \global\let\mysymb\cmdAQ@global@symb + \ifthenelse{\equal{\goodrep}{#2}}{% + \global\let\mysymb\cmdAQ@global@corsymb \def\@stop{9}}{% + }% + \fi}% + \mysymb\hspace*{6pt}% + \else + \cmdAQ@global@symb\hspace*{6pt}% + \fi + \fi + \fi + \ifAQ@global@transparent + \vrule height0pt depth0pt width\aq@wdprop + \else + \ignorespaces#1% + \fi + \vrule height\aq@dimtmpa depth\aq@dimtmpb width0pt + \ifAQ@global@VF\hfil\fi}% +%<-------------------------> +\newcommand{\AQquestion}[3][]{% +\setkeys[AQ]{local}{#1}% +\stepcounter{AQ@numquestion}% +\setcounter{AQ@numprop}{0} % v0.93 +\setcounter{aq@numb}{0}% +\@for\liste:=#3\do{% +\stepcounter{aq@numb}% +\begingroup +\ifnum\aqlocall@ng=3 \nogreekalph\fi +\global\expandafter\let\csname aq@arg\alph{aq@numb}\endcsname\liste +\endgroup}% +\ifAQ@global@alea\ifAQ@global@VF +\else +\aq@n@arg=0 % +\loop\ifnum\aq@n@arg<\value{aq@numb}\aq@melange\advance\aq@n@arg by1\repeat\fi +\fi +\aq@adjust{#2}% +\multirow{1}{\cmdAQ@global@lq}[\cmdAQ@local@pq]{% +\ifAQ@global@num\aq@style@numquest{\cmdAQ@global@numstyle{AQ@numquestion}.}% +\hspace{3pt}\fi +\ifAQ@global@transparent% +\hrule height0pt depth0pt width\aq@wdquest% +\else +#2\vss +\fi + }% +&\setkeys[AQ]{local}{#1}% + \aq@prop{\aq@arga}{1}\\% + \ifAQ@global@sep\cline{2-2}\fi +&\setkeys[AQ]{local}{#1}% + \aq@prop{\aq@argb}{2}\\ + \ifAQ@global@sep\cline{2-2}\fi + \ifnum\value{aq@numb}=2\hline\else\ifAQ@global@sep\cline{2-2}\fi +&\setkeys[AQ]{local}{#1}% + \aq@prop{\aq@argc}{3}\\ + \ifnum\value{aq@numb}=3\hline\else\ifAQ@global@sep\cline{2-2}\fi +&\setkeys[AQ]{local}{#1}% + \aq@prop{\aq@argd}{4}\\ + \ifnum\value{aq@numb}=4\hline\else\ifAQ@global@sep\cline{2-2}\fi +&\setkeys[AQ]{local}{#1}% + \aq@prop{\aq@arge}{5}\\ +\hline\fi\fi\fi}% +%<-------------------------> +\def\aqtextfortrue{\textbf{V}} +\def\aqtextforfalse{\textbf{F}} +\newcommand{\aq@questionVF}[2][]{% +\setkeys[AQ]{local}{#1} +\stepcounter{AQ@numquestion}% +\setcounter{AQ@numprop}{0}% v0.93 +\ifcase\aqlocall@ng +\protected@xdef\aq@arga{\textbf{V}} +\protected@xdef\aq@argb{\textbf{F}} +\or +\protected@xdef\aq@arga{\textbf{T}} +\protected@xdef\aq@argb{\textbf{F}} +\or +\protected@xdef\aq@arga{\textbf{R}} +\protected@xdef\aq@argb{\textbf{F}} +\or +\protected@xdef\aq@arga{\textbf{Σ}} +\protected@xdef\aq@argb{\textbf{Λ}} +\or %--- wjb +\protected@xdef\aq@arga{\textbf{П}} +\protected@xdef\aq@argb{\textbf{Ф}} +\or +\protected@xdef\aq@arga{\textbf{V}} +\protected@xdef\aq@argb{\textbf{F}} +\or +\protected@xdef\aq@arga{\textbf{正}} +\protected@xdef\aq@argb{\textbf{误}} +\or +\protected@xdef\aq@arga{\aqtextfortrue} +\protected@xdef\aq@argb{\aqtextforfalse} +\fi +\setcounter{aq@numb}{2}% +\aq@adjust{#2}% +\multirow{3}{\cmdAQ@global@lq}[\cmdAQ@local@pq]{% +\ifAQ@global@num\aq@style@numquest{\cmdAQ@global@numstyle{AQ@numquestion}.}\hspace{3pt}\fi +#2\vss}% + &\setkeys[AQ]{local}{#1}\aq@prop{\aq@arga}{1}\\ +\ifAQ@global@sep \cline{2-2}\fi + &\setkeys[AQ]{local}{#1}\aq@prop{\aq@argb}{2}\\ +\hline}% +%<-------------------------> +\newenvironment{alterqcm}[1][]{% +\ifAQ@global@numprop \setkeys [AQ] {global} {nosquare = true}{}\fi +\setkeys[AQ]{global}{#1}% +\ifx\aqutil@empty\cmdAQ@global@points \else +\points{\cmdAQ@global@points} +\fi +\setcounter{AQ@numquestion}{\cmdAQ@global@numbreak}% +\ifAQ@global@VF\let\AQquestion\aq@questionVF\let\aq@pre\aq@preVF\fi +\ifAQ@global@pre\aq@pre\par\cmdAQ@global@afterpreskip\fi +\ifAQ@global@long% +\setlength\LTleft{0pt}% +\setlength\LTright\fill% +\setlength{\LTpre}{\intextsep}% +\setlength{\LTpost}{\intextsep}% +\begin{longtable}[l]{% +@{}|>{\cmdAQ@global@size}p{\cmdAQ@global@lq}!{\extracolsep{\fill}}% +|>{\cmdAQ@global@size}p{\textwidth-\tabcolsep*4-\arrayrulewidth*3-\cmdAQ@global@lq}|@{}}% + \else + \begin{tabular}{% + @{}|>{\cmdAQ@global@size}p{\cmdAQ@global@lq}% + |>{\cmdAQ@global@size}p{% + \textwidth-\tabcolsep*4-\arrayrulewidth*3-\cmdAQ@global@lq}% + |@{}}% + \fi + \ifAQ@global@title\aq@title\else\hline\fi% +}% +{\ifAQ@global@long + \end{longtable}% + \else + \end{tabular}% + \fi +}% +%<-------------------------> +% #1 chemin & #2 theme & #3 liste de numéros +% code de JC Charpentier +%----------------------------------------------------------% +\newcommand\InputQuestionList[3]{% + \aq@tdml@a={}% + \aq@tdml@b={}% + \ifx\relax#3\relax\else + \tdml@#3,\@nil,\expandafter\tdml@clean\the\aq@tdml@a\@nil + \fi + \expandafter\gdef\expandafter\last@val\expandafter{\the\aq@tdml@b}% + \AQ@TA{#1}{#2}{\the\aq@tdml@a}% + \AQ@TB{#1}{#2}{\last@val}} +%----------------------------------------------------------% +\long\def\tdml@#1,{% + \ifx\@nil#1\relax + \else + \expandafter\addtotoks\the\aq@tdml@b,\to\aq@tdml@a + \aq@tdml@b={#1}% + \expandafter\tdml@ + \fi +} +%----------------------------------------------------------% +\long\def\addtotoks#1\to#2{% + #2=\expandafter{\the#2#1}% +}% +%----------------------------------------------------------% +\long\def\tdml@clean,#1\@nil{% + \ifx\relax#1\relax + \aq@tdml@a{}% + \else + \tdml@@clean#1\@nil + \fi +} +%----------------------------------------------------------% +\long\def\tdml@@clean#1,\@nil{% + \aq@tdml@a{#1}% +}% +%----------------------------------------------------------% +%----------------------------------------------------------% +\newcommand\AQ@TA[3]{\@for\nb:=#3\do{% +\input #1#2\nb}% +}% +\newcommand\AQ@TB[3]{\input#1#2#3}% +%----------------------------------------------------------% +% from forloop.sty +\newcommand{\aq@forLoop}[5][1] +{% +\setcounter{#4}{#2}% +\ifthenelse{\value{#4}<#3}% +{#5\addtocounter{#4}{#1}% +\aq@forLoop[#1]{\value{#4}}{#3}{#4}{#5}% +}% +{\ifthenelse{\value{#4}=#3}% +{#5}{}}}% + +%----------------------------------------------------------% +\def\aq@tvi(#1,#2){\vrule height #1pt depth #2pt width 0pt} +\define@cmdkey [AQ] {ann} {propstyle}[true]{} +\define@boolkey[AQ] {ann} {VF}[true]{} +\presetkeys [AQ] {ann} {propstyle = \arabic, + VF = false}{} +\newcommand*{\AQannexe}[4][]{% +\setkeys[AQ]{ann}{#1}% +\aq@tmp=#4 % +\advance\aq@tmp by 1 % +\begin{tabular}{*{\number\aq@tmp}{|>{\hfill}c}|}\hline% + \ifAQ@ann@VF% +N&V&F% + \else +N\aq@forLoop{1}{#4}{aq@identCol}% + {& \cmdAQ@ann@propstyle{aq@identCol}}\fi +\tabularnewline\hline% +\aq@forLoop{#2}{#3}{aq@identRow} + {\number\value{aq@identRow}&% + \aq@forLoop{2}{\number\aq@tmp}{aq@identCol}% + {$\ $% + \ifthenelse{\equal{\value{aq@identCol}}{#4}}{}{&}% + }% +\tabularnewline\hline}% +\end{tabular}% +}% +%----------------------------------------------------------% +\newcommand\AQpoints[1]{% +\marginpar{% +\begin{tabular}{|c|} + \hline + \textbf{#1}\\ + \hline\\ + \hline +\end{tabular}}} +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/covington/README b/macros/latex/contrib/covington/README index 2ff405d3de..327cb913a5 100644 --- a/macros/latex/contrib/covington/README +++ b/macros/latex/contrib/covington/README @@ -31,6 +31,10 @@ The package consists of the following files: == CHANGES == +* Version 2.6 (2021-05-19): + - New length \exampleind to adjust (increase/decrease) the indentation (left margin) + of examples. + * Version 2.5 (2021-03-21): - Fix metrics of stacked diacritics with XeTeX/LuaTeX. diff --git a/macros/latex/contrib/covington/covington.pdf b/macros/latex/contrib/covington/covington.pdf index dbb6f3caad..5a56381da2 100644 Binary files a/macros/latex/contrib/covington/covington.pdf and b/macros/latex/contrib/covington/covington.pdf differ diff --git a/macros/latex/contrib/covington/covington.sty b/macros/latex/contrib/covington/covington.sty index 2bd80b0339..79601a2eba 100644 --- a/macros/latex/contrib/covington/covington.sty +++ b/macros/latex/contrib/covington/covington.sty @@ -42,8 +42,8 @@ %%% Metadata %%% -\def\filedate{2021/03/21} -\def\fileversion{2.5} +\def\filedate{2021/05/19} +\def\fileversion{2.6} \def\filename{covington.sty} % Force redefinition of environments? @@ -245,6 +245,9 @@ \newlength\examplenumbersep \setlength\examplenumbersep{0pt} +\newlength\exampleind +\setlength\exampleind{0pt} + \newcommand*\covexnumber[1]{(#1)} \newenvironment{covexamples}% % define "example" environment @@ -253,6 +256,7 @@ {% \addtolength{\labelwidth}{\examplenumbersep}% \addtolength{\leftmargin}{\examplenumbersep}% +\addtolength{\leftmargin}{\exampleind}% \ifownexcounter \setcounter{covexsave}{\arabic{covex}}% \usecounter{covex}% % sets it to zero, unwantedly diff --git a/macros/latex/contrib/covington/covington.tex b/macros/latex/contrib/covington/covington.tex index e22796a1d8..74cc19f33d 100644 --- a/macros/latex/contrib/covington/covington.tex +++ b/macros/latex/contrib/covington/covington.tex @@ -94,8 +94,8 @@ % % Titling % -\def\pversion{Version 2.5} -\def\pdate{March 21, 2021} +\def\pversion{Version 2.6} +\def\pdate{May 19, 2021} \title{\textbf{The \cvt\ Package\\Macros for Linguistics}} \author{Michael A. Covington \and J\"urgen Spitzm\"uller\thanks{Current maintainer. @@ -274,6 +274,10 @@ If you need more space between the example number and the text, you can increase the length \jcsmacro{examplenumbersep} (which is preset to \texttt{0pt}). Doing \lstinline|\setlength\examplenumbersep{1em}|, for instance, will increase the space by 1\,em (negative values will decrease the space accordingly). +If you need to change the indentation (left margin) of examples, you can do so by means of +the length \jcsmacro{exampleind} (preset to \texttt{0pt}). Doing \lstinline|\setlength\exampleind{1em}|, +for instance, will increase the indentation by 1\,em, negative values will decrease it accordingly. + Note that, as of version 1.1, \cvt\ checks if there is already an \jenv{example} environment defined (e.\,g., by the class). If so, \cvt\ does not define its own one. However, there is always the alias environment \jenv{covexample} which can be used in order to @@ -332,6 +336,8 @@ existing \jenv{examples} environments. The package will issue a warning if \jenv (this is the case, for instance, if you use \cvt\ with the \texttt{beamer} class), telling you how it has dealt with the situation. +Please refer to sec.~\ref{sec:ex} for ways to adjust the spacing of the environment. + \subsection[The \texttt{subexamples} environment]{The \jenv{subexamples} environment}\label{sec:subexs} @@ -410,6 +416,9 @@ for instance, will come out like this: \item This is the first sentence. \item This is the second sentence. \end{subexamples} +% +To change the indentation (left margin) of subexamples, adjust the length \jcsmacro{exampleind} +(preset to \texttt{0pt}). Note that this also applies to the \jenv{examples} environment. \egroup @@ -1095,6 +1104,14 @@ it. \section{Release history} +\subsection*{2.6 (2021 May 19)} + +\begin{itemize} + \item New length \jcsmacro{exampleind} to adjust (increase/decrease) + the indentation (left margin) of examples. + See sec.~\ref{sec:ex} for details. +\end{itemize} + \subsection*{2.5 (2021 March 21)} \begin{itemize} diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 81f9679ad5..c9295ed617 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -23,11 +23,11 @@ % % \changes{v1.20}{2021/01/09}{修改和完善用户文档。} % \changes{v1.20}{2021/01/09}{模板更改为使用 CC-BY 许可协议。} -% \changes{v1.25l}{2021/05/03}{取消附带的示例文件,可查看历史版本及其它来源的使用样例。} +% \changes{v1.25m}{2021/05/03}{取消附带的示例文件,可查看历史版本及其它来源的使用样例。} % % \title{\sffamily easybook 文档类手册} % \author{瞿毅} -% \date{2021/05/18\hskip\ccwd\relax v1.25l\thanks{\url{https://gitee.com/texl3/easybook}}} +% \date{2021/05/19\hskip\ccwd\relax v1.25m\thanks{\url{https://gitee.com/texl3/easybook}}} % % \maketitle % \begin{abstract} @@ -71,7 +71,7 @@ % % \subsection{字体设置} % \label{subsec:font settings} -% 默认使用 \CTeX 预置中文字库,当开启 \opt{font = noto} 选项时需要安装开源字体,中文使用方正系列的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}和{\fangsong 方正仿宋},英文使用思源系列的{\rmfamily Noto Serif}、{\sffamily Noto Sans}和{\ttfamily Noto Sans Mono},数学字体使用 \pkg{notomath}。相关选项可以见节 \ref{sec:document class options} 中的 \opt{font} 选项,字体点击此处下载\href{https://wwe.lanzoui.com/b01ns361i}{下载地址}。 +% 默认使用 \CTeX 预置中文字库,当开启 \opt{font = noto} 选项时需要安装开源字体,中文使用方正系列的{\songti 方正书宋}、{\heiti 方正黑体}、{\kaishu 方正楷体}和{\fangsong 方正仿宋},英文使用思源系列的{\rmfamily Noto Serif}、{\sffamily Noto Sans}和{\ttfamily Noto Sans Mono},数学字体默认使用 \pkg{notomath}。相关选项可以见节 \ref{sec:document class options} 中的 \opt{font} 选项,字体点击此处下载\href{https://wwe.lanzoui.com/b01ns361i}{下载地址}。 % % 如果您不想使用 \CTeX 默认字体和方正、思源字体,\textbf{自定义字体}需启用选项 \opt{font = none},并可在导言区设置中文字体,粗体与斜体不设置会产生警告。 % \begin{ctexexam} @@ -117,7 +117,7 @@ % \end{syntax} % 传递给 \cls{ctexbook} 设置字体,最好不要使用原有的 \opt{fontset} 选项,默认情况下使用自定义字体而不开启这个选项,可根据安装的字体及电脑系统选取。\opt{noto} 与 \opt{none} 选项的相关描述见小节 \ref{subsec:font settings},\opt{overleaf} 是一个各系统通用选项,会检测系统环境选取对应字体。 % \changes{v1.21}{2021/01/12}{默认字体与 \CTeX 一致,不再是自定义字体。} -% \changes{v1.25l}{2021/05/04}{修复使用 \pkg{xeCJK} 与 \pkg{fontspec} 宏包的字体设置命令在 \hologo{LuaLaTeX} 下失效的问题。} +% \changes{v1.25m}{2021/05/04}{修复使用 \pkg{xeCJK} 与 \pkg{fontspec} 宏包的字体设置命令在 \hologo{LuaLaTeX} 下失效的问题。} % \end{function} % % \begin{function}[rEXP,added = 2021-01-05,updated = 2021-01-13]{paper} @@ -168,7 +168,7 @@ % \tn{listoflistings*+}\oarg{键值列表} % \end{syntax} % \tn{listoffigures} 命令输出图片目录,\tn{listoftables} 输出表格目录,\tn{listoflistings} 输出代码目录。带有星号的目录命令不将标题添加进主文档目录,带有+号的目录命令可以使当前标题编号。\tn{tableofcontents+} 与其它命令不同是用于输出双语目录,需要与双语目录标题命令 \tn{bichapter} 等或设置图片、表格和代码等英文目录的标题配合使用,附加代码是中文与英文目录之间的代码,可以插入文本和换页命令等。目录的键值列表选项如下 -% \changes{v1.25l}{2021/05/05}{命令 \tn{tableofcontents} 可以输出双语目录。} +% \changes{v1.25m}{2021/05/05}{命令 \tn{tableofcontents} 可以输出双语目录。} % \end{function} % % \begin{function}{multoc,title,format,aftertitle,pagestyle,book,article} @@ -199,7 +199,7 @@ % 双语目录的标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录,这个功能是为国内一些大学的学位论文模板的要求设计,在一般情况和英文模式下不需要使用。 % % 它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \tn{chapter*} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。双语目录的格式是一致的,共享使用 \tn{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下 -% \changes{v1.25l}{2021/05/05}{增加与双语目录配合的标题命令。} +% \changes{v1.25m}{2021/05/05}{增加与双语目录配合的标题命令。} % \end{function} % % \begin{function}{biname,binmuber} @@ -228,7 +228,7 @@ % \begin{tabular}{*{5}{c}} % \toprule % \hyperref[subsec:style]{风格} & \hyperref[subsec:other font]{其它字体} & \hyperref[subsec:spacing]{行距} & \hyperref[subsec:hyperlinks]{超链接} & \hyperref[subsec:reference]{参考文献} \\ -% style & elsefont & spread & refset & bibset \\ +% style & subfont & spread & refset & bibset \\ % \midrule % \hyperref[subsec:theorem of style]{定理样式} & \hyperref[subsec:page margins]{页面尺寸} & \hyperref[subsec:header and footer]{页眉页脚} & \hyperref[subsec:catalog style]{目录样式} & \\ % thmset & geoset & hdrset & tocset & \\ @@ -239,14 +239,13 @@ % % \subsection{风格} % \label{subsec:style} -% \begin{function}[EXP,added = 2021-01-05,updated = 2021-05-17]{color,color-all,multoc,withpart,footwith,notomath,rulewidth,uppercase,figure-sep,table-sep,listing-sep,equation-sep,number-sep,figpath} +% \begin{function}[EXP,added = 2021-01-05,updated = 2021-05-19]{color,color-all,multoc,withpart,footwith,rulewidth,uppercase,figure-sep,table-sep,listing-sep,equation-sep,number-sep,figurepath} % \begin{syntax} % color = <(none)|seaside|energy|cyberpunk> % color-all = % multoc = % withpart = % footwith = -% notomath = <(true)|false> % rulewidth = <(0.75pt)> % uppercase = <(true)|false> % figure-sep = <(.)> @@ -254,7 +253,7 @@ % listing-sep = <(.)> % equation-sep = <(.)> % number-sep = <(.)> -% figpath = \{\{路径名1\}\{路径名2\}\} +% figurepath = \{\{路径名1\}\{路径名2\}\} % \end{syntax} % \ding{229} 以上选项路径为 \opt{style/...} % \changes{v1.10}{2021/01/08}{更改颜色实现方式与选项名。} @@ -276,7 +275,6 @@ % \item[multoc] 开启双栏目录,可与 \opt{onecolumn} 和 \opt{twocolumn} 选项配合出单栏正文、单栏目录,双栏正文、单栏目录,单栏正文、双栏目录和双栏正文、双栏目录四种方式。 % \item[withpart] 使章跟随每一部分编号,默认不跟随。 % \item[footwith] 使脚注跟随编号的计数器,默认跟随章,当开启新的一章时脚注编号从1开始。 -% \item[notomath] 使用 \opt{noto} 风格的数学字体,将会加载 \pkg{newtxmath} 宏包。关闭此选项时可以使用 \pkg{unicode-math} 等宏包自定义数学字体。 % \item[rulewidth] 调整页眉、定理盒子以及代码框线条的粗细。 % \item[uppercase] 使用 \tn{rightmark} 及 \tn{leftmark} 获取标题内容设置页眉页脚时英文是否大小写。 % \item[figure-sep] 图片标题编号的连接符。 @@ -284,7 +282,7 @@ % \item[listing-sep] 代码标题编号的连接符。 % \item[equation-sep] 公式编号的连接符。 % \item[number-sep] 统一设置所有编号的连接符。 -% \item[figpath] 设置插入图片的文件夹路径名,可以有多个路径名,但需要包含在括号内作为间隔,即使只有一个路径。 +% \item[figurepath] 设置插入图片的文件夹路径名,可以有多个路径名,但需要包含在括号内作为间隔,即使只有一个路径。 % \end{optdesc} % % \subsection{超链接} @@ -301,7 +299,7 @@ % \changes{v1.10}{2021/01/08}{修复了 \opt{linktopage} 选项关闭时目录中标题编号无超链接的问题。} % \changes{v1.23}{2021/03/19}{修复在 \pkg{ctex} v2.5.6 更新后 \cls{easybook} 与 \pkg{hyperref} 冲突问题。} % \changes{v1.24}{2021/04/05}{增加 \pkg{hyperref} 超链接选项完整的支持。} -% \changes{v1.25l}{2021/05/06}{模块名 \opt{link} 改为 \opt{refset},\opt{link} 作为兼容性保留。} +% \changes{v1.25m}{2021/05/06}{模块名 \opt{link} 改为 \opt{refset},\opt{link} 作为兼容性保留。} % \end{function} % % \begin{optdesc} @@ -346,17 +344,19 @@ % % \subsection{其它字体} % \label{subsec:other font} -% \begin{function}[EXP,added = 2021-01-08,updated = 2021-05-12]{table-cap,figure-cap,listing-cap,footnote,marginpar} +% \begin{function}[EXP,added = 2021-01-08,updated = 2021-05-19]{table-cap,figure-cap,listing-cap,footnote,marginpar,math} % \begin{syntax} % table-cap = <\tn{sffamily}\tn{small}> % figure-cap = <\tn{sffamily}\tn{small}> % listing-cap = <\tn{sffamily}\tn{small}> % footnote = <\tn{rmfamily}> % marginpar = <\tn{rmfamily}\tn{footnotesize}> +% math = % \end{syntax} -% \ding{229} 以上选项路径为 \opt{elsefont/...} +% \ding{229} 以上选项路径为 \opt{subfont/...} % \changes{v1.10}{2021/01/08}{加入自定义非正文字体选项。} % \changes{v1.23}{2021/02/08}{修复使用 \tn{zihao} 命令设置字体失效的问题。} +% \changes{v1.25m}{2021/05/19}{其它字体模块名由 \opt{elsefont} 改为 \opt{subfont},并增加数学字体的选项 \opt{subfont/math}。} % \end{function} % % \begin{optdesc} @@ -365,6 +365,7 @@ % \item[listing-cap] 代码标题的字体设置。 % \item[footnote] 脚注的字体设置,包括脚注标记与内容的字体。 % \item[marginpar] 边注的字体设置。 +% \item[math] 选择合适的数学字体,将会加载 \pkg{newtxmath} 和 \pkg{bm} 宏包。使用选项 \opt{none} 时可以使用 \pkg{unicode-math} 等其它数学字体宏包定义字体。 % \end{optdesc} % % \subsection{参考文献} @@ -380,7 +381,7 @@ % \changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。} % \changes{v1.23}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。} % \changes{v1.24}{2021/04/09}{可以不载入参考文献包手动配置参考文献格式。} -% \changes{v1.25l}{2021/05/12}{取消 \opt{bib-loadpkg} 选项,由是否设置参考文献数据库来决定载入宏包。} +% \changes{v1.25m}{2021/05/12}{取消 \opt{bib-loadpkg} 选项,由是否设置参考文献数据库来决定载入宏包。} % \end{function} % % \begin{optdesc} @@ -443,15 +444,15 @@ % \item[spacepost] 定理标题后与第一段内容的间隔。 % \end{optdesc} % -% \begin{function}[added = 2021-01-12,updated = 2021-04-25]{\newtheorem,\EbNewtheorem,\declaretheoremstyle} +% \begin{function}[added = 2021-01-12,updated = 2021-04-25]{\newtheorem,\EbNewTheorem,\declaretheoremstyle} % \begin{syntax} % \tn{newtheorem}\oarg{键值列表}\marg{定理环境名} -% \tn{EbNewtheorem}\marg{定理环境名}\oarg{英文标题}\marg{中文标题}\parg{盒子样式|(tc-theorem)}\oarg{键值列表} +% \tn{EbNewTheorem}\marg{定理环境名}\oarg{英文标题}\marg{中文标题}\parg{盒子样式|(tc-theorem)}\oarg{键值列表} % \tn{declaretheoremstyle}\oarg{键值列表}\marg{定理样式名} % \end{syntax} % 文档类已预置8个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这两个命令。 % \changes{v1.23}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。} -% \changes{v1.24}{2021/04/25}{增加定义定理环境命令 \tn{EbNewtheorem}。} +% \changes{v1.24}{2021/04/25}{增加定义定理环境命令 \tn{EbNewTheorem}。} % \end{function} % % \begin{optdesc} @@ -462,7 +463,7 @@ % \item[numberlike] 定理将使用此计数器进行编号,通常这是另一个定理环境的名称。 % \item[style] 用 \tn{declaretheoremstyle} 定义的定理样式的名称,定理将使用这种样式的设置。 % \end{description} -% \item[\tn{EbNewtheorem}] \tn{EbNewtheorem} 是更便捷的定理命令,它定义一个新的定理环境,键值列表支持的选项与 \tn{newtheorem} 相同,但它们的区别有 +% \item[\tn{EbNewTheorem}] \tn{EbNewTheorem} 是更便捷的定理命令,它定义一个新的定理环境,键值列表支持的选项与 \tn{newtheorem} 相同,但它们的区别有 % \begin{itemize} % \item 中英文模式下标题不同,英文标题为可选项,默认为首字母大写的环境名。 % \item 自动定义交叉引用的格式,引用标签前缀为定理名称。 @@ -475,7 +476,7 @@ % \subsubsection{新的定理样式} % 定理由 \pkg{thmtools} 设置,预置定理的样式为 \opt{easy-theorem},上述定理样式选项将对这个定理样式生效。如果使用这个样式而只是增加新的定理名称,可以这样 % \begin{ctexexam} -% \EbNewtheorem{定理环境名}{中文标题}[style = other theorem] +% \EbNewTheorem{定理环境名}{中文标题}[style = other theorem] % \newtheorem[style = easy-theorem,name = 定理名]{定理环境名} % \end{ctexexam} % \tn{newtheorem} 定义的定理环境需要手动增加盒子边框,可以如下进行设置 @@ -573,8 +574,8 @@ % \ding{229} 以上选项路径为 \opt{hdrset/...} \\ % 上面几个选项用于设置脚注格式,\opt{fnparskip} 和 \opt{fnparindent} 选项仅在 \opt{fnhang = true} 时有效。\opt{fnhang} 用于将脚注设置为悬挂缩进的格式,\opt{fnmark-pos} 选项设置脚注编号的位置,正常文本或是上标形式。\opt{fnmark-num} 选项设置脚注编号的格式,默认为原生样式 \opt{plain},还可以改为 \opt{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括1-10。 % -% \opt{fnmark-form} 是脚注标记的格式,默认为空,在此设置字体命令会覆盖 \opt{elsefont/footnote} 的设置,最后一个格式命令可以带有一个参数,这个参数接受脚注编号,一般配合 \opt{fnmark-num = plain} 使用。\opt{afterfnmark} 是脚注标记后的代码,一般用于设置标记与文本间的距离。 -% \changes{v1.25l}{2021/05/12}{增加脚注样式设置选项。} +% \opt{fnmark-form} 是脚注标记的格式,默认为空,在此设置字体命令会覆盖 \opt{subfont/footnote} 的设置,最后一个格式命令可以带有一个参数,这个参数接受脚注编号,一般配合 \opt{fnmark-num = plain} 使用。\opt{afterfnmark} 是脚注标记后的代码,一般用于设置标记与文本间的距离。 +% \changes{v1.25m}{2021/05/12}{增加脚注样式设置选项。} % \end{function} % % \subsection{目录样式} @@ -593,17 +594,17 @@ % \opt{format} 是目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \tn{addvspace} 命令,带有加号的 \opt{format+} 选项用于在已有的格式命令后附加内容。\opt{indent} 是目录中标题在页面左侧的缩进距离,应该有长度单位。\opt{rule} 选项中一般应当使用 \tn{tocrule} 命令,将会在接下来介绍。\opt{numsep} 是有编号的标题在目录中编号与标题的间距。 % \changes{v1.21}{2021/01/13}{增加配置目录样式的选项。} % \changes{v1.24}{2021/04/20}{增加目录中编号与标题的间距选项 \opt{numsep}。} -% \changes{v1.25l}{2021/05/14}{可以分别设置图片、表格和代码目录的格式。} +% \changes{v1.25m}{2021/05/14}{可以分别设置图片、表格和代码目录的格式。} % \end{function} % -% \begin{function}[added = 2021-01-13,updated = 2021-04-20]{\tocrule,\EbNumberline} +% \begin{function}[added = 2021-01-13,updated = 2021-04-20]{\tocrule,\EbNumberLine} % \begin{syntax} % \tn{tocrule}*\oarg{引导点间距|(0.7pc)}\parg{引导点大小|(1.2)}\marg{引导点}\oarg{页码格式} -% \tn{EbNumberline}\marg{编号类型} +% \tn{EbNumberLine}\marg{编号类型} % \end{syntax} % \tn{tocrule} 命令生成目录引导线,需要在 \opt{rule} 选项中使用。带有星号的命令会使当前级别的目录引导线右边与页码连接而不是对齐。引导点间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \tn{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体、距离。 % -% \tn{EbNumberline} 命令类似 \CTeX 的 \tn{CTEXnumberline} 命令,用于 \opt{tocline} 选项中设置目录标签的编号。区别是它需要在 \opt{tocset/hang = false} 时使用,否则目录中无法显示标题编号,使用它的时候 \opt{numsep} 选项仍然有效。\meta{编号类型} 为 \opt{chapter} 和 \opt{section} 等,也可用参数 \#1 代替当前级别类型,标题名用参数 \#2 代替一般不变。 +% \tn{EbNumberLine} 命令类似 \CTeX 的 \tn{CTEXnumberline} 命令,用于 \opt{tocline} 选项中设置目录标签的编号。区别是它需要在 \opt{tocset/hang = false} 时使用,否则目录中无法显示标题编号,使用它的时候 \opt{numsep} 选项仍然有效。\meta{编号类型} 为 \opt{chapter} 和 \opt{section} 等,也可用参数 \#1 代替当前级别类型,标题名用参数 \#2 代替一般不变。 % \end{function} % % \begin{ctexexam} @@ -678,7 +679,7 @@ % \tn{end}\marg{环境名} % \end{syntax} % \pkg{tabularray} 是一个较新的宏包,不仅提供了 \pkg{tabularx}、\pkg{multirow}、和 \pkg{booktabs} 宏包的功能,并且不依赖其它宏包与它们同时使用不会产生冲突,还实现了用简便的键值列表方式设置表格样式。目前除了表头斜线以及跨页功能存在不足,其它方面已满足对表格绝大多数格式的需求,具体用法可见宏包的说明文档。 -% \changes{v1.25l}{2021/05/17}{使用功能更便捷齐全的 \pkg{tabularray} 宏包设置表格样式。} +% \changes{v1.25m}{2021/05/17}{使用功能更便捷齐全的 \pkg{tabularray} 宏包设置表格样式。} % \end{function} % % \subsection{列表} @@ -842,7 +843,7 @@ % \tn{qtyrange}\oarg{键值列表}\marg{数字1}\marg{数字2}\marg{单位} % \end{syntax} % \pkg{siunitx} 宏包的 \tn{num} 命令可以输出以科学计数法表示的数值,单位格式化命令 \tn{unit} 包含文字项目(例如字母或数字)时,使用 . 和 \~{} 放置在单元乘积中间,并使用 \_ 和 \^{} 正确放置指定的下标和上标。格式化方法可在数学和文本模式下使用。而 \tn{qty} 命令可用来输出带有单位的量,\tn{qtyrange} 可以输出带有范围和单位的量。 -% \changes{v1.25l}{2021/05/18}{\pkg{siunitx} 宏包 v3.0.0 更新后用法改变,修改相关配置选项。} +% \changes{v1.25m}{2021/05/18}{\pkg{siunitx} 宏包 v3.0.0 更新后用法改变,修改相关配置选项。} % \end{function} % % \begin{ctexexam} @@ -979,7 +980,7 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplClass{easybook}{2021/05/18}{1.25l}{beta} +\ProvidesExplClass{easybook}{2021/05/19}{1.25m}{beta} \cs_generate_variant:Nn \eb_ctex_define:nn { nx } \cs_generate_variant:Nn \int_to_arabic:n { v } @@ -1090,21 +1091,20 @@ { xindy } { imakeidx }, { CJKmath = true } { xeCJK }, { no-math } { fontspec }, - { noto,upint } { newtxmath } + { upint } { newtxmath } } { \PassOptionsToPackage #1 } \eb_put_ctexbook:n { \g__eb_options_clist } \LoadClass[UTF8]{ctexbook} \bool_new:N \l__eb_multoc_bool -\bool_new:N \l__eb_notomath_bool \bool_new:N \l__eb_uppercase_bool \bool_new:N \l__eb_chap_withpart_bool -\tl_new:N \l__eb_foot_numberwith_tl +\tl_new:N \l__eb_foot_numparent_choice_tl \seq_const_from_clist:Nn \c__eb_options_path_seq { - style,elsefont,spread, + style,subfont,spread, refset,bibset,thmset, geoset,hdrset,tocset } @@ -1128,19 +1128,19 @@ withpart .bool_set:N = \l__eb_chap_withpart_bool, withpart .default:n = true, withpart .initial:n = false, - notomath .bool_set:N = \l__eb_notomath_bool, - notomath .default:n = true, - notomath .initial:n = true, rulewidth .dim_set:N = \l__eb_rule_width_dim, rulewidth .initial:n = 0.75pt, uppercase .bool_set:N = \l__eb_uppercase_bool, uppercase .default:n = true, uppercase .initial:n = true, - figpath .tl_set:N = \l_eb_graphics_path_tl, + figurepath .tl_set:N = \l_eb_graphics_path_tl, footwith .choices:nn = { part,page,chapter } - { \tl_set_eq:NN \l__eb_foot_numberwith_tl \l_keys_choice_tl }, + { + \tl_set_eq:NN + \l__eb_foot_numparent_choice_tl \l_keys_choice_tl + }, footwith .value_required:n = true, footwith .initial:n = chapter, @@ -1171,11 +1171,6 @@ enumitem, listings } -\ctex_at_end_preamble:n - { - \bool_if:NT \l__eb_notomath_bool - { \RequirePackage{newtxmath,bm} } - } \ctex_at_end:n { \tl_if_empty:NF \g__eb_config_tl @@ -1302,8 +1297,6 @@ \cs_new_protected:Npn \kaishu { \eb_switch_family:n { kaishu } } \cs_new_protected:Npn \fangsong { \eb_switch_family:n { fangsong } } } -\eb_at_end_preamble:n - { \cs_if_exist:NF \kaishu { \cs_gset_eq:NN \kaishu \itshape } } \includepdfset{fitpaper = true} \geometry @@ -1441,7 +1434,10 @@ fnmark-num .choices:nn = { plain,pifont,pifont*,pifont-sans,pifont-sans* } - { \tl_gset_eq:NN \l__eb_fnmark_number_tl \l_keys_choice_tl }, + { + \tl_gset_eq:NN + \l__eb_fnmark_number_choice_tl \l_keys_choice_tl + }, fnmark-num .value_required:n = true } @@ -1488,6 +1484,7 @@ } \tl_if_empty:NF \l_eb_graphics_path_tl { \exp_args:No \graphicspath { \l_eb_graphics_path_tl } } + \cs_if_exist:NF \kaishu { \cs_gset_eq:NN \kaishu \itshape } } \eb_at_end_preamble:n @@ -1500,12 +1497,12 @@ \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox } \bool_if:NT \l__eb_chap_withpart_bool { \counterwithin*{chapter}{part} } - \tl_if_eq:NnT \l__eb_foot_numberwith_tl { part } + \tl_if_eq:NnT \l__eb_foot_numparent_choice_tl { part } { \counterwithout*{footnote}{chapter} \counterwithin*{footnote}{part} } - \tl_if_eq:NnT \l__eb_foot_numberwith_tl { page } + \tl_if_eq:NnT \l__eb_foot_numparent_choice_tl { page } { \counterwithout*{footnote}{chapter} \counterwithin*{footnote}{page} @@ -1518,14 +1515,14 @@ { \linespread{\fp_use:N \l__eb_spread_footnote_fp} \selectfont\ignorespaces - \l__eb_font_footnote_tl + \l__eb_subfont_footnote_tl } \eb_patch_cmd:Nnn \@mpfootnotetext { \reset@font } { \linespread{\fp_use:N \l__eb_spread_footnote_fp} \selectfont\ignorespaces - \l__eb_font_footnote_tl + \l__eb_subfont_footnote_tl } \ctex_after_end_preamble:n { @@ -1533,7 +1530,7 @@ \eb_patch_cmd:Nnn \@footnotemark { \@makefnmark } { - \tl_use:N \l__eb_font_footnote_tl + \tl_use:N \l__eb_subfont_footnote_tl \tl_use:N \l__eb_fnmark_format_tl {\hbox:n { \textsuperscript{\@thefnmark} }} } @@ -1541,7 +1538,7 @@ } \cs_set:Npn \@makefnmark { - \tl_use:N \l__eb_font_footnote_tl + \tl_use:N \l__eb_subfont_footnote_tl \tl_use:N \l__eb_fnmark_format_tl { \hbox:n @@ -1576,7 +1573,7 @@ { \ding{\int_eval:n { 201 + #1 }} } \cs_new:Npn \eb_footnote_counter:N #1 { - \tl_case:NnF \l__eb_fnmark_number_tl + \tl_case:NnF \l__eb_fnmark_number_choice_tl { \c__eb_fnmark_number_plain_tl { \int_use:N #1 } @@ -1651,7 +1648,7 @@ } } -\cs_new:Npn \EbNumberline #1 +\cs_new:Npn \EbNumberLine #1 { \CTEXifname { @@ -1708,9 +1705,9 @@ { \ctex_set:n { - chapter/tocline = \EbNumberline{##1}##2, - section/tocline = \EbNumberline{##1}##2, - subsection/tocline = \EbNumberline{##1}##2 + chapter/tocline = \EbNumberLine{##1}##2, + section/tocline = \EbNumberLine{##1}##2, + subsection/tocline = \EbNumberLine{##1}##2 } }, hang .default:n = true, @@ -1938,8 +1935,8 @@ { \bisection{\eb@toc@title}{\eb@bitoc@title} } }{ \IfBooleanTF{#2} - { \eb_title_mark_notoc:n {\eb@toc@title} } - { \eb_title_mark_intoc:n {\eb@toc@title} } + {\eb_title_mark_notoc:n {\eb@toc@title}} + {\eb_title_mark_intoc:n {\eb@toc@title}} } } \cs_new_protected:Npn \eb_biber_title_level_bool:n #1 @@ -1959,7 +1956,7 @@ \bool_if:NTF \l__eb_multoc_bool { \twocolumn } { \onecolumn } }{ \boolfalse{@restonecol} - \bool_if:NT \l__eb_multoc_bool { \twocolumn } + \bool_if:NTF \l__eb_multoc_bool { \twocolumn } { \onecolumn } } } { \tl_set:Nn \l__eb_toc_type_tl { article } } @@ -2103,23 +2100,66 @@ } } -\tl_new:N \l__eb_font_table_tl -\tl_new:N \l__eb_font_figure_tl -\tl_new:N \l__eb_font_listing_tl -\tl_new:N \l__eb_font_footnote_tl +\tl_new:N \l__eb_subfont_table_tl +\tl_new:N \l__eb_subfont_figure_tl +\tl_new:N \l__eb_subfont_listing_tl +\tl_new:N \l__eb_subfont_footnote_tl + +\seq_const_from_clist:Nn \c__eb_subfont_math_choice_seq + { + noto,notosans,times,scholax,stix, + charter,ebgaramond,libertine,none + } +\seq_map_inline:Nn \c__eb_subfont_math_choice_seq + { \tl_const:cn { c__eb_subfont_math_#1_tl } {#1} } -\eb_ctex_define:nn { elsefont } +\eb_ctex_define:nn { subfont } { - table-cap .tl_set:N = \l__eb_font_table_tl, + table-cap .tl_set:N = \l__eb_subfont_table_tl, table-cap .initial:n = \sffamily\small, - figure-cap .tl_set:N = \l__eb_font_figure_tl, + figure-cap .tl_set:N = \l__eb_subfont_figure_tl, figure-cap .initial:n = \sffamily\small, - listing-cap .tl_set:N = \l__eb_font_listing_tl, + listing-cap .tl_set:N = \l__eb_subfont_listing_tl, listing-cap .initial:n = \sffamily\small, - footnote .tl_set:N = \l__eb_font_footnote_tl, + footnote .tl_set:N = \l__eb_subfont_footnote_tl, footnote .initial:n = \rmfamily, marginpar .tl_set:N = \marginfont, - marginpar .initial:n = \rmfamily\footnotesize + marginpar .initial:n = \rmfamily\footnotesize, + + math .choices:xn = + { \seq_use:Nn \c__eb_subfont_math_choice_seq { , } } + { + \tl_gset_eq:NN + \l__eb_subfont_math_choice_tl \l_keys_choice_tl + }, + math .value_required:n = true, + math .initial:n = noto + } + +\cs_new_protected:Npn \eb_put_newtxmath:n #1 + { \PassOptionsToPackage{#1}{newtxmath} } +\eb_at_end_preamble:n + { + \tl_case:NnT \l__eb_subfont_math_choice_tl + { + \c__eb_subfont_math_noto_tl + { \eb_put_newtxmath:n { noto } } + \c__eb_subfont_math_notosans_tl + { \eb_put_newtxmath:n { notosans } } + \c__eb_subfont_math_ebgaramond_tl + { \eb_put_newtxmath:n { ebgaramond } } + \c__eb_subfont_math_times_tl + { \eb_put_newtxmath:n { noOT1 } } + \c__eb_subfont_math_libertine_tl + { \eb_put_newtxmath:n { libertine,noOT1 } } + \c__eb_subfont_math_stix_tl + { \eb_put_newtxmath:n { stix2,noOT1 } } + \c__eb_subfont_math_scholax_tl + { \eb_put_newtxmath:n { nc,noOT1 } } + \c__eb_subfont_math_charter_tl + { \eb_put_newtxmath:n { charter,noOT1 } } + } + { \RequirePackage{newtxmath,bm} } } \fp_new:N \l__eb_spread_line_fp @@ -2152,9 +2192,9 @@ \DeclareCaptionLabelSeparator{ccwd}{\hspace{\ccwd}} \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{~}(#2)} -\DeclareCaptionFont{eb@table@font}{\l__eb_font_table_tl} -\DeclareCaptionFont{eb@figure@font}{\l__eb_font_figure_tl} -\DeclareCaptionFont{eb@listing@font}{\l__eb_font_listing_tl} +\DeclareCaptionFont{eb@table@font}{\l__eb_subfont_table_tl} +\DeclareCaptionFont{eb@figure@font}{\l__eb_subfont_figure_tl} +\DeclareCaptionFont{eb@listing@font}{\l__eb_subfont_listing_tl} \captionsetup { format = hang, @@ -2270,7 +2310,7 @@ { \tl_const:cn { c__eb_name_#1_tl } {#3} } { \tl_const:cn { c__eb_name_#1_tl } {#2} } } -\NewDocumentCommand{\EbNewtheorem} +\NewDocumentCommand{\EbNewTheorem} {mO{\text_titlecase_first:n {#1}}mD(){tc-theorem}O{}} { \ctex_at_end_preamble:n @@ -2358,7 +2398,7 @@ { remark } { 注 } [ numbered = no ], { { proof } { 证明 } [ numbered = no,qed = \qedsymbol ] } } - { \EbNewtheorem #1 } + { \EbNewTheorem #1 } } \ctex_at_end_package:nn { tasks } @@ -2906,7 +2946,7 @@ part = { pagestyle = empty, - tocline = \EbNumberline{#1}#2, + tocline = \EbNumberLine{#1}#2, format = \color{ctex@frame}\sffamily\Huge, aftername = { diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf index f9dffdf646..8e42cef60f 100644 Binary files a/macros/latex/contrib/easybook/easybook.pdf and b/macros/latex/contrib/easybook/easybook.pdf differ diff --git a/macros/latex/contrib/pgfmath-xfp/README.md b/macros/latex/contrib/pgfmath-xfp/README.md new file mode 100644 index 0000000000..fc82f5c8b0 --- /dev/null +++ b/macros/latex/contrib/pgfmath-xfp/README.md @@ -0,0 +1,30 @@ +------------------------------------------------------------------------------- +# pgfmath-xfp -- define pgfmath functions using xfp + +Version 2021-05-19 v1.0 + +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt + +Hosted at https://github.com/Skillmon/ltx_pgfmath-xfp + +------------------------------------------------------------------------------- + +Copyright (C) 2021 Jonathan P. Spratte + +This work may be distributed and/or modified under the conditions of the +LaTeX Project Public License (LPPL), either version 1.3c of this license or +(at your option) any later version. The latest version of this license is in +the file: + + http://www.latex-project.org/lppl.txt + +This work is "maintained" (as per LPPL maintenance status) by + Jonathan P. Spratte. + +------------------------------------------------------------------------------- + +This provides a wrapper that allows to define `pgfmath` functions using the +`expl3` FPU (which's LaTeX2e document-level package is called `xfp`) for the +calculations. Each input argument is parsed by `pgfmath` to normalize it to a +form that `xfp` understands. diff --git a/macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.dtx b/macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.dtx new file mode 100644 index 0000000000..7e9571b43a --- /dev/null +++ b/macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.dtx @@ -0,0 +1,503 @@ +% \iffalse meta-comment +% +% File: pgfmath-xfp.dtx Copyright (C) 2021 Jonathan P. Spratte +% +% This work may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this license or +% (at your option) any later version. The latest version of this license is in +% the file: +% +% http://www.latex-project.org/lppl.txt +% +% ------------------------------------------------------------------------------ +% +%<*driver>^^A>>= +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX\else + \expandafter\begingroup +\fi +\input l3docstrip.tex +\askforoverwritefalse +\preamble + +-------------------------------------------------------------- +pgfmath-xfp -- define pgfmath functions using xfp +E-mail: jspratte@yahoo.de +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +-------------------------------------------------------------- + +Copyright (C) 2020-2021 Jonathan P. Spratte + +This work may be distributed and/or modified under the conditions of the +LaTeX Project Public License (LPPL), either version 1.3c of this license or +(at your option) any later version. The latest version of this license is in +the file: + + http://www.latex-project.org/lppl.txt + +This work is "maintained" (as per LPPL maintenance status) by + Jonathan P. Spratte. + +This work consists of the file pgfmath-xfp.dtx +and the derived files pgfmath-xfp.pdf + pgfmath-xfp.sty + +\endpreamble +% stop docstrip adding \endinput +\postamble +\endpostamble +\generate{\file{pgfmath-xfp.sty}{\from{pgfmath-xfp.dtx}{pkg}}} +\ifx\fmtname\nameofplainTeX + \expandafter\endbatchfile +\else + \expandafter\endgroup +\fi +% +\IfFileExists{pgfmath-xfp.sty}{\RequirePackage{pgfmath-xfp}}{} +\ProvidesFile{pgfmath-xfp.dtx} + [\csname pgfmxfpDate\endcsname\space define pgfmath functions using xfp] +\PassOptionsToPackage{full}{textcomp} +\documentclass{l3doc} +\RequirePackage{pgfplots} +\pgfplotsset{compat=1.18} +\RequirePackage[oldstylenums,nott]{kpfonts} +\input{glyphtounicode} +\pdfgentounicode=1 +\RequirePackage{listings} +\RequirePackage{xcolor} +\RequirePackage{microtype} +\RequirePackage{accsupp} +\lstset + { + ,flexiblecolumns=false + ,basewidth=.53em + ,gobble=2 + ,basicstyle=\fontfamily{jkp}^^A\itshape + ,morekeywords=^^A + {^^A + } + ,morecomment=[l]\% + ,commentstyle=\color[gray]{0.4} + ,literate={\{}{{\CodeSymbol\{}}{1} + {\}}{{\CodeSymbol\}}}{1} + ^^A,literate=*{}{\key}{4}{}{\set}{4} + } +\newcommand*\CodeSymbol[1]{\textbf{#1}} +\RequirePackage{randtext} +\let\metaORIG\meta +\protected\def\meta #1{\texttt{\metaORIG{#1}}} +\renewcommand*\thefootnote{\fnsymbol{footnote}} +\makeatletter +\definecolor{xfpred}{HTML}{9F393D} +\colorlet{pgfgray}{black!75} +\newcommand*\pgfmxfplogo + {^^A + \begingroup + \rmfamily + \bfseries + {\color{pgfgray}\scshape pgfmath}^^A + {\color{black}\textendash}^^A + {\color{xfpred}xfp}^^A + \endgroup + } +\newcommand*\pgfmxfp + {^^A + \texorpdfstring + {^^A + \mbox + {^^A + \BeginAccSupp{ActualText=pgfmath-xfp}^^A + \href{https://github.com/Skillmon/ltx_pgfmath-xfp}{\pgfmxfplogo}^^A + \EndAccSupp{}^^A + }^^A + } + {pgfmath-xfp}^^A + } +\hypersetup{linkcolor=red!80!black,urlcolor=purple!80!black} +\DoNotIndex{} +\DoNotIndex{} +\DoNotIndex{} +\DoNotIndex{} +\DoNotIndex{} +\DoNotIndex{} +\DoNotIndex{} +\DoNotIndex{} +\DoNotIndex{} +^^A\@gobble\fi ^^A ignoring \ifx and \ifcsname, but only one \fi +\@ifdefinable\gobbledocstriptag{\def\gobbledocstriptag#1>{}} +\makeatother +\begin{document} + \title + {^^A + \texorpdfstring + {^^A + \huge\pgfmxfp + \\[\medskipamount] + \Large define \pkg{pgfmath} functions using \pkg{xfp}^^A + }{pgfmath-xfp - define pgfmath functions using xfp}^^A + } + \date{\pgfmxfpDate\space v\pgfmxfpVersion} + \author{Jonathan P. Spratte\thanks{\protect\randomize{jspratte@yahoo.de}}} + \DocInput{pgfmath-xfp.dtx} +\end{document} +%^^A=<< +% \fi +% +% \maketitle +% \renewcommand*\thefootnote{\arabic{footnote}} +% +% \begin{abstract} +% \noindent\parfillskip=0pt +% \pgfmxfp\ provides a small wrapper to define \pkg{pgfmath} functions which +% use the floating point unit of \pkg{expl3} (of which the document-level +% interface is called \pkg{xfp}). +% \end{abstract} +% +% \tableofcontents +% +% \begin{documentation}^^A>>= +% +% \section{Documentation} +% +% This package serves as a stopgap to allow the usage of \pkg{xfp} in +% \pkg{pgfmath} functions. It is only meant as a temporary fix to allow single +% functions using the \pkg{expl3} fpu until a more sophisticated solution to +% allow broader support for it in \textsc{pgf} is available. +% +% The defined functions should work correctly independent of the surrounding +% \pkg{pgfmath} context. This is achieved by first parsing the arguments via +% \cs{pgfmathsetmacro} with \textsc{pgf} settings applied locally to ensure +% that the resulting format is understandable by \pkg{xfp}'s fpu. +% +% Though it has both \pkg{pgfmath} and \pkg{xfp} in its name, it only loads +% \pkg{pgfmath} as a dependency, the access to \pkg{xfp}'s fpu is done at the +% \pkg{expl3} level. +% +% It was created as a result of two questions on +% \url{https://tex.stackexchange.com}: +% \href +% {https://tex.stackexchange.com/q/597549/117050} +% {expl3 cannot see declared functions} +% and +% \href +% {https://tex.stackexchange.com/q/584887/117050} +% {pgf: “Dimension too large” in a function which fits into a graph, +% /pgf/fpu=true does not help}. +% +% \subsection{Document-Level Interface} +% +% \begin{function}{\pgfmxfpdeclarefunction} +% \begin{syntax} +% \cs{pgfmxfpdeclarefunction}\marg{name}\marg{arg-count}\oarg{process-args}\marg{fp-expression} +% \end{syntax} +% Define a \pkg{pgfmath} function named \meta{name} that takes +% \meta{arg-count} arguments. The behaviour is different depending on whether +% the optional argument was used or not. +% \begin{description} +% \item[If it isn't] the \meta{fp-expression} can refer to the +% \meta{arg-count} arguments using |#1|, \emph{etc.}, and will get the +% arguments just like they are given to the function (translated to a +% format that \pkg{xfp} will understand by parsing them through +% \pkg{pgfmath} once). +% \item[If it is] use \meta{process-args} to specify any number of +% processed arguments in a comma separated list. Inside this list you can +% specify up to nine processed arguments using \pkg{pgfmath} functions in +% which you can refer to the arguments passed to your new function using +% |#1|, \emph{etc}. +% You can refer to these processed arguments inside \meta{fp-expression} +% using |#1|, \emph{etc}. A result of this rule is that you have to +% explicitly use |#1| in \meta{process-args} to forward it unaltered to +% the underlying \pkg{xfp} expression. +% \end{description} +% \end{function} +% +% \subsection{Examples} +% +% The following are examples taken from the two questions responsible for this +% package. +% +% \begin{lstlisting} +% \pgfmxfpdeclarefunction{lognormal}{3} +% {exp(-((ln(#1) - #2)^2) / (2 * (#3)^2)) / (#1 * #3 * sqrt(2 * pi))} +% +% \begin{tikzpicture} +% \begin{axis}[ domain=0.01:10, samples=100 ] +% \addplot {lognormal(x,ln(5),0.2)}; +% \end{axis} +% \end{tikzpicture} +% \end{lstlisting} +% \begin{minipage}{\linewidth} +% \pgfmxfpdeclarefunction{lognormal}{3} +% {exp(-((ln(#1) - #2)^2) / (2 * (#3)^2)) / (#1 * #3 * sqrt(2 * pi))} +% \begin{tikzpicture} +% \begin{axis}[ domain=0.01:10, samples=100 ] +% \addplot {lognormal(x,ln(5),0.2)}; +% \end{axis} +% \end{tikzpicture} +% \end{minipage} +% +% Showing that a single \pkg{pgfmath} function argument can result in multiple +% arguments for the \pkg{xfp} expression. This example is suboptimal slow code, +% but could be educational. +% +% \begin{lstlisting} +% \pgfmxfpdeclarefunction{fplog}{1}{ln(#1)} +% \pgfmxfpdeclarefunction{nlogn}{1}[#1,fplog(#1)]{#1 * #2} +% +% \begin{tikzpicture} +% \begin{axis}[ domain=0.01:10, samples=50 ] +% \addplot {nlogn(x)}; +% \end{axis} +% \end{tikzpicture} +% \end{lstlisting} +% \begin{minipage}{\linewidth} +% \pgfmxfpdeclarefunction{fplog}{1}{ln(#1)} +% \pgfmxfpdeclarefunction{nlogn}{1}[#1,fplog(#1)]{#1 * #2} +% \begin{tikzpicture} +% \begin{axis}[ domain=0.01:10, samples=50 ] +% \addplot {nlogn(x)}; +% \end{axis} +% \end{tikzpicture} +% \end{minipage} +% +% +% \subsection{\pkg{expl3}-Level Interface} +% +% \begin{function}{\pgfmxfp_declare:nnn} +% \begin{syntax} +% \cs{pgfmxfp_declare:nnn} \marg{name} \marg{arg-count} \marg{fp-expression} +% \end{syntax} +% Defines a \pkg{pgfmath} function named \meta{name}, that takes +% \marg{arg-count} arguments. The function will evaluate the +% \meta{fp-expression} using the \pkg{l3fp} fpu and store the result for +% \pkg{pgfmath}. The arguments can be referred using |#1|, \emph{etc}. +% \end{function} +% +% \begin{function}{\pgfmxfp_declare_processed_args:nnnn} +% \begin{syntax} +% \cs{pgfmxfp_declare_processed_args:nnnn} \marg{name} \marg{arg-count} \marg{processed-args} \marg{fp-expression} +% \end{syntax} +% Defines a \pkg{pgfmath} function named \meta{name}, that takes +% \marg{arg-count} arguments. The arguments will be evaluated through +% \pkg{pgfmath} according to the comma separated list of +% \meta{processed-args} (in which you can refer to the arguments using |#1|, +% \emph{etc.}) and the results of which will be the arguments for the +% \meta{fp-expression} (in which you can refer to the \meta{processed-args} +% using |#1|, \emph{etc.}). +% \end{function} +% +% \end{documentation}^^A=<< +% +% \begin{implementation}^^A>>= +% +% \clearpage +% +% \section{Implementation}^^A>>= +% +% \gobbledocstriptag +%<*pkg> +% \gobbledocstriptag +%<@@=pgfmxfp> +% +% \subsection{General Package code} +% +% Some code for versioning support might not be available in older \LaTeXe{} +% releases. +% \begin{macrocode} +\providecommand\DeclareRelease[3]{} +\providecommand\DeclareCurrentRelease[2]{} +% \end{macrocode} +% Use these rollback functions to declare the current release. +% \begin{macrocode} +\DeclareCurrentRelease{}{2021-05-19} +% \end{macrocode} +% +% Make sure \pkg{expl3} is available and load \pkg{pgfmath} and the \textsc{pgf} +% fpu. +% \begin{macrocode} +\@ifundefined{ExplFileDate} + {\RequirePackage{expl3}} + {} +\RequirePackage{pgfmath} +\usepgflibrary{fpu} +% \end{macrocode} +% +% \begin{macro}{\pgfmxfpDate, \pgfmxfpVersion} +% Store version and date in a macro. +% \begin{macrocode} +\newcommand*\pgfmxfpDate{2021-05-19} +\newcommand*\pgfmxfpVersion{1.0} +% \end{macrocode} +% \end{macro} +% +% Provide the package. +% \begin{macrocode} +\ProvidesExplPackage + {pgfmath-xfp} {\pgfmxfpDate} + {\pgfmxfpVersion} {define pgfmath functions using xfp} +% \end{macrocode} +% +% \subsection{Document-Level Interface} +% +% \begin{macro}{\pgfmxfpdeclarefunction} +% The document-level interface decides which of the two allocator functions +% are used. +% \begin{macrocode} +\NewDocumentCommand \pgfmxfpdeclarefunction { m m o m } + { + \IfValueTF {#3} + { \pgfmxfp_declare_processed_args:nnnn {#1} {#2} {#3} } + { \pgfmxfp_declare:nnn {#1} {#2} } + {#4} + } +% \end{macrocode} +% \end{macro} +% +% \subsection{\pkg{expl3}-Level Interface} +% +% \begin{macro}{\pgfmxfp_declare:nnn} +% Start building the function body. First step is to initialize it with the +% common code. Then we add to the function body the input parsing step. For +% this we use a loop that will place +% \cs{pgfmathsetmacro} \meta{tmp-cs_i} |{#|\meta{i}|}| +% in the function body. +% Afterwards we do the real definitions. This strange construct is used to +% normalize the input. Depending on the context in which these functions are +% used, the arguments might be in the internal format of \textsc{pgf}'s +% \pkg{fpu}-library or something else that \pkg{l3fp} will not understand. +% The \cs{pgfmathsetmacro} calls will be done in a local context in which +% \textsc{pgf}'s \pkg{fpu}-library will be activated and set up to output in +% a format \pkg{l3fp} understands. +% \begin{macrocode} +\cs_new_protected:Npn \pgfmxfp_declare:nnn #1#2#3 + { + \@@_initialize_body: + \int_step_inline:nn {#2} + { + \tl_put_right:Nx \l_@@_function_body_tl + { + \exp_not:n { \pgfmathsetmacro } \exp_not:c { @@_arg##1 } + { \exp_not:n {####} ##1 } + } + } + \@@_define_function:nnnn {#2} {#1} {#2} {#3} + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\pgfmxfp_declare_processed_args:nnnn} +% This works mostly like \cs{pgfmxfp_declare:nnn}, but instead of +% using an \cs{int_step_inline:nn}-loop this uses \cs{clist_map_inline:nn} to +% map over the processed arguments. Those will be stored in the function body +% as +% \cs{pgfmathsetmacro} \meta{tmp-cs_i} |{|\meta{expr_i}|}|. +% \begin{macrocode} +\cs_new_protected:Npn \pgfmxfp_declare_processed_args:nnnn #1#2#3#4 + { + \@@_initialize_body: + \int_zero:N \l_@@_args_int + \clist_map_inline:nn {#3} + { + \int_incr:N \l_@@_args_int + \tl_put_right:Nx \l_@@_function_body_tl + { + \exp_not:n { \pgfmathsetmacro } + \exp_not:c { @@_arg \int_use:N \l_@@_args_int } + { \exp_not:n {##1} } + } + } + \exp_args:NV \@@_define_function:nnnn \l_@@_args_int {#1} {#2} {#4} + } +% \end{macrocode} +% \end{macro} +% +% \subsection{Internals} +% +% \begin{variable}{\l_@@_function_body_tl} +% This token list will be used to build the function's top-level definition. +% \begin{macrocode} +\tl_new:N \l_@@_function_body_tl +% \end{macrocode} +% \end{variable} +% +% \begin{variable}{\l_@@_args_int} +% In the case of \cs{pgfmxfp_declare_processed_args:nnnn} we'll have +% to count how many arguments the auxiliary function will take. +% \begin{macrocode} +\int_new:N \l_@@_args_int +% \end{macrocode} +% \end{variable} +% +% +% \begin{macro}{\@@_initialize_body:} +% Each function will have the same start setting up \textsc{pgf}'s \pkg{fpu}. +% \begin{macrocode} +\cs_new_protected:Npn \@@_initialize_body: + { + \tl_set:Nn \l_@@_function_body_tl + { + \group_begin: + \pgfkeys{/pgf/fpu=true, /pgf/fpu/output~format=sci}% + } + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_define_function:nnnn, \@@_define_function_aux:n} +% First we define the internal function. Then add to the function body some +% code that'll use \cs{use:x} to expand the temporary macros that store the +% input arguments and forward the results to the internal function. +% \begin{macrocode} +\cs_new_protected:Npn \@@_define_function:nnnn #1#2#3#4 + { + \@@_define_internal_function:nnn {#1} {#2} {#4} + \tl_put_right:Nx \l_@@_function_body_tl + { + \use:x + { + \exp_not:c { @@_function_ #2 _cmd } + \int_step_function:nN {#1} \@@_define_function_aux:n + } + } + \exp_args:Nnno + \pgfmathdeclarefunction {#2} {#3} \l_@@_function_body_tl + } +% \end{macrocode} +% The auxiliary is just used to build the temporary macro names and prevent +% them from further expansion. +% \begin{macrocode} +\cs_new:Npn \@@_define_function_aux:n #1 { { \exp_not:c { @@_arg#1 } } } +% \end{macrocode} +% \end{macro} +% +% \begin{macro} +% {\@@_define_internal_function:nnn, \@@_define_internal_function_aux:n} +% The internal function is pretty straight forward, the only difficult part +% is building the parameter list. For that we use some simple loop, a slow +% but simplistic solution. +% \begin{macrocode} +\cs_new_protected:Npn \@@_define_internal_function:nnn #1#2#3 + { + \exp_last_unbraced:Nx + \cs_set_protected:cpn + { + { @@_function_ #2 _cmd } + \int_step_function:nN {#1} \@@_define_internal_function_aux:n + } + { \group_end: \exp_args:Nf \pgfmathparse { \fp_eval:n {#3} } } + } +\cs_new:Npn \@@_define_internal_function_aux:n #1 { \exp_not:n {## #1} } +% \end{macrocode} +% \end{macro} +\ExplSyntaxOff +%^^A=<< +% +% \end{implementation}^^A=<< +% +% \clearpage +% \PrintIndex +% +\endinput +% +^^A vim: ft=tex fdm=marker fmr=>>=,=<< diff --git a/macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.pdf b/macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.pdf new file mode 100644 index 0000000000..7b03b1fdfa Binary files /dev/null and b/macros/latex/contrib/pgfmath-xfp/pgfmath-xfp.pdf differ diff --git a/macros/latex/contrib/pm-isomath/README.txt b/macros/latex/contrib/pm-isomath/README.txt index cf98e8ff02..3b23a56269 100644 --- a/macros/latex/contrib/pm-isomath/README.txt +++ b/macros/latex/contrib/pm-isomath/README.txt @@ -1,4 +1,4 @@ - README.txt file for pm-isomath.sty 2021/05/03 v.1.1.01 + README.txt file for pm-isomath.sty 2021/05/15 v.1.1.07 Distributable under the LaTeX Project Public License, diff --git a/macros/latex/contrib/pm-isomath/pm-isomath.dtx b/macros/latex/contrib/pm-isomath/pm-isomath.dtx index 466885491a..61a4df91da 100644 --- a/macros/latex/contrib/pm-isomath/pm-isomath.dtx +++ b/macros/latex/contrib/pm-isomath/pm-isomath.dtx @@ -50,14 +50,14 @@ This work consists of this file pm-isomath.dtx, a README.txt file % % \iffalse %^^A The following trick uses the same date for every file header. -%