summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls')
-rw-r--r--Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls84
1 files changed, 82 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls b/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls
index 7ba40e53e4c..2a57f1064b4 100644
--- a/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls
+++ b/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplClass
{jwjournal}
- {2023/10/01} {}
+ {2023/10/19} {}
{JW's journal class}
\keys_define:nn { jwjournal }
@@ -56,6 +56,7 @@
\colorlet { jwjournal-color-7 } { red!20!orange }
\colorlet { jwjournal-entry } { . }
+\colorlet { jwjournal-sep-line } { .!27!paper }
\NewDocumentCommand \JWJournalSeperator { O{jwjournal-entry!60!main-text} }
{
@@ -65,6 +66,14 @@
\enspace
}
+\NewDocumentCommand \JWJournalSepLine { O{.75pt} }
+ {
+ \vspace*{-.5\baselineskip}
+ \noindent
+ \hspace*{-\paperwidth}
+ \makebox[\linewidth]{\color{jwjournal-sep-line}\rule{4\paperwidth}{#1}}
+ }
+
\NewDocumentCommand \JWJournalEntry { m m }
{
\phantomsection
@@ -83,7 +92,17 @@
\begin{tcolorbox}[enhanced~jigsaw,
enlarge~left~by=-3.5mm, width=\textwidth+3.5mm,
colback=jwjournal-entry-background,
- boxrule=0pt, top=2pt, bottom=2pt, left=2.5mm, right=
+ boxrule=0pt,
+ top=
+ \bool_if:NTF \l__jwjournal_color_entry_bool
+ { 2pt }
+ { 0pt },
+ bottom=
+ \bool_if:NTF \l__jwjournal_color_entry_bool
+ { 2pt }
+ { 0pt },
+ left=2.5mm,
+ right=
\bool_if:NTF \l__jwjournal_color_entry_bool
{ 2mm }
{ -1mm },
@@ -252,6 +271,23 @@
\tl_use:N \g_jwjournal_content_tl
}
{}
+\NewDocumentCommand \jwjournaltext { +m }
+ {
+ \tl_gset:Nn \g_jwjournal_content_tl { #1 }
+ \jwjournal_parse_content:N \g_jwjournal_content_tl
+ \tl_use:N \g_jwjournal_content_tl
+ }
+\NewDocumentCommand \InputJournal { m }
+ {
+ \file_get:nnN { #1 } { } \l_tmpa_tl
+ \exp_args:No \jwjournaltext { \l_tmpa_tl }
+ }
+\NewDocumentCommand \IncludeJournal { m }
+ {
+ \clearpage
+ \InputJournal { #1 }
+ \clearpage
+ }
\tl_const:Nn \c_jwjournal_new_line_with_skip_tl { \\[.3\baselineskip] }
\bool_new:N \l_jwjournal_regex_no_more_match_bool
@@ -271,6 +307,40 @@
{ }
\l_jwjournal_tmp_tl
+ \regex_replace_all:nnN
+ { \:\:\: }
+ { \c{IncludeJournal} }
+ \l_jwjournal_tmp_tl
+ \regex_replace_all:nnN
+ { \:\: }
+ { \c{InputJournal} }
+ \l_jwjournal_tmp_tl
+
+ \regex_replace_all:nnN
+ { \#\#\#\#\+ }
+ { \c{subsubsection} }
+ \l_jwjournal_tmp_tl
+ \regex_replace_all:nnN
+ { \#\#\#\+ }
+ { \c{subsection} }
+ \l_jwjournal_tmp_tl
+ \regex_replace_all:nnN
+ { \#\#\+ }
+ { \c{section} }
+ \l_jwjournal_tmp_tl
+ \regex_replace_all:nnN
+ { \#\#\#\# }
+ { \c{subsubsection}\* }
+ \l_jwjournal_tmp_tl
+ \regex_replace_all:nnN
+ { \#\#\# }
+ { \c{subsection}\* }
+ \l_jwjournal_tmp_tl
+ \regex_replace_all:nnN
+ { \#\# }
+ { \c{section}\* }
+ \l_jwjournal_tmp_tl
+
\regex_match:nVT { ❄️ \ *? -> } \l_jwjournal_tmp_tl
{
\regex_match:nVTF { ❄️ \ *? -> \ *? < [\+\-\ ]*(\d+|\d*\.\d+)\ * > } \l_jwjournal_tmp_tl
@@ -407,6 +477,16 @@
}
}
+ \tl_put_right:Nn \l_jwjournal_tmp_tl { ❄️ }
+ \regex_match:nVT { ❄️ \ *? \-{3,} \ *? ❄️ } \l_jwjournal_tmp_tl
+ {
+ \regex_replace_once:nnN
+ { ❄️ \ *? \-{3,} \ *? }
+ { ❄️ \c{JWJournalSepLine} }
+ \l_jwjournal_tmp_tl
+ }
+ \regex_replace_once:nnN { ❄️ (.*) ❄️ } { ❄️ \1 } \l_jwjournal_tmp_tl
+
\regex_replace_once:nnN
{ ❄️ (\ *)? (\d{4}-\d{1,2}-\d{1,2}) (\ *)? (.*) }
{ \c{JWJournalEntry} {\2} {\4} }