texlive[69162] Master/texmf-dist: jwjournal (18dec23)

commits+karl at tug.org commits+karl at tug.org
Mon Dec 18 21:56:39 CET 2023


Revision: 69162
          https://tug.org/svn/texlive?view=revision&revision=69162
Author:   karl
Date:     2023-12-18 21:56:39 +0100 (Mon, 18 Dec 2023)
Log Message:
-----------
jwjournal (18dec23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/jwjournal/README.md
    trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.pdf
    trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex
    trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.pdf
    trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex
    trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.pdf
    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-12-18 20:56:13 UTC (rev 69161)
+++ trunk/Master/texmf-dist/doc/latex/jwjournal/README.md	2023-12-18 20:56:39 UTC (rev 69162)
@@ -91,6 +91,11 @@
       - `(( <⟨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`.
+1) Code
+    > Due to the current method of implementation, it is unfortunate that one cannot directly insert source code in the document. There are some workarounds though, as described below.
+    - For *inline* code: you may simply write it between two backticks `` `⟨code⟩` ``, similar to the Markdown syntax. However, be aware that special characters need to be escaped, for example, `\` should be written as `\textbackslash`, `{` should be written as `\{`, `%` should be written as `\%`, etc.
+    - For *displayed* code: **this feature is not yet complete.**
+    <!-- - For *displayed* code: store the code into a separate file, and then use `== {⟨file name⟩}` to print it. You may also use an optional argument like `== [⟨language⟩] {⟨file name⟩}` to select the language of your code. -->
 1) Section
     - You may start a new (*unnumbered*)
       - section, via `## {⟨section title⟩}`;

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

Modified: trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex	2023-12-18 20:56:13 UTC (rev 69161)
+++ trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex	2023-12-18 20:56:39 UTC (rev 69162)
@@ -9,14 +9,17 @@
 \begin{document}
 
 
-2023-01-01 晴 | 地点
+2024-01-01 晴 | 地点
 
-  在文中出现的日期和标注不会被识别: 2022-12-25、[标注]、【标注】,放心使用!
+  在文中出现的日期和标注不会被识别: 2023-12-25、[标注]、【标注】,放心使用!
 
-  [文本] 你可以使用*斜体*、**粗体**或者***两者结合***。
+  [文本]
+    你可以使用*斜体*、**粗体**或者***两者结合***。
+    \\
+    数学模式下的星号不会被识别:
 
   【说明】 % 【...】与 [...] 效果相同
-  在一些特殊情况需要把星号用 \texttt{\{\}} 隔开:**像**{}***这***{}*样*。
+    在一些特殊情况需要把星号用 \texttt{\{\}} 隔开:**像**{}***这***{}*样*。
 
   >>> 像这样可以把文本放在色彩框内。
 
@@ -34,13 +37,15 @@
 
 ## {新篇章}
 
-2023-01-02
+2024-01-02
 不明(天气也可以写在第二行,看你的喜好)
 
   标签的颜色会根据日期改变,并且很长的文本会自动缩进:
 
-  [学习] 今天没有学习,但我写了很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多代码。
+  [学习] 今天没有学习,但我写了很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多很多代码: `inline code`.
 
+  [注意] 行内代码中的特殊字符需要转义。例如,`\textbackslash` 应写为 `\textbackslash textbackslash`, `\{` 应写为 `\textbackslash\{`, `\%` 应写为 `\textbackslash\%`,等等。
+
   -----
 
   三个或更多的\textquote{\texttt{-}}符号被放置在单独的段落中时,就会生成一条分割线 ---
@@ -67,19 +72,19 @@
 
 
 
-2023-01-03
+2024-01-03
 
   [注] 如果只写了日期,那么后面就不会有第二个分隔符。
 
 
 +++
-2023-01-04  多云
+2024-01-04  多云
 
   三个加号 \texttt{+++} 可以将当前页面显示的文字多出一行左右,有时候单独的一句话或者几个字落到了下一页,这时可以用它来改善一下显示的效果。
 
 
 
-2023-01-05    多云        —— 居家办公
+2024-01-05    多云        —— 居家办公
 =======================================
 
 也可以把代码排列成这样。
@@ -86,7 +91,7 @@
 
 
 ==========
-2023-01-06    晴朗        —— 居家办公
+2024-01-06    晴朗        —— 居家办公
 ==========
 
 或者这样……
@@ -93,19 +98,19 @@
 
 
 
-2023-01-07  多云
+2024-01-07  多云
 
   ...
 
 
 
-2023-01-08  多云
+2024-01-08  多云
 
   一周之后,又会回到之前的颜色
 
 
 
-2023-01-09  多云
+2024-01-09  多云
 
   ...
 

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

Modified: trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex	2023-12-18 20:56:13 UTC (rev 69161)
+++ trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex	2023-12-18 20:56:39 UTC (rev 69162)
@@ -7,11 +7,14 @@
 \begin{document}
 
 
-01/01/2023 Sunny | Location
+01/01/2024 Sunny | Location
 
-  Dates and annotations appearing in the text will not be recognized: 12/25/2022, [Note], so feel free to write these.
+  Dates and annotations appearing in the text will not be recognized: 12/25/2023, [Note], so feel free to write these.
 
-  [Text] You can write text in *italics*, **bold** or ***both***.
+  [Text]
+    You can write text in *italics*, **bold** or ***both***.
+    \\
+    Asterisks in math mode will not be recognized: $a^* b^*$.
 
   [Remark] In some special cases, it would be necessary to separate the asterisks with~\texttt{\{\}}: **like**{}***this***{}*one*.
 
@@ -23,6 +26,7 @@
   >> (Remark on the image)
   >> (More remark...)
 
+  +++
   You may also show the image on the left or on the right:
   (( <.4> {example-image-a} % or (( {example-image-a} <.4>
   -> <.3> % add some vertical spacing, here is 0.3\baselineskip
@@ -31,13 +35,15 @@
 
 ## {\textsc{A New Section}}
 
-01/02/2023
+01/02/2024
 Unknown (the weather can also be written on the second line, depending on your preference)
 
   The color of the labels shall change according to the date, and long text shall be automatically wrapped and indented:
 
-  [Note] I didn't study today, but I wrote many many many many many many many many many many many many code.
+  [Note] I didn't study today, but I wrote many many many many many many many many many many many many code: `inline code`.
 
+  [Attention] Special characters in inline code need to be escaped. For example, `\textbackslash` should be written as `\textbackslash textbackslash`, `\{` should be written as `\textbackslash\{`, `\%` should be written as `\textbackslash\%`, etc.
+
   -----
 
   Three or more \textquote{\texttt{-}} in a separate paragraph give you a separation line ---
@@ -64,19 +70,19 @@
 
 
 
-01/03/2023
+01/03/2024
 
   [Note] If only the date is written, then there would be no second separator after it.
 
 
 +++
-01/04/2023  Cloudy
+01/04/2024  Cloudy
 
   Three plus signs \texttt{+++} can enlarge the current page by about one line. Sometimes a single sentence or a few words fall to the next page --- in such cases, you may use it to improve the display effect.
 
 
 
-01-05-2023    Cloudy        --- Work at home
+01-05-2024    Cloudy        --- Work at home
 ============================================
 
 You may also organize your code like this.
@@ -83,7 +89,7 @@
 
 
 ==========
-01-06-2023    Sunny         --- Work at home
+01-06-2024    Sunny         --- Work at home
 ==========
 
 Or like this...
@@ -90,19 +96,19 @@
 
 
 
-01/07/2023  Cloudy
+01/07/2024  Cloudy
 
   ...
 
 
 
-01/08/2023  Cloudy
+01/08/2024  Cloudy
 
   A week later, the color goes back to the earlier one.
 
 
 
-01/09/2023  Cloudy
+01/09/2024  Cloudy
 
   ...
 

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

Modified: trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex	2023-12-18 20:56:13 UTC (rev 69161)
+++ trunk/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex	2023-12-18 20:56:39 UTC (rev 69162)
@@ -9,16 +9,20 @@
 \begin{document}
 
 
-01/01/2023 Ensoleillé | Lieu
+01/01/2024 Ensoleillé | Lieu
 
-  Les dates et annotations apparaissant dans le texte ne seront pas  détectées : 25/12/2022, [Note], alors n'hésitez pas à les écrire !
+  Les dates et annotations apparaissant dans le texte ne seront pas détectées : 25/12/2023, [Note], alors n'hésitez pas à les écrire !
 
-  [Texte] Vous pouvez écrire votre texte en *italique*, **gras** ou ***les deux***.
+  [Texte]
+    Vous pouvez écrire votre texte en *italique*, **gras** ou ***les deux***.
+    \\
+    Les astérisques en mode math ne seront pas détectées : $a^* b^*$.
 
   [Remarque] Dans certains cas particuliers, il serait nécessaire de séparer les astérisques par~\texttt{\{\}} : **comme**{}***cet***{}*exemple*.
 
   >>> Vous pouvez mettre votre texte dans un bloc coloré comme celui-ci.
 
+  +++
   Les images peuvent être incluses via :
 
   || <.4> {example-image} % ou || {example-image} <.4>
@@ -33,13 +37,15 @@
 
 ## {\textsc{Une Nouvelle Section}}
 
-02/01/2023
+02/01/2024
 Inconnu (la météo peut aussi être écrite sur la deuxième ligne, selon votre préférence)
 
   La couleur des étiquettes changera en fonction de la date, et le texte long sera automatiquement indenté :
 
-  [Note] Je n'ai pas étudié aujourd'hui, mais j'ai écrit beaucoup beaucoup beaucoup beaucoup beaucoup beaucoup beaucoup beaucoup beaucoup de code.
+  [Note] Je n'ai pas étudié aujourd'hui, mais j'ai écrit beaucoup beaucoup beaucoup beaucoup beaucoup beaucoup beaucoup de code: `code en ligne`.
 
+  [Attention] Les caractères spéciaux dans le code en ligne doivent être échappés. Par exemple, `\textbackslash` doit être écrit comme `\textbackslash textbackslash`, `\{` doit être écrit comme `\textbackslash\{`, `\%` doit être écrit comme `\textbackslash\%`, etc.
+
   -----
 
   Trois ou plus \textquote{\texttt{-}} signes dans un paragraphe isolé vous donnent une ligne de séparation ---
@@ -66,19 +72,19 @@
 
 
 
-03/01/2023
+03/01/2024
 
   [Note] Si seule la date est écrite, il n'y aura pas de deuxième séparateur après celle-ci.
 
 
 +++
-04/01/2023  Nuageux
+04/01/2024  Nuageux
 
   Trois signes plus \texttt{+++} peuvent agrandir la page courante d'environ une ligne. Parfois, une seule phrase ou quelques mots tombent sur la page suivante --- dans de tels cas, vous pouvez l'utiliser pour améliorer l'effet d'affichage.
 
 
 
-05-01-2023    Nuageux       --- Travail à domicile
+05-01-2024    Nuageux       --- Travail à domicile
 ==================================================
 
 Vous pouvez également organiser votre code comme ceci.
@@ -85,7 +91,7 @@
 
 
 ==========
-06-01-2023    Ensoleillé    --- Travail à domicile
+06-01-2024    Ensoleillé    --- Travail à domicile
 ==========
 
 Ou bien comme ceci...
@@ -92,19 +98,19 @@
 
 
 
-07/01/2023  Nuageux
+07/01/2024  Nuageux
 
   ...
 
 
 
-08/01/2023  Nuageux
+08/01/2024  Nuageux
 
   Une semaine plus tard, la couleur revient à la précédente...
 
 
 
-09/01/2023  Nuageux
+09/01/2024  Nuageux
 
   ...
 

Modified: trunk/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls	2023-12-18 20:56:13 UTC (rev 69161)
+++ trunk/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls	2023-12-18 20:56:39 UTC (rev 69162)
@@ -12,7 +12,7 @@
 \NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplClass
   {jwjournal}
-  {2023/11/03} {}
+  {2023/12/19} {}
   {JW's journal class}
 
 \keys_define:nn { jwjournal }
@@ -263,6 +263,22 @@
     \end{JWJournalRight}
   }
 
+\newtcbox \JWJournalCodebox
+  {
+    tcbox~raise~base,
+    nobeforeafter,
+    boxrule=.1pt, boxsep=1.5pt, arc=1pt,
+    left=.5pt, right=.5pt, top=0pt, bottom=0pt,
+    colframe=main-text!60!paper,
+    colback=main-text!3!paper,
+    fontupper=\small\normalfont\ttfamily,
+  }
+\NewDocumentCommand \JWJournalCode { m }
+  {
+    % \textcolor{emph-text}{\texttt{#1}}
+    \JWJournalCodebox{\vphantom{Äpgjy}#1}
+  }
+
 \tl_new:N \g_jwjournal_content_tl
 \NewDocumentEnvironment { jwjournal } { +b }
   {
@@ -295,6 +311,26 @@
 \seq_new:N \l_jwjournal_tmp_seq
 \tl_new:N \l_jwjournal_tmp_tl
 \cs_generate_variant:Nn \regex_split:nnN { nVN }
+\cs_new:Nn \jwjournal_regex_replace_case_once_skip_math:nN
+  {
+    \regex_replace_case_once:nN
+      {
+        { \$ (.*?) \$ } { \0 }
+        { \c{\(} (.*?) \c{\)} } { \0 }
+        { \c{\[} (.*?) \c{\]} } { \0 }
+        #1
+      } #2
+  }
+\cs_new:Nn \jwjournal_regex_replace_case_all_skip_math:nN
+  {
+    \regex_replace_case_all:nN
+      {
+        { \$ (.*?) \$ } { \0 }
+        { \c{\(} (.*?) \c{\)} } { \0 }
+        { \c{\[} (.*?) \c{\]} } { \0 }
+        #1
+      } #2
+  }
 \cs_new:Nn \jwjournal_parse_content:N
   {
     \regex_split:nVN { \c{par} } #1 \l_jwjournal_tmp_seq
@@ -342,6 +378,19 @@
           { \c{section}\* }
           \l_jwjournal_tmp_tl
 
+        \regex_replace_all:nnN
+          { \`\` }
+          { ❝ }
+          \l_jwjournal_tmp_tl
+        \regex_replace_all:nnN
+          { \` (.*?) \` }
+          { \c{JWJournalCode} {\1} }
+          \l_jwjournal_tmp_tl
+        \regex_replace_all:nnN
+          { ❝ }
+          { \`\` }
+          \l_jwjournal_tmp_tl
+
         \regex_match:nVT { ❄️ \ *? -> } \l_jwjournal_tmp_tl
           {
             \regex_match:nVTF { ❄️ \ *? -> \ *? < [\+\-\ ]*(\d+|\d*\.\d+)\ * > } \l_jwjournal_tmp_tl
@@ -401,40 +450,57 @@
           { \c{JWJournalBack} }
           \l_jwjournal_tmp_tl
 
-        \regex_replace_all:nnN
-          { \|\| }
-          { \c{JWJournalShowImageCenter} }
-          \l_jwjournal_tmp_tl
-        \regex_replace_all:nnN
-          { \(\( }
-          { \c{JWJournalShowImageLeft} }
-          \l_jwjournal_tmp_tl
-        \regex_replace_all:nnN
-          { \)\) }
-          { \c{JWJournalShowImageRight} }
-          \l_jwjournal_tmp_tl
+        % \regex_replace_all:nnN
+        %   { \|\| }
+        %   { \c{JWJournalShowImageCenter} }
+        %   \l_jwjournal_tmp_tl
+        % \regex_replace_all:nnN
+        %   { \(\( }
+        %   { \c{JWJournalShowImageLeft} }
+        %   \l_jwjournal_tmp_tl
+        % \regex_replace_all:nnN
+        %   { \)\) }
+        %   { \c{JWJournalShowImageRight} }
+        %   \l_jwjournal_tmp_tl
+        \jwjournal_regex_replace_case_all_skip_math:nN
+          {
+            { \|\| } { \c{JWJournalShowImageCenter} }
+            { \(\( } { \c{JWJournalShowImageLeft} }
+            { \)\) } { \c{JWJournalShowImageRight} }
+          } \l_jwjournal_tmp_tl
 
-        \regex_replace_once:nnN
-          { \| }
-          { \c{hfill} }
-          \l_jwjournal_tmp_tl
+        % \regex_replace_once:nnN
+        %   { \| }
+        %   { \c{hfill} }
+        %   \l_jwjournal_tmp_tl
+        \jwjournal_regex_replace_case_once_skip_math:nN
+          {
+            { \| } { \c{hfill} }
+          } \l_jwjournal_tmp_tl
+
         \regex_replace_all:nnN
           { [^\:]// }
           { \c{c_jwjournal_new_line_with_skip_tl} }
           \l_jwjournal_tmp_tl
 
-        \regex_replace_all:nnN
-          { \*\*\* (.*?) \*\*\* }
-          { \c{textbf} { \c{emph} {\1} } }
-          \l_jwjournal_tmp_tl
-        \regex_replace_all:nnN
-          { \*\* (.*?) \*\* }
-          { \c{textbf} {\1} }
-          \l_jwjournal_tmp_tl
-        \regex_replace_all:nnN
-          { \* (.*?) \* }
-          { \c{emph} {\1} }
-          \l_jwjournal_tmp_tl
+        % \regex_replace_all:nnN
+        %   { \*\*\* (.*?) \*\*\* }
+        %   { \c{textbf} { \c{emph} {\1} } }
+        %   \l_jwjournal_tmp_tl
+        % \regex_replace_all:nnN
+        %   { \*\* (.*?) \*\* }
+        %   { \c{textbf} {\1} }
+        %   \l_jwjournal_tmp_tl
+        % \regex_replace_all:nnN
+        %   { \* (.*?) \* }
+        %   { \c{emph} {\1} }
+        %   \l_jwjournal_tmp_tl
+        \jwjournal_regex_replace_case_all_skip_math:nN
+          {
+            { \*\*\* (.*?) \*\*\* } { \c{textbf} { \c{emph} { \1 } } }
+            { \*\* (.*?) \*\* } { \c{textbf} { \1 } }
+            { \* (.*?) \* } { \c{emph} { \1 } }
+          } \l_jwjournal_tmp_tl
 
         \regex_replace_once:nnN
           { >>> \ *? (.*) }
@@ -578,6 +644,15 @@
 
 \pagestyle { empty }
 
+\def\textasterisk{*}
+\def\textbacktick{`}
+\def\textcolon{:}
+\def\textequalsign{=}
+\def\textleftparen{(}
+\def\textrightparen{)}
+\def\textsharp{\#}
+\def\textvert{|}
+
 \endinput
 %%
 %% End of file `jwjournal.cls'.



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