texlive[68116] Master/texmf-dist: jwjournal (30aug23)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 30 23:22:01 CEST 2023


Revision: 68116
          http://tug.org/svn/texlive?view=revision&revision=68116
Author:   karl
Date:     2023-08-30 23:22:01 +0200 (Wed, 30 Aug 2023)
Log Message:
-----------
jwjournal (30aug23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/jwjournal/README.md
    trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex
    trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex
    trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex
    trunk/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls

Modified: trunk/Master/texmf-dist/doc/latex/jwjournal/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jwjournal/README.md	2023-08-30 11:16:53 UTC (rev 68115)
+++ trunk/Master/texmf-dist/doc/latex/jwjournal/README.md	2023-08-30 21:22:01 UTC (rev 68116)
@@ -65,10 +65,10 @@
       The space(s) between `[Note]` and the text following it would be ignored.
     > You may also use `【` and `】`, which is especially useful when writing Chinese.
 3) Displayed images can be included via one of the following ways:
-    - `|| [<width>] {<image file name>}`: show image in the middle.
-    - `(( [<width>] {<image file name>}`: show image on the left.
-    - `)) [<width>] {<image file name>}`: show image on the right.
-    > The `[<width>]` is optional. Here `<width>` is a number like `0.75`, the unit is `\linewidth`. When `[<width>]` is not given, the width would be full `\linewidth`.
+    - `|| <⟨width⟩> {⟨image file name⟩}` or `|| {⟨image file name⟩} <⟨width⟩>`: show image in the middle.
+    - `(( <⟨width⟩> {⟨image file name⟩}` or `(( {⟨image file name⟩} <⟨width⟩>`: show image on the left.
+    - `)) <⟨width⟩> {⟨image file name⟩}` or `)) {⟨image file name⟩} <⟨width⟩>`: show image on the right.
+    > The `<⟨width⟩>` is optional. Here `⟨width⟩` is a number like `0.75`, the unit is `\linewidth`. When `<⟨width⟩>` is not given, the width would be full `\linewidth`.
 
 With a few more for icing on the cake:
 - `|`: The first vertical bar would be interpreted as `\hfill`. This allows you to write the title line as
