summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def')
-rw-r--r--Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def56
1 files changed, 43 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def
index 5e38802fe70..7c1637de0a5 100644
--- a/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def
+++ b/Master/texmf-dist/tex/latex/exsheets/exsheets_headings.def
@@ -42,9 +42,11 @@
\coffin_new:N \l__exsheets_heading_title_coffin
\coffin_new:N \l__exsheets_heading_number_coffin
\coffin_new:N \l__exsheets_heading_points_coffin
+\coffin_new:N \l__exsheets_heading_meta_coffin
-% the object varaibles:
+% the object variables:
\bool_new:N \l__exsheets_heading_runin_bool
+\bool_new:N \l__exsheets_heading_inline_bool
\bool_new:N \l__exsheets_heading_indent_first_bool
\bool_new:N \l__exsheets_heading_toc_reversed_bool
@@ -64,6 +66,9 @@
\tl_new:N \l__exsheets_heading_number_pre_code_tl
\tl_new:N \l__exsheets_heading_number_post_code_tl
+\tl_new:N \l__exsheets_heading_meta_pre_code_tl
+\tl_new:N \l__exsheets_heading_meta_post_code_tl
+
\tl_new:N \l__exsheets_heading_points_format_tl
\tl_new:N \l__exsheets_heading_points_pre_code_tl
\tl_new:N \l__exsheets_heading_points_post_code_tl
@@ -145,6 +150,7 @@
% the `default' template interface:
\DeclareTemplateInterface { exsheets-heading } { default } { 4 }
{
+ inline : boolean = false ,
runin : boolean = false ,
indent-first : boolean = false ,
toc-reversed : boolean = false ,
@@ -160,6 +166,8 @@
number-format : tokenlist = ,
number-pre-code : tokenlist = ,
number-post-code : tokenlist = ,
+ meta-pre-code : tokenlist = ,
+ meta-post-code : tokenlist = ,
points-format : tokenlist = ,
points-pre-code : tokenlist = ,
points-post-code : tokenlist = ,
@@ -170,6 +178,7 @@
% the `default' template code:
\DeclareTemplateCode { exsheets-heading } { default } { 4 }
{
+ inline = \l__exsheets_heading_inline_bool ,
runin = \l__exsheets_heading_runin_bool ,
indent-first = \l__exsheets_heading_indent_first_bool ,
toc-reversed = \l__exsheets_heading_toc_reversed_bool ,
@@ -185,6 +194,8 @@
number-format = \l__exsheets_heading_number_format_tl ,
number-pre-code = \l__exsheets_heading_number_pre_code_tl ,
number-post-code = \l__exsheets_heading_number_post_code_tl ,
+ meta-pre-code = \l__exsheets_heading_meta_pre_code_tl ,
+ meta-post-code = \l__exsheets_heading_meta_post_code_tl ,
points-format = \l__exsheets_heading_points_format_tl ,
points-pre-code = \l__exsheets_heading_points_pre_code_tl ,
points-post-code = \l__exsheets_heading_points_post_code_tl ,
@@ -193,6 +204,8 @@
}
{
\AssignTemplateKeys
+ \bool_if:NT \l__exsheets_heading_inline_bool
+ { \cs_set_eq:NN \exsheets_par: \scan_stop: }
\bool_if:nT
{ \l__exsheets_questions_totoc_bool && \l__exsheets_inside_question_bool }
{
@@ -201,7 +214,7 @@
{
\bool_if:NTF \l__exsheets_heading_toc_reversed_bool
{ #2 \ #1 }
- { #1\ #2 }
+ { #1 \ #2 }
}
}
\bool_if:nT
@@ -212,14 +225,15 @@
{
\bool_if:NTF \l__exsheets_heading_toc_reversed_bool
{ #2 \ #1 }
- { #1\ #2 }
+ { #1 \ #2 }
}
}
\seq_set_split:NnV \l__exsheets_heading_joined_coffins_seq { ; }
\l__exsheets_heading_joined_coffins_tl
\seq_set_split:NnV \l__exsheets_heading_attached_coffins_seq { ; }
\l__exsheets_heading_attached_coffins_tl
- \bool_if:NTF \l__exsheets_heading_runin_bool
+ \bool_if:nTF
+ { \l__exsheets_heading_runin_bool || \l__exsheets_heading_inline_bool }
{
\hcoffin_set:Nn \l__exsheets_heading_main_coffin
{
@@ -268,6 +282,17 @@
{ \tl_use:N \l__exsheets_heading_title_user_format_tl #2 }
\tl_use:N \l__exsheets_heading_number_post_code_tl
}
+ \hcoffin_set:Nn \l__exsheets_heading_meta_coffin
+ {
+ \prop_get:NoNT \g__exsheets_questions_meta_prop
+ { \g__exsheets_questions_current_id_tl }
+ \l__exsheets_questions_meta_tl
+ {
+ \tl_use:N \l__exsheets_heading_meta_pre_code_tl
+ \tl_use:N \l__exsheets_questions_meta_tl
+ \tl_use:N \l__exsheets_heading_meta_post_code_tl
+ }
+ }
\hcoffin_set:Nn \l__exsheets_heading_points_coffin
{
\bool_if:nF { \fp_compare_p:n { #3 = 0 } && \fp_compare_p:n { #4 = 0 } }
@@ -312,7 +337,8 @@
\tl_use:N \l__exsheets_heading_points_post_code_tl
}
}
- \bool_if:NF \l__exsheets_heading_runin_bool
+ \bool_if:nT
+ { !\l__exsheets_heading_runin_bool && !\l__exsheets_heading_inline_bool }
{
\coffin_resize:Nnn \l__exsheets_heading_main_coffin { \linewidth }
{
@@ -323,19 +349,23 @@
}
\__exsheets_join:N \l__exsheets_heading_joined_coffins_seq
\__exsheets_attach:N \l__exsheets_heading_attached_coffins_seq
- \skip_vertical:N \l__exsheets_heading_above_dim
- \exsheets_needspace:n
+ \bool_if:NF \l__exsheets_heading_inline_bool
{
- \coffin_ht:N \l__exsheets_heading_main_coffin +
- \coffin_dp:N \l__exsheets_heading_main_coffin +
- \l__exsheets_heading_below_dim +
- \baselineskip
+ \skip_vertical:N \l__exsheets_heading_above_dim
+ \exsheets_needspace:n
+ {
+ \coffin_ht:N \l__exsheets_heading_main_coffin +
+ \coffin_dp:N \l__exsheets_heading_main_coffin +
+ \l__exsheets_heading_below_dim +
+ \baselineskip
+ }
+ \noindent
}
\skip_set:Nn \parfillskip { 0pt plus 1fil }
- \noindent
\coffin_typeset:Nnnnn \l__exsheets_heading_main_coffin
{ H } { l } { 0pt }{ 0pt }
- \bool_if:NF \l__exsheets_heading_runin_bool
+ \bool_if:nT
+ { !\l__exsheets_heading_runin_bool && !\l__exsheets_heading_inline_bool }
{
\skip_vertical:N \l__exsheets_heading_below_dim
\dim_compare:nF { \parskip = 0pt }