diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty | 87 |
1 files changed, 64 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty b/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty index b626f072d30..e8a3345204f 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/xgalley/l3galley.sty @@ -48,11 +48,14 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3names} -\GetIdInfo$Id: l3galley.dtx 2899 2011-10-09 21:22:06Z joseph $ +\GetIdInfo$Id: l3galley.dtx 2938 2011-10-25 18:41:20Z joseph $ {L3 Experimental galley code} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \package_check_loaded_expl: +\cs_new_protected:Npn \scan_marker_new:N #1 + { \cs_new_eq:NN #1 \scan_stop: } +\cs_generate_variant:Nn \scan_marker_new:N { c } \cs_new_protected_nopar:Npn \galley_leave_vmode: { \tex_unhbox:D \c_empty_box } \clist_new:N \l_galley_parshape_left_indent_clist @@ -69,7 +72,6 @@ \cs_new_eq:NN \l_galley_width_dim \tex_hsize:D \bool_new:N \g_galley_begin_level_bool \bool_new:N \l_galley_begin_level_bool -\bool_gset_true:N \g_galley_begin_level_bool \bool_new:N \g_galley_omit_next_indent_bool \bool_new:N \l_galley_omit_next_indent_bool \bool_new:N \g_galley_parshape_set_bool @@ -107,9 +109,10 @@ \bool_gset_false:N \g_galley_parshape_set_bool \int_gzero:N \g_galley_previous_par_lines_int \tl_gclear:N \g_galley_restore_running_tl - \tl_gclear:N \g_galley_whatsits_previous_tl - \tl_gclear:N \g_galley_whatsits_next_tl + \tl_gclear:N \g_galley_whatsit_previous_tl + \tl_gclear:N \g_galley_whatsit_next_tl } +\galley_initialise_variables: \cs_new_protected_nopar:Npn \galley_initialise_settings: { \dim_set_eq:NN \l_galley_text_width_dim \l_galley_width_dim @@ -142,10 +145,10 @@ \g_galley_previous_par_lines_int \tl_set_eq:NN \l_galley_restore_running_tl \g_galley_restore_running_tl - \tl_set_eq:NN \l_galley_whatsits_previous_tl - \g_galley_whatsits_previous_tl - \tl_set_eq:NN \l_galley_whatsits_next_tl - \g_galley_whatsits_next_tl + \tl_set_eq:NN \l_galley_whatsit_previous_tl + \g_galley_whatsit_previous_tl + \tl_set_eq:NN \l_galley_whatsit_next_tl + \g_galley_whatsit_next_tl } \cs_new_protected_nopar:Npn \galley_restore_parameters: { @@ -171,10 +174,10 @@ \l_galley_previous_par_lines_int \tl_gset_eq:NN \g_galley_restore_running_tl \l_galley_restore_running_tl - \tl_gset_eq:NN \g_galley_whatsits_previous_tl - \l_galley_whatsits_previous_tl - \tl_gset_eq:NN \g_galley_whatsits_next_tl - \l_galley_whatsits_next_tl + \tl_gset_eq:NN \g_galley_whatsit_previous_tl + \l_galley_whatsit_previous_tl + \tl_gset_eq:NN \g_galley_whatsit_next_tl + \l_galley_whatsit_next_tl } \cs_new_protected_nopar:Npn \galley_level: { @@ -190,8 +193,28 @@ \galley_restore_parameters: \group_end: } +\scan_marker_new:N \s_par_omit \cs_new_protected_nopar:Npn \galley_std_par: { + \s_par_omit + \exp_after:wN \galley_std_par_aux_i: \tex_romannumeral:D - `0 + } +\cs_new_protected:Npn \galley_std_par_aux_i: + { + \peek_meaning:NTF \s_par_omit + { \galley_std_par_aux:N } + { \galley_std_par_aux_ii: } + } +\cs_new_protected:Npn \galley_std_par_aux:N #1 + { + \str_if_eq:xxF {#1} { \s_par_omit } + { + \galley_std_par_aux_ii: + #1 + } + } +\cs_new_protected_nopar:Npn \galley_std_par_aux_ii: + { \mode_if_vertical:TF { \tex_par:D } { @@ -206,6 +229,15 @@ \tl_gclear:N \g_galley_par_after_hook_tl \tex_penalty:D \c_ten_thousand } +\cs_new_protected:Npn \galley_end_par:n #1 + { + \s_par_omit + \bool_if:nF \g_galley_begin_level_bool + { + #1 + \galley_std_par: + } + } \cs_set_protected_nopar:Npn \par { \galley_std_par: } \tl_set:Nn \@par { \galley_std_par: } \cs_new_protected_nopar:Npn \galley_display_begin: @@ -354,14 +386,14 @@ { \g_galley_whatsit_next_tl \tl_gclear:N \g_galley_whatsit_next_tl - \bool_if:NT \g_galley_omit_next_indent_bool + \bool_if:NF \g_galley_omit_next_indent_bool { - \box_if_empty:NF \g_galley_last_box + \box_if_empty:NF \g_galley_last_box { \hbox_to_wd:nn \l_galley_par_indent_dim { } } } \skip_horizontal:N \l_galley_par_begin_skip \g_galley_par_begin_hook_tl - \bool_gset_true:N \g_galley_omit_next_indent_bool + \bool_gset_false:N \g_galley_omit_next_indent_bool } \cs_new_protected_nopar:Npn \galley_restore_running_parameters: { @@ -732,6 +764,20 @@ { \int_use:N \etex_widowpenalties:D \int_eval:w #1 \int_eval_end: , } \cs_new_protected_nopar:Npn \galley_interline_penalty: { \int_use:N \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero } +\cs_set_protected_nopar:Npn \nobreak + { \bool_gset_true:N \g_galley_no_break_next_bool } +\cs_set_protected_nopar:Npn \noindent + { + \tex_noindent:D + \bool_gset_false:N \g_galley_omit_next_indent_bool + } +\cs_set_protected_nopar:Npn \vspace #1 + { + \@ifstar + { \galley_set_user_vspace:n {#1} } + { \galley_set_user_vspace:n {#1} } + } +\cs_set_eq:NN \@@par \galley_std_par: \cs_set_protected_nopar:Npn \@afterheading { \bool_gset_true:N \g_galley_no_break_next_bool @@ -742,6 +788,8 @@ } \cs_set_protected:Npn \@hangfrom #1 { + \bool_gset_true:N \g_galley_omit_next_indent_bool + \leavevmode \setbox \@tempboxa = \hbox { {#1} } \galley_parshape_single_par:nnnN \c_one @@ -749,16 +797,9 @@ \c_zero_dim \c_false_bool \bool_gset_true:N \g_galley_no_break_next_bool - \bool_gset_true:N \galley_omit_next_indent_bool + \bool_gset_true:N \g_galley_omit_next_indent_bool \box \@tempboxa } -\cs_set_protected:Npn \@makefntext #1 - { - \UseTemplate { justification } { std } { indent-width = 1 em } - \bool_gset_true:N \galley_omit_next_indent_bool - \galley_leave_vmode: - \hb@xt@ 1.8em { \hss \@makefnmark } #1 - } %% %% %% End of file `l3galley.sty'. |