diff options
author | Norbert Preining <norbert@preining.info> | 2024-01-12 03:01:12 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-01-12 03:01:12 +0000 |
commit | 1748d1e662c9618cc16f80d5e67669e9e9d6d4be (patch) | |
tree | 7d46019dbae3fa8e0345487ecf524cfc641f1b2a /macros/latex/contrib/tikzquests | |
parent | b14090c9f3c7797e26fed9eb2b83ce144dcb16a3 (diff) |
CTAN sync 202401120301
Diffstat (limited to 'macros/latex/contrib/tikzquests')
-rw-r--r-- | macros/latex/contrib/tikzquests/README.md | 3 | ||||
-rw-r--r-- | macros/latex/contrib/tikzquests/doc/tikzquests.pdf | bin | 348067 -> 356126 bytes | |||
-rw-r--r-- | macros/latex/contrib/tikzquests/doc/tikzquests.tex | 54 | ||||
-rw-r--r-- | macros/latex/contrib/tikzquests/latex/tikzquests.sty | 37 |
4 files changed, 49 insertions, 45 deletions
diff --git a/macros/latex/contrib/tikzquests/README.md b/macros/latex/contrib/tikzquests/README.md index b33cdcbfaa..c15ca5ed94 100644 --- a/macros/latex/contrib/tikzquests/README.md +++ b/macros/latex/contrib/tikzquests/README.md @@ -67,5 +67,8 @@ The Current Maintainer of this work is Alceu Frigeri - documentation in PDF format ------------- +* Version 1.1 (this) + - Documentation typos, and issue #1. + * Version 1.0 - Initial release by CTAN. diff --git a/macros/latex/contrib/tikzquests/doc/tikzquests.pdf b/macros/latex/contrib/tikzquests/doc/tikzquests.pdf Binary files differindex 3195ef7b2d..6890e18507 100644 --- a/macros/latex/contrib/tikzquests/doc/tikzquests.pdf +++ b/macros/latex/contrib/tikzquests/doc/tikzquests.pdf diff --git a/macros/latex/contrib/tikzquests/doc/tikzquests.tex b/macros/latex/contrib/tikzquests/doc/tikzquests.tex index 49259e7f8d..50d40b5adc 100644 --- a/macros/latex/contrib/tikzquests/doc/tikzquests.tex +++ b/macros/latex/contrib/tikzquests/doc/tikzquests.tex @@ -15,7 +15,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.0} {2024/01/03} +%% This is version {1.1} {2024/01/11} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/tikzquests @@ -175,18 +175,24 @@ The \tsobj[marg]{idx} can be extended with the \tsobj[option]{xtraidx} option. F \end{tsremark} Unless the \tsobj[option]{no defs} option is defined, a corresponding macro (with the same name) will also be defined. For example, there is a macro \tsobj{\Ra} associated with the key \tsobj[key]{Ra}. -All those macros/keys are initialized as follow: ``math mode'' (\tsobj{\ensuremath}), $ID_{idx}$, so, for example, the key \tsobj[key]{Rab}, which can be accessed with the macro \tsobj{\Rab}, will be predefined as $R_{ab}$, \tsobj[key]{Lca} (\tsobj{\Lca}) will be predefined as $L_{ca}$, and so on. +All those macros/keys are initialized as follow (math mode) \tsverb{\ensuremath{<ID>_{<idx>}}}, resulting in $ID_{idx}$. So, for example, the key \tsobj[key]{Rab}, which can be accessed with the macro \tsobj{\Rab}, will be predefined as $R_{ab}$, \tsobj[key]{Lca} (\tsobj{\Lca}) will be predefined as $L_{ca}$, and so on. -The idea is that, when using the commands in \ref{question use}, if one doesn't specify a \tsobj[oarg]{key=value list}, the default values will be ``en force'', and all one has to do (to change those values) is to set said list, which doesn't have to be complete, non assigned keys will keep their default value. +The idea is that, when using the commands in \ref{question use}, if one doesn't specify a \tsobj[oarg]{key=value list}, the default values will be en force, and all one has to do (to change those values) is to set said list, which doesn't have to be complete, non assigned keys will keep their default value. Besides those default keys, one can set and use any key at will (in \tsobj[oarg]{key=value list}) non-existing keys will be created ``on the fly'' with the given name as the default value. \subsection{Assigning a new value to pre-defined keys} -In fact, with each and every key there are 3 ways to assign a value to it \tsobj[oarg]{key}\,=\tsobj[value]{value}, \tsobj[oarg]{key*}\,=\tsobj[value]{value} and \tsobj[oarg]{key raw}\,=\tsobj[value]{value}. The difference being that \tsobj[oarg]{key raw} will assign whatever code/value to the key (and associated macro), \tsobj[oarg]{key*} will assign the code/value inside a math environment. +In fact, with each and every predefined key there are 3 ways to assign a value to it \tsobj[oarg]{key}\,=\tsobj[value]{value}, \tsobj[oarg]{key*}\,=\tsobj[value]{value} and \tsobj[oarg]{key raw}\,=\tsobj[value]{value}. The difference being that \tsobj[oarg]{key raw} will assign whatever code/value to the key (and associated macro), \tsobj[oarg]{key*} will assign the code/value inside a math environment. \begin{tsremark}[\color{red}warning:] \tsobj[oarg]{key}\,=\tsobj[value]{value} (without any specifier) will be the same as \tsobj[oarg]{key*} (default). But, if the option \tsobj[option]{no defs} is used, it will be equivalent to \tsobj[oarg]{key raw}. \end{tsremark} +\subsection{Assigning a value to new keys} +When using \tsobj[oarg]{key}\,=\tsobj[value]{value}, if the \tsobj[oarg]{key} isn't one of the pre-defined ones, then \tsobj[value]{value} will be assigned ``as is'' to \tsobj[oarg]{key}. +\begin{tsremark}[\color{red}warning:] +Note that, in this case there are no \tsobj[oarg,sep=or]{key*,key raw} equivalents. +\end{tsremark} + \subsection{Using a parameter key} When defining the \tsobj[marg]{code} of a question (see \ref{question definition}) one has two options to recover a key's value: \begin{itemize} @@ -203,13 +209,13 @@ If the option \tsobj[option]{no defs} is defined, the only option to recover a k \tsmacro{\QuestVal}{IDidx} \tsmacro{\QuestVal}{key} \end{codesyntax} -This will always recover the value of a key, regardless if the key is one of the pre-defined ones (in the form \tsobj[marg]{IDidx} or a ``on the fly'' one. -If the key didn't got (re)defined with the \tsobj[oarg]{key=value list}, this will return the key/paramenter default value. In the case of a ``on the fly'' key, it will be the key's name in red (or the color set up with the \tsobj[option]{undef color} option, see \ref{package options}). +This will always recover the value of a key, regardless if the key is one of the pre-defined ones (in the form \tsobj[marg]{IDidx} or a ``on the fly'' one, \tsobj[marg]{key}. +If the key didn't got (re)defined with the \tsobj[oarg]{key=value list}, this will return the key/parameter default value. In the case of a ``on the fly'' key, it will be the key's name in red (or the color set up with the \tsobj[option]{undef color} option, see \ref{package options}). This should be safe in most situations where \tsobj{\pgfkeys} command can be used. Though, the safest, and most robust, way to use a parameter/key is using it's related macro. \end{codedescribe} -\section{Example of Use} +\section{Examples of Use} \subsection{Package Options} \begin{codestore}[pack.options A] @@ -244,7 +250,7 @@ Besides that, the undefined color will be blue and no additional macro will be d In this case, no alias will be defined (the command \tsobj{\defQuestionAlias} will be ignored), and when using \tsobj{\tikzQuestion} (and similar) the question's remarks (defined by \tsobj{\defQuestion}) and annotations (from \tsobj{\tikzQuestion}) will be printed. The \tsobj[option]{no alias} is specially useful when using the command \tsobj{\QuestionsList}. \subsection{A More Complete Example} -In the code below, an extra repository will be set (besides the default one) and two questions (a starred, text, and non starred, graphics) will be defined for each repository. +In the following code, an extra repository will be set (besides the default one) and two questions (a starred, text, and non starred, graphics) will be defined for each repository. \begin{codestore}[DefQuestion] % A repository name can be just about anything. @@ -265,6 +271,7 @@ In the code below, an extra repository will be set (besides the default one) and to[C] ++(2,0) coordinate(B) -- ++(1,0) node[npn,anchor=B] (T1){} (A) -- (A -| B) coordinate(Ba) to[R=\Rb] (B) to[R=\Rg] ++(0,3) coordinate(C) + (B) node[circ]{} (T1.E) to[R,l=\Rc] (T1.E |- A) -- (A) (T1.C) to[R,l_=\Rd] (T1.C |- C) -- (C -| A) -- ++(-2,0) coordinate(X) to[V,l=\Vbc] (X |- A) -- (A) (T1.C) -- ++(1.5,0) node[ocirc]{} coordinate(k) to[open,v=\Vo] (k |- A) node[ocirc]{} -- (A) @@ -287,6 +294,7 @@ In the code below, an extra repository will be set (besides the default one) and to[C] ++(2,0) coordinate(B) -- ++(1,0) node[pnp,anchor=B] (T1){} (A) -- (A -| B) coordinate(Ba) to[R=\Rb] (B) to[R=\Rg] ++(0,3) coordinate(C) + (B) node[circ]{} (T1.C) to[R,l=\Rc] (T1.C |- A) -- (A) (T1.E) to[R,l_=\Rd] (T1.E |- C) -- (C -| A) -- ++(-2,0) coordinate(X) to[V,l=\Vbc] (X |- A) -- (A) (T1.C) -- ++(1.5,0) node[ocirc]{} coordinate(k) to[open,v=\Vo] (k |- A) node[ocirc]{} -- (A) @@ -313,8 +321,9 @@ In the code below, an extra repository will be set (besides the default one) and to[C] ++(2,0) coordinate(B) -- ++(1,0) node[npn,anchor=B] (T1){} (A) -- (A -| B) coordinate(Ba) to[R=\Rb] (B) to[R=\Rg] ++(0,3) coordinate(C) - (T1.E) to[R,l=\Rc] (T1.E |- A) -- (A) - (T1.C) to[R,l_=\Rd] (T1.C |- C) -- (C -| A) -- ++(-2,0) coordinate(X) to[V,l=\Vbc] (X |- A) -- (A) + (B) node[circ]{} + (T1.E) to[R,l_=\Rc] (T1.E |- A) -- (A) + (T1.C) to[R,l=\Rd] (T1.C |- C) -- (C -| A) -- ++(-2,0) coordinate(X) to[V,l=\Vbc] (X |- A) -- (A) (T1.C) -- ++(1.5,0) node[ocirc]{} coordinate(k) to[open,v=\Vo] (k |- A) node[ocirc]{} -- (A) ; }[this is a CircuiTikZ example] @@ -335,11 +344,12 @@ In the code below, an extra repository will be set (besides the default one) and to[C] ++(2,0) coordinate(B) -- ++(1,0) node[pnp,anchor=B] (T1){} (A) -- (A -| B) coordinate(Ba) to[R=\Rb] (B) to[R=\Rg] ++(0,3) coordinate(C) - (T1.C) to[R,l=\Rc] (T1.C |- A) -- (A) - (T1.E) to[R,l_=\Rd] (T1.E |- C) -- (C -| A) -- ++(-2,0) coordinate(X) to[V,l=\Vbc] (X |- A) -- (A) + (B) node[circ]{} + (T1.C) to[R,l_=\Rc] (T1.C |- A) -- (A) + (T1.E) to[R,l=\Rd] (T1.E |- C) -- (C -| A) -- ++(-2,0) coordinate(X) to[V,l=\Vbc] (X |- A) -- (A) (T1.C) -- ++(1.5,0) node[ocirc]{} coordinate(k) to[open,v=\Vo] (k |- A) node[ocirc]{} -- (A) ; -}[this is a CircuiTikZ example] +}[this is another CircuiTikZ example] Once Questions are defined one can use them, for instance, using just the default parameter's values. @@ -359,7 +369,7 @@ Choose one of the following two questions: \tscode*[codeprefix={Questions Defaults},resultprefix={Result: \emph{no output}},emph={Ra,Rb,Rc,Rd,Rg,Vi,Vbc,Vo,QuestVal,Beta,Gain,raw,DC,level},emph2={textQuestion,ftikzQuestion},basicstyle={\scriptsize\ttfamily}]{QuestionDefault} -\hrule\relax +\hrule\relax\vspace{0.5ex} Choose one of the following two questions: @@ -371,35 +381,35 @@ Choose one of the following two questions: \ftikzQuestion(0.4)[default]{Elect. 1b} \end{enumerate} -Finally, one can use those same questions, setting it's parameters: +Finally, one can use these same questions, setting it's parameters: \begin{codestore}[QuestionUse] Choose one of the following two questions: \begin{enumerate} \item \textQuestion[Repo 2]{Quest A:1}[Beta=200,Gain=4,Ra=50\Omega]<just a last minute note about this>\par - \ftikzQuestion(0.4)[Repo 2]{Elect. 1a}[Ra=50\Omega,Rb*=100\Omega,Rg raw=100,Rc=100,Rd=R_c,Vbc=18V,Vi=v_i(t),Vo=v_o(t)] + \ftikzQuestion(0.4)[Repo 2]{Elect. 1a}[Ra=50\Omega,Rb*=100\Omega,Rg raw=$100\Omega$,Rc=100\Omega,Rd=R_c,Vbc=18V,Vi=v_i(t),Vo=v_o(t)] \item \textQuestion[default]{Quest A:1}[Beta=200,DC level=8V,Rg=R_{b1},Vo=v_o(t)]<just for the sake of it...>\par - \ftikzQuestion(0.4)[default]{Elect. 1b}[Ra=50\Omega,Rb*=100\Omega,Rg=R_{b1},Rc=100,Rd=200\Omega,Vbc=18V,Vi=v_i(t),Vo=v_o(t)] + \ftikzQuestion(0.4)[default]{Elect. 1b}[Ra=50\Omega,Rb*=100\Omega,Rg=R_{b1},Rc=100\Omega,Rd=200\Omega,Vbc=18V,Vi=v_i(t),Vo=v_o(t)] \end{enumerate} \end{codestore} \tscode*[codeprefix={Questions Using Parameters},resultprefix={Result: \emph{no output}},emph={Ra,Rb,Rc,Rd,Rg,Vi,Vbc,Vo,QuestVal,Beta,Gain,raw,DC,level},emph2={textQuestion,ftikzQuestion},basicstyle={\scriptsize\ttfamily}]{QuestionUse} -\hrule\relax +\hrule\relax\vspace{0.5ex} Choose one of the following two questions: \begin{enumerate} \item \textQuestion[Repo 2]{Quest A:1}[Beta=200,Gain=4,Ra=50\Omega]<just a last minute note about this>\par - \ftikzQuestion(0.4)[Repo 2]{Elect. 1a}[Ra=50\Omega,Rb*=100\Omega,Rg raw=100,Rc=100,Rd=R_c,Vbc=18V,Vi=v_i(t),Vo=v_o(t)] + \ftikzQuestion(0.4)[Repo 2]{Elect. 1a}[Ra=50\Omega,Rb*=100\Omega,Rg raw=$100\Omega$,Rc=100\Omega,Rd=R_c,Vbc=18V,Vi=v_i(t),Vo=v_o(t)] \item \textQuestion[default]{Quest A:1}[Beta=200,DC level=8V,Rg=R_{b1},Vo=v_o(t)]<just for the sake of it...>\par - \ftikzQuestion(0.4)[default]{Elect. 1b}[Ra=50\Omega,Rb*=100\Omega,Rg=R_{b1},Rc=100,Rd=200\Omega,Vbc=18V,Vi=v_i(t),Vo=v_o(t)] + \ftikzQuestion(0.4)[default]{Elect. 1b}[Ra=50\Omega,Rb*=100\Omega,Rg=R_{b1},Rc=100\Omega,Rd=200\Omega,Vbc=18V,Vi=v_i(t),Vo=v_o(t)] \end{enumerate} -\subsection{Creating a Questions List} +\subsection{Creating a Questions' List} To round it up, using the \tsobj{\QuestionsList} (see \ref{question use}): \begin{codestore}[Qlist] \QuestionsList @@ -407,7 +417,7 @@ To round it up, using the \tsobj{\QuestionsList} (see \ref{question use}): \tscode*{Qlist} -One get's: +One get's: %and then \QuestionsList diff --git a/macros/latex/contrib/tikzquests/latex/tikzquests.sty b/macros/latex/contrib/tikzquests/latex/tikzquests.sty index d54507f477..4ecad3156b 100644 --- a/macros/latex/contrib/tikzquests/latex/tikzquests.sty +++ b/macros/latex/contrib/tikzquests/latex/tikzquests.sty @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.0} {2024/01/02} +%% This is version {1.1} {2024/01/11} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/tikzquests @@ -27,8 +27,8 @@ \ProvidesExplPackage {tikzquests} - {2024/01/02} - {1.0} + {2024/01/11} + {1.1} {A Simple Framework for (tikz/text) Parametric Questions} \ExplSyntaxOn @@ -42,24 +42,15 @@ { name .code:n = {tikzquests} , prefix .code:n = {tikzquests} , - date .code:n = {2024/01/02}, - version .code:n = {1.0} , + date .code:n = {2024/01/11}, + version .code:n = {1.1} , description .code:n = {A Simple Framework for (tikz/text) Parametric Questions} - } -\cs_if_exist:NF \__codedesc_pkg_info:nn +\cs_if_exist:NF \PkgInfo { - \cs_new_protected:Npn \__codedesc_pkg_info:nn #1#2 - { \keys_set:nn {#1 / pkg info}{#2} } - } -\cs_if_exist:NF \PkgInfo - { \NewDocumentCommand \PkgInfo {mm} { \keys_set:nn {#1 / pkg info}{#2} } } -\cs_if_exist:NF \PkgDescription - { + \NewDocumentCommand \PkgInfo {mm} { \keys_set:nn {#1 / pkg info}{#2} } \NewDocumentCommand \PkgDescription {m} - { - \noindent Package~ \textbf{\PkgInfo{#1}{name}}~Version:~\PkgInfo{#1}{version}~ -~ \PkgInfo{#1}{date}\par \emph{\PkgInfo{#1}{description}}~\par - } + { \noindent Package~ \textbf{\PkgInfo{#1}{name}}~Version:~\PkgInfo{#1}{version}~ -~ \PkgInfo{#1}{date}\par \emph{\PkgInfo{#1}{description}}~\par } } %%%%%%% %%% End of cut-n-paste @@ -266,11 +257,9 @@ \NewDocumentCommand{\ftikzQuestion}{D(){}O{\l__tikzquests_active_repository_tl}mO{}} { -% \begin{figure}[!htb] \begin{center} \tikzQuestion(#1)[#2]{#3}[#4] \end{center} -% \end{figure} } @@ -342,7 +331,7 @@ \__tikzquests_rawquestion:nnnnn {#1}{textrepo}{#2}{#3}{#4} } -\cs_new_protected:Npn \__tikzquests_sorted_list:nnn #1#2#3#4 +\cs_new_protected:Npn \__tikzquests_sorted_list:nnnn #1#2#3#4 { \prop_if_empty:cF {l__tikzquests_ #1 _ #2 _prop} { @@ -392,9 +381,11 @@ { \prop_if_exist:cTF {l__tikzquests_ ##1 _tikzrepo_prop} { - {\vspace{1ex}Repository~ Name:~ \large\textbf{##1}}\vspace{0.35ex}\hrule\relax\hrule\relax - \__tikzquests_sorted_list:nnn {##1}{tikzrepo}{\raisebox{3em}}{\tikzQuestion(0.35)} - \__tikzquests_sorted_list:nnn {##1}{textrepo}{}{\textQuestion} + {\vspace{1ex}Repository~ Name:~ \large\textbf{##1}}\vspace{0.35ex}\hrule\relax\hrule\relax + {\vspace{1ex}~\hfill\emph{non~ starred~ ones~ -~ TikZ~ graphics}}\vspace{0.35ex}\hrule\relax + \__tikzquests_sorted_list:nnnn {##1}{tikzrepo}{\raisebox{3em}}{\tikzQuestion(0.35)} + {~\hfill\emph{starred~ ones~ -~ text/\TeX}}\vspace{0.35ex}\hrule\relax + \__tikzquests_sorted_list:nnnn {##1}{textrepo}{}{\textQuestion} } { \msg_error:nnne {tikzquests}{invalid repository}{Qlist~01}{##1} |