summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/esami/esami.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-01-13 20:58:24 +0000
committerKarl Berry <karl@freefriends.org>2022-01-13 20:58:24 +0000
commita23370aa985dab90107baf2674cecce72e815d9e (patch)
treea9a6be6e5597cab7ba42f684846ba2ed464a1d65 /Master/texmf-dist/tex/latex/esami/esami.sty
parent755cccc747cfc4d674898392d645d05644aa2c8a (diff)
esami (13jan22)
git-svn-id: svn://tug.org/texlive/trunk@61596 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/esami/esami.sty')
-rw-r--r--Master/texmf-dist/tex/latex/esami/esami.sty56
1 files changed, 41 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/esami/esami.sty b/Master/texmf-dist/tex/latex/esami/esami.sty
index 668bef76068..2968a0d60dd 100644
--- a/Master/texmf-dist/tex/latex/esami/esami.sty
+++ b/Master/texmf-dist/tex/latex/esami/esami.sty
@@ -2,8 +2,8 @@
%% This is file `esami.sty',
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% esami.sty package, 2021-10-11 %%
-%% Copyright (C) 2008-2021 G. Messineo e S. Vassallo %%
+%% esami.sty package, 2022-01-11 %%
+%% Copyright (C) 2008-2022 G. Messineo e S. Vassallo %%
%% %%
%% This program can be redistributed and/or modified %%
%% under the terms of the LaTeX Project Public License %%
@@ -47,10 +47,14 @@
%Corrected a misprint in the code. Improved the selection of random exercises.
% Version 2.6
% 2021/10/11
-%Corrected a misprint in the code. Improved the selection of random exercises.
+%Improved the spacing in \cmd{\FPsignpol}. Corrected the code to avoid some spourios spaces.
+% Version 2.7
+% 2022/01/11
+%Improved the spacing in \cmd{\sempli} and \cmd{\FPsignpol}. Corrected a misprint in the code.
+%
\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{esami}
- [2021/10/11 v2.6 An Exam Construction Package]
+ [2022/01/11 v2.7 An Exam Construction Package]
% +=============================+
% | THE OPTIONS |
@@ -428,7 +432,7 @@
}
\FPeval\fp@num{round((\fp@n/\fp@restoold):0)}%
\FPeval\fp@den{round((\fp@d/\fp@restoold):0)}%
- \FPifneg\segnofrac{-}
+ \FPifneg\segnofrac{-\:}
\else{}
\fi
\ifthenelse{\fp@den=1}{%
@@ -547,26 +551,44 @@
%========================================================%
\newcommand{\FPsignpol}[2] %%% adapted from code contributed by Hjalmar Basile NEW 2016/04/11
+%{\FPval\tempsign{#1}
+ %\ifthenelse{\equal{#2}{}}
+ %{%
+ %\ifnum \tempsign<0 {\:\sempli{\tempsign}{1}#2}
+ %\else
+ %\ifnum \tempsign>0{\:+\:\sempli{\tempsign}{1}#2}
+ %\else{}
+ %\fi
+ %\fi
+ %}
+ %{%
+ %\ifnum \tempsign<0 {\:\semplix{\tempsign}{1}#2\:}
+ %\else
+ %\ifnum \tempsign>0{\:+\:\semplix{\tempsign}{1}#2}
+ %\else{}
+ %\fi
+ %\fi
+ %}
+%} %% improved for spacing 2021/10/11
{\FPval\tempsign{#1}
\ifthenelse{\equal{#2}{}}
{%
\ifnum \tempsign<0 {\:\sempli{\tempsign}{1}#2}
\else
- \ifnum \tempsign>0{\:+\:\sempli{\tempsign}{1}#2}
- \else{}
- \fi
+ \ifnum \tempsign>0{+\:\sempli{\tempsign}{1}#2}
+ \else{}
+ \fi
\fi
}
{%
\ifnum \tempsign<0 {\:\semplix{\tempsign}{1}#2\:}
\else
- \ifnum \tempsign>0{\:+\:\semplix{\tempsign}{1}#2}
- \else{}
- \fi
+ \ifnum \tempsign>0{\:+\:\semplix{\tempsign}{1}#2}
+ \else{}
+ \fi
\fi
}
-} %% improved for spacing 2021/10/11
-
+} %% improved for spacing 2021/10/11
%========================================================%
% Commands adapted from exerquiz %
@@ -926,9 +948,13 @@
\addtocounter{match@plo}{1}
\expandafter\edef\csname match@numi\number\i@sh\endcsname{(\Alph{match@plu})}
\vspace{2ex}
+
\begin{tabular}{p{.05\textwidth}p{.40\textwidth}p{.01\textwidth}p{.40\textwidth}}
- \underbar{\makebox[.5cm]{\match@ans@color{\csname match@numi\number\i@sh\endcsname}}} & \csname match@qsti\number\i@sh\endcsname&&(\Alph{match@plo})\hspace{3mm}\csname match@ansi\number\i@sh\endcsname%\tabularnewline
- \end{tabular}
+ \underbar{\makebox[.5cm]{\match@ans@color{\csname match@numi\number\i@sh\endcsname}}} & \csname match@qsti\number\i@sh\endcsname&&(\Alph{match@plo})\hspace{3mm}\csname match@ansi\number\i@sh\endcsname%\tabularnewline
+ \end{tabular}
+ %% ADD next line
+ % \vspace{2ex} \\
+ %%
\advance\i@sh by-1
\ifnum\i@sh > 0 \fi
\fi