@@ -96,7 +96,7 @@
   >> (Some remark)
   >> (Another remark)
   ```
-- `->` and `<-`: Skip or retrieve certain vertical space, by default half of `\baselineskip`. You may specify the exact spacing in the unit of `\baselineskip`: for example, `-> [0.3]` would be skipping `0.3\baselineskip`, while `<- [.75]` means retrieving `0.75\baselineskip`.
+- `->` and `<-`: Skip or retrieve certain vertical space, by default half of `\baselineskip`. You may specify the exact spacing in the unit of `\baselineskip`: for example, `-> <0.3>` would be skipping `0.3\baselineskip`, while `<- <.75>` means retrieving `0.75\baselineskip`.
 - `+++`: If a single sentence or a few words fall to the next page, you may write a `+++` before that entry to enlarge the current page by one line.
   > You may write this `+++` several times if necessary, but do make sure that the number of the `+` sign is a multiple of 3.
 - `===`: Three or more equal signs `=` would simply be ignored. This is for improving the readability of the code, allowing you to write your journal like:

Modified: trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex	2023-08-30 11:16:53 UTC (rev 68115)
+++ trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex	2023-08-30 21:22:01 UTC (rev 68116)
@@ -19,14 +19,14 @@
 
   图片这可以这样引入:
 
-  || [.4] {example-image-a}
+  || <.4> {example-image-a} % 或者 || {example-image-a} <.4>
   >> (图片的注释)
   >> (更多注释)
 
   也可以靠左或者靠右显示:
-  (( [.4] {example-image-a}
-  -> [.3] % 加入一点竖直间距,例如这里是 0.3\baselineskip
-  )) [.4] {example-image-a}
+  (( <.4> {example-image-a} % 或者 (( {example-image-a} <.4>
+  -> <.3> % 加入一点竖直间距,例如这里是 0.3\baselineskip
+  )) <.4> {example-image-a} % 或者 )) {example-image-a} <.4>
 
 
 

Modified: trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex	2023-08-30 11:16:53 UTC (rev 68115)
+++ trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex	2023-08-30 21:22:01 UTC (rev 68116)
@@ -16,14 +16,14 @@
 
   Images can be included via:
 
-  || [.4] {example-image-a}
+  || <.4> {example-image-a} % or || {example-image-a} <.4>
   >> (Remark on the image)
   >> (More remark...)
 
   You may also show the image on the left or on the right:
-  (( [.4] {example-image-a}
-  -> [.3] % add some vertical spacing, here is 0.3\baselineskip
-  )) [.4] {example-image-a}
+  (( <.4> {example-image-a} % or (( {example-image-a} <.4>
+  -> <.3> % add some vertical spacing, here is 0.3\baselineskip
+  )) <.4> {example-image-a} % or )) {example-image-a} <.4>
 
 
 

Modified: trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex	2023-08-30 11:16:53 UTC (rev 68115)
+++ trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex	2023-08-30 21:22:01 UTC (rev 68116)
@@ -18,14 +18,14 @@
 
   Les images peuvent être incluses via :
 
-  || [.4] {example-image-a}
+  || <.4> {example-image-a} % ou || {example-image-a} <.4>
   >> (Remarque sur l'image)
   >> (Plus de remarque...)
 
   Vous pouvez également afficher l'image à gauche ou à droite :
-  (( [.4] {example-image-a}
-  -> [.3] % ajouter un certain espace vertical, ici c'est 0.3\baselineskip
-  )) [.4] {example-image-a}
+  (( <.4> {example-image-a} % ou (( {example-image-a} <.4>
+  -> <.3> % ajouter un certain espace vertical, ici c'est 0.3\baselineskip
+  )) <.4> {example-image-a} % ou )) {example-image-a} <.4>
 
 
 

Modified: trunk/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls	2023-08-30 11:16:53 UTC (rev 68115)
+++ trunk/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls	2023-08-30 21:22:01 UTC (rev 68116)
@@ -12,7 +12,7 @@
 \NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplClass
   {jwjournal}
-  {2023/08/29} {}
+  {2023/08/30} {}
   {JW's journal class}
 
 \keys_define:nn { jwjournal }
@@ -119,15 +119,17 @@
     \end{description}
   }
 
-\NewDocumentCommand \JWJournalSkip { O{.5} }
+\NewDocumentCommand \JWJournalSkip { D<>{.5} }
   {
     % \vspace{#1\baselineskip}
-    \vskip#1\baselineskip
+    % \vskip#1\baselineskip
+    \par\vspace{#1\baselineskip}
   }
-\NewDocumentCommand \JWJournalBack { O{.5} }
+\NewDocumentCommand \JWJournalBack { D<>{.5} }
   {
     % \vspace{-#1\baselineskip}
-    \vskip-#1\baselineskip
+    % \vskip-#1\baselineskip
+    \par\vspace{-#1\baselineskip}
   }
 
 \newenvironment{JWJournalCompactCenter}
@@ -148,22 +150,61 @@
       #1
     \end{JWJournalCompactCenter}
   }
-\NewDocumentCommand \JWJournalShowImageCenter { O{1} m }
+\NewDocumentCommand \JWJournalShowImageCenter { D<>{*} m D<>{*} }
   {
+    \str_if_eq:nnTF { #1 } { * }
+      {
+        \str_if_eq:nnTF { #3 } { * }
+          {
+            \tl_set:Nn \l_tmpa_tl { 1 }
+          }
+          {
+            \tl_set:Nn \l_tmpa_tl { #3 }
+          }
+      }
+      {
+        \tl_set:Nn \l_tmpa_tl { #1 }
+      }
     \begin{JWJournalCenter}
-      \includegraphics[width=#1\linewidth]{#2}
+      \includegraphics[width= \tl_use:N \l_tmpa_tl \linewidth]{#2}
     \end{JWJournalCenter}
   }
-\NewDocumentCommand \JWJournalShowImageLeft { O{1} m }
+\NewDocumentCommand \JWJournalShowImageLeft { D<>{*} m D<>{*} }
   {
+    \str_if_eq:nnTF { #1 } { * }
+      {
+        \str_if_eq:nnTF { #3 } { * }
+          {
+            \tl_set:Nn \l_tmpa_tl { 1 }
+          }
+          {
+            \tl_set:Nn \l_tmpa_tl { #3 }
+          }
+      }
+      {
+        \tl_set:Nn \l_tmpa_tl { #1 }
+      }
     \begin{JWJournalLeft}
-      \includegraphics[width=#1\linewidth]{#2}
+      \includegraphics[width= \tl_use:N \l_tmpa_tl \linewidth]{#2}
     \end{JWJournalLeft}
   }
-\NewDocumentCommand \JWJournalShowImageRight { O{1} m }
+\NewDocumentCommand \JWJournalShowImageRight { D<>{*} m D<>{*} }
   {
+    \str_if_eq:nnTF { #1 } { * }
+      {
+        \str_if_eq:nnTF { #3 } { * }
+          {
+            \tl_set:Nn \l_tmpa_tl { 1 }
+          }
+          {
+            \tl_set:Nn \l_tmpa_tl { #3 }
+          }
+      }
+      {
+        \tl_set:Nn \l_tmpa_tl { #1 }
+      }
     \begin{JWJournalRight}
-      \includegraphics[width=#1\linewidth]{#2}
+      \includegraphics[width= \tl_use:N \l_tmpa_tl \linewidth]{#2}
     \end{JWJournalRight}
   }
 
@@ -193,14 +234,66 @@
           { ={3,} }
           { }
           \l_jwjournal_tmp_tl
+
+        \regex_match:nVT { ❄️ \ *? -> } \l_jwjournal_tmp_tl
+          {
+            \regex_match:nVTF { ❄️ \ *? -> \ *? < [\+\-\ ]*(\d+|\d*\.\d+)\ * > } \l_jwjournal_tmp_tl
+              {
+                \exp_args:Nno \regex_extract_once:nnN
+                  { ❄️ \ *? -> \ *? < ([\+\-\ ]*(?:\d+|\d*\.\d+)\ *) > }
+                  { \l_jwjournal_tmp_tl }
+                  \l_tmpa_seq
+                \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
+                \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
+                \tl_gput_right:Nn \g_jwjournal_content_tl { \JWJournalSkip }
+                \tl_gput_right:Nx \g_jwjournal_content_tl { < \l_tmpa_tl > }
+                \regex_replace_once:nnN
+                  { ❄️ \ *? -> \ *? < (?:[\+\-\ ]*(?:\d+|\d*\.\d+)\ *) > (.*)  }
+                  { ❄️ \1 }
+                  \l_jwjournal_tmp_tl
+              }
+              {
+                \tl_gput_right:Nn \g_jwjournal_content_tl { \JWJournalSkip }
+                \regex_replace_once:nnN
+                  { ❄️ \ *? -> \ *? (.*)  }
+                  { ❄️ \1 }
+                  \l_jwjournal_tmp_tl
+              }
+          }
         \regex_replace_all:nnN
           { -> }
           { \c{JWJournalSkip} }
           \l_jwjournal_tmp_tl
+        \regex_match:nVT { ❄️ \ *? <- } \l_jwjournal_tmp_tl
+          {
+            \regex_match:nVTF { ❄️ \ *? <- \ *? < [\+\-\ ]*(\d+|\d*\.\d+)\ * > } \l_jwjournal_tmp_tl
+              {
+                \exp_args:Nno \regex_extract_once:nnN
+                  { ❄️ \ *? <- \ *? < ([\+\-\ ]*(?:\d+|\d*\.\d+)\ *) > }
+                  { \l_jwjournal_tmp_tl }
+                  \l_tmpa_seq
+                \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
+                \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
+                \tl_gput_right:Nn \g_jwjournal_content_tl { \JWJournalBack }
+                \tl_gput_right:Nx \g_jwjournal_content_tl { < \l_tmpa_tl > }
+                \regex_replace_once:nnN
+                  { ❄️ \ *? <- \ *? < (?:[\+\-\ ]*(?:\d+|\d*\.\d+)\ *) > (.*)  }
+                  { ❄️ \1 }
+                  \l_jwjournal_tmp_tl
+              }
+              {
+                \tl_gput_right:Nn \g_jwjournal_content_tl { \JWJournalBack }
+                \regex_replace_once:nnN
+                  { ❄️ \ *? <- \ *? (.*)  }
+                  { ❄️ \1 }
+                  \l_jwjournal_tmp_tl
+              }
+          }
         \regex_replace_all:nnN
           { <- }
           { \c{JWJournalBack} }
           \l_jwjournal_tmp_tl
+
         \regex_replace_all:nnN
           { \|\| }
           { \c{JWJournalShowImageCenter} }
@@ -213,6 +306,7 @@
           { \)\) }
           { \c{JWJournalShowImageRight} }
           \l_jwjournal_tmp_tl
+
         \regex_replace_once:nnN
           { \| }
           { \c{hfill} }
@@ -228,8 +322,7 @@
         %   \l_jwjournal_tmp_tl
         \exp_args:Nno \regex_split:nnN { >> } { \l_jwjournal_tmp_tl } \l_tmpa_seq
         \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
-        \tl_clear:N \l_jwjournal_tmp_tl
-        \tl_put_right:NV \l_jwjournal_tmp_tl \l_tmpa_tl
+        \tl_set_eq:NN \l_jwjournal_tmp_tl \l_tmpa_tl
         \seq_map_inline:Nn \l_tmpa_seq
           {
             \tl_put_right:Nn \l_jwjournal_tmp_tl



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