diff options
author | Norbert Preining <norbert@preining.info> | 2022-06-17 03:01:24 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-06-17 03:01:24 +0000 |
commit | f9418ac1e9385653cfa09da311bb2d405a936334 (patch) | |
tree | 764fc072c0bea51901ba3ef3a6dd915400df47c5 /macros/latex/contrib/verifiche | |
parent | b83d15e1ff2e551eb7391d45becd87dce59d39b8 (diff) |
CTAN sync 202206170301
Diffstat (limited to 'macros/latex/contrib/verifiche')
-rw-r--r-- | macros/latex/contrib/verifiche/verifiche-example.pdf | bin | 191888 -> 192001 bytes | |||
-rw-r--r-- | macros/latex/contrib/verifiche/verifiche-example.tex | 2 | ||||
-rw-r--r-- | macros/latex/contrib/verifiche/verifiche.dtx | 92 | ||||
-rw-r--r-- | macros/latex/contrib/verifiche/verifiche.pdf | bin | 555223 -> 585018 bytes |
4 files changed, 61 insertions, 33 deletions
diff --git a/macros/latex/contrib/verifiche/verifiche-example.pdf b/macros/latex/contrib/verifiche/verifiche-example.pdf Binary files differindex 191c055935..b6ae252e2e 100644 --- a/macros/latex/contrib/verifiche/verifiche-example.pdf +++ b/macros/latex/contrib/verifiche/verifiche-example.pdf diff --git a/macros/latex/contrib/verifiche/verifiche-example.tex b/macros/latex/contrib/verifiche/verifiche-example.tex index ec32c5f405..b399be3644 100644 --- a/macros/latex/contrib/verifiche/verifiche-example.tex +++ b/macros/latex/contrib/verifiche/verifiche-example.tex @@ -167,7 +167,7 @@ Quali delle seguenti equazioni descrive il moto rettilineo uniforme?\par \begin{esercizio} \lipsum[2]\\[1em] -\openquestion[type=squares, width=8cm, height=6cm, linecolor=orange]{\lipsum[2]} +\openquestion[type=lines, width=8cm, height=6cm, linecolor=orange]{\lipsum[2]} \end{esercizio} diff --git a/macros/latex/contrib/verifiche/verifiche.dtx b/macros/latex/contrib/verifiche/verifiche.dtx index 90f9978a64..de03d7052a 100644 --- a/macros/latex/contrib/verifiche/verifiche.dtx +++ b/macros/latex/contrib/verifiche/verifiche.dtx @@ -16,7 +16,7 @@ % % \iffalse %<package>\NeedsTeXFormat{LaTeX2e} -%<package>\ProvidesPackage{verifiche} [2022/03/10 v5.0 .dtx verifiche file] +%<package>\ProvidesPackage{verifiche} [2022/06/16 v5.1 .dtx verifiche file] %<*driver> \documentclass{ltxdoc} \usepackage[utf8]{inputenc} @@ -70,7 +70,7 @@ %</driver> % \fi % -% \CheckSum{863} +% \CheckSum{914} % \changes{v1.0}{2020/06/14}{Initial version.} % \changes{v2.0}{2020/06/26}{Better performance in exercise environment.} % \changes{v2.1}{2020/06/30}{Introduced closedquestionitem to control |item| symbol.} @@ -82,6 +82,7 @@ % \changes{v4.3}{2022/02/10}{Move |parindent{0pt}| inside the environment.} % \changes{v4.4}{2022/03/10}{Minor update. Fixed labels issues.} % \changes{v5.0}{2022/05/18}{Major update. Remove some unnecessary packages. Remove spurious space in closedquestion environment. Add a starred version of closedquestion environment. Add the possibility to add local label to soluzione environment. Add a new command: makecolumn.} +% \changes{v5.1}{2022/06/16}{Minor update. Clean the code for printheading command; better appearance for openquestion command.} % \GetFileInfo{verifiche.sty} % \DoNotIndex{\newcommand,\newenvironment,\def,\begin,\end,\par} % \DoNotIndex{\DeclareOption,\ExecuteOptions,\ProcessOptions,\RequirePackage} @@ -120,7 +121,8 @@ % % \title{Il pacchetto \textsf{verifiche} % \thanks{Questo documento corrisponde al pacchetto \textsf{verifiche}~\fileversion, -% in data~\filedate.}} +% in data~\filedate.} +%\\ {\normalsize Version: \fileversion}} % \author{Francesco Raccanello\\ \texttt{raccanello.francesco@gmail.com}} % % \maketitle @@ -732,7 +734,7 @@ dell'esercizio somministrato %Il comando gestisce alcune opzioni:\\ % %\begin{tabular}{ll} -%|type| & accetta due valori: \texttt{lines} e \texttt{squares} (default: |lines|)\\ +%|type| & accetta due valori: \texttt{lines} e \texttt{squares} (default: |squares|)\\ %|width| & gestisce la dimensione orizzontale del campo di testo (default: 12 cm)\\ %|height| & gestisce la dimensione verticale del campo di testo (default: 20 cm)\\ %|spacedim|& gestisce la dimensione dei quadretti o delle linee (default: 0.5 cm)\\ @@ -749,7 +751,7 @@ dell'esercizio somministrato Prova del testo della soluzione della domanda aperta }} -{\openquestion[width=4cm, height=2cm]{Prova del testo della soluzione della domanda aperta}} +{\vspace*{1em}\openquestion[width=4cm, height=2cm]{Prova del testo della soluzione della domanda aperta}} % \iffalse %</example> % \fi @@ -758,11 +760,11 @@ dell'esercizio somministrato %<*example> % \fi \example -{\openquestion[type=squares]{ +{\openquestion[type=lines]{ Prova del testo della soluzione della domanda aperta }} -{\openquestion[type=squares, width=4cm, height=2cm]{Prova del testo della soluzione della domanda aperta}} +{\vspace*{1em}\openquestion[type=lines, width=4cm, height=2cm]{Prova del testo della soluzione della domanda aperta}} % \iffalse %</example> % \fi @@ -1094,6 +1096,7 @@ dell'esercizio somministrato \newif\ifsolutionscolor\solutionscolorfalse \newif\ifcandidatename\candidatenametrue \newif\iftesttype\testtypetrue +\newif\ifshowinstructiondelimiter\showinstructiondelimiterfalse \newif\ifprintedheading\printedheadingfalse \newif\ifexercisesnumbered\exercisesnumberedtrue \newif\ifshowmarginexercise\showmarginexercisefalse @@ -1147,6 +1150,9 @@ dell'esercizio somministrato \setlength{\classrulerlength}{.1\textwidth} \setlength{\daterulerlength}{.15\textwidth} \setlength{\ptrulerlength}{1cm} +\newlength{\verifiche@remainingvspace} +\newlength{\verifiche@remaininghspace} +\newlength{\spacedim} \setlength{\columnseparation}{\fill} % \end{macrocode} % @@ -1207,11 +1213,13 @@ dell'esercizio somministrato \newcommand{\institute}[1]{% \gdef\@institute{#1}} \newcommand{\duration}[2][\@durationlabeldefault]{% - \gdef\@durationpreamble{#1}\gdef\@duration{#2}} + \gdef\@durationpreamble{#1}\gdef\@duration{#2}% + \showinstructiondelimitertrue}% \newcommand{\testtype}[1]{% \gdef\@testtype{#1}} \newcommand{\instruction}[1]{% - \gdef\@instruction{#1}} + \gdef\@instruction{#1}% + \showinstructiondelimitertrue} \newcommand{\asyear}[2][\@asyearlabeldefault]{% \gdef\@asyearpreamble{#1}\gdef\@asyear{#2}} % \end{macrocode} @@ -1231,15 +1239,15 @@ dell'esercizio somministrato % \end{macrocode} % \begin{macrocode} \newcommand{\asyearfont}[1]{% - \hspace*{\fill} #1\hspace*{\fill}\\[.5em]} + \hspace*{\fill} #1\hspace*{\fill}} % \end{macrocode} % \begin{macrocode} \newcommand{\testtypefont}[1]{% - \hspace*{\fill}\scshape\huge#1\hspace*{\fill}} + \bgroup\hspace*{\fill}\scshape\huge#1\hspace*{\fill}\egroup} % \end{macrocode} % \begin{macrocode} \newcommand{\instructiondelimiter}{% - \rule{\textwidth}{.5pt}} + \hrulefill} % \end{macrocode} % \begin{macrocode} \newcommand{\instrunctionfont}[1]{% @@ -1247,7 +1255,7 @@ dell'esercizio somministrato % \end{macrocode} % \begin{macrocode} \newcommand{\durationfont}[1]{% - \hspace*{\fill}\@durationpreamble\space\bfseries #1\hspace*{\fill}} + \bgroup\hspace*{\fill}\@durationpreamble\space\bfseries #1\hspace*{\fill}\egroup} % \end{macrocode} % \begin{macrocode} \newcommand{\@header@candidatename}{% @@ -1368,6 +1376,21 @@ dell'esercizio somministrato #2} \chardef\ltx@zero=0% % \end{macrocode} +%\iffalse +%% init vertical/horizontal remaining space +%\fi +% \begin{macrocode} +\newcommand{\verifiche@initremainingvspace}{% + \pgfmathsetlength{\verifiche@remainingvspace}{% + floor((\dimexpr\pagegoal-\pagetotal-.5\baselineskip\relax)/\spacedim)*\spacedim% + }% +}% +\newcommand{\verifiche@initremaininghspace}{% + \pgfmathsetlength{\verifiche@remaininghspace}{% + floor(\linewidth/\spacedim)*\spacedim% + }% +}% +% \end{macrocode} %\paragraph{Page styles} %The package define two new pagestyle: \texttt{mainverifiche} and \texttt{verifiche}. The former is used if \verb|\@institute| is defined (or if \verb|noinstitute| is not declared) as \verb|\thispagestyle| mode. The latter can be used by the user and print, on the odd pages, the name, date and class of the candidate. @@ -1392,11 +1415,13 @@ dell'esercizio somministrato % \begin{macrocode} \newcommand{\printheading}{% {\ifdefined\@institute\ifinstitute\thispagestyle{mainverifiche}\fi\else\thispagestyle{plain}\fi}% - {\ifcandidatename\@header\\[1em]\fi}% - {\ifdefined\@asyear\ifasyear \asyearfont{\@asyearpreamble\space\@asyear}\fi\fi}% - {\ifdefined\@testtype\iftesttype\testtypefont{\@testtype}\fi\fi}\\% - {\ifdefined\@instruction\ifinstruction\instructiondelimiter\\{\instrunctionfont{\@instruction}}\\% - \ifdefined\@duration\ifduration{\durationfont\@duration\\}\fi\fi\instructiondelimiter\fi\fi}% + {\ifcandidatename\@header\par\vspace{\baselineskip}\fi}% + {\ifdefined\@asyear\ifasyear\asyearfont{\@asyearpreamble\space\@asyear}\par\vspace{\baselineskip}\fi\fi}% + {\ifdefined\@testtype\iftesttype\testtypefont{\@testtype}\par\fi\fi}% + {\ifshowinstructiondelimiter\instructiondelimiter\par\fi}% + {\ifdefined\@instruction\ifinstruction\instrunctionfont{\@instruction}}\par\fi\fi% + {\ifdefined\@duration\ifduration\durationfont\@duration\par\fi\fi}% + {\ifshowinstructiondelimiter\instructiondelimiter\par\fi}% } % \end{macrocode} @@ -1648,11 +1673,11 @@ dell'esercizio somministrato %\begin{macro}{\openquestion} %The |\openquestion| use key-value options defined as following presented. % \begin{macrocode} -\define@key{openquestion}{width}[\linewidth]{\def\openquestionwidth{#1}} -\define@key{openquestion}{height}[19cm]{\def\openquestionheight{#1}} -\define@key{openquestion}{spacedim}[0.5cm]{\def\spacedim{#1}} -\define@key{openquestion}{linecolor}[gray]{\def\openquestionlinecolor{#1}} -\define@choicekey*+{openquestion}{type}[\val\nr]{lines, squares}[lines]{% +\define@key{openquestion}{spacedim}[0.5cm]{\setlength{\spacedim}{#1}\verifiche@initremainingvspace\verifiche@initremaininghspace}% +\define@key{openquestion}{height}[\the\verifiche@remainingvspace]{\def\openquestionheight{#1}}% +\define@key{openquestion}{width}[\the\verifiche@remaininghspace]{\def\openquestionwidth{#1}}% +\define@key{openquestion}{linecolor}[gray]{\def\openquestionlinecolor{#1}}% +\define@choicekey*+{openquestion}{type}[\val\nr]{lines, squares}[squares]{% \ifcase\nr\relax% % lines \openquestionsquaredfalse\openquestionlinestrue% @@ -1667,33 +1692,36 @@ dell'esercizio somministrato %Depending on the |type| of the |\openquestion|, squared or ruled background is composed and in the foreground is reproduce the text of the argument of the command (in the "solutions mode"). % \begin{macrocode} \NewDocumentCommand{\openquestion}{o m}{% - \setkeys{openquestion}{type, width, height, linecolor, spacedim} %init + \setkeys{openquestion}{type, spacedim, width, height, linecolor} %init \IfValueT{#1}{\setkeys{openquestion}{#1}}% - \ifopenquestionsquared% if squared open question + \vspace{-\baselineskip}% + \begin{center} + \ifopenquestionsquared% if squared open question \begin{tikzpicture}% - \draw[step=\spacedim, \openquestionlinecolor]% + \draw[step=\the\spacedim, \openquestionlinecolor]% (0,0) grid (\openquestionwidth,-\openquestionheight);% \node[% anchor=base west,% align=left, text width=\openquestionwidth,% inner sep=0cm,% font=\solutionfont,% - execute at begin node=\setlength{\baselineskip}{\spacedim}]% - at (0, -\spacedim){\ifsol#2\fi}; + execute at begin node=\setlength{\baselineskip}{\the\spacedim}]% + at (0, -\the\spacedim){\ifsol#2\fi}; \end{tikzpicture}% \else% if lined open question \begin{tikzpicture}% - \pgfmathparse{int(\openquestionheight/\spacedim)}% + \pgfmathparse{int(\openquestionheight/\the\spacedim)}% \foreach \y in {1, ..., \pgfmathresult}% - \draw[\openquestionlinecolor] (0, -\y*\spacedim) -- +(\openquestionwidth,0);% + \draw[\openquestionlinecolor] (0, -\y*\the\spacedim) -- +(\openquestionwidth,0);% \node[% anchor=base west,align=left,% text width=\openquestionwidth,% inner sep=0cm, font=\solutionfont,% - execute at begin node=\setlength{\baselineskip}{\spacedim}]% - at (0, -\spacedim){\ifsol#2\fi};% + execute at begin node=\setlength{\baselineskip}{\the\spacedim}]% + at (0, -\the\spacedim){\ifsol#2\fi};% \end{tikzpicture}% \fi% + \end{center}% } % \end{macrocode} %\end{macro} diff --git a/macros/latex/contrib/verifiche/verifiche.pdf b/macros/latex/contrib/verifiche/verifiche.pdf Binary files differindex 63cb42a4d1..47ae4949a2 100644 --- a/macros/latex/contrib/verifiche/verifiche.pdf +++ b/macros/latex/contrib/verifiche/verifiche.pdf |