texlive[53795] Master: sdaps (15feb20)
commits+karl at tug.org
commits+karl at tug.org
Sat Feb 15 23:16:00 CET 2020
Revision: 53795
http://tug.org/svn/texlive?view=revision&revision=53795
Author: karl
Date: 2020-02-15 23:16:00 +0100 (Sat, 15 Feb 2020)
Log Message:
-----------
sdaps (15feb20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/sdaps/README
trunk/Master/texmf-dist/doc/latex/sdaps/sdapsarray.pdf
trunk/Master/texmf-dist/doc/latex/sdaps/sdapsbase.pdf
trunk/Master/texmf-dist/doc/latex/sdaps/sdapsclassic.pdf
trunk/Master/texmf-dist/doc/latex/sdaps/sdapslayout.pdf
trunk/Master/texmf-dist/doc/latex/sdaps/sdapspdf.pdf
trunk/Master/texmf-dist/source/latex/sdaps/sdapsarray.dtx
trunk/Master/texmf-dist/source/latex/sdaps/sdapsarray.ins
trunk/Master/texmf-dist/source/latex/sdaps/sdapsbase.dtx
trunk/Master/texmf-dist/source/latex/sdaps/sdapsbase.ins
trunk/Master/texmf-dist/source/latex/sdaps/sdapsclassic.dtx
trunk/Master/texmf-dist/source/latex/sdaps/sdapsclassic.ins
trunk/Master/texmf-dist/source/latex/sdaps/sdapslayout.dtx
trunk/Master/texmf-dist/source/latex/sdaps/sdapslayout.ins
trunk/Master/texmf-dist/source/latex/sdaps/sdapspdf.dtx
trunk/Master/texmf-dist/source/latex/sdaps/sdapspdf.ins
trunk/Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty
trunk/Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty
trunk/Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls
trunk/Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty
trunk/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty
trunk/Master/tlpkg/bin/tlpkginfo
trunk/Master/tlpkg/libexec/ctan2tds
Modified: trunk/Master/texmf-dist/doc/latex/sdaps/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/sdaps/README 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/doc/latex/sdaps/README 2020-02-15 22:16:00 UTC (rev 53795)
@@ -1,11 +1,12 @@
SDAPS Class and Package repository
==================================
+Version: 1.9.8
+
This repository contains LaTeX classes and packages to create machine readable
questionnaires. Metadata is generated for the whole document and it is
possible to process created forms fully automatically using the SDAPS main
program.
-As of now, this package is included in the SDAPS unstable (1.9.0) distribution.
Features
========
Modified: trunk/Master/texmf-dist/doc/latex/sdaps/sdapsarray.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sdaps/sdapsbase.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sdaps/sdapsclassic.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sdaps/sdapslayout.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/sdaps/sdapspdf.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapsarray.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapsarray.dtx 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapsarray.dtx 2020-02-15 22:16:00 UTC (rev 53795)
@@ -1,14 +1,12 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
+% Copyright (C) 2019 by Benjamin Berg <benjamin at sipsolutions.net>
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
@@ -260,6 +258,11 @@
\keys_set:nf { sdaps / array } { \prop_item:Nn \g__sdaps_array_layouter_prop { #1 } }
+ % Force cell layouter instead of column header layouter
+ \bool_if:NT \l_sdaps_sdapsarray_no_header_bool {
+ \tl_set:NV \l__sdaps_array_colhead_tl \l__sdaps_array_cell_tl
+ }
+
\_sdaps_array_open_tmpfiles:
\tl_gset_eq:NN \g__sdaps_array_last_row_tl \c_empty_tl
@@ -352,33 +355,49 @@
\msg_error:nn { sdapsarray } { wrong_mode }
\fi
- % Pagebreak detection
- \_sdaps_array_check_insert_header:N \g_tmpa_bool
% XXX: \l_tmpa_dim is the height to the first baseline in the box. Note that
% we use the real baseline in the case of the header row!
\l__sdaps_array_row_tl #1 #2 \l_tmpb_box \l_tmpa_dim
- \bool_if:NT \g_sdaps_array_first_row_bool {
- % Stow away the box for later use (before rewriting it to save the position)
+ \bool_if:nTF { \g_sdaps_array_first_row_bool && !\l_sdaps_sdapsarray_no_header_bool } {
+ % Stow away the box for later use
\box_gset_eq:NN \g__sdaps_array_header_box \l_tmpb_box
\dim_gset:Nn \g__sdaps_array_header_dim { \box_ht:N \g__sdaps_array_header_box + \box_dp:N \g__sdaps_array_header_box }
+ } {
+ % Pagebreak detection (not needed for header row)
+ \_sdaps_array_check_insert_header:N \g_tmpa_bool
+
+ \hbox_set:Nn \l_tmpb_box {
+ \pdfsavepos
+ \iow_shipout_x:Nn \g__sdaps_array_info_iow {
+ \thepage,
+ \the\pdflastxpos
+ }
+ \box_use:N \l_tmpb_box
+ }
}
- \hbox_set:Nn \l_tmpb_box {
- \pdfsavepos
- \iow_shipout_x:Nn \g__sdaps_array_info_iow {
- \thepage,
- \the\pdflastxpos
+ \bool_if:nTF { \g_sdaps_array_first_row_bool || \l_sdaps_sdapsarray_no_header_bool } {
+ \_sdaps_array_calc_interlineskip:nnN { \prevdepth } { \l_tmpa_dim } \l_tmpa_skip
+ \nointerlineskip
+ \skip_vertical:n { \l_tmpa_skip }
+
+ % However do not insert the rowskip in the case of the first line.
+ % We rely on surrounding code to insert proper spacing before/after
+ % the environment.
+ \bool_if:NT \g_sdaps_array_first_row_bool {
+ \skip_vertical:n { - \l_sdaps_sdapsarray_rowsep_dim }
}
+
\box_use:N \l_tmpb_box
- }
+ % For the header, insert a \nobreak, otherwise the normal inter-row penalty
+ \bool_if:NTF \l_sdaps_sdapsarray_no_header_bool {
+ \penalty\int_use:N\g_sdaps_array_row_penalty_tl
+ } {
+ \nobreak
+ }
- \bool_if:NTF \g_sdaps_array_first_row_bool {
\bool_gset_false:N \g_sdaps_array_first_row_bool
-
- \box_use:N \l_tmpb_box
- % Do not ever allow a break after the header line.
- \nobreak
} {
% The idea is simple. Before every line the header is re-inserted (either
% the real one or an empty box with the same dimensions). In the case that
@@ -757,6 +776,7 @@
\tl_new:N \l_sdaps_sdapsarray_angle_sine_tl
\dim_new:N \l_sdaps_sdapsarray_colsep_dim
\dim_new:N \l_sdaps_sdapsarray_rowsep_dim
+\bool_new:N \l_sdaps_sdapsarray_no_header_bool
\keys_define:nn { sdaps / sdapsarray }
{
@@ -770,6 +790,9 @@
keepenv .bool_set:N = \l_sdaps_sdapsarray_keepenv_bool,
keepenv .initial:n = false,
keepenv .default:n = true,
+ no_header .bool_set:N = \l_sdaps_sdapsarray_no_header_bool,
+ no_header .initial:n = false,
+ no_header .default:n = true,
angle .code:n = {
\int_set:Nn \l_sdaps_sdapsarray_angle_int {#1}
@@ -1104,7 +1127,7 @@
% (i.e. it could still be an alignment character). Execute the alignment
% code directly if the next character is &.
\bool_if:NF \l_sdaps_sdapsarray_keepenv_bool {
- \peek_charcode_remove:NT & { \sdaps_array_alignment: }
+ \peek_charcode_remove_ignore_spaces:NT & { \sdaps_array_alignment: }
}
}
{
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapsarray.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapsarray.ins 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapsarray.ins 2020-02-15 22:16:00 UTC (rev 53795)
@@ -2,12 +2,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
@@ -26,12 +24,10 @@
Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
\endpreamble
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapsbase.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapsbase.dtx 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapsbase.dtx 2020-02-15 22:16:00 UTC (rev 53795)
@@ -1,14 +1,12 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
+% Copyright (C) 2019 by Benjamin Berg <benjamin at sipsolutions.net>
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
@@ -806,6 +804,7 @@
\dim_new:N \l_sdaps_checkbox_height_dim
\tl_new:N \l_sdaps_checkbox_form_tl
\tl_new:N \l_sdaps_checkbox_fill_tl
+\tl_new:N \l_sdaps_checkbox_draw_tl
\tl_new:N \l_sdaps_checkbox_var_tl
\tl_new:N \l_sdaps_checkbox_value_tl
\bool_new:N \l_sdaps_checkbox_draw_check_bool
@@ -836,6 +835,9 @@
fill .tl_set:N = \l_sdaps_checkbox_fill_tl,
fill .initial:n = { white },
+ draw .tl_set:N = \l_sdaps_checkbox_draw_tl,
+ draw .initial:n = { . },
+
draw_check .bool_set:N = \l_sdaps_checkbox_draw_check_bool,
draw_check .default:n = true,
draw_check .initial:n = false,
@@ -900,10 +902,10 @@
\tikz[baseline={0.5\l_sdaps_checkbox_height_dim-0.8ex}]{%
\tl_if_eq:VnT \l_sdaps_checkbox_form_tl { box } {
- \draw[line~width=\l_sdaps_checkbox_linewidth_dim,fill=\l_sdaps_checkbox_fill_tl] (0.5\l_sdaps_checkbox_linewidth_dim, 0.5\l_sdaps_checkbox_linewidth_dim) rectangle +($(\l_sdaps_checkbox_width_dim, \l_sdaps_checkbox_height_dim)-(\l_sdaps_checkbox_linewidth_dim,\l_sdaps_checkbox_linewidth_dim)$);%
+ \draw[line~width=\l_sdaps_checkbox_linewidth_dim,fill=\l_sdaps_checkbox_fill_tl,draw=\l_sdaps_checkbox_draw_tl] (0.5\l_sdaps_checkbox_linewidth_dim, 0.5\l_sdaps_checkbox_linewidth_dim) rectangle +($(\l_sdaps_checkbox_width_dim, \l_sdaps_checkbox_height_dim)-(\l_sdaps_checkbox_linewidth_dim,\l_sdaps_checkbox_linewidth_dim)$);%
}
\tl_if_eq:VnT \l_sdaps_checkbox_form_tl { ellipse } {
- \draw[line~width=\l_sdaps_checkbox_linewidth_dim,fill=\l_sdaps_checkbox_fill_tl] (0.5\l_sdaps_checkbox_width_dim, 0.5\l_sdaps_checkbox_height_dim) circle [x~radius=0.5\l_sdaps_checkbox_width_dim-0.5\l_sdaps_checkbox_linewidth_dim, y~radius=0.5\l_sdaps_checkbox_height_dim-0.5\l_sdaps_checkbox_linewidth_dim];%
+ \draw[line~width=\l_sdaps_checkbox_linewidth_dim,fill=\l_sdaps_checkbox_fill_tl,draw=\l_sdaps_checkbox_draw_tl] (0.5\l_sdaps_checkbox_width_dim, 0.5\l_sdaps_checkbox_height_dim) circle [x~radius=0.5\l_sdaps_checkbox_width_dim-0.5\l_sdaps_checkbox_linewidth_dim, y~radius=0.5\l_sdaps_checkbox_height_dim-0.5\l_sdaps_checkbox_linewidth_dim];%
}
% For the overlay we actually position the nodes relative to the checkbox
@@ -1018,6 +1020,7 @@
\dim_new:N \l_sdaps_textbox_linewidth_dim
\tl_new:N \l_sdaps_textbox_var_tl
\tl_new:N \l_sdaps_textbox_fill_tl
+\tl_new:N \l_sdaps_textbox_draw_tl
\tl_new:N \l__sdaps_textbox_boxtype_tl
@@ -1029,6 +1032,9 @@
fill .tl_set:N = \l_sdaps_textbox_fill_tl,
fill .initial:n = { white },
+ draw .tl_set:N = \l_sdaps_textbox_draw_tl,
+ draw .initial:n = { . },
+
% Simple node overlay
centered_text .tl_set:N = \l_sdaps_overlay_centered_text_tl,
centered_text .initial:n = {},
@@ -1176,7 +1182,7 @@
\dim_set:Nn \l_sdaps_height_dim {\l__sdaps_height}
% Draw the rectangle
- \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
+ \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl,draw=\l_sdaps_textbox_draw_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
\begin{scope}
\seq_map_inline:Nn \g__sdaps_textbox_overlays_seq {##1}
@@ -1267,7 +1273,7 @@
\dim_set:Nn \l_sdaps_height_dim {\l__sdaps_height}
% Draw the rectangle
- \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
+ \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl,draw=\l_sdaps_textbox_draw_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
\begin{scope}
\seq_map_inline:Nn \g__sdaps_textbox_overlays_seq {##1}
@@ -1338,7 +1344,7 @@
% The textbox (rendered on the background)
\begin{tikzpicture}[overlay]
% Draw the rectangle
- \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
+ \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl,draw=\l_sdaps_textbox_draw_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
\begin{scope}
\seq_map_inline:Nn \g__sdaps_textbox_overlays_seq {##1}%
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapsbase.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapsbase.ins 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapsbase.ins 2020-02-15 22:16:00 UTC (rev 53795)
@@ -2,12 +2,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
@@ -26,12 +24,10 @@
Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
\endpreamble
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapsclassic.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapsclassic.dtx 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapsclassic.dtx 2020-02-15 22:16:00 UTC (rev 53795)
@@ -1,14 +1,12 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
+% Copyright (C) 2019 by Benjamin Berg <benjamin at sipsolutions.net>
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
@@ -290,7 +288,7 @@
%\setlength{\parskip}{0pt}
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}
-% Redefine the spacings for \subsection ie. \questions.
+% Redefine the spacings for \subsection ie. \_sdaps_classic_question.
\renewcommand\section{\@startsection {section}{1}{\z@}%
{-\parskip}%
{\parskip}%
@@ -341,7 +339,7 @@
\newcommand\qid{\tl_use:N \g__sdaps_questionnaire_id_tl}
-\def\question#1{%
+\def\_sdaps_classic_question#1{%
\tl_if_empty:nTF{#1}{
\refstepcounter{subsection}%
\par%
@@ -471,7 +469,7 @@
\keys_set:nn { sdapsclassic / textbox } { #1 }
\sdaps_classic_ensure_section:
- \question{#3}
+ \_sdaps_classic_question{#3}
\tl_if_empty:NTF \l_sdaps_classic_textbox_text_tl {
\sdaps_qobject_begin:nnn { textbox } { Text } { #3 }
@@ -571,7 +569,7 @@
\int_set:Nn \l_sdaps_singlemark_count_int { \themarkcheckboxcount }
}
- \question{#2}%
+ \_sdaps_classic_question{#2}%
\sdaps_qobject_begin:nnn { singlemark } { range } { #2 }
@@ -606,7 +604,7 @@
\int_set:Nn \l_sdaps_singlemark_count_int { \themarkcheckboxcount }
}
- \question{#2}%
+ \_sdaps_classic_question{#2}%
\sdaps_qobject_begin:nnn { singlemark } { range } { #2 }
@@ -634,6 +632,7 @@
\dim_new:N \l__sdaps_classic_choiceitem_pad_dim
\int_new:N \l__sdaps_classic_choiceitem_cols_int
\int_new:N \l__sdaps_classic_choiceitem_col_int
+\dim_new:N \l__sdaps_classic_choicequestion_prevdepth_dim
\coffin_new:N \l__sdaps_classic_choicequestion_coffin
\msg_new:nnn { sdapsclassic } { choicequestion_wrong_mode } { Mode~should~always~be~vertical~inside~a~choicequestion.\\ This~likely~means~that~the~choicequestion~contains~content~other~than~one~of~the~permissable~macros. }
@@ -692,7 +691,7 @@
\keys_set:nn { sdaps / choicequestion } { #1 }
- \question{#2}%
+ \_sdaps_classic_question{#2}%
% Setup the context
\tl_if_eq:VnTF \l_sdaps_choicquestion_type_tl { multichoice } {
@@ -716,6 +715,7 @@
\int_set:NV \l__sdaps_classic_choiceitem_cols_int \l_sdaps_choicequestion_cols_int
\int_set:Nn \l__sdaps_classic_choiceitem_col_int { 0 }
+ \dim_set:Nn \l__sdaps_classic_choicequestion_prevdepth_dim { 1000pt }
\coffin_clear:N \l__sdaps_classic_choicequestion_coffin
% We have to be in vertical mode at this point.
@@ -744,6 +744,7 @@
\choicequestion_widowpenalty
\vbox:n { \skip_horizontal:N \@totalleftmargin \box_use:N \l__sdaps_classic_choicequestion_coffin }
+ \prevdepth=\l__sdaps_classic_choicequestion_prevdepth_dim
\coffin_clear:N \l__sdaps_classic_choicequestion_coffin
\sdaps_qobject_end:n { choicequestion }
@@ -757,7 +758,7 @@
\endchoicequestion
}
-\cs_new_protected_nopar:Nn \_sdaps_classic_line_shipout_add:Nn
+\cs_new_protected_nopar:Nn \_sdaps_classic_line_shipout_add:NNn
{
% We have to be in vertical mode at this point.
\if_mode_vertical:
@@ -767,11 +768,13 @@
\fi:
% Is linewidth the right thing here?
- \int_compare:nT { \l__sdaps_classic_choiceitem_col_int + #2 > \l__sdaps_classic_choiceitem_cols_int } {
+ \int_compare:nT { \l__sdaps_classic_choiceitem_col_int + #3 > \l__sdaps_classic_choiceitem_cols_int } {
% We can only typeset a coffin in vertical mode if we use the box function
\vbox:n { \skip_horizontal:N \@totalleftmargin \box_use:N \l__sdaps_classic_choicequestion_coffin }
+ \prevdepth=\l__sdaps_classic_choicequestion_prevdepth_dim
\skip_vertical:N \l_sdaps_choicequestion_rowsep_dim
\coffin_clear:N \l__sdaps_classic_choicequestion_coffin
+ \dim_set:Nn \l__sdaps_classic_choicequestion_prevdepth_dim { 1000pt }
\choicequestion_clubpenalty
\int_set:Nn \l__sdaps_classic_choiceitem_col_int { 0 }
}
@@ -779,8 +782,14 @@
\dim_set:Nn \l_tmpa_dim { \linewidth / \l__sdaps_classic_choiceitem_cols_int + \l__sdaps_classic_choiceitem_pad_dim / \l__sdaps_classic_choiceitem_cols_int }
\dim_set:Nn \l_tmpa_dim { \l__sdaps_classic_choiceitem_col_int \l_tmpa_dim }
+ \dim_compare:nNnTF { \coffin_dp:N \l__sdaps_classic_choicequestion_coffin } > { \coffin_dp:N #1 } {
+ \dim_set:Nn \l__sdaps_classic_choicequestion_prevdepth_dim {\dim_min:nn { \l__sdaps_classic_choicequestion_prevdepth_dim } { #2 + \coffin_dp:N \l__sdaps_classic_choicequestion_coffin - \coffin_dp:N #1 } }
+ } {
+ \dim_set:Nn \l__sdaps_classic_choicequestion_prevdepth_dim {\dim_min:nn { \l__sdaps_classic_choicequestion_prevdepth_dim + \coffin_dp:N #1 - \coffin_dp:N \l__sdaps_classic_choicequestion_coffin } { #2 } }
+ }
+
\coffin_join:NnnNnnnn \l__sdaps_classic_choicequestion_coffin { l } { H } #1 { l } { H } { \l_tmpa_dim } { 0pt }
- \int_add:Nn \l__sdaps_classic_choiceitem_col_int { #2 }
+ \int_add:Nn \l__sdaps_classic_choiceitem_col_int { #3 }
}
\providecommand*{\choiceitem}[2][]{%
@@ -802,13 +811,16 @@
\hbox_set:Nn \l_tmpa_box { \strut \sdaps_checkbox:VV \l_sdaps_choicequestion_choice_var_tl \l_sdaps_choicequestion_choice_val_tl {}\ }
\dim_set:Nn \l_tmpb_dim { \box_wd:N \l_tmpa_box }
\hskip \l_sdaps_choicequestion_colsep_dim
- \hbox_unpack_clear:N \l_tmpa_box
+ \hbox_unpack:N \l_tmpa_box
\begin{minipage}[t]{\dim_eval:n { \l_tmpa_dim - \l_tmpb_dim - 2\l_sdaps_choicequestion_colsep_dim}}
- \noindent \usekomafont{choiceitemfont} \tl_trim_spaces:n { #2 }
+ \noindent \usekomafont{choiceitemfont} \tl_trim_spaces:n { #2 }\strut
+ \par
+ \dim_gset:Nn \g_tmpa_dim { \dim_max:nn { \box_dp:N \l_tmpa_box } { \prevdepth } }
+ \unskip
\end{minipage}
}
- \_sdaps_classic_line_shipout_add:Nn \l_tmpa_coffin { 1 }
+ \_sdaps_classic_line_shipout_add:NNn \l_tmpa_coffin \g_tmpa_dim { 1 }
\ignorespaces
}
@@ -831,13 +843,16 @@
\hbox_set:Nn \l_tmpa_box { \strut \sdaps_checkbox:VV \l_sdaps_choicequestion_choice_var_tl \l_sdaps_choicequestion_choice_val_tl {}\ }
\dim_set:Nn \l_tmpb_dim { \box_wd:N \l_tmpa_box }
\hskip \l_sdaps_choicequestion_colsep_dim
- \hbox_unpack_clear:N \l_tmpa_box
+ \hbox_unpack:N \l_tmpa_box
\begin{minipage}[t]{\dim_eval:n { \l_tmpa_dim - \l_tmpb_dim - 2\l_sdaps_choicequestion_colsep_dim}}
- \noindent \usekomafont{choiceitemfont} \tl_trim_spaces:n { #3 }
+ \noindent \usekomafont{choiceitemfont} \tl_trim_spaces:n { #3 }\strut
+ \par
+ \dim_gset:Nn \g_tmpa_dim { \dim_max:nn { \box_dp:N \l_tmpa_box } { \prevdepth } }
+ \unskip
\end{minipage}
}
- \_sdaps_classic_line_shipout_add:Nn \l_tmpa_coffin { #2 }
+ \_sdaps_classic_line_shipout_add:NNn \l_tmpa_coffin \g_tmpa_dim { #2 }
\ignorespaces
}
@@ -872,10 +887,13 @@
\dim_set:Nn \l_tmpb_dim { 0.5 \l_tmpb_dim + 0.8ex }
\strut\ignorespaces \tl_trim_spaces:n { #4 } ~
\sdaps_textbox_hstretch:VVVnn \l_sdaps_choicequestion_choice_var_tl \l_tmpa_dim \l_tmpb_dim { 0pt } { 1 }
+ \par
+ \dim_gset:Nn \g_tmpa_dim { \prevdepth }
+ \unskip
\end{minipage}
}
- \_sdaps_classic_line_shipout_add:Nn \l_tmpa_coffin { #3 }
+ \_sdaps_classic_line_shipout_add:NNn \l_tmpa_coffin \g_tmpa_dim { #3 }
\ignorespaces
}
@@ -1050,13 +1068,31 @@
% \begin{macrocode}
%
+\tl_new:N \l__sdaps_classic_group_var_tl
+\tl_new:N \l__sdaps_classic_group_text_tl
+\tl_new:N \l__sdaps_classic_group_extra_tl
+\keys_define:nn { sdapsclassic / group }
+{
+ var .tl_set:N = \l__sdaps_classic_group_var_tl,
+ text .tl_set:N = \l__sdaps_classic_group_text_tl,
+}
\newenvironment { choicegroup } [ 2 ] []
{
\group_begin:
+ \keys_set_known:nnN { sdapsclassic / group } { #1 } \l__sdaps_classic_group_extra_tl
- \question{#2}
+ \_sdaps_classic_question{#2}
+ \tl_if_empty:NTF \l__sdaps_classic_group_text_tl {
+ \sdaps_qobject_begin:nnn { choicegroup } { Head } { #2 }
+ } {
+ \sdaps_qobject_begin:nnV { choicegroup } { Head } \l__sdaps_classic_group_text_tl
+ }
+ \tl_if_empty:NF \l__sdaps_classic_group_var_tl {
+ \sdaps_qobject_append_var:V \l__sdaps_classic_group_var_tl
+ }
+
% Undefine the question (and choice) commands in local scope so that they
% can be redefined by choicearray without any issues.
% Note that \cs_undefine:N works in global scope, so we cannot use it here.
@@ -1063,7 +1099,7 @@
\cs_set_eq:NN\question\tex_undefined:D
\cs_set_eq:NN\choice\tex_undefined:D
- \begin{choicearray}[#1]{#2}
+ \expandafter\choicearray\expandafter[\l__sdaps_classic_group_extra_tl]
% XXX: This is a bit of a hack, set in global scope because the choicearray
% environment does evil things with scopes.
\cs_gset_eq:NN\groupaddchoice\choice
@@ -1073,7 +1109,9 @@
\cs_gset_eq:NN\groupaddchoice\undefined
\cs_gset_eq:NN\choiceline\undefined
- \end{choicearray}
+ \endchoicearray
+
+ \sdaps_qobject_end:n { choicegroup }
\group_end:
}
@@ -1080,9 +1118,19 @@
\newenvironment { optiongroup } [ 2 ] []
{
\group_begin:
+ \keys_set_known:nnN { sdapsclassic / group } { #1 } \l__sdaps_classic_group_extra_tl
- \question{#2}
+ \_sdaps_classic_question{#2}
+ \tl_if_empty:NTF \l__sdaps_classic_group_text_tl {
+ \sdaps_qobject_begin:nnn { optiongroup } { Head } { #2 }
+ } {
+ \sdaps_qobject_begin:nnV { optiongroup } { Head } \l__sdaps_classic_group_text_tl
+ }
+ \tl_if_empty:NF \l__sdaps_classic_group_var_tl {
+ \sdaps_qobject_append_var:V \l__sdaps_classic_group_var_tl
+ }
+
% Undefine the question (and choice) commands in local scope so that they
% can be redefined by optionarray without any issues.
% Note that \cs_undefine:N works in global scope, so we cannot use it here.
@@ -1089,7 +1137,7 @@
\cs_set_eq:NN\question\tex_undefined:D
\cs_set_eq:NN\choice\tex_undefined:D
- \begin{optionarray}[#1]{#2}
+ \expandafter\optionarray\expandafter[\l__sdaps_classic_group_extra_tl]
% XXX: This is a bit of a hack, set in global scope because the optionarray
% environment does evil things with scopes.
\cs_gset_eq:NN\groupaddchoice\choice
@@ -1099,7 +1147,8 @@
\cs_gset_eq:NN\groupaddoption\undefined
\cs_gset_eq:NN\optionline\undefined
- \end{optionarray}
+ \endoptionarray
+ \sdaps_qobject_end:n { optiongroup }
\group_end:
}
@@ -1106,15 +1155,25 @@
\newenvironment { markgroup } [ 2 ] []
{
\group_begin:
+ \keys_set_known:nnN { sdapsclassic / group } { #1 } \l__sdaps_classic_group_extra_tl
- \question{#2}
+ \_sdaps_classic_question{#2}
+ \tl_if_empty:NTF \l__sdaps_classic_group_text_tl {
+ \sdaps_qobject_begin:nnn { markgroup } { Head } { #2 }
+ } {
+ \sdaps_qobject_begin:nnV { markgroup } { Head } \l__sdaps_classic_group_text_tl
+ }
- % Undefine the question (and choice) commands in local scope so that they
- % can be redefined by choicearray without any issues.
+ \tl_if_empty:NF \l__sdaps_classic_group_var_tl {
+ \sdaps_qobject_append_var:V \l__sdaps_classic_group_var_tl
+ }
+
+ % Undefine the range command in local scope so that it can be redefined
+ % by rangearray without any issues.
% Note that \cs_undefine:N works in global scope, so we cannot use it here.
\cs_set_eq:NN\range\tex_undefined:D
- \begin{rangearray}[#1]{#2}
+ \expandafter\rangearray\expandafter[\l__sdaps_classic_group_extra_tl]
% XXX: This is a bit of a hack, set in global scope because the choicearray
% environment does evil things with scopes.
\cs_gset_eq:NN\markline\range
@@ -1122,7 +1181,8 @@
{
\cs_gset_eq:NN\markline\undefined
- \end{rangearray}
+ \endrangearray
+ \sdaps_qobject_end:n { markgroup }
\group_end:
}
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapsclassic.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapsclassic.ins 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapsclassic.ins 2020-02-15 22:16:00 UTC (rev 53795)
@@ -2,12 +2,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
@@ -26,12 +24,10 @@
Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
\endpreamble
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapslayout.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapslayout.dtx 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapslayout.dtx 2020-02-15 22:16:00 UTC (rev 53795)
@@ -1,15 +1,13 @@
% \iffalse meta-comment
%
% Copyright (C) 2014 by Henry Menke <henrimenke at gmail.com>
-% Copyright (C) 2015-2016 by Benjamin Berg <benjamin at sipsolutions.net>
+% Copyright (C) 2019 by Benjamin Berg <benjamin at sipsolutions.net>
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
@@ -112,8 +110,6 @@
\tl_new:N \l_sdaps_choicearray_qobject_type_tl
\bool_new:N \l_sdaps_choicearray_horizontal_bool
-\tl_new:N \l_sdaps_choicearray_var_tl
-\tl_new:N \l_sdaps_choicearray_text_tl
\tl_new:N \l_sdaps_choicearray_layouter_tl
\tl_new:N \l_sdaps_choicearray_align_tl
\tl_new:N \l_sdaps_choicearray_extra_tl
@@ -136,8 +132,6 @@
horizontal .initial:n = true,
vertical .bool_set_inverse:N = \l_sdaps_choicearray_horizontal_bool,
vertical .default:n = true,
- var .tl_set:N = \l_sdaps_choicearray_var_tl,
- text .tl_set:N = \l_sdaps_choicearray_text_tl,
layouter .tl_set:N = \l_sdaps_choicearray_layouter_tl,
layouter .initial:n = default,
align .tl_set:N = \l_sdaps_choicearray_align_tl,
@@ -168,20 +162,10 @@
range .initial:n = {...}
}
-\cs_new_protected_nopar:Npn \_sdaps_choicearray_preprocess:nn #1#2
+\cs_new_protected_nopar:Npn \_sdaps_choicearray_preprocess:n #1
{
\keys_set_known:nnN { sdaps / choicearray } { #1 } \l_sdaps_choicearray_extra_tl
- \tl_if_empty:NTF \l_sdaps_choicearray_text_tl {
- \sdaps_qobject_begin:nnn { choicearray } { Head } { #2 }
- } {
- \sdaps_qobject_begin:nnV { choicearray } { Head } \l_sdaps_choicearray_text_tl
- }
-
- \tl_if_empty:NF \l_sdaps_choicearray_var_tl {
- \sdaps_qobject_append_var:V \l_sdaps_choicearray_var_tl
- }
-
\sdaps_checkbox_set_type:V \l_sdaps_choicearray_type_tl
\tl_if_eq:VnTF \l_sdaps_choicearray_type_tl { multichoice } {
\tl_set:Nn \l_sdaps_choicearray_qobject_type_tl { Choice }
@@ -189,13 +173,8 @@
\tl_set:Nn \l_sdaps_choicearray_qobject_type_tl { Option }
}
}
-\cs_generate_variant:Nn \_sdaps_choicearray_preprocess:nn { Vn }
+\cs_generate_variant:Nn \_sdaps_choicearray_preprocess:n { V }
-\cs_new_protected_nopar:Npn \_sdaps_choicearray_postprocess:
-{
- \sdaps_qobject_end:n { choicearray }
-}
-
\cs_new_protected_nopar:Npn \_sdaps_choicearray_process_choice_insert_tail_after:w {
\bgroup
\group_insert_after:N \_sdaps_choicearray_process_choice_tail:
@@ -375,8 +354,6 @@
% \begin{macrocode}
-\tl_new:N \l_sdaps_rangearray_var_tl
-\tl_new:N \l_sdaps_rangearray_text_tl
\tl_new:N \l_sdaps_rangearray_align_tl
\tl_new:N \l_sdaps_rangearray_extra_tl
\int_new:N \l_sdaps_rangearray_rangecount_int
@@ -387,14 +364,16 @@
\tl_new:N \g_sdaps_question_uppertext_tl
\tl_new:N \g_sdaps_question_othertext_tl
+\msg_new:nnn { sdapslayout } { option_not_supported } { The~#1~option~is~not~supported~by~this~environment. }
+
\keys_define:nn { sdaps / rangearray }
{
- var .tl_set:N = \l_sdaps_rangearray_var_tl,
- text .tl_set:N = \l_sdaps_rangearray_text_tl,
count .int_set:N = \l_sdaps_rangearray_rangecount_int,
count .initial:n = 5,
align .tl_set:N = \l_sdaps_rangearray_align_tl,
align .initial:n = { },
+ % Override and disallow flipping; it does not work currently
+ flip .code:n = { \msg_error:nnn { sdapslayout } { option_not_supported } { flip } },
other .bool_set:N = \l_sdaps_rangearray_other_bool,
other .default:n = true,
other .initial:n = false,
@@ -409,29 +388,14 @@
other .tl_gset:N = \g_sdaps_question_othertext_tl,
}
-\cs_new_protected_nopar:Npn \_sdaps_rangearray_preprocess:nn #1#2
+\cs_new_protected_nopar:Npn \_sdaps_rangearray_preprocess:n #1
{
\keys_set_known:nnN { sdaps / rangearray } { #1 } \l_sdaps_rangearray_extra_tl
- \tl_if_empty:NTF \l_sdaps_rangearray_text_tl {
- \sdaps_qobject_begin:nnn { rangearray } { Head } { #2 }
- } {
- \sdaps_qobject_begin:nnV { rangearray } { Head } \l_sdaps_rangearray_text_tl
- }
-
\sdaps_checkbox_set_type:n { singlechoice }
-
- \tl_if_empty:NF \l_sdaps_rangearray_var_tl {
- \sdaps_qobject_append_var:V \l_sdaps_rangearray_var_tl
- }
}
-\cs_generate_variant:Nn \_sdaps_rangearray_preprocess:nn { Vn }
+\cs_generate_variant:Nn \_sdaps_rangearray_preprocess:n { V }
-\cs_new_protected_nopar:Npn \_sdaps_rangearray_postprocess:
-{
- \sdaps_qobject_end:n { rangearray }
-}
-
% Before/After the different parts
\cs_new_protected_nopar:Nn \_sdaps_rangearray_process_question_before_question: {
@@ -683,7 +647,7 @@
%
-\newenvironment { choicearray } [ 2 ] []
+\newenvironment { choicearray } [ 1 ] []
{
\group_begin:
@@ -700,7 +664,7 @@
}
}
- \_sdaps_choicearray_preprocess:Vn \l_tmpa_tl { #2 }
+ \_sdaps_choicearray_preprocess:V \l_tmpa_tl
% Clear the variables
\seq_gclear:N \g_sdaps_choices_filter_seq
\seq_gclear:N \g_sdaps_choices_cell_seq
@@ -724,21 +688,19 @@
{
\endsdapsarray
\group_end:
- % Process keys
- \_sdaps_choicearray_postprocess:
\group_end:
}
-\newenvironment { optionarray } [ 2 ] []
+\newenvironment { optionarray } [ 1 ] []
{
- \choicearray[singlechoice,#1] { #2 }
+ \choicearray[singlechoice,#1]
}
{
\endchoicearray
}
-\newenvironment { rangearray } [ 2 ] []
+\newenvironment { rangearray } [ 1 ] []
{
\group_begin:
@@ -755,7 +717,7 @@
}
}
- \_sdaps_rangearray_preprocess:Vn \l_tmpa_tl { #2 }
+ \_sdaps_rangearray_preprocess:V \l_tmpa_tl
\newcommand \range [ 1 ] [] {
\_sdaps_rangearray_process_question:nw { ##1 }
@@ -763,14 +725,12 @@
\group_begin:
- \tl_set:Nx \l_tmpb_tl {keepenv,align=\l_sdaps_rangearray_align_tl,\l_sdaps_rangearray_extra_tl}
+ \tl_set:Nx \l_tmpb_tl {keepenv,align=\l_sdaps_rangearray_align_tl,no_header,\l_sdaps_rangearray_extra_tl}
\expandafter\sdapsarray\expandafter[\l_tmpb_tl]
}
{
\endsdapsarray
\group_end:
- % Process keys
- \_sdaps_rangearray_postprocess:
\group_end:
}
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapslayout.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapslayout.ins 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapslayout.ins 2020-02-15 22:16:00 UTC (rev 53795)
@@ -2,12 +2,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
@@ -26,12 +24,10 @@
Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
\endpreamble
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapspdf.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapspdf.dtx 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapspdf.dtx 2020-02-15 22:16:00 UTC (rev 53795)
@@ -1,15 +1,13 @@
% \iffalse meta-comment
%
% Copyright (C) 2014 by Henry Menke <henrimenke at gmail.com>
-% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
+% Copyright (C) 2019 by Benjamin Berg <benjamin at sipsolutions.net>
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
Modified: trunk/Master/texmf-dist/source/latex/sdaps/sdapspdf.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/sdaps/sdapspdf.ins 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/source/latex/sdaps/sdapspdf.ins 2020-02-15 22:16:00 UTC (rev 53795)
@@ -2,12 +2,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
@@ -26,12 +24,10 @@
Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
\endpreamble
Modified: trunk/Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty 2020-02-15 22:16:00 UTC (rev 53795)
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{sdapsarray}
@@ -149,6 +147,11 @@
\keys_set:nf { sdaps / array } { \prop_item:Nn \g__sdaps_array_layouter_prop { #1 } }
+ % Force cell layouter instead of column header layouter
+ \bool_if:NT \l_sdaps_sdapsarray_no_header_bool {
+ \tl_set:NV \l__sdaps_array_colhead_tl \l__sdaps_array_cell_tl
+ }
+
\_sdaps_array_open_tmpfiles:
\tl_gset_eq:NN \g__sdaps_array_last_row_tl \c_empty_tl
@@ -240,33 +243,49 @@
\msg_error:nn { sdapsarray } { wrong_mode }
\fi
- % Pagebreak detection
- \_sdaps_array_check_insert_header:N \g_tmpa_bool
% XXX: \l_tmpa_dim is the height to the first baseline in the box. Note that
% we use the real baseline in the case of the header row!
\l__sdaps_array_row_tl #1 #2 \l_tmpb_box \l_tmpa_dim
- \bool_if:NT \g_sdaps_array_first_row_bool {
- % Stow away the box for later use (before rewriting it to save the position)
+ \bool_if:nTF { \g_sdaps_array_first_row_bool && !\l_sdaps_sdapsarray_no_header_bool } {
+ % Stow away the box for later use
\box_gset_eq:NN \g__sdaps_array_header_box \l_tmpb_box
\dim_gset:Nn \g__sdaps_array_header_dim { \box_ht:N \g__sdaps_array_header_box + \box_dp:N \g__sdaps_array_header_box }
+ } {
+ % Pagebreak detection (not needed for header row)
+ \_sdaps_array_check_insert_header:N \g_tmpa_bool
+
+ \hbox_set:Nn \l_tmpb_box {
+ \pdfsavepos
+ \iow_shipout_x:Nn \g__sdaps_array_info_iow {
+ \thepage,
+ \the\pdflastxpos
+ }
+ \box_use:N \l_tmpb_box
+ }
}
- \hbox_set:Nn \l_tmpb_box {
- \pdfsavepos
- \iow_shipout_x:Nn \g__sdaps_array_info_iow {
- \thepage,
- \the\pdflastxpos
+ \bool_if:nTF { \g_sdaps_array_first_row_bool || \l_sdaps_sdapsarray_no_header_bool } {
+ \_sdaps_array_calc_interlineskip:nnN { \prevdepth } { \l_tmpa_dim } \l_tmpa_skip
+ \nointerlineskip
+ \skip_vertical:n { \l_tmpa_skip }
+
+ % However do not insert the rowskip in the case of the first line.
+ % We rely on surrounding code to insert proper spacing before/after
+ % the environment.
+ \bool_if:NT \g_sdaps_array_first_row_bool {
+ \skip_vertical:n { - \l_sdaps_sdapsarray_rowsep_dim }
}
+
\box_use:N \l_tmpb_box
- }
+ % For the header, insert a \nobreak, otherwise the normal inter-row penalty
+ \bool_if:NTF \l_sdaps_sdapsarray_no_header_bool {
+ \penalty\int_use:N\g_sdaps_array_row_penalty_tl
+ } {
+ \nobreak
+ }
- \bool_if:NTF \g_sdaps_array_first_row_bool {
\bool_gset_false:N \g_sdaps_array_first_row_bool
-
- \box_use:N \l_tmpb_box
- % Do not ever allow a break after the header line.
- \nobreak
} {
% The idea is simple. Before every line the header is re-inserted (either
% the real one or an empty box with the same dimensions). In the case that
@@ -623,6 +642,7 @@
\tl_new:N \l_sdaps_sdapsarray_angle_sine_tl
\dim_new:N \l_sdaps_sdapsarray_colsep_dim
\dim_new:N \l_sdaps_sdapsarray_rowsep_dim
+\bool_new:N \l_sdaps_sdapsarray_no_header_bool
\keys_define:nn { sdaps / sdapsarray }
{
@@ -636,6 +656,9 @@
keepenv .bool_set:N = \l_sdaps_sdapsarray_keepenv_bool,
keepenv .initial:n = false,
keepenv .default:n = true,
+ no_header .bool_set:N = \l_sdaps_sdapsarray_no_header_bool,
+ no_header .initial:n = false,
+ no_header .default:n = true,
angle .code:n = {
\int_set:Nn \l_sdaps_sdapsarray_angle_int {#1}
@@ -957,7 +980,7 @@
% (i.e. it could still be an alignment character). Execute the alignment
% code directly if the next character is &.
\bool_if:NF \l_sdaps_sdapsarray_keepenv_bool {
- \peek_charcode_remove:NT & { \sdaps_array_alignment: }
+ \peek_charcode_remove_ignore_spaces:NT & { \sdaps_array_alignment: }
}
}
{
Modified: trunk/Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty 2020-02-15 22:16:00 UTC (rev 53795)
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{sdapsbase}
@@ -643,6 +641,7 @@
\dim_new:N \l_sdaps_checkbox_height_dim
\tl_new:N \l_sdaps_checkbox_form_tl
\tl_new:N \l_sdaps_checkbox_fill_tl
+\tl_new:N \l_sdaps_checkbox_draw_tl
\tl_new:N \l_sdaps_checkbox_var_tl
\tl_new:N \l_sdaps_checkbox_value_tl
\bool_new:N \l_sdaps_checkbox_draw_check_bool
@@ -670,6 +669,9 @@
fill .tl_set:N = \l_sdaps_checkbox_fill_tl,
fill .initial:n = { white },
+ draw .tl_set:N = \l_sdaps_checkbox_draw_tl,
+ draw .initial:n = { . },
+
draw_check .bool_set:N = \l_sdaps_checkbox_draw_check_bool,
draw_check .default:n = true,
draw_check .initial:n = false,
@@ -727,10 +729,10 @@
\tikz[baseline={0.5\l_sdaps_checkbox_height_dim-0.8ex}]{%
\tl_if_eq:VnT \l_sdaps_checkbox_form_tl { box } {
- \draw[line~width=\l_sdaps_checkbox_linewidth_dim,fill=\l_sdaps_checkbox_fill_tl] (0.5\l_sdaps_checkbox_linewidth_dim, 0.5\l_sdaps_checkbox_linewidth_dim) rectangle +($(\l_sdaps_checkbox_width_dim, \l_sdaps_checkbox_height_dim)-(\l_sdaps_checkbox_linewidth_dim,\l_sdaps_checkbox_linewidth_dim)$);%
+ \draw[line~width=\l_sdaps_checkbox_linewidth_dim,fill=\l_sdaps_checkbox_fill_tl,draw=\l_sdaps_checkbox_draw_tl] (0.5\l_sdaps_checkbox_linewidth_dim, 0.5\l_sdaps_checkbox_linewidth_dim) rectangle +($(\l_sdaps_checkbox_width_dim, \l_sdaps_checkbox_height_dim)-(\l_sdaps_checkbox_linewidth_dim,\l_sdaps_checkbox_linewidth_dim)$);%
}
\tl_if_eq:VnT \l_sdaps_checkbox_form_tl { ellipse } {
- \draw[line~width=\l_sdaps_checkbox_linewidth_dim,fill=\l_sdaps_checkbox_fill_tl] (0.5\l_sdaps_checkbox_width_dim, 0.5\l_sdaps_checkbox_height_dim) circle [x~radius=0.5\l_sdaps_checkbox_width_dim-0.5\l_sdaps_checkbox_linewidth_dim, y~radius=0.5\l_sdaps_checkbox_height_dim-0.5\l_sdaps_checkbox_linewidth_dim];%
+ \draw[line~width=\l_sdaps_checkbox_linewidth_dim,fill=\l_sdaps_checkbox_fill_tl,draw=\l_sdaps_checkbox_draw_tl] (0.5\l_sdaps_checkbox_width_dim, 0.5\l_sdaps_checkbox_height_dim) circle [x~radius=0.5\l_sdaps_checkbox_width_dim-0.5\l_sdaps_checkbox_linewidth_dim, y~radius=0.5\l_sdaps_checkbox_height_dim-0.5\l_sdaps_checkbox_linewidth_dim];%
}
% For the overlay we actually position the nodes relative to the checkbox
@@ -834,6 +836,7 @@
\dim_new:N \l_sdaps_textbox_linewidth_dim
\tl_new:N \l_sdaps_textbox_var_tl
\tl_new:N \l_sdaps_textbox_fill_tl
+\tl_new:N \l_sdaps_textbox_draw_tl
\tl_new:N \l__sdaps_textbox_boxtype_tl
\keys_define:nn { sdaps / textbox }
@@ -844,6 +847,9 @@
fill .tl_set:N = \l_sdaps_textbox_fill_tl,
fill .initial:n = { white },
+ draw .tl_set:N = \l_sdaps_textbox_draw_tl,
+ draw .initial:n = { . },
+
% Simple node overlay
centered_text .tl_set:N = \l_sdaps_overlay_centered_text_tl,
centered_text .initial:n = {},
@@ -959,7 +965,7 @@
\dim_set:Nn \l_sdaps_height_dim {\l__sdaps_height}
% Draw the rectangle
- \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
+ \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl,draw=\l_sdaps_textbox_draw_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
\begin{scope}
\seq_map_inline:Nn \g__sdaps_textbox_overlays_seq {##1}
@@ -1049,7 +1055,7 @@
\dim_set:Nn \l_sdaps_height_dim {\l__sdaps_height}
% Draw the rectangle
- \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
+ \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl,draw=\l_sdaps_textbox_draw_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
\begin{scope}
\seq_map_inline:Nn \g__sdaps_textbox_overlays_seq {##1}
@@ -1120,7 +1126,7 @@
% The textbox (rendered on the background)
\begin{tikzpicture}[overlay]
% Draw the rectangle
- \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
+ \draw[line~width=\l_sdaps_textbox_linewidth_dim,fill=\l_sdaps_textbox_fill_tl,draw=\l_sdaps_textbox_draw_tl] ($(\l_sdaps_x_dim, \l_sdaps_y_dim) + 0.5 * (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$) rectangle +($(\l_sdaps_width_dim, -\l_sdaps_height_dim) - (\l_sdaps_textbox_linewidth_dim, -\l_sdaps_textbox_linewidth_dim)$);
\begin{scope}
\seq_map_inline:Nn \g__sdaps_textbox_overlays_seq {##1}%
Modified: trunk/Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls 2020-02-15 22:16:00 UTC (rev 53795)
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{sdapsclassic}
@@ -209,7 +207,7 @@
\newcommand\qid{\tl_use:N \g__sdaps_questionnaire_id_tl}
-\def\question#1{%
+\def\_sdaps_classic_question#1{%
\tl_if_empty:nTF{#1}{
\refstepcounter{subsection}%
\par%
@@ -321,7 +319,7 @@
\keys_set:nn { sdapsclassic / textbox } { #1 }
\sdaps_classic_ensure_section:
- \question{#3}
+ \_sdaps_classic_question{#3}
\tl_if_empty:NTF \l_sdaps_classic_textbox_text_tl {
\sdaps_qobject_begin:nnn { textbox } { Text } { #3 }
@@ -420,7 +418,7 @@
\int_set:Nn \l_sdaps_singlemark_count_int { \themarkcheckboxcount }
}
- \question{#2}%
+ \_sdaps_classic_question{#2}%
\sdaps_qobject_begin:nnn { singlemark } { range } { #2 }
@@ -454,7 +452,7 @@
\int_set:Nn \l_sdaps_singlemark_count_int { \themarkcheckboxcount }
}
- \question{#2}%
+ \_sdaps_classic_question{#2}%
\sdaps_qobject_begin:nnn { singlemark } { range } { #2 }
@@ -482,6 +480,7 @@
\dim_new:N \l__sdaps_classic_choiceitem_pad_dim
\int_new:N \l__sdaps_classic_choiceitem_cols_int
\int_new:N \l__sdaps_classic_choiceitem_col_int
+\dim_new:N \l__sdaps_classic_choicequestion_prevdepth_dim
\coffin_new:N \l__sdaps_classic_choicequestion_coffin
\msg_new:nnn { sdapsclassic } { choicequestion_wrong_mode } { Mode~should~always~be~vertical~inside~a~choicequestion.\\ This~likely~means~that~the~choicequestion~contains~content~other~than~one~of~the~permissable~macros. }
@@ -538,7 +537,7 @@
\keys_set:nn { sdaps / choicequestion } { #1 }
- \question{#2}%
+ \_sdaps_classic_question{#2}%
% Setup the context
\tl_if_eq:VnTF \l_sdaps_choicquestion_type_tl { multichoice } {
@@ -562,6 +561,7 @@
\int_set:NV \l__sdaps_classic_choiceitem_cols_int \l_sdaps_choicequestion_cols_int
\int_set:Nn \l__sdaps_classic_choiceitem_col_int { 0 }
+ \dim_set:Nn \l__sdaps_classic_choicequestion_prevdepth_dim { 1000pt }
\coffin_clear:N \l__sdaps_classic_choicequestion_coffin
% We have to be in vertical mode at this point.
@@ -590,6 +590,7 @@
\choicequestion_widowpenalty
\vbox:n { \skip_horizontal:N \@totalleftmargin \box_use:N \l__sdaps_classic_choicequestion_coffin }
+ \prevdepth=\l__sdaps_classic_choicequestion_prevdepth_dim
\coffin_clear:N \l__sdaps_classic_choicequestion_coffin
\sdaps_qobject_end:n { choicequestion }
@@ -603,7 +604,7 @@
\endchoicequestion
}
-\cs_new_protected_nopar:Nn \_sdaps_classic_line_shipout_add:Nn
+\cs_new_protected_nopar:Nn \_sdaps_classic_line_shipout_add:NNn
{
% We have to be in vertical mode at this point.
\if_mode_vertical:
@@ -613,11 +614,13 @@
\fi:
% Is linewidth the right thing here?
- \int_compare:nT { \l__sdaps_classic_choiceitem_col_int + #2 > \l__sdaps_classic_choiceitem_cols_int } {
+ \int_compare:nT { \l__sdaps_classic_choiceitem_col_int + #3 > \l__sdaps_classic_choiceitem_cols_int } {
% We can only typeset a coffin in vertical mode if we use the box function
\vbox:n { \skip_horizontal:N \@totalleftmargin \box_use:N \l__sdaps_classic_choicequestion_coffin }
+ \prevdepth=\l__sdaps_classic_choicequestion_prevdepth_dim
\skip_vertical:N \l_sdaps_choicequestion_rowsep_dim
\coffin_clear:N \l__sdaps_classic_choicequestion_coffin
+ \dim_set:Nn \l__sdaps_classic_choicequestion_prevdepth_dim { 1000pt }
\choicequestion_clubpenalty
\int_set:Nn \l__sdaps_classic_choiceitem_col_int { 0 }
}
@@ -625,8 +628,14 @@
\dim_set:Nn \l_tmpa_dim { \linewidth / \l__sdaps_classic_choiceitem_cols_int + \l__sdaps_classic_choiceitem_pad_dim / \l__sdaps_classic_choiceitem_cols_int }
\dim_set:Nn \l_tmpa_dim { \l__sdaps_classic_choiceitem_col_int \l_tmpa_dim }
+ \dim_compare:nNnTF { \coffin_dp:N \l__sdaps_classic_choicequestion_coffin } > { \coffin_dp:N #1 } {
+ \dim_set:Nn \l__sdaps_classic_choicequestion_prevdepth_dim {\dim_min:nn { \l__sdaps_classic_choicequestion_prevdepth_dim } { #2 + \coffin_dp:N \l__sdaps_classic_choicequestion_coffin - \coffin_dp:N #1 } }
+ } {
+ \dim_set:Nn \l__sdaps_classic_choicequestion_prevdepth_dim {\dim_min:nn { \l__sdaps_classic_choicequestion_prevdepth_dim + \coffin_dp:N #1 - \coffin_dp:N \l__sdaps_classic_choicequestion_coffin } { #2 } }
+ }
+
\coffin_join:NnnNnnnn \l__sdaps_classic_choicequestion_coffin { l } { H } #1 { l } { H } { \l_tmpa_dim } { 0pt }
- \int_add:Nn \l__sdaps_classic_choiceitem_col_int { #2 }
+ \int_add:Nn \l__sdaps_classic_choiceitem_col_int { #3 }
}
\providecommand*{\choiceitem}[2][]{%
@@ -648,13 +657,16 @@
\hbox_set:Nn \l_tmpa_box { \strut \sdaps_checkbox:VV \l_sdaps_choicequestion_choice_var_tl \l_sdaps_choicequestion_choice_val_tl {}\ }
\dim_set:Nn \l_tmpb_dim { \box_wd:N \l_tmpa_box }
\hskip \l_sdaps_choicequestion_colsep_dim
- \hbox_unpack_clear:N \l_tmpa_box
+ \hbox_unpack:N \l_tmpa_box
\begin{minipage}[t]{\dim_eval:n { \l_tmpa_dim - \l_tmpb_dim - 2\l_sdaps_choicequestion_colsep_dim}}
- \noindent \usekomafont{choiceitemfont} \tl_trim_spaces:n { #2 }
+ \noindent \usekomafont{choiceitemfont} \tl_trim_spaces:n { #2 }\strut
+ \par
+ \dim_gset:Nn \g_tmpa_dim { \dim_max:nn { \box_dp:N \l_tmpa_box } { \prevdepth } }
+ \unskip
\end{minipage}
}
- \_sdaps_classic_line_shipout_add:Nn \l_tmpa_coffin { 1 }
+ \_sdaps_classic_line_shipout_add:NNn \l_tmpa_coffin \g_tmpa_dim { 1 }
\ignorespaces
}
@@ -677,13 +689,16 @@
\hbox_set:Nn \l_tmpa_box { \strut \sdaps_checkbox:VV \l_sdaps_choicequestion_choice_var_tl \l_sdaps_choicequestion_choice_val_tl {}\ }
\dim_set:Nn \l_tmpb_dim { \box_wd:N \l_tmpa_box }
\hskip \l_sdaps_choicequestion_colsep_dim
- \hbox_unpack_clear:N \l_tmpa_box
+ \hbox_unpack:N \l_tmpa_box
\begin{minipage}[t]{\dim_eval:n { \l_tmpa_dim - \l_tmpb_dim - 2\l_sdaps_choicequestion_colsep_dim}}
- \noindent \usekomafont{choiceitemfont} \tl_trim_spaces:n { #3 }
+ \noindent \usekomafont{choiceitemfont} \tl_trim_spaces:n { #3 }\strut
+ \par
+ \dim_gset:Nn \g_tmpa_dim { \dim_max:nn { \box_dp:N \l_tmpa_box } { \prevdepth } }
+ \unskip
\end{minipage}
}
- \_sdaps_classic_line_shipout_add:Nn \l_tmpa_coffin { #2 }
+ \_sdaps_classic_line_shipout_add:NNn \l_tmpa_coffin \g_tmpa_dim { #2 }
\ignorespaces
}
@@ -718,10 +733,13 @@
\dim_set:Nn \l_tmpb_dim { 0.5 \l_tmpb_dim + 0.8ex }
\strut\ignorespaces \tl_trim_spaces:n { #4 } ~
\sdaps_textbox_hstretch:VVVnn \l_sdaps_choicequestion_choice_var_tl \l_tmpa_dim \l_tmpb_dim { 0pt } { 1 }
+ \par
+ \dim_gset:Nn \g_tmpa_dim { \prevdepth }
+ \unskip
\end{minipage}
}
- \_sdaps_classic_line_shipout_add:Nn \l_tmpa_coffin { #3 }
+ \_sdaps_classic_line_shipout_add:NNn \l_tmpa_coffin \g_tmpa_dim { #3 }
\ignorespaces
}
@@ -875,12 +893,31 @@
}
+\tl_new:N \l__sdaps_classic_group_var_tl
+\tl_new:N \l__sdaps_classic_group_text_tl
+\tl_new:N \l__sdaps_classic_group_extra_tl
+\keys_define:nn { sdapsclassic / group }
+{
+ var .tl_set:N = \l__sdaps_classic_group_var_tl,
+ text .tl_set:N = \l__sdaps_classic_group_text_tl,
+}
+
\newenvironment { choicegroup } [ 2 ] []
{
\group_begin:
+ \keys_set_known:nnN { sdapsclassic / group } { #1 } \l__sdaps_classic_group_extra_tl
- \question{#2}
+ \_sdaps_classic_question{#2}
+ \tl_if_empty:NTF \l__sdaps_classic_group_text_tl {
+ \sdaps_qobject_begin:nnn { choicegroup } { Head } { #2 }
+ } {
+ \sdaps_qobject_begin:nnV { choicegroup } { Head } \l__sdaps_classic_group_text_tl
+ }
+ \tl_if_empty:NF \l__sdaps_classic_group_var_tl {
+ \sdaps_qobject_append_var:V \l__sdaps_classic_group_var_tl
+ }
+
% Undefine the question (and choice) commands in local scope so that they
% can be redefined by choicearray without any issues.
% Note that \cs_undefine:N works in global scope, so we cannot use it here.
@@ -887,7 +924,7 @@
\cs_set_eq:NN\question\tex_undefined:D
\cs_set_eq:NN\choice\tex_undefined:D
- \begin{choicearray}[#1]{#2}
+ \expandafter\choicearray\expandafter[\l__sdaps_classic_group_extra_tl]
% XXX: This is a bit of a hack, set in global scope because the choicearray
% environment does evil things with scopes.
\cs_gset_eq:NN\groupaddchoice\choice
@@ -897,7 +934,9 @@
\cs_gset_eq:NN\groupaddchoice\undefined
\cs_gset_eq:NN\choiceline\undefined
- \end{choicearray}
+ \endchoicearray
+
+ \sdaps_qobject_end:n { choicegroup }
\group_end:
}
@@ -904,9 +943,19 @@
\newenvironment { optiongroup } [ 2 ] []
{
\group_begin:
+ \keys_set_known:nnN { sdapsclassic / group } { #1 } \l__sdaps_classic_group_extra_tl
- \question{#2}
+ \_sdaps_classic_question{#2}
+ \tl_if_empty:NTF \l__sdaps_classic_group_text_tl {
+ \sdaps_qobject_begin:nnn { optiongroup } { Head } { #2 }
+ } {
+ \sdaps_qobject_begin:nnV { optiongroup } { Head } \l__sdaps_classic_group_text_tl
+ }
+ \tl_if_empty:NF \l__sdaps_classic_group_var_tl {
+ \sdaps_qobject_append_var:V \l__sdaps_classic_group_var_tl
+ }
+
% Undefine the question (and choice) commands in local scope so that they
% can be redefined by optionarray without any issues.
% Note that \cs_undefine:N works in global scope, so we cannot use it here.
@@ -913,7 +962,7 @@
\cs_set_eq:NN\question\tex_undefined:D
\cs_set_eq:NN\choice\tex_undefined:D
- \begin{optionarray}[#1]{#2}
+ \expandafter\optionarray\expandafter[\l__sdaps_classic_group_extra_tl]
% XXX: This is a bit of a hack, set in global scope because the optionarray
% environment does evil things with scopes.
\cs_gset_eq:NN\groupaddchoice\choice
@@ -923,7 +972,8 @@
\cs_gset_eq:NN\groupaddoption\undefined
\cs_gset_eq:NN\optionline\undefined
- \end{optionarray}
+ \endoptionarray
+ \sdaps_qobject_end:n { optiongroup }
\group_end:
}
@@ -930,15 +980,25 @@
\newenvironment { markgroup } [ 2 ] []
{
\group_begin:
+ \keys_set_known:nnN { sdapsclassic / group } { #1 } \l__sdaps_classic_group_extra_tl
- \question{#2}
+ \_sdaps_classic_question{#2}
+ \tl_if_empty:NTF \l__sdaps_classic_group_text_tl {
+ \sdaps_qobject_begin:nnn { markgroup } { Head } { #2 }
+ } {
+ \sdaps_qobject_begin:nnV { markgroup } { Head } \l__sdaps_classic_group_text_tl
+ }
- % Undefine the question (and choice) commands in local scope so that they
- % can be redefined by choicearray without any issues.
+ \tl_if_empty:NF \l__sdaps_classic_group_var_tl {
+ \sdaps_qobject_append_var:V \l__sdaps_classic_group_var_tl
+ }
+
+ % Undefine the range command in local scope so that it can be redefined
+ % by rangearray without any issues.
% Note that \cs_undefine:N works in global scope, so we cannot use it here.
\cs_set_eq:NN\range\tex_undefined:D
- \begin{rangearray}[#1]{#2}
+ \expandafter\rangearray\expandafter[\l__sdaps_classic_group_extra_tl]
% XXX: This is a bit of a hack, set in global scope because the choicearray
% environment does evil things with scopes.
\cs_gset_eq:NN\markline\range
@@ -946,7 +1006,8 @@
{
\cs_gset_eq:NN\markline\undefined
- \end{rangearray}
+ \endrangearray
+ \sdaps_qobject_end:n { markgroup }
\group_end:
}
Modified: trunk/Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty 2020-02-15 22:16:00 UTC (rev 53795)
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{sdapslayout}
@@ -35,8 +33,6 @@
\tl_new:N \l_sdaps_choicearray_qobject_type_tl
\bool_new:N \l_sdaps_choicearray_horizontal_bool
-\tl_new:N \l_sdaps_choicearray_var_tl
-\tl_new:N \l_sdaps_choicearray_text_tl
\tl_new:N \l_sdaps_choicearray_layouter_tl
\tl_new:N \l_sdaps_choicearray_align_tl
\tl_new:N \l_sdaps_choicearray_extra_tl
@@ -59,8 +55,6 @@
horizontal .initial:n = true,
vertical .bool_set_inverse:N = \l_sdaps_choicearray_horizontal_bool,
vertical .default:n = true,
- var .tl_set:N = \l_sdaps_choicearray_var_tl,
- text .tl_set:N = \l_sdaps_choicearray_text_tl,
layouter .tl_set:N = \l_sdaps_choicearray_layouter_tl,
layouter .initial:n = default,
align .tl_set:N = \l_sdaps_choicearray_align_tl,
@@ -91,20 +85,10 @@
range .initial:n = {...}
}
-\cs_new_protected_nopar:Npn \_sdaps_choicearray_preprocess:nn #1#2
+\cs_new_protected_nopar:Npn \_sdaps_choicearray_preprocess:n #1
{
\keys_set_known:nnN { sdaps / choicearray } { #1 } \l_sdaps_choicearray_extra_tl
- \tl_if_empty:NTF \l_sdaps_choicearray_text_tl {
- \sdaps_qobject_begin:nnn { choicearray } { Head } { #2 }
- } {
- \sdaps_qobject_begin:nnV { choicearray } { Head } \l_sdaps_choicearray_text_tl
- }
-
- \tl_if_empty:NF \l_sdaps_choicearray_var_tl {
- \sdaps_qobject_append_var:V \l_sdaps_choicearray_var_tl
- }
-
\sdaps_checkbox_set_type:V \l_sdaps_choicearray_type_tl
\tl_if_eq:VnTF \l_sdaps_choicearray_type_tl { multichoice } {
\tl_set:Nn \l_sdaps_choicearray_qobject_type_tl { Choice }
@@ -112,13 +96,8 @@
\tl_set:Nn \l_sdaps_choicearray_qobject_type_tl { Option }
}
}
-\cs_generate_variant:Nn \_sdaps_choicearray_preprocess:nn { Vn }
+\cs_generate_variant:Nn \_sdaps_choicearray_preprocess:n { V }
-\cs_new_protected_nopar:Npn \_sdaps_choicearray_postprocess:
-{
- \sdaps_qobject_end:n { choicearray }
-}
-
\cs_new_protected_nopar:Npn \_sdaps_choicearray_process_choice_insert_tail_after:w {
\bgroup
\group_insert_after:N \_sdaps_choicearray_process_choice_tail:
@@ -283,8 +262,6 @@
\cs_generate_variant:Nn \_sdaps_choicearray_process_question:nw { Vw }
-\tl_new:N \l_sdaps_rangearray_var_tl
-\tl_new:N \l_sdaps_rangearray_text_tl
\tl_new:N \l_sdaps_rangearray_align_tl
\tl_new:N \l_sdaps_rangearray_extra_tl
\int_new:N \l_sdaps_rangearray_rangecount_int
@@ -295,14 +272,16 @@
\tl_new:N \g_sdaps_question_uppertext_tl
\tl_new:N \g_sdaps_question_othertext_tl
+\msg_new:nnn { sdapslayout } { option_not_supported } { The~#1~option~is~not~supported~by~this~environment. }
+
\keys_define:nn { sdaps / rangearray }
{
- var .tl_set:N = \l_sdaps_rangearray_var_tl,
- text .tl_set:N = \l_sdaps_rangearray_text_tl,
count .int_set:N = \l_sdaps_rangearray_rangecount_int,
count .initial:n = 5,
align .tl_set:N = \l_sdaps_rangearray_align_tl,
align .initial:n = { },
+ % Override and disallow flipping; it does not work currently
+ flip .code:n = { \msg_error:nnn { sdapslayout } { option_not_supported } { flip } },
other .bool_set:N = \l_sdaps_rangearray_other_bool,
other .default:n = true,
other .initial:n = false,
@@ -317,30 +296,15 @@
other .tl_gset:N = \g_sdaps_question_othertext_tl,
}
-\cs_new_protected_nopar:Npn \_sdaps_rangearray_preprocess:nn #1#2
+\cs_new_protected_nopar:Npn \_sdaps_rangearray_preprocess:n #1
{
\keys_set_known:nnN { sdaps / rangearray } { #1 } \l_sdaps_rangearray_extra_tl
- \tl_if_empty:NTF \l_sdaps_rangearray_text_tl {
- \sdaps_qobject_begin:nnn { rangearray } { Head } { #2 }
- } {
- \sdaps_qobject_begin:nnV { rangearray } { Head } \l_sdaps_rangearray_text_tl
- }
-
\sdaps_checkbox_set_type:n { singlechoice }
-
- \tl_if_empty:NF \l_sdaps_rangearray_var_tl {
- \sdaps_qobject_append_var:V \l_sdaps_rangearray_var_tl
- }
}
-\cs_generate_variant:Nn \_sdaps_rangearray_preprocess:nn { Vn }
+\cs_generate_variant:Nn \_sdaps_rangearray_preprocess:n { V }
-\cs_new_protected_nopar:Npn \_sdaps_rangearray_postprocess:
-{
- \sdaps_qobject_end:n { rangearray }
-}
-
\cs_new_protected_nopar:Nn \_sdaps_rangearray_process_question_before_question: {
\sdaps_array_newline:
% Note: This needs to be after sdaps_array_newline as the command may be
@@ -570,7 +534,7 @@
\cs_generate_variant:Nn \_sdaps_rangearray_process_question:nw { Vw }
-\newenvironment { choicearray } [ 2 ] []
+\newenvironment { choicearray } [ 1 ] []
{
\group_begin:
@@ -587,7 +551,7 @@
}
}
- \_sdaps_choicearray_preprocess:Vn \l_tmpa_tl { #2 }
+ \_sdaps_choicearray_preprocess:V \l_tmpa_tl
% Clear the variables
\seq_gclear:N \g_sdaps_choices_filter_seq
\seq_gclear:N \g_sdaps_choices_cell_seq
@@ -611,21 +575,19 @@
{
\endsdapsarray
\group_end:
- % Process keys
- \_sdaps_choicearray_postprocess:
\group_end:
}
-\newenvironment { optionarray } [ 2 ] []
+\newenvironment { optionarray } [ 1 ] []
{
- \choicearray[singlechoice,#1] { #2 }
+ \choicearray[singlechoice,#1]
}
{
\endchoicearray
}
-\newenvironment { rangearray } [ 2 ] []
+\newenvironment { rangearray } [ 1 ] []
{
\group_begin:
@@ -642,7 +604,7 @@
}
}
- \_sdaps_rangearray_preprocess:Vn \l_tmpa_tl { #2 }
+ \_sdaps_rangearray_preprocess:V \l_tmpa_tl
\newcommand \range [ 1 ] [] {
\_sdaps_rangearray_process_question:nw { ##1 }
@@ -650,14 +612,12 @@
\group_begin:
- \tl_set:Nx \l_tmpb_tl {keepenv,align=\l_sdaps_rangearray_align_tl,\l_sdaps_rangearray_extra_tl}
+ \tl_set:Nx \l_tmpb_tl {keepenv,align=\l_sdaps_rangearray_align_tl,no_header,\l_sdaps_rangearray_extra_tl}
\expandafter\sdapsarray\expandafter[\l_tmpb_tl]
}
{
\endsdapsarray
\group_end:
- % Process keys
- \_sdaps_rangearray_postprocess:
\group_end:
}
Modified: trunk/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty 2020-02-15 22:16:00 UTC (rev 53795)
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin at sipsolutions.net>
%%
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{sdapspdf}
Modified: trunk/Master/tlpkg/bin/tlpkginfo
===================================================================
--- trunk/Master/tlpkg/bin/tlpkginfo 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/tlpkg/bin/tlpkginfo 2020-02-15 22:16:00 UTC (rev 53795)
@@ -75,7 +75,7 @@
# erroneous or problematic tds files (when new, tell CTAN and author)
$erroneous_tds = join ("|",
qw(alertmessage amstex countriesofeurope dad ebproof endfloat engpron gost
- hacm inriafonts imtekda mathdesign tufte-latex xassoccnt),
+ hacm inriafonts imtekda mathdesign sdaps tufte-latex xassoccnt),
);
# special packages from latex-tds project; used by prepare()
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2020-02-15 22:13:45 UTC (rev 53794)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2020-02-15 22:16:00 UTC (rev 53795)
@@ -576,6 +576,7 @@
'highlight', "die 'skipping, complicated compilation'",
'hilowres', "die 'skipping, nonfree'",
'historische-zeitschrift', "&MAKEflatten",
+ 'hitszthesis', "die 'skipping, requires nonfree fonts'",
'hm-ftx', "die 'skipping, use persian-hm-ftx'",
'hm-xbs', "die 'skipping, use persian-hm-xbs'",
'html2latex', "die 'skipping, no self-locating of Perl modules'",
More information about the tex-live-commits
mailing list.