diff options
author | Karl Berry <karl@freefriends.org> | 2023-08-31 21:41:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-08-31 21:41:03 +0000 |
commit | 66ca5c194aaf78a2958c039dcf01b6beed0184dc (patch) | |
tree | fa249b4e37567b9e59ec7b2aee532a8ed6089175 | |
parent | ada939a1043b21584b10cc7632bd26eda08f1bbe (diff) |
jwjournal (31aug23)
git-svn-id: svn://tug.org/texlive/trunk@68124 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/jwjournal/README.md | 54 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.pdf | bin | 70876 -> 115307 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex | 14 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.pdf | bin | 34389 -> 75218 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.pdf | bin | 35287 -> 77570 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex | 10 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls | 79 |
8 files changed, 123 insertions, 44 deletions
diff --git a/Master/texmf-dist/doc/latex/jwjournal/README.md b/Master/texmf-dist/doc/latex/jwjournal/README.md index 996d0376a0d..20f9f773071 100644 --- a/Master/texmf-dist/doc/latex/jwjournal/README.md +++ b/Master/texmf-dist/doc/latex/jwjournal/README.md @@ -13,7 +13,16 @@ Codewise, it is as simple as below: Today I visited the botanical garden! - [Food] And had ice-cream for lunch! + [Food] And had *ice cream* for lunch! + + >>> This botanical garden has a history of nearly two hundred years, take a look at this photo: + || <0.40> {example-image} + + (( <0.45> {example-image-a} + <- <5> + )) <0.50> {example-image-b} + <- <5> + (( <0.45> {example-image-c} ``` > It is also possible to write the date as `2023/01/01`. @@ -35,28 +44,34 @@ By the way, the conversion from plain date string like `2023-01-01` to natural l The structure of the document is very simple: ```latex -\documentclass[11pt, paperstyle=light yellow, color entry]{jwjournal} +\documentclass[11pt, paperstyle = light yellow, color entry]{jwjournal} +\UseLanguage{⟨language⟩} \begin{document} + + % Your journal + + \end{document} ``` -The options are: -- `month-day-year` or `day-month-year` for other date format -- `paperstyle = ...` adjusts the paper color, options include: lightyellow、yellow、parchment、green、lightgray、gray、nord、dark... -- `color entry` adds more color to the title of each entry -- `scroll` turns on the scroll mode and can generate a single-page pdf similar to a long screenshot +The available class options include: +- `month-day-year` or `day-month-year` for using other date format; +- `paperstyle = ...` adjusts the paper color, choices include: `light yellow`, `yellow`, `parchment`, `green`, `light gray`, `gray`, `nord`, `dark`... +- `color entry` adds more color to the title of each entry; +- `scroll` turns the scroll mode on, which generates a single-page pdf similar to a long screenshot. -And there are only three major syntaxes for the main text: +Here are the major syntaxes for your main text: 1) Title - - Any line begins with date like `2023-01-01` would be regard as the *Title* line. + - Any line begins with date like `2023-01-01` or `2023/01/01` would be regard as the *Title* line. - You may write the weather and/or location after the date. - Example: ``` - 2023-01-01 Sunny --- Apartment + 2023-01-01 Sunny | Apartment ``` -2) Note + > With the options `month-day-year` or `day-month-year`, you can also write date in the format `mm-dd-yyyy` or `dd-mm-yyyy`, respectively. You may refer to the English and French demo documents for examples. +1) Note - Any line begins with something like `[Note]` would be regard as the *Note* line. - Example: ``` @@ -64,10 +79,17 @@ And there are only three major syntaxes for the main text: ``` 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⟩}` 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. +1) Emphasis + - You may emphasize text as with Markdown: + - `*⟨text⟩*` is emphasizing; + - `**⟨text⟩**` is bolding; + - `***⟨text⟩***` is bolding and emphasizing. + - You may put text in a colored block via `>>>`, its usage is like the `>` in Markdown for blockquote. +1) Image + - Displayed images can be included via one of the following ways: + - `|| <⟨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: @@ -111,6 +133,8 @@ With a few more for icing on the cake: > You may also refer to the demo documents to see their behaviors in action. +> And don't forget that you are still using LaTeX! Thus if the provided syntax does not satisfy you, there are always LaTeX commands as a fallback. + Indentations are not important, but paragraphs need to be separated by a blank line. For the sake of readability, it is recommended to organize your text as one of the following ways: - with indentation: ``` diff --git a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.pdf b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.pdf Binary files differindex 40281336ade..7980506f1ef 100644 --- a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.pdf +++ b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.pdf diff --git a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex index 5ed5d235893..9cd0937d84d 100644 --- a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex +++ b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-cn.tex @@ -12,21 +12,23 @@ 在文中出现的日期和标注不会被识别: 2022-12-25、[标注]、【标注】,放心使用! - [体育] 一些关于体育赛事的事情 + [文本] 你可以使用*斜体*、**粗体**或者***两者结合***。 - 【学习】 % 【...】与 [...] 效果相同 - 一些关于学习的事情 + 【说明】 % 【...】与 [...] 效果相同 + 在一些特殊情况需要把星号用 \texttt{\{\}} 隔开:**像**{}***这***{}*样*。 - 图片这可以这样引入: + >>> 像这样可以把文本放在色彩框内。 - || <.4> {example-image-a} % 或者 || {example-image-a} <.4> + 图片可以这样引入: + + || <.4> {example-image} % 或者 || {example-image} <.4> >> (图片的注释) >> (更多注释) 也可以靠左或者靠右显示: (( <.4> {example-image-a} % 或者 (( {example-image-a} <.4> -> <.3> % 加入一点竖直间距,例如这里是 0.3\baselineskip - )) <.4> {example-image-a} % 或者 )) {example-image-a} <.4> + )) <.4> {example-image-b} % 或者 )) {example-image-b} <.4> diff --git a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.pdf b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.pdf Binary files differindex 04b98e63663..eeffdf0183c 100644 --- a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.pdf +++ b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.pdf diff --git a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex index 5a5d8740c9a..0fb357e3eea 100644 --- a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex +++ b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-en.tex @@ -10,20 +10,22 @@ Dates and annotations appearing in the text will not be recognized: 12/25/2022, [Note], so feel free to write these. - [Sports] something about sporting events. + [Text] You can write text in *italics*, **bold** or ***both***. - [Learning] something about learning. + [Remark] In some special cases, it would be necessary to separate the asterisks with~\texttt{\{\}}: **like**{}***this***{}*one*. + + >>> You can put text inside a colored block like this. Images can be included via: - || <.4> {example-image-a} % or || {example-image-a} <.4> + || <.4> {example-image} % or || {example-image} <.4> >> (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 - )) <.4> {example-image-a} % or )) {example-image-a} <.4> + )) <.4> {example-image-b} % or )) {example-image-b} <.4> diff --git a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.pdf b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.pdf Binary files differindex 7303b8b07e3..98da8d18979 100644 --- a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.pdf +++ b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.pdf diff --git a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex index 865402e2540..f83a5d4ae1e 100644 --- a/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex +++ b/Master/texmf-dist/doc/latex/jwjournal/jwjournal-demo-fr.tex @@ -12,20 +12,22 @@ 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 ! - [Sports] quelque chose sur les événements sportifs. + [Texte] Vous pouvez écrire votre texte en *italique*, **gras** ou ***les deux***. - [Apprendre] quelque chose sur l'apprentissage. + [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-a} % ou || {example-image-a} <.4> + || <.4> {example-image} % ou || {example-image} <.4> >> (Remarque sur l'image) >> (Plus de remarque...) Vous pouvez également afficher l'image à gauche ou à droite : (( <.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> + )) <.4> {example-image-b} % ou )) {example-image-b} <.4> diff --git a/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls b/Master/texmf-dist/tex/latex/jwjournal/jwjournal.cls index bf039931587..c178db4e59c 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/08/30} {} + {2023/08/31} {} {JW's journal class} \keys_define:nn { jwjournal } @@ -57,6 +57,14 @@ \colorlet { jwjournal-entry } { . } +\NewDocumentCommand \JWJournalSeperator { O{jwjournal-entry!60!main-text} } + { + \enspace + \tikz [x=.75ex,y=.75ex,line~width=.2ex,line~join=round,baseline=-.3ex] + \draw [#1] (0,.5) -- (.5,1) -- (1,.5) -- (.5,0) -- (0,.5) -- cycle; + \enspace + } + \NewDocumentCommand \JWJournalEntry { m m } { \skip_vertical:n { .5 \baselineskip } @@ -70,7 +78,7 @@ { \colorlet { jwjournal-entry-background } { paper } } - \begin{tcolorbox}[enhanced~jigsaw, breakable, + \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= @@ -84,15 +92,11 @@ \color {jwjournal-entry!30!main-text} } \ProjLibDate {#1} - \enspace - \tikz [x=.75ex,y=.75ex,line~width=.2ex,line~join=round,baseline=-.3ex] \draw [jwjournal-entry!60!main-text] (0,.5) -- (.5,1) -- (1,.5) -- (.5,0) -- (0,.5) -- cycle; - \enspace + \JWJournalSeperator{} \projlib_datetime_display_week_uppercase:n { #1 } \tl_if_blank:eF { #2 } { - \enspace - \tikz [x=.75ex,y=.75ex,line~width=.2ex,line~join=round,baseline=-.3ex] \draw [jwjournal-entry!60!main-text] (0,.5) -- (.5,1) -- (1,.5) -- (.5,0) -- (0,.5) -- cycle; - \enspace + \JWJournalSeperator{} #2 } \end{tcolorbox} @@ -100,11 +104,10 @@ } \RequirePackage { enumitem } -\setlist [ description ] { font = \normalfont\sffamily, leftmargin = 3em, topsep = 0pt } +\setlist [ description ] { font = \normalfont\sffamily, leftmargin = 3em, topsep = 0pt, labelsep = 1em } \RenewDocumentCommand \descriptionlabel { m } { - \skip_horizontal:n { \labelsep } - \makebox[\maxof{\width}{2.5em}]{ + \makebox[\maxof{\width}{2em}][l]{ \tcbox[enhanced~jigsaw, breakable, oversize, on~line, arc = .12em, outer~arc = .1em, colframe = jwjournal-entry, colupper=main-text, opacityback = 0, @@ -119,6 +122,26 @@ \end{description} } +\NewDocumentCommand \JWJournalNote { m } + { + \bool_if:NTF \l__jwjournal_color_entry_bool + { + \colorlet { jwjournal-note-background } { jwjournal-entry!3!paper } + } + { + \colorlet { jwjournal-note-background } { paper } + } + \begin{tcolorbox}[enhanced~jigsaw, breakable, + colback=jwjournal-note-background, + boxrule=0pt, top=2pt, bottom=2pt, left=1em-1mm, right= + \bool_if:NTF \l__jwjournal_color_entry_bool + { 2mm } + { -1mm }, + borderline~west={1mm}{0mm}{jwjournal-entry!90!main-text!60!paper}, frame~hidden] + #1 + \end{tcolorbox} + } + \NewDocumentCommand \JWJournalSkip { D<>{.5} } { % \vspace{#1\baselineskip} @@ -316,10 +339,36 @@ { \c{c_jwjournal_new_line_with_skip_tl} } \l_jwjournal_tmp_tl - % \regex_replace_all:nnN - % { >> (.*) } - % { \c{JWJournalCompactCenterText}\{\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 + + \regex_replace_once:nnN + { >>> \ *? (.*) } + { \c{JWJournalNote}\{\1\} } + \l_jwjournal_tmp_tl + \regex_replace_all:nnN + { \ *? >>> \ *? } + { } + \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_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 + % { \JWJournalNote { ####1 } } + % } + \exp_args:Nno \regex_split:nnN { >> } { \l_jwjournal_tmp_tl } \l_tmpa_seq \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl \tl_set_eq:NN \l_jwjournal_tmp_tl \l_tmpa_tl |