diff options
author | Karl Berry <karl@freefriends.org> | 2021-02-15 22:15:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-02-15 22:15:29 +0000 |
commit | 73046e13d38cda6c175c5886c17fd4d716898a5e (patch) | |
tree | a27d12c36b1a84ad5b8b5e360273ec8c6002b519 /Master/texmf-dist/tex/latex | |
parent | 57d1b83eef654515374e38b04758517b0eaec0f5 (diff) |
verifiche (15feb21)
git-svn-id: svn://tug.org/texlive/trunk@57753 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/verifiche/verifiche.sty | 113 |
1 files changed, 96 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/verifiche/verifiche.sty b/Master/texmf-dist/tex/latex/verifiche/verifiche.sty index 13ca6420ddc..182f995f86c 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 by Francesco Raccanello +%% Copyright (C) 2021 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,9 +15,7 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{verifiche} [2020/07/01 v2.2 .dtx verifiche file] - - +\ProvidesPackage{verifiche} [2021/02/14 v4.0 .dtx verifiche file] \RequirePackage{xparse} \RequirePackage{xkeyval} \RequirePackage{amsmath} @@ -29,7 +27,6 @@ \RequirePackage{xcolor} \RequirePackage{tikz} \RequirePackage{booktabs} -\RequirePackage{fancyhdr} \RequirePackage[normalem]{ulem} \RequirePackage{xstring} %%Forse si può cancellare questo @@ -72,6 +69,13 @@ %%counters \newcounter{exercisenumber} \newcounter{partialpoints}[exercisenumber] +%%newlenght +\newlength{\candidatenamerulerlength} +\newlength{\classrulerlength} +\newlength{\daterulerlength} +\setlength{\candidatenamerulerlength}{.35\textwidth} +\setlength{\classrulerlength}{.1\textwidth} +\setlength{\daterulerlength}{.15\textwidth} %%macro and environment %%global variable \newcommand{\institute}[1]{% @@ -85,6 +89,8 @@ \newcommand{\asyear}[2][Anno scolastico]{% \gdef\@asyearpreamble{#1}\gdef\@asyear{#2}} %%fonts and aspects +\newcommand{\headerfont}[1]{% + \sffamily\color{darkgray}#1} \newcommand{\institutefont}[1]{% \large \sffamily\color{darkgray}#1} \newcommand{\asyearfont}[1]{% @@ -97,6 +103,13 @@ \sffamily#1} \newcommand{\durationfont}[1]{% \hspace*{\fill}\@durationpreamble\space\bfseries #1\hspace*{\fill}} +\newcommand{\headercandidatenamelabel}{Nome e Cognome} +\newcommand{\headerclasslabel}{Classe} +\newcommand{\headerdatelabel}{Data} +\newcommand{\@header@candidatename}{\headercandidatenamelabel\space\underline{\hspace{\candidatenamerulerlength}}} +\newcommand{\@header@class}{\headerclasslabel\space\underline{\hspace{\classrulerlength}}} +\newcommand{\@header@date}{\headerdatelabel\space\underline{\hspace{\daterulerlength}}} +\newcommand{\@header}{\@header@candidatename\hfill\@header@class\hfill\@header@date} \newcommand{\eserciziolabel}{% Quesito} \newcommand{\solutionfont}{% @@ -105,16 +118,80 @@ $\bigstar$} \newcommand{\closedquestionitem}{% $\square$} +%%pt prefix +\newcommand{\@ptprefix}{\underline{\hspace{1cm}}/} +\newcommand{\ptprefix}[1]{% + \renewcommand{\@ptprefix}{#1}} +%%partialpt prefix +\newcommand{\@partialptprefix}{} +\newcommand{\partialptprefix}[1]{% + \renewcommand{\@partialptprefix}{#1}} +%%pt label +\newcommand{\@ptsinglabel}{pt} +\newcommand{\@ptplurlabel}{pt} +\NewDocumentCommand{\ptlabel}{o m}{% + \renewcommand{\@ptplurlabel}{#2}% + \renewcommand{\@ptsinglabel}{\IfNoValueTF{#1}{#2}{#1}}}% +\newcommand{\@useptlabel}[1]{% + \ifnum#1=1 \@ptsinglabel \else \@ptplurlabel\fi} +%%partialpt label +\newcommand{\@partialptsinglabel}{pt} +\newcommand{\@partialptplurlabel}{pt} +\NewDocumentCommand{\partialptlabel}{o m}{% + \renewcommand{\@partialptplurlabel}{#2}% + \renewcommand{\@partialptsinglabel}{\IfNoValueTF{#1}{#2}{#1}}}% +\newcommand{\@usepartialptlabel}[1]{% + \ifnum#1=1 \@partialptsinglabel \else \@partialptplurlabel\fi} +%%partialpt delimiter +\newcommand{\@lpartialpt@delimiter}{(} +\newcommand{\@rpartialpt@delimiter}{)} +\newcommand{\@definepartialptdelimiter}[2]{ + \renewcommand{\@lpartialpt@delimiter}{#1} + \renewcommand{\@rpartialpt@delimiter}{#2}} +\newcommand{\partialptdelimiters}[1]{% + \@definepartialptdelimiter#1} +%%pt delimiter +\newcommand{\@lpt@delimiter}{} +\newcommand{\@rpt@delimiter}{} +\newcommand{\@defineptdelimiter}[2]{% + \renewcommand{\@lpt@delimiter}{#1}% + \renewcommand{\@rpt@delimiter}{#2}} +\newcommand{\ptdelimiters}[1]{% + \@defineptdelimiter#1} +%% convert ref to num +\newcommand*{\convertreftonum}[1]{% + \romannumeral + \@ifundefined{r@#1}{% + \expandafter\ltx@zero + \rc@default}{% + \expandafter\expandafter\expandafter\rc@extract@ + \expandafter\expandafter\expandafter!% + \csname r@#1\expandafter\endcsname + \expandafter{\rc@default}\@nil}% +} +\def\rc@default{0}% +\long\def\rc@extract@#1#2#3\@nil{% + \ltx@zero + #2} +\chardef\ltx@zero=0% + +%%pagestyles +\newcommand{\ps@mainverifiche}{% +\renewcommand\@oddhead{\parbox{\textwidth}{\centering \institutefont{\@institute}}}% +\renewcommand\@evenhead{}% +} +\newcommand{\ps@verifiche}{% +\renewcommand\@oddhead{ +\ifodd\thepage\parbox{\textwidth}{\headerfont\@header}\fi}% +} %%print headings \newcommand{\printheading}{% - \ifinstitute\pagestyle{fancy}\fi% - {\ifinstitute\chead{\institutefont{\@institute}}\fi}% - {\ifcandidatename\vspace*{.25em}Nome e Cognome \underline{\hspace{6cm}}% - \hfill Classe \underline{\hspace{1.5cm}} \hfill Data \underline{\hspace{2.5cm}}\\[1em]\fi}% - {\ifasyear \asyearfont{\@asyearpreamble\space\@asyear}\fi}% - {\iftesttype\testtypefont{\@testtype}\fi}\\% - {\ifinstruction\instructiondelimiter\\{\instrunctionfont{\@instruction}}\\% - \ifduration{\durationfont\@duration\\}\fi\instructiondelimiter\fi}% + {\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}% } %%ambiente esercizio @@ -125,10 +202,11 @@ \showmarginexercisetrue}% \define@key{esercizio}{pt}[none]{ \def\pointes{#1}% - \def\espoint{\hfill\underline{\hspace{1cm}}/\pointes pt}% + \def\espoint{\hfill\@ptprefix\@lpt@delimiter\pointes\space\@useptlabel{\pointes}\@rpt@delimiter} \showmarginexercisetrue}% \define@key{esercizio}{partialpt}[none]{% - \def\sumpartialpt{\underline{\hspace{1cm}}/\ref{ptes@\theexercisenumber} pt}% + \def\@totalpartialpt{\convertreftonum{ptes@\theexercisenumber}}% + \def\sumpartialpt{\@ptprefix\@lpt@delimiter\@totalpartialpt\space\@useptlabel{\@totalpartialpt}\@rpt@delimiter}% \showmarginexercisetrue}% \newcommand{\exercisetitle}{% \ifdefined\tempeserciziolabel\tempeserciziolabel% @@ -179,8 +257,9 @@ \savepointsaux%print partial pt sum }% \NewDocumentCommand{\partialpt}{m}{% - \leavevmode\reversemarginpar\marginpar{\hfill(#1 pt)\addtocounter{partialpoints}{#1}}% -} + \leavevmode\reversemarginpar\marginpar{% + \hfill\@partialptprefix\@lpartialpt@delimiter#1\space\@usepartialptlabel{#1}\@rpartialpt@delimiter% + \addtocounter{partialpoints}{#1}}}% \NewDocumentEnvironment{soluzione}{+b}{% \ifsol% \par\addvspace{\baselineskip}% |