diff options
author | Norbert Preining <norbert@preining.info> | 2022-04-05 03:01:24 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-04-05 03:01:24 +0000 |
commit | a4e931576165d0a4a143915f4725399272e06fee (patch) | |
tree | ef5b6d71c2223b9f58e61fbb25423d4042430198 /macros/latex/contrib/projlib | |
parent | 7548e4d37c2aaefd32fe0a9bcd83f8e71326dde1 (diff) |
CTAN sync 202204050301
Diffstat (limited to 'macros/latex/contrib/projlib')
-rw-r--r-- | macros/latex/contrib/projlib/ProjLib.dtx | 200 | ||||
-rw-r--r-- | macros/latex/contrib/projlib/README.md | 21 |
2 files changed, 140 insertions, 81 deletions
diff --git a/macros/latex/contrib/projlib/ProjLib.dtx b/macros/latex/contrib/projlib/ProjLib.dtx index dd0b2e393f..03de30a0d0 100644 --- a/macros/latex/contrib/projlib/ProjLib.dtx +++ b/macros/latex/contrib/projlib/ProjLib.dtx @@ -20,77 +20,77 @@ %<*ProjLib> \ProvidesExplPackage {ProjLib} - {2022/03/28} {} + {2022/04/03} {} {Collective interface of the ProjLib toolkit} %</ProjLib> % %<*projlib-author> \ProvidesExplPackage {projlib-author} - {2022/03/28} {} + {2022/04/03} {} {Enhanced author information block} %</projlib-author> % %<*projlib-datetime> \ProvidesExplPackage {projlib-datetime} - {2022/03/28} {} + {2022/04/03} {} {Convert numeric date-time string to natural language} %</projlib-datetime> % %<*projlib-draft> \ProvidesExplPackage {projlib-draft} - {2022/03/28} {} + {2022/04/03} {} {Useful commands during draft stage} %</projlib-draft> % %<*projlib-font> \ProvidesExplPackage {projlib-font} - {2022/03/28} {} + {2022/04/03} {} {Font selection and configuration} %</projlib-font> % %<*projlib-language> \ProvidesExplPackage {projlib-language} - {2022/03/28} {} + {2022/04/03} {} {Multi-language configuration} %</projlib-language> % %<*projlib-logo> \ProvidesExplPackage {projlib-logo} - {2022/03/28} {} + {2022/04/03} {} {The ProjLib logo} %</projlib-logo> % %<*projlib-math> \ProvidesExplPackage {projlib-math} - {2022/03/28} {} + {2022/04/03} {} {Efficient math setup} %</projlib-math> % %<*projlib-paper> \ProvidesExplPackage {projlib-paper} - {2022/03/28} {} + {2022/04/03} {} {Configuration of the paper style} %</projlib-paper> % %<*projlib-theorem> \ProvidesExplPackage {projlib-theorem} - {2022/03/28} {} + {2022/04/03} {} {Configuration of theorem-like environments} %</projlib-theorem> % %<*projlib-titlepage> \ProvidesExplPackage {projlib-titlepage} - {2022/03/28} {} + {2022/04/03} {} {Commands for rendering the title page} %</projlib-titlepage> @@ -499,10 +499,20 @@ , month-year .code:n = { \tl_set:Nn \g__projlib_datetime_input_format_tl { day-month-year } } , day-month .code:n = { \tl_set:Nn \g__projlib_datetime_input_format_tl { day-month-year } } , only-year-month .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-year-month } } - , only-month-day .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-month-day } } - , only-year .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-year } } - , only-month .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-month } } - , only-day .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-day } } + , only~year~month .meta:n = { only-year-month } + , only year month .meta:n = { only-year-month } + , only-month-day .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-month-day } } + , only~month~day .meta:n = { only-month-day } + , only month day .meta:n = { only-month-day } + , only-year .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-year } } + , only~year .meta:n = { only-year } + , only year .meta:n = { only-year } + , only-month .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-month } } + , only~month .meta:n = { only-month } + , only month .meta:n = { only-month } + , only-day .code:n = { \tl_set:Nn \l__projlib_datetime_output_format_tl { only-day } } + , only~day .meta:n = { only-day } + , only day .meta:n = { only-day } , unknown .code:n = {} } @@ -2176,72 +2186,73 @@ } -\projlib_langauge_define_multilingual_text:Nn \projlib_draft_dnf_text +\projlib_langauge_define_multilingual_text:Nn \projlib_draft_DNF_text { - EN = To\ be\ finished , - FR = Pas\ encore\ fini , - DE = Nicht\ beendet , - IT = Per\ essere\ finito , - PT = Não\ terminou , - BR = Não\ terminou , - ES = Estar\ terminado , - CN = 这里尚未完成 , - TC = 這裡尚未完成 , - JP = 終わってない , - RU = Не\ закончен , + EN = To ~ be ~ finished , + FR = Pas ~ encore ~ fini , + DE = Nicht ~ beendet , + IT = Per ~ essere ~ finito , + PT = Não ~ terminou , + BR = Não ~ terminou , + ES = Estar ~ terminado , + CN = 这里尚未完成 , + TC = 這裡尚未完成 , + JP = 終わってない , + RU = Не ~ закончен , } -\projlib_langauge_define_multilingual_text:Nn \projlib_draft_dnf_report_text +\projlib_langauge_define_multilingual_text:Nn \projlib_draft_DNF_report_text { - EN = { Below\ is\ a\ list\ of\ outstanding\ items, - \ followed\ by\ the\ corresponding\ page\ numbers. } , - FR = { Voici\ la\ liste\ des\ éléments\ en\ suspens, - \ suivie\ des\ numéros\ de\ page\ correspondants. } , - DE = { Unten\ ist\ eine\ Liste\ der\ ausstehenden\ Posten, - \ gefolgt\ von\ den\ entsprechenden\ Seitenzahlen. } , - IT = { Qui\ sotto\ c'è\ una\ lista\ di\ voci\ in\ sospeso, - \ seguita\ dai\ numeri\ di\ pagina\ corrispondenti. } , - PT = { Abaixo\ está\ uma\ lista\ de\ itens\ pendentes, - \ seguida\ dos\ números\ de\ página\ correspondentes. } , - BR = { Abaixo\ está\ uma\ lista\ de\ itens\ pendentes, - \ seguida\ dos\ números\ de\ página\ correspondentes. } , - ES = { Aquí está\ la\ lista\ de\ elementos\ pendientes, - \ seguida\ de\ los\ números\ de\ página\ correspondientes. } , - CN = { 以下是未完成事项列表,括号内注明了对应的页码。 } , - TC = { 以下是未完成事項的列表,括號內註明了對應頁碼。 } , - JP = { 以下は、未解決の項目とそれに対応するページ番号の一覧です。 } , - RU = { Ниже\ приведен\ список\ невыполненных\ пунктов - \ с\ соответствующими\ номерами\ страниц\ в\ скобках. } , + EN = { Below ~ is ~ a ~ list ~ of ~ outstanding ~ items, ~ + followed ~ by ~ the ~ corresponding ~ page ~ numbers. } , + FR = { Voici ~ la ~ liste ~ des ~ éléments ~ en ~ suspens, ~ + suivie ~ des ~ numéros ~ de ~ page ~ correspondants. } , + DE = { Unten ~ ist ~ eine ~ Liste ~ der ~ ausstehenden ~ Posten, ~ + gefolgt ~ von ~ den ~ entsprechenden ~ Seitenzahlen. } , + IT = { Qui ~ sotto ~ c'è ~ una ~ lista ~ di ~ voci ~ in ~ sospeso, ~ + seguita ~ dai ~ numeri ~ di ~ pagina ~ corrispondenti. } , + PT = { Abaixo ~ está ~ uma ~ lista ~ de ~ itens ~ pendentes, ~ + seguida ~ dos ~ números ~ de ~ página ~ correspondentes. } , + BR = { Abaixo ~ está ~ uma ~ lista ~ de ~ itens ~ pendentes, ~ + seguida ~ dos ~ números ~ de ~ página ~ correspondentes. } , + ES = { Aquí está ~ la ~ lista ~ de ~ elementos ~ pendientes, ~ + seguida ~ de ~ los ~ números ~ de ~ página ~ correspondientes. } , + CN = { 以下是未完成事项列表,括号内注明了对应的页码。 } , + TC = { 以下是未完成事項的列表,括號內註明了對應頁碼。 } , + JP = { 以下は、未解決の項目とそれに対応するページ番号の一覧です。 } , + RU = { Ниже ~ приведен ~ список ~ невыполненных ~ пунктов ~ + с ~ соответствующими ~ номерами ~ страниц ~ в ~ скобках. } , } -\tl_new:c { projlib_draft_dnf_font } -\tl_gset:cn { projlib_draft_dnf_font } { \normalfont \ttfamily \bfseries \small } +\tl_new:c { projlib_draft_DNF_font } +\tl_gset:cn { projlib_draft_DNF_font } { \small \normalfont \bfseries \ttfamily \hyphenchar\font=`\-\spaceskip=.5em ~ plus ~ .5em\xspaceskip=.5em } -\definecolor { projlib_draft_dnf_color } { RGB } { 21, 122, 20 } +\definecolor { projlib_draft_DNF_color } { RGB } { 21, 122, 20 } -\newcounter { projlib_draft_dnf_counter } +\newcounter { projlib_draft_DNF_counter } -\tl_new:N \g__projlib_draft_dnf_report_tl +\tl_new:N \g__projlib_draft_DNF_report_tl -\NewDocumentCommand \dnf { D<>{} } +\NewDocumentCommand \DNF { D<>{} } { \noindent \group_begin: - \projlib_draft_dnf_font - \stepcounter { projlib_draft_dnf_counter } - \projlib_draft_plain_box:nn { projlib_draft_dnf_color } + \projlib_draft_DNF_font + \stepcounter { projlib_draft_DNF_counter } + \projlib_draft_plain_box:nn { projlib_draft_DNF_color } { - \projlib_draft_dnf_text + \projlib_draft_DNF_text \nobreakspace - \# \theprojlib_draft_dnf_counter + \# \theprojlib_draft_DNF_counter \tl_if_blank:nF { #1 } { \, : ~ } - #1 + \tl_trim_spaces:n { #1 } } \group_end: - \tl_gput_right:Nx \g__projlib_draft_dnf_report_tl + \tl_gput_right:Nx \g__projlib_draft_DNF_report_tl { + \noindent \# \, - \int_value:w \theprojlib_draft_dnf_counter + \int_value:w \theprojlib_draft_DNF_counter \c_space_tl \c_space_tl $\langle$ \skip_horizontal:n { 0.1em } @@ -2255,8 +2266,10 @@ \skip_horizontal:n { 0.1em } $\rangle$ \nobreakspace - \IfNoValueF { #1 } { : ~ } - #1 \newline + \exp_not:n { \tl_if_blank:nF { #1 } { : ~ } } + \exp_not:n { \tl_trim_spaces:n { #1 } } + \par \skip_vertical:n { -\parskip } + \skip_vertical:n { .15\baselineskip } } } @@ -2264,15 +2277,16 @@ { \hook_gput_code:nnn { enddocument } { projlib-draft } { - \tl_if_blank:VF \g__projlib_draft_dnf_report_tl + \tl_if_blank:VF \g__projlib_draft_DNF_report_tl { \clearpage - \pagestyle{empty} + \pagestyle { empty } + \color { projlib_draft_DNF_color } \noindent - \color { projlib_draft_dnf_color } - \projlib_draft_dnf_font - \projlib_draft_dnf_report_text \\[0.75\baselineskip] - \g__projlib_draft_dnf_report_tl + \projlib_draft_DNF_font + \projlib_draft_DNF_report_text + \par \bigskip + \g__projlib_draft_DNF_report_tl } } } @@ -3018,7 +3032,7 @@ { % #1 = command name (with backslash) % #2 = key-value name configuration \keyval_parse:nnn - {} + { \use_none:n } { \__projlib_langauge_define_multilingual_text_do:nnn { \cs_to_str:N #1 } } { #2 } \tl_gset:Nn #1 @@ -3041,6 +3055,14 @@ { \projlib_langauge_define_multilingual_text:Nn #1 { #2 } } + + +\PassOptionsToPackage { autostyle } { csquotes } +\RequirePackage { csquotes } + +\DeclareQuoteStyle { schinese } {“} {”} {‘} {’} +\DeclareQuoteStyle { tchinese } {“} {”} {‘} {’} +\DeclareQuoteStyle { japanese } {「} {」} {『} {』} %</projlib-language> % %<*projlib-logo> @@ -3379,6 +3401,42 @@ \projlib_math_define_shortcut:nnn { #1 } { #3 } { #2 } } } + + +\cs_new:Nn \__projlib_math_list_of_symbols_entry:nnnn + % #1 = column one width + % #2 = column two width + % #3 = symbol + % #4 = description + { + \noindent + \begin { tabular } { p{#1} p{#2} } + \parbox [t] { #1 } { #3 } & \parbox [t] { #2 } { #4 } + \end { tabular } + \par + \skip_vertical:n { -\parskip } + } + +\cs_new:Nn \projlib_math_list_of_symbols:nnn + % #1 = column one width + % #2 = column two width + % #3 = key-val list + { + \keyval_parse:nnn + { \use_none:n } + { \__projlib_math_list_of_symbols_entry:nnnn { #1 } { #2 } } + { #3 } + } + +\NewDocumentCommand \ProjLibListOfSymbols { O{0.17\textwidth} O{0.75\textwidth} m } + { + \projlib_math_list_of_symbols:nnn { #1 } { #2 } { #3 } + } + +\ProvideDocumentCommand \ListOfSymbols { O{0.17\textwidth} O{0.75\textwidth} m } + { + \projlib_math_list_of_symbols:nnn { #1 } { #2 } { #3 } + } %</projlib-math> % %<*projlib-paper> @@ -3594,7 +3652,7 @@ \cs_generate_variant:Nn \keyval_parse:nnn { nno } \keyval_parse:nno - { } + { \use_none:n } { \projlib_theorem_preset_theorem_style:nn } { \l__projlib_theorem_theorem_style_tl } diff --git a/macros/latex/contrib/projlib/README.md b/macros/latex/contrib/projlib/README.md index 3e927c0fb5..ab478f4771 100644 --- a/macros/latex/contrib/projlib/README.md +++ b/macros/latex/contrib/projlib/README.md @@ -4,10 +4,10 @@ # The `ProjLib` Toolkit -This bundle is dated 2022/03/28. Please note that the documentations are not yet up-to-date. - > **ProjLib** can be interpreted as "***Proj**ect **Lib**rary*" (in English), or as "***Proj**et **Lib**re*" (in French, meaning "*Free Project*"). +**This bundle is dated 2022/04/03. Please note that the documentations are not yet up-to-date.** + ## Introduction `ProjLib` is a collection of tools that help you write LaTeX document. With the main package `ProjLib` loaded (note that it is *case-sensitive*), you no longer need to manually configure the appropriate multilingual settings nor to set up the theorem-like environments. In addition, a series of auxiliary functionalities are introduced. @@ -31,31 +31,32 @@ The modules include: - `\thanks` can be written outside `\author`; - The `abstract` environment can be placed before `\maketitle`. 1. module `datetime` - *Convert numeric date-time string to natural language* - - Offering `\TheDate` and `\Thedate` to convert numeric date-time string to normal datetime format, with multi-language support (if the command names `\TheDate` or `\Thedate` are occupied, then one can switch to the longer version `\ProjLibDate` and `\ProjLibdate`). - - Offering `\ProjLibToday` and `\ProjLibToday` (with the module `language` enabled, `\today` is redefined into `\ProjLibToday`, and thus supports the arguments like `only-year-month`). + - `\TheDate` and `\Thedate` for converting numeric date-time string to natural language, with multi-language support (if the command names `\TheDate` or `\Thedate` are occupied, then one can switch to the longer version `\ProjLibDate` and `\ProjLibdate`). + - `\ProjLibToday` and `\ProjLibToday` (with the module `language` enabled, `\today` is redefined into `\ProjLibToday`, and thus supports the arguments like `only-year-month`). - Multiple input and output format available. 1. module `draft` - *Useful commands during draft stage* - - Offering `\dnf` for marking unfinished part. In addition, a report of all unfinished places shall be printed at the last of your document. + - `\DNF` for marking unfinished part. In addition, a report of all unfinished places shall be printed at the last of your document. 1. module `font` - *Font selection and configuration* - Supporting Palatino, Times, Garamond, Biolinum, Noto, etc. 1. module `language` - *Multi-language configuration* - - Offering `\UseLanguage`, `\UseOtherLanguage` for selecting languages, and `\AddLanguageSetting` for adding language-specific settings. - - Define multilingual text string with `\DefineMultilingualText`. + - `\UseLanguage`, `\UseOtherLanguage` for selecting languages, and `\AddLanguageSetting` for adding language-specific settings. + - `\DefineMultilingualText` for defining multilingual text strings. - Currently support Chinese (simplified and traditional), English, French, German, Italien, Japanese, Portuguese (European and Brazilian), Russian and Spanish. 1. module `logo` - *The ProjLib logo* - Draw the `ProjLib` logo in colorful or colorless fashion. 1. module `math` - *Efficient math setup* - - Offering `\DefineOperator` and `\DefineShortcut` for setting up math macros efficiently + - `\DefineOperator` and `\DefineShortcut` for setting up math macros efficiently + - `\ListOfSymbols` for printing list of symboks 1. module `paper` - *Configuration of the paper style* - Paper style configuration, with the themes `yellow`, `green`, `light gray`, `gray`, `dark`, etc. 1. module `theorem` - *Configuration of theorem-like environments* - - Set up theorem-like environments based on the package `create-theorem`, and in particular, support options `name as is` and `name as context` for referencing names + - `\CreateTheorem`, `\SetTheorem` and more: setting up theorem-like environments based on the package `create-theorem`, and in particular, supporting the modes `name as is` and `name as context` for referencing names - Support options `simple name` and `complex name` for referencing names - Preset environments include: `assertion`, `assumption`, `axiom`, `conclusion`, `conjecture`, `convention`, `corollary`, `definition`, `definition-proposition`, `definition-theorem`, `example`, `exercise`, `fact`, `hypothesis`, `lemma`, `notation`, `observation`, `postulate`, `problem`, `property`, `proposition`, `question`, `remark`, `theorem`, and the corresponding unnumbered version with an asterisk `*` in the name. 1. module `titlepage` - *Commands for rendering the title page* - Currently support two title page styles: `default` and `simple`. -> Since module `theorem.sty` (and thus `ProjLib`) uses `cleveref`, it should be loaded after `varioref` and `hyperref`. +> Since the module `theorem` uses `cleveref`, it should be loaded after `varioref` and `hyperref` (same for the main package `ProjLib`). ## How to get these files You can get the `.sty` files mentioned above simply by compiling `ProjLib.ins`: |