marei: reconfigure longdescription
authorMarei (peiTeX) <marei@peitex.de>
Fri, 5 Jun 2020 12:20:08 +0000 (14:20 +0200)
committerJan Büren <jan@kivitendo.de>
Wed, 21 Oct 2020 11:42:01 +0000 (13:42 +0200)
templates/print/marei/kiviletter.sty

index aa18080..6978764 100644 (file)
@@ -104,6 +104,7 @@ contents={\usebox\shippingAddressBox}
 
 \ExplSyntaxOn
 \dim_new:N \l_kivi_tab_desc_dim
+\dim_new:N \l_kivi_tab_desc_leftskip_dim
 \bool_new:N \l_kivi_col_desc_bool
 \bool_set_true:N \l_kivi_col_desc_bool 
 
@@ -121,7 +122,7 @@ contents={\usebox\shippingAddressBox}
 }
 
 % set default values for colwidth
-\dim_set:Nn \l_kivi_tab_pos_dim {3.5ex}
+\dim_set:Nn \l_kivi_tab_pos_dim {5ex}
 \dim_set:Nn \l_kivi_tab_id_dim {4em}
 \dim_set:Nn \l_kivi_tab_amount_dim {5em}
 \dim_set:Nn \l_kivi_tab_price_dim {7em}
@@ -131,10 +132,14 @@ contents={\usebox\shippingAddressBox}
 \dim_gset:Nn \g_kivi_tabcolsep_dim {.5\tabcolsep}
 
 \cs_new:Nn \__kivi_calc_desc_column: {
+       \dim_gset:Nn \l_kivi_tab_desc_leftskip_dim {
+               0pt
+               \bool_if:NT \l_kivi_col_pos_bool {+\l_kivi_tab_pos_dim +2\g_kivi_tabcolsep_dim}
+               \bool_if:NT \l_kivi_col_id_bool {+\l_kivi_tab_id_dim +2\g_kivi_tabcolsep_dim}
+       }
        \dim_gset:Nn \l_kivi_tab_desc_dim {
                \textwidth
-               \bool_if:NT \l_kivi_col_pos_bool {-\l_kivi_tab_pos_dim -2\g_kivi_tabcolsep_dim}
-               \bool_if:NT \l_kivi_col_id_bool {-\l_kivi_tab_id_dim -2\g_kivi_tabcolsep_dim}
+               -\l_kivi_tab_desc_leftskip_dim 
                \bool_if:NT \l_kivi_col_amount_bool {-\l_kivi_tab_amount_dim -2\g_kivi_tabcolsep_dim}
                \bool_if:NT \l_kivi_col_pricetotal_bool  {-\l_kivi_tab_pricetotal_dim -2\g_kivi_tabcolsep_dim}
                \bool_if:NT \l_kivi_col_price_bool  {-\l_kivi_tab_price_dim -2\g_kivi_tabcolsep_dim}
@@ -190,6 +195,7 @@ contents={\usebox\shippingAddressBox}
 \newcommand{\FakeTable}[1]{
        \par
        \seq_set_split:Nnn \l_kivi_PricingTable_seq {\tabularnewline} {#1}
+        \seq_remove_all:Nn \l_kivi_PricingTable_seq {}
        \begingroup
        \setlength{\tabcolsep}{\g_kivi_tabcolsep_dim}
        \seq_map_inline:Nn \l_kivi_PricingTable_seq {
@@ -203,19 +209,12 @@ contents={\usebox\shippingAddressBox}
                }
        \endtabular
        \seq_if_empty:NTF \g_kivi_extraDescription_seq
-       {\par\nointerlineskip}
-       {\par\nointerlineskip
-       \begin{tcolorbox}[
-               empty,
-               left=\dim_eval:n {\l_kivi_tab_pos_dim+ \l_kivi_tab_id_dim +4\g_kivi_tabcolsep_dim},
-               right=\dim_eval:n {\l_kivi_tab_num_dim+ 2\l_kivi_tab_price_dim +6\g_kivi_tabcolsep_dim},top=0pt,bottom=0pt,
-               boxsep=0pt,
-               breakable,
-               lines~before~break=1,
-       ]
-       \seq_use:Nn \g_kivi_extraDescription_seq {\\}
-       \end{tcolorbox}
-       \nointerlineskip
+       {\par}
+       {\par
+       \setlength{\hsize}{\dimexpr\l_kivi_tab_desc_dim+\l_kivi_tab_desc_leftskip_dim}
+       \setlength{\leftskip}{\l_kivi_tab_desc_leftskip_dim}
+               \seq_use:Nn \g_kivi_extraDescription_seq {\\}
+        \par\nointerlineskip
        }
        }
        \endgroup
@@ -261,9 +260,9 @@ contents={\usebox\shippingAddressBox}
                \bfseries\bezeichnung
                \bool_if:NT \l_kivi_col_amount_bool {&\bfseries\menge}
                \bool_if:NT \l_kivi_col_price_bool { &\multicolumn{1}{>{\raggedleft}p{\l_kivi_tab_price_dim}}{\bfseries\einzelpreis}}
-               \bool_if:NT \l_kivi_col_pricetotal_bool {&\multicolumn{1}{>{\raggedleft}p{\l_kivi_tab_pricetotal_dim}@{}}{\bfseries\gesamtpreis}}\\
+               \bool_if:NT \l_kivi_col_pricetotal_bool {&\multicolumn{1}{>{\raggedleft}p{\l_kivi_tab_pricetotal_dim}@{}}{\bfseries\gesamtpreis}}
                \\
-               \midrule\\[-\dp\strutbox]
+               \midrule
                \endtabular
        }
        \hbox_gset:Nn \g_kivi_LT@foot_box {