From 7a8d1925127ad121a8f591db931524f9b8eacb93 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 28 Feb 2022 03:02:40 +0000 Subject: CTAN sync 202202280302 --- .../contrib/projlib/new-modules/projlib-draft.sty | 140 +++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 macros/latex/contrib/projlib/new-modules/projlib-draft.sty (limited to 'macros/latex/contrib/projlib/new-modules/projlib-draft.sty') diff --git a/macros/latex/contrib/projlib/new-modules/projlib-draft.sty b/macros/latex/contrib/projlib/new-modules/projlib-draft.sty new file mode 100644 index 0000000000..6c7fe818c7 --- /dev/null +++ b/macros/latex/contrib/projlib/new-modules/projlib-draft.sty @@ -0,0 +1,140 @@ +\NeedsTeXFormat{LaTeX2e}[2020-10-01] +\RequirePackage{l3keys2e} +\ProvidesExplPackage + {projlib-draft} + {2022/02/24} {} + {Useful commands during draft stage} + +\keys_define:nn { projlib-draft } + { + , draft .bool_set:N = \l__projlib_draft_fast_bool + , draft .initial:n = { false } + , fast .bool_set:N = \l__projlib_draft_fast_bool + , unknown .code:n = {} + } +\ProcessKeysOptions { projlib-draft } + +\RequirePackage { projlib-language } +\RequirePackage { xcolor } + +\bool_if:NTF \l__projlib_draft_fast_bool + { + \NewDocumentCommand \projlib_draft_plain_box { O{-paper} m } + { + \group_begin: + \color { #1 } + \dim_set:Nn \fboxsep { 1.5pt } + \dim_set:Nn \fboxrule { 1.5pt } + \fbox { #2 } + \group_end: + } + } + { + \PassOptionsToPackage { many } { tcolorbox } + \RequirePackage { tcolorbox } + \NewTCBox \projlib_draft_plain_box { O{-paper} } + { + enhanced~jigsaw, breakable, + on~line, arc = 1.2pt, outer~arc = 1pt, + colframe = #1, colupper = #1, opacityback = 0, + boxsep = 1pt, boxrule = 1.2pt, + left = 1pt, right = 1pt, top = 0pt, bottom = 0pt, + } + } + +\projlib_langauge_define_multilingual_text:Nn \__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 = Не\ закончен , + } + +\projlib_langauge_define_multilingual_text:Nn \__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 = { Ниже\ приведен\ список\ невыполненных\ пунктов + \ с\ соответствующими\ номерами\ страниц\ в\ скобках. } , + } + +\tl_new:c { __dnf_font } +\tl_gset:cn { __dnf_font } { \normalfont \ttfamily \bfseries \small } + +\definecolor { __dnf_color } { RGB } { 21, 122, 20 } + +\newcounter { __dnf_counter } + +\tl_new:N \g__projlib_draft_dnf_report_tl + +\NewDocumentCommand \dnf { d<> } + { + \noindent + \projlib_draft_plain_box [ __dnf_color ] + { + \stepcounter { __dnf_counter } + \__dnf_font + \__dnf_text + \c_space_tl + \# \the__dnf_counter + \IfNoValueF { #1 } { \, : ~ #1 } + \tl_gput_right:Nx \g__projlib_draft_dnf_report_tl + { + \# \, + \int_value:w \the__dnf_counter + \c_space_tl \c_space_tl + $\langle$ + \skip_horizontal:n { 0.1em } + \cs_if_exist:cTF { hyperlink } + { + \exp_not:N \hyperlink { page.\thepage } { \thepage } + } + { + \thepage + } + \skip_horizontal:n { 0.1em } + $\rangle$ + \c_space_tl + \IfNoValueF { #1 } { : ~ #1 } + \\ + } + } + } + +\hook_gput_code:nnn { enddocument } { projlib-draft } + { + \tl_if_blank:VF \g__projlib_draft_dnf_report_tl + { + \clearpage \noindent + \color { __dnf_color } + \__dnf_font + \__dnf_report_text \\[0.75\baselineskip] + \g__projlib_draft_dnf_report_tl + } + } + +\endinput +%% +%% End of file `projlib-draft.sty'. -- cgit v1.2.3