diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/verifiche/verifiche.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/verifiche/verifiche.sty | 131 |
1 files changed, 87 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/latex/verifiche/verifiche.sty b/Master/texmf-dist/tex/latex/verifiche/verifiche.sty index 27b32d77bdd..b60f65f7c09 100644 --- a/Master/texmf-dist/tex/latex/verifiche/verifiche.sty +++ b/Master/texmf-dist/tex/latex/verifiche/verifiche.sty @@ -6,7 +6,7 @@ %% %% verifiche.dtx (with options: `package') %% This is a generated file. -%% Copyright (C) 2020 - 2022 by Francesco Raccanello +%% Copyright (C) 2020 - 2023 by Francesco Raccanello %% This file 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 @@ -15,28 +15,16 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{verifiche} [2022/09/17 v6.0 .dtx verifiche file] +\ProvidesPackage{verifiche} [2023/08/22 v7.0 .dtx verifiche file] + \RequirePackage{xparse} \RequirePackage{xkeyval} -\RequirePackage{amsmath} -\RequirePackage{amssymb} \RequirePackage{pgffor} +\RequirePackage{amssymb} \RequirePackage[shortlabels, inline]{enumitem} -\RequirePackage{siunitx} -\RequirePackage{graphicx} -\RequirePackage{xcolor} \RequirePackage{tikz} -\RequirePackage{booktabs} \RequirePackage[normalem]{ulem} -%%Forse si può cancellare questo -\usetikzlibrary{calc,shapes.geometric,patterns,positioning,angles,quotes} -\sisetup{ - output-decimal-marker = {,}, - exponent-product = \cdot, - per-mode=symbol-or-fraction, - separate-uncertainty -} %%newif \newif\ifsol \newif\ifinstitute\institutetrue @@ -146,11 +134,11 @@ \newcommand{\institutefont}[1]{% \large \sffamily\color{darkgray}#1} \newcommand{\asyearfont}[1]{% - \hspace*{\fill} #1\hspace*{\fill}} + #1} \newcommand{\testtypefont}[1]{% - \bgroup\hspace*{\fill}\scshape\huge#1\hspace*{\fill}\egroup} + \bgroup\scshape\huge#1\egroup} \newcommand{\subtitlefont}[1]{% - \bgroup\hspace*{\fill}\Large\scshape#1\hspace*{\fill}\egroup}% + \bgroup\Large\scshape#1\egroup}% \newcommand{\instructiondelimiter}{% \hrulefill} \newcommand{\instrunctionfont}[1]{% @@ -173,9 +161,10 @@ \ifsolutionscolor\color{\solutionscolor}\fi% \itshape} \newcommand{\diffsymb}{% - $\bigstar$} + $\bullet$} \newcommand{\closedquestionitem}{% $\square$} +\newcommand{\ptfont}{\normalsize}% %%pt prefix \newcommand{\@ptprefix}{% \underline{\hspace{\ptrulerlength}}/} @@ -267,19 +256,75 @@ \renewcommand{\@oddfoot}{\hfill\normalfont\textrm\thepage\hfill}% \let\evenfoot\@oddfoot% } -%%print headings -\newcommand{\printheading}{% - {\ifdefined\@institute\ifinstitute\thispagestyle{mainverifiche}\fi\else\thispagestyle{plain}\fi}% +%%define the heading style command +\newcommand{\defineheadingstyle}[2]{ + \expandafter\newcommand\csname @verifichehdgsty#1\endcsname{% + \gdef\printheading{#2}} +} +%%use the heading style +\newcommand{\headingstyle}[1]{ + \ifcsname @verifichehdgsty#1\endcsname{% + \csname @verifichehdgsty#1\endcsname% + }% + \else% + \PackageError{verifiche}{% + Headings style "#1" is not define. + }{% + Headings style "#1" is not define. + Use \noexpand\defineheadingstyle to define a new ones before use it.% + }% + \fi% +}% +%%define "einstein" style +\defineheadingstyle{einstein}{% + {\ifdefined\@institute\ifinstitute\thispagestyle{mainverifiche}\fi\else\thispagestyle{empty}\fi}% + {\ifcandidatename% + \noindent% + \begin{minipage}[t]{.5\textwidth}% + \vspace{0mm}% + \headerfont{\@header@candidatename\\[.5em]% + \@header@class\\[.5em]% + \@header@date}% + \end{minipage}}\fi% + \begin{minipage}[t]{.5\textwidth}% + \vspace{0mm}% + {\ifdefined\@asyear\ifasyear\hspace*{\fill}\asyearfont{\@asyearpreamble\space\@asyear}\hspace*{\fill}\par\vspace{\baselineskip}\fi\fi}% + {\ifdefined\@testtype\iftesttype\makebox[\linewidth][s]{\testtypefont{\@testtype}}\par\fi\fi}% + {\ifdefined\@subtitle\ifsubtitle\vspace{\baselineskip}\hspace*{\fill}\subtitlefont{\@subtitle}\hspace*{\fill}\par\fi\fi}% + \end{minipage}% + \par\vspace{\baselineskip}% + {\ifshowinstructiondelimiter\noindent\instructiondelimiter\par\fi}% + {\ifdefined\@instruction\ifinstruction\instrunctionfont{\noindent\@instruction}}\par\fi\fi% + {\ifdefined\@duration\ifduration\hspace*{\fill}\durationfont\@duration\hspace*{\fill}\par\fi\fi}% + {\ifshowinstructiondelimiter\noindent\instructiondelimiter\par\fi}% +}% +%%define "cattaneo" style +\defineheadingstyle{cattaneo}{% + {\ifdefined\@institute\ifinstitute\thispagestyle{mainverifiche}\fi\else\thispagestyle{empty}\fi}% + {\ifdefined\@asyear\ifasyear\hspace*{\fill}\asyearfont{\@asyearpreamble\space\@asyear}\hspace*{\fill}\par\vspace{\baselineskip}\fi\fi}% + {\ifdefined\@testtype\iftesttype\hspace*{\fill}\testtypefont{\@testtype}\hspace*{\fill}\par\fi\fi}% + {\ifdefined\@subtitle\ifsubtitle\vspace{\baselineskip}\hspace*{\fill}\subtitlefont{\@subtitle}\hspace*{\fill}\par\vspace{\baselineskip} + \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}% - {\ifdefined\@subtitle\ifsubtitle\vspace{\baselineskip}\subtitlefont{\@subtitle}\par\fi\fi}% {\ifshowinstructiondelimiter\noindent\instructiondelimiter\par\fi}% {\ifdefined\@instruction\ifinstruction\instrunctionfont{\noindent\@instruction}}\par\fi\fi% - {\ifdefined\@duration\ifduration\durationfont\@duration\par\fi\fi}% + {\ifdefined\@duration\ifduration\hspace*{\fill}\durationfont\@duration\hspace*{\fill}\par\fi\fi}% {\ifshowinstructiondelimiter\noindent\instructiondelimiter\par\fi}% } - +%%define "galilei" style +\defineheadingstyle{galilei}{% + {\ifdefined\@institute\ifinstitute\thispagestyle{mainverifiche}\fi\else\thispagestyle{empty}\fi}% + {\ifcandidatename\@header\par\vspace{\baselineskip}\fi}% + {\ifdefined\@asyear\ifasyear\hspace*{\fill}\asyearfont{\@asyearpreamble\space\@asyear}\hspace*{\fill}\par\vspace{\baselineskip}\fi\fi}% + {\ifdefined\@testtype\iftesttype\hspace*{\fill}\testtypefont{\@testtype}\hspace*{\fill}\par\fi\fi}% + {\ifdefined\@subtitle\ifsubtitle\vspace{\baselineskip}\hspace*{\fill}\subtitlefont{\@subtitle}\hspace*{\fill}\par\fi\fi}% + {\ifshowinstructiondelimiter\noindent\instructiondelimiter\par\fi}% + {\ifdefined\@instruction\ifinstruction\instrunctionfont{\noindent\@instruction}}\par\fi\fi% + {\ifdefined\@duration\ifduration\hspace*{\fill}\durationfont\@duration\hspace*{\fill}\par\fi\fi}% + {\ifshowinstructiondelimiter\noindent\instructiondelimiter\par\fi}% +} +%% default style: "galilei" +\headingstyle{galilei} %%ambiente esercizio \define@key{esercizio}{label}[\exerciselabel]{% \def\tempeserciziolabel{#1}}% @@ -290,6 +335,7 @@ \ifshowexercisept% \def\pointes{#1}% \def\espoint{% + \ptfont% \hfill\@ptprefix\@lpt@delimiter% \pointes\space\@useptlabel{\pointes}% \@rpt@delimiter} @@ -299,6 +345,7 @@ \ifshowexercisept% \def\@totalpartialpt{\convertreftonum{ptes@\theexercisenumber}}% \def\sumpartialpt{% + \ptfont% \@ptprefix\@lpt@delimiter% \@totalpartialpt\space\@useptlabel{\@totalpartialpt}% \@rpt@delimiter}% @@ -333,9 +380,9 @@ \par\addvspace{\baselineskip}% {\noindent\bfseries\exercisetitle\ifexercisesnumbered\space\theexercisenumber\fi}% \ifshowmarginexercise\exercisemargin\fi% - \par% newline after label + \par\nopagebreak\@nobreaktrue\ignorespaces% newline after label \setlength\parindent{0pt}%no parindent - \nobreak\ignorespaces#2%body of the environment + #2%body of the environment }{% \par% \ignorespacesafterend% @@ -346,9 +393,9 @@ \IfValueT{#1}{\setkeys{esercizio}{#1}}% \par\addvspace{\baselineskip}{\noindent\bfseries\exercisetitle}% \ifshowmarginexercise\exercisemargin\fi% - \par% newline after label + \par\nopagebreak\@nobreaktrue\ignorespaces% newline after label \setlength\parindent{0pt}%no parindent - \nobreak\ignorespaces#2% body of the environment + #2%body of the environment }{% \par% \ignorespacesafterend @@ -376,7 +423,7 @@ {\noindent\bfseries% \ifsolutionscolor\color{\solutionscolor}\fi% \verifiche@solutionlabel}% - \par\nobreak\noindent\ignorespaces% + \par\nopagebreak\@nobreaktrue\noindent\ignorespaces% \setlength\parindent{0pt}%no parindent \solutionfont #2% \fi% @@ -396,11 +443,8 @@ \fi% } \newcommand{\completetext}[2][4.5cm]{% - \ifsol% - $\overset{\displaystyle\text{\solutionfont#2}}{\underline{\hspace{#1}}}$% - \else% - $\overset{\relax}{\underline{\hspace{#1}}}$% - \fi}% + \underline{\makebox[#1][c]{\ifsol\solutionfont#2\else\relax\fi}} +}% \newcommand{\truefalse}[1]{% %True \framebox{\parbox[c][\verifiche@truefalsesquares]{\verifiche@truefalsesquares}{\centering\@verifiche@Tletter}}% @@ -419,12 +463,11 @@ \fi%% } \newcommand{\finderror}[2]{% - \ifsol% - $\overset{\text{{\solutionfont#2}}}{\text{\xout{#1}}}$% - \else% - #1% - \fi% -} + \tikz[baseline=(error.base)]{% + \node[inner sep=0pt](error){\ifsol\xout{#1}\else#1\fi};% + \node[anchor=south, inner sep=2pt] at (error.north){\ifsol\solutionfont#2\else\relax\fi};% + }% +}% \newlist{crocette}{itemize}{1}% \newlist{crocette*}{itemize*}{1}% \setlist[crocette]{label=\closedquestionitem, leftmargin=*, parsep=0pt }% |