texlive[69331] Master/texmf-dist: codedescribe (6jan24)

commits+karl at tug.org commits+karl at tug.org
Sun Jan 7 22:25:54 CET 2024


Revision: 69331
          https://tug.org/svn/texlive?view=revision&revision=69331
Author:   karl
Date:     2024-01-07 22:25:54 +0100 (Sun, 07 Jan 2024)
Log Message:
-----------
codedescribe (6jan24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/codedescribe/README.md
    trunk/Master/texmf-dist/doc/latex/codedescribe/codedescribe.pdf
    trunk/Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex
    trunk/Master/texmf-dist/tex/latex/codedescribe/codedescribe.sty
    trunk/Master/texmf-dist/tex/latex/codedescribe/codelisting.sty

Modified: trunk/Master/texmf-dist/doc/latex/codedescribe/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/codedescribe/README.md	2024-01-07 21:25:46 UTC (rev 69330)
+++ trunk/Master/texmf-dist/doc/latex/codedescribe/README.md	2024-01-07 21:25:54 UTC (rev 69331)
@@ -52,7 +52,7 @@
 * git: https://github.com/alceu-frigeri/codedescribe
 
 -------------
-Copyright 2023 by Alceu Frigeri
+Copyright 2023-present by Alceu Frigeri
 
  This work may be distributed and/or modified under the
  conditions of
@@ -87,7 +87,11 @@
 ## Changelog
 
 
-* Version 1.2 (this)
+* Version 1.3 (this)
+    - Added \tsresult, a command to just show the result of a stored code (codelisting specific).
+
+
+* Version 1.2
     - Added of format key: basicstyle
     
 * Version 1.1

Modified: trunk/Master/texmf-dist/doc/latex/codedescribe/codedescribe.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex	2024-01-07 21:25:46 UTC (rev 69330)
+++ trunk/Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex	2024-01-07 21:25:54 UTC (rev 69331)
@@ -2,7 +2,7 @@
 % !TEX ext =  --interaction=nonstopmode --enable-etex --enable-write18
 % !BIB program = none
 %%%==============================================================================
-%% Copyright 2023 by Alceu Frigeri
+%% Copyright 2023-present by Alceu Frigeri
 %%
 %% This work may be distributed and/or modified under the conditions of
 %%
@@ -15,7 +15,7 @@
 %%
 %% The Current Maintainer of this work is Alceu Frigeri
 %%
-%% This is version 1.1 (2023/05/16)
+%% This is version {1.3} (2023/05/16)
 %%
 %% The list of files that compose this work can be found in the README.md file at
 %% https://ctan.org/pkg/codedescribe
@@ -67,7 +67,7 @@
 \section{codelisting Package}
 
 It requires two packages: \tsobj[pkg]{listings,scontents},  defines an environment: \tsobj[env]{codestore} and 
- 2 main commands: \tsobj[code]{\tscode,\tsdemo} and 1 auxiliary command: \tsobj{\setcodekeys}.
+ 3 main commands: \tsobj[code]{\tscode,\tsdemo,\tsresult} and 1 auxiliary command: \tsobj{\setcodekeys}.
 
 \subsection{In Memory Code Storage}
 Thanks to \tsobj[pkg]{scontents} (\tsobj[pkg]{expl3} based) it's possible to store \LaTeX~ code snippets in a \tsobj[pkg]{expl3} key.
@@ -96,14 +96,18 @@
 \end{tsremark}
 \end{codedescribe}
 
-\begin{codedescribe}{\tscode*,\tsdemo*}
+\begin{codedescribe}[code,new=2024-01-06]{\tscode*,\tsdemo*,\tsresult*}
 	\begin{codesyntax}%
 		\tsmacro{\tscode*}[code-keys]{st-name}
 		\tsmacro{\tsdemo*}[code-keys]{st-name}
+		\tsmacro{\tsresult*}[code-keys]{st-name}
 	\end{codesyntax}
 \tsmacro{\tscode}{} just typesets \tsobj[meta]{st-name} (the key-name created with \tsobj[env]{stcode}), in verbatim mode with syntax highlight. The non-star version centers it and use just half of the base line. The star version uses the full text width.
 
 \tsmacro{\tsdemo*}{} first typesets \tsobj[meta]{st-name}, as above, then it \emph{executes} said code. The non-start versions place them side-by-side, whilst the star versions places one following the other.
+
+(new) \tsmacro{\tsresult*}{} only \emph{executes} said code. The non-start versions centers it and use just half of the base line, whilst the star versions uses the full text width.
+
 \end{codedescribe}
 
 

Modified: trunk/Master/texmf-dist/tex/latex/codedescribe/codedescribe.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/codedescribe/codedescribe.sty	2024-01-07 21:25:46 UTC (rev 69330)
+++ trunk/Master/texmf-dist/tex/latex/codedescribe/codedescribe.sty	2024-01-07 21:25:54 UTC (rev 69331)
@@ -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
     {codedescribe}
-    {2023/11/18}
-    {1.2}
+    {2024/01/06}
+    {1.3}
     {LaTeX Code Description/Documentation}
 
 %%%%%%%
@@ -36,8 +36,8 @@
   {
      name        .code:n = {codedescribe} ,
      prefix      .code:n = {codedesc} ,
-     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~Description/Documentation}
   }
 \cs_if_exist:NF \__codedesc_pkg_info:nn 

Modified: trunk/Master/texmf-dist/tex/latex/codedescribe/codelisting.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/codedescribe/codelisting.sty	2024-01-07 21:25:46 UTC (rev 69330)
+++ trunk/Master/texmf-dist/tex/latex/codedescribe/codelisting.sty	2024-01-07 21:25:54 UTC (rev 69331)
@@ -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 !!!!
 %%%



More information about the tex-live-commits mailing list.