summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty61
-rw-r--r--Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty22
-rw-r--r--Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls119
-rw-r--r--Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty72
-rw-r--r--Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty4
5 files changed, 163 insertions, 115 deletions
diff --git a/Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty b/Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty
index c57c389b347..3cbe705ab3c 100644
--- a/Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty
+++ b/Master/texmf-dist/tex/latex/sdaps/sdapsarray.sty
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin@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: }
}
}
{
diff --git a/Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty b/Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty
index cacfaedd739..d423333d700 100644
--- a/Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty
+++ b/Master/texmf-dist/tex/latex/sdaps/sdapsbase.sty
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin@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}%
diff --git a/Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls b/Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls
index c0d2d07a043..1a4a52ddfcf 100644
--- a/Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls
+++ b/Master/texmf-dist/tex/latex/sdaps/sdapsclassic.cls
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin@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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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,11 +893,30 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
}
+\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.
@@ -887,7 +924,7 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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,15 +934,27 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\cs_gset_eq:NN\groupaddchoice\undefined
\cs_gset_eq:NN\choiceline\undefined
- \end{choicearray}
+ \endchoicearray
+
+ \sdaps_qobject_end:n { choicegroup }
\group_end:
}
\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.
@@ -913,7 +962,7 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\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,22 +972,33 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
\cs_gset_eq:NN\groupaddoption\undefined
\cs_gset_eq:NN\optionline\undefined
- \end{optionarray}
+ \endoptionarray
+ \sdaps_qobject_end:n { optiongroup }
\group_end:
}
\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 @@ you~can~get~similar~results~by~temporarily~changing~the~checkbox~style. }
{
\cs_gset_eq:NN\markline\undefined
- \end{rangearray}
+ \endrangearray
+ \sdaps_qobject_end:n { markgroup }
\group_end:
}
diff --git a/Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty b/Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty
index 54c755b0481..32f825f44fb 100644
--- a/Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty
+++ b/Master/texmf-dist/tex/latex/sdaps/sdapslayout.sty
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin@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,12 +96,7 @@
\tl_set:Nn \l_sdaps_choicearray_qobject_type_tl { Option }
}
}
-\cs_generate_variant:Nn \_sdaps_choicearray_preprocess:nn { Vn }
-
-\cs_new_protected_nopar:Npn \_sdaps_choicearray_postprocess:
-{
- \sdaps_qobject_end:n { choicearray }
-}
+\cs_generate_variant:Nn \_sdaps_choicearray_preprocess:n { V }
\cs_new_protected_nopar:Npn \_sdaps_choicearray_process_choice_insert_tail_after:w {
\bgroup
@@ -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,28 +296,13 @@
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_new_protected_nopar:Npn \_sdaps_rangearray_postprocess:
-{
- \sdaps_qobject_end:n { rangearray }
}
+\cs_generate_variant:Nn \_sdaps_rangearray_preprocess:n { V }
\cs_new_protected_nopar:Nn \_sdaps_rangearray_process_question_before_question: {
@@ -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:
}
diff --git a/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty b/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty
index 6951e63c484..b3f64b8169e 100644
--- a/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty
+++ b/Master/texmf-dist/tex/latex/sdaps/sdapspdf.sty
@@ -11,12 +11,10 @@
%% Copyright (C) 2015 by Benjamin Berg <benjamin@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}