summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-01-07 21:25:54 +0000
committerKarl Berry <karl@freefriends.org>2024-01-07 21:25:54 +0000
commitbeb290d8356ec89fbcb07686041a5103ccec87ce (patch)
tree0997dfe612e4abf71da567c6cf290838733c22cd
parent6c00f6e90d69949609b1ded1361d38950f82fd50 (diff)
codedescribe (6jan24)
git-svn-id: svn://tug.org/texlive/trunk@69331 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/codedescribe/README.md8
-rw-r--r--Master/texmf-dist/doc/latex/codedescribe/codedescribe.pdfbin251836 -> 252057 bytes
-rw-r--r--Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex12
-rw-r--r--Master/texmf-dist/tex/latex/codedescribe/codedescribe.sty12
-rw-r--r--Master/texmf-dist/tex/latex/codedescribe/codelisting.sty58
5 files changed, 72 insertions, 18 deletions
diff --git a/Master/texmf-dist/doc/latex/codedescribe/README.md b/Master/texmf-dist/doc/latex/codedescribe/README.md
index 2ef3da25142..218cb142027 100644
--- a/Master/texmf-dist/doc/latex/codedescribe/README.md
+++ b/Master/texmf-dist/doc/latex/codedescribe/README.md
@@ -52,7 +52,7 @@ Please do not use the issue page for generic help on how to use the package.
* 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 @@ The Current Maintainer of this work is Alceu Frigeri
## 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
diff --git a/Master/texmf-dist/doc/latex/codedescribe/codedescribe.pdf b/Master/texmf-dist/doc/latex/codedescribe/codedescribe.pdf
index 59e01cf4878..45271b09d63 100644
--- a/Master/texmf-dist/doc/latex/codedescribe/codedescribe.pdf
+++ b/Master/texmf-dist/doc/latex/codedescribe/codedescribe.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex b/Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex
index 93d26b249ca..94e9dd8ba40 100644
--- a/Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex
+++ b/Master/texmf-dist/doc/latex/codedescribe/codedescribe.tex
@@ -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 @@ This doc regards to \tsobj[pkg]{codedescribe} version \PkgInfo{codedescribe}{ver
\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 @@ All \tsobj[code]{\tscode,\tsdemo} commands create a local group in which the \t
\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}
diff --git a/Master/texmf-dist/tex/latex/codedescribe/codedescribe.sty b/Master/texmf-dist/tex/latex/codedescribe/codedescribe.sty
index aa4b61ad5dd..05058dc183e 100644
--- a/Master/texmf-dist/tex/latex/codedescribe/codedescribe.sty
+++ b/Master/texmf-dist/tex/latex/codedescribe/codedescribe.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
{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
diff --git a/Master/texmf-dist/tex/latex/codedescribe/codelisting.sty b/Master/texmf-dist/tex/latex/codedescribe/codelisting.sty
index b4a939034d3..fa54237963e 100644
--- a/Master/texmf-dist/tex/latex/codedescribe/codelisting.sty
+++ b/Master/texmf-dist/tex/latex/codedescribe/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 !!!!
%%%