diff options
Diffstat (limited to 'macros/latex/contrib/codedescribe/latex/codelisting.sty')
-rw-r--r-- | macros/latex/contrib/codedescribe/latex/codelisting.sty | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/macros/latex/contrib/codedescribe/latex/codelisting.sty b/macros/latex/contrib/codedescribe/latex/codelisting.sty index b4a939034d..fa54237963 100644 --- a/macros/latex/contrib/codedescribe/latex/codelisting.sty +++ b/macros/latex/contrib/codedescribe/latex/codelisting.sty @@ -1,5 +1,5 @@ %%%============================================================================== -%% Copyright 2023 by Alceu Frigeri +%% Copyright 2023-present by Alceu Frigeri %% %% This work may be distributed and/or modified under the conditions of %% @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version {1.2} {2023/11/18} +%% This is version {1.3} {2024/01/06} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/codedescribe @@ -22,8 +22,8 @@ \ProvidesExplPackage {codelisting} - {2023/11/18} - {1.2} + {2024/01/06} + {1.3} {LaTeX Code Listing} %%%%%%% @@ -36,8 +36,8 @@ { name .code:n = {codelisting} , prefix .code:n = {codelist} , - date .code:n = {2023/11/18} , - version .code:n = {1.2} , + date .code:n = {2024/01/06} , + version .code:n = {1.3} , description .code:n = {\LaTeX~Code~Listing} } \cs_if_exist:NF \__codedesc_pkg_info:nn @@ -689,6 +689,52 @@ \cs_new_eq:NN \tsdemo \typesetdemo + + +\NewDocumentCommand{\typesetresult}{sO{}mO{1ex}} + { + \__codedesc_set_textcolwidth: + \group_begin: + \par\setlength\parindent{0pt} + \bool_if:nTF {#1} + { % full width + \dim_set:Nn \l__codedesc_width_dim {\l__codedesc_textcolwidth_dim} + \tl_set:Nn \l__codedesc_rule_in_tl {\__codedesc_rule:n {\l__codelist_ruleheight_tl}} + \dim_set:Nn \l__codedesc_offset_dim {0pt} + } + { % half width + \dim_set:Nn \l__codedesc_width_dim {0.5\l__codedesc_textcolwidth_dim} + \tl_set:Nn \l__codedesc_rule_in_tl {\__codedesc_rule:n {\l__codelist_ruleheight_tl}} + \dim_set:Nn \l__codedesc_offset_dim {0.5\l__codedesc_width_dim} + } + + \vcoffin_set:Nnn \__codelist_demo_label_coffin {\l__codedesc_width_dim} + { + \raggedright + \l__codelist_resultprefix_tl + } + \vcoffin_set:Nnn \__codelist_demo_coffin {\l__codedesc_width_dim} + { + \l__codedesc_rule_in_tl + \group_begin:\vspace*{0.5\baselineskip}%\vspace*{-1ex} + \setlength\parindent{\l__codelist_demo_parindent_dim} + \getstored{#3}%\vspace*{-1ex} + \group_end: + \l__codedesc_rule_in_tl + } + + \coffin_join:NnnNnnnn + \__codelist_demo_label_coffin {l}{b} + \__codelist_demo_coffin {l}{t} + {0pt}{-1ex} + \coffin_typeset:Nnnnn \__codelist_demo_label_coffin {l}{t}{\l__codedesc_offset_dim}{0pt} + \vspace*{\baselineskip} + \par + \group_end: + } + +\cs_new_eq:NN \tsresult \typesetresult + %%% %%% Using scontents package !!!! %%% |