summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/projlib/projlib-draft.sty
blob: bdfb2e9702a885fe6672d2801724e50ef7916b07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
%%
%% This is file `projlib-draft.sty',
%% generated with the docstrip utility.

%% Copyright (C) 2021-2022 by Jinwen XU
%% 
%% This is part of the ProjLib Toolkit.
%% 
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3c of this license or (at
%% your option) any later version. The latest version of this license is in
%% 
%%     http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\RequirePackage{l3keys2e}
\ProvidesExplPackage
  {projlib-draft}
  {2022/03/21} {}
  {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
    , no-report-page    .bool_set:N   = \l__projlib_draft_no_report_page_bool
    , no-report-page    .initial:n    = { false }
    , no~report~page    .bool_set:N   = \l__projlib_draft_no_report_page_bool
    , no report page    .bool_set:N   = \l__projlib_draft_no_report_page_bool
    , unknown           .code:n       = {}
  }
\ProcessKeysOptions { projlib-draft }

\RequirePackage { projlib-language }
\RequirePackage { xcolor }
\RequirePackage { ulem }

\cs_new_protected:Nn \projlib_draft_plain_box_lines:n
  {
    \bgroup\markoverwith{
      \rule[-0.6ex]{1pt}{1.25pt}
      \skip_horizontal:n { -1pt }
      \rule[1.8ex]{1pt}{1.25pt}
      \skip_horizontal:n { -.1pt }
    }\ULon { #1 }
  }

  \bool_if:NTF \l__projlib_draft_fast_bool
  {
    \tl_const:Nn \l_projlib_draft_plain_box_begin_tl { $[$ }
    \tl_const:Nn \l_projlib_draft_plain_box_after_tl { $]$ }
  }
  {
    \RequirePackage { tikz }
    \tl_const:Nn \l_projlib_draft_plain_box_begin_tl
      {
        \tikz[line~width=1.25pt,baseline=-.625pt]
          \draw (1ex,-.6ex) -- (.5ex,-.6ex)
                (0,-.1ex) arc [start~angle=180, end~angle=270, radius=.5ex]
                (0,-.1ex) -- (0,1.3ex)
                (0,1.3ex) arc [start~angle=180, end~angle=90, radius=.5ex]
                (0.5ex,1.8ex) -- (1ex,1.8ex);
      }
    \tl_const:Nn \l_projlib_draft_plain_box_after_tl
      {
        \tikz[line~width=1.25pt,baseline=-.625pt]
          \draw (-1ex,-.6ex) -- (-.5ex,-.6ex)
                (0,-.1ex) arc [start~angle=0, end~angle=-90, radius=.5ex]
                (0,-.1ex) -- (0,1.3ex)
                (0,1.3ex) arc [start~angle=0, end~angle=90, radius=.5ex]
                (-0.5ex,1.8ex) -- (-1ex,1.8ex);
      }
  }

\cs_new_protected:Nn \projlib_draft_plain_box:nn
  {
    \group_begin:
      \color{ #1 }
      \l_projlib_draft_plain_box_begin_tl
      \nobreak
      \hspace{-.5ex}
      \nobreak
      \projlib_draft_plain_box_lines:n { #2 }
      \nobreak
      \hspace{-.5ex}
      \nobreak
      \l_projlib_draft_plain_box_after_tl
    \group_end:
  }

\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 = Не\ закончен         ,
  }

\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 = { Ниже\ приведен\ список\ невыполненных\ пунктов
           \ с\ соответствующими\ номерами\ страниц\ в\ скобках.      }     ,
  }

\tl_new:c    { projlib_draft_dnf_font }
\tl_gset:cn  { projlib_draft_dnf_font }        { \normalfont \ttfamily \bfseries \small }

\definecolor { projlib_draft_dnf_color }       { RGB } {  21, 122,  20 }

\newcounter  { projlib_draft_dnf_counter }

\tl_new:N \g__projlib_draft_dnf_report_tl

\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_text
        \nobreakspace
        \# \theprojlib_draft_dnf_counter
        \tl_if_blank:nF { #1 } { \, : ~ }
        #1
      }
    \group_end:
    \tl_gput_right:Nx \g__projlib_draft_dnf_report_tl
      {
        \# \,
        \int_value:w \theprojlib_draft_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$
        \nobreakspace
        \IfNoValueF { #1 } { : ~ }
        #1 \\
      }
  }

\bool_if:NF \l__projlib_draft_no_report_page_bool
  {
    \hook_gput_code:nnn { enddocument } { projlib-draft }
      {
        \tl_if_blank:VF \g__projlib_draft_dnf_report_tl
          {
            \clearpage
            \pagestyle{empty}
            \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_langauge_define_multilingual_text:Nn \projlib_draft_blind_text_tl
  {
    , EN = {
              Hello,~here~is~some~text~without~a~meaning.~This~text~should~show~what~a~printed~text~will~look~like~at~this~place.~If~you~read~this~text,~you~will~get~no~information.~Really?~Is~there~no~information?~Is~there~a~difference~between~this~text~and~some~nonsense~like~``Huardest~gefburn''?~Not~at~all!~A~blind~text~like~this~gives~you~information~about~the~selected~font,~how~the~letters~are~written~and~an~impression~of~the~look.~This~text~should~contain~all~letters~of~the~alphabet~and~it~should~be~written~in~of~the~original~language.~There~is~no~need~for~special~content,~but~the~length~of~words~should~match~the~language.
           }
    , FR = {
              Bonjour,~voici~un~texte~sans~signification.~Ce~texte~doit~montrer~à~quoi~ressemble~un~texte~imprimé~à~cet~endroit.~Si~vous~lisez~ce~texte,~vous~n'obtiendrez~aucune~information.~Vraiment~?~Il~n'y~a~aucune~information~?~Y~a-t-il~une~différence~entre~ce~texte~et~une~absurdité~comme~«~Huardest~gefburn~»~?~Pas~du~tout~!~Un~texte~aveugle~comme~celui-ci~vous~donne~des~informations~sur~la~police~choisie,~la~façon~dont~les~lettres~sont~écrites~et~une~impression~de~l'apparence.~Ce~texte~doit~contenir~toutes~les~lettres~de~l'alphabet~et~être~écrit~dans~la~langue~d'origine.~Il~n'est~pas~nécessaire~de~prévoir~un~contenu~spécial,~mais~la~longueur~des~mots~doit~correspondre~à~la~langue.
           }
    , DE = {
              Hallo,~hier~ist~ein~Text~ohne~Bedeutung.~Dieser~Text~soll~zeigen,~wie~ein~gedruckter~Text~an~dieser~Stelle~aussehen~wird.~Wenn~Sie~diesen~Text~lesen,~werden~Sie~keine~Informationen~erhalten.~Wirklich?~Gibt~es~keine~Informationen?~Gibt~es~einen~Unterschied~zwischen~diesem~Text~und~irgendeinem~Blödsinn~wie~``Huardest~gefburn''?~Ganz~und~gar~nicht!~Ein~solcher~Blindtext~gibt~Ihnen~Informationen~über~die~gewählte~Schriftart,~wie~die~Buchstaben~geschrieben~sind~und~einen~Eindruck~vom~Aussehen.~Dieser~Text~sollte~alle~Buchstaben~des~Alphabets~enthalten~und~in~der~Originalsprache~geschrieben~sein.~Es~ist~kein~besonderer~Inhalt~erforderlich,~aber~die~Länge~der~Wörter~sollte~der~Sprache~entsprechen.
           }
    , IT = {
              Ciao,~qui~c'è~un~drafto~senza~significato.~Questo~drafto~dovrebbe~mostrare~come~sarà~un~drafto~stampato~in~questo~posto.~Se~leggete~questo~drafto,~non~otterrete~alcuna~informazione.~Davvero?~Non~c'è~nessuna~informazione?~C'è~una~differenza~tra~questo~drafto~e~qualche~sciocchezza~come~``Huardest~gefburn''?~Niente~affatto!~Un~drafto~cieco~come~questo~ti~dà~informazioni~sul~font~selezionato,~su~come~sono~scritte~le~lettere~e~un'impressione~dell'aspetto.~Questo~drafto~dovrebbe~contenere~tutte~le~lettere~dell'alfabeto~e~dovrebbe~essere~scritto~nella~lingua~originale.~Non~c'è~bisogno~di~contenuti~speciali,~ma~la~lunghezza~delle~parole~dovrebbe~corrispondere~alla~lingua.
           }
    , PT = {
              Olá,~aqui~está~um~texto~sem~significado.~Este~texto~deve~mostrar~como~será~um~texto~impresso~neste~local.~Se~ler~este~texto,~não~obterá~qualquer~informação.~A~sério?~Não~há~informação?~Há~alguma~diferença~entre~este~texto~e~alguns~disparates~como~"Huardest~gefburn"?~De~modo~algum!~Um~texto~cego~como~este~dá-lhe~informações~sobre~a~fonte~seleccionada,~como~as~letras~são~escritas~e~uma~impressão~do~aspecto.~Este~texto~deve~conter~todas~as~letras~do~alfabeto~e~deve~ser~escrito~na~língua~original.~Não~há~necessidade~de~conteúdo~especial,~mas~o~tamanho~das~palavras~deve~corresponder~à~língua.
           }
    , BR = {
              Olá,~aqui~está~um~texto~sem~sentido.~Este~texto~deve~mostrar~como~será~um~texto~impresso~neste~lugar.~Se~você~ler~este~texto,~você~não~obterá~nenhuma~informação.~É~mesmo?~Não~há~nenhuma~informação?~Há~alguma~diferença~entre~este~texto~e~alguns~disparates~como~"Huardest~gefburn"?~De~jeito~nenhum!~Um~texto~cego~como~este~lhe~dá~informações~sobre~a~fonte~selecionada,~como~as~letras~são~escritas~e~uma~impressão~da~aparência.~Este~texto~deve~conter~todas~as~letras~do~alfabeto~e~deve~ser~escrito~no~idioma~original.~Não~há~necessidade~de~conteúdo~especial,~mas~o~tamanho~das~palavras~deve~corresponder~ao~idioma.
           }
    , ES = {
              Hola,~aquí~hay~un~texto~sin~significado.~Este~texto~debe~mostrar~cómo~se~verá~un~texto~impreso~en~este~lugar.~Si~lees~este~texto,~no~obtendrás~ninguna~información.~¿En~serio?~¿No~hay~información?~¿Hay~alguna~diferencia~entre~este~texto~y~alguna~tontería~como~``Huardest~gefburn''?~¡Para~nada!~Un~texto~oculto~como~este~le~brinda~información~sobre~la~fuente~seleccionada,~cómo~se~escriben~las~letras~y~una~impresión~de~la~apariencia.~Este~texto~debe~contener~todas~las~letras~del~alfabeto~y~debe~estar~escrito~en~el~idioma~original.~No~hay~necesidad~de~contenido~especial,~pero~la~longitud~de~las~palabras~debe~coincidir~con~el~idioma.
           }
    , CN = {
              你好,这里有一些没有意义的文字。 此文本应显示打印文本在此位置的外观。 如果你阅读这段文字,你将不会得到任何信息。 真的没有信息吗? 这段文字和诸如 “劳仑衣普桑,认至将指点效则机,最你更枝” 或者 “想极整月正进好志次回总般,段然取向使张规军证回,世市总李率英茄持伴” 之类的废话有区别吗? 一点都没有! 这样的一段文本会给你提供关于所选字体的信息、字母的书写方式以及对外观的印象。 该文本应包含字母表中的所有字母,并且应使用原始语言编写。 不需要特别的内容,但字长要与语言相匹配。
           }
    , TC = {
              你好,這裡有一些沒有意義的文字。此文本應顯示打印文本在此位置的外觀。如果你閱讀這段文字,你將不會得到任何信息。真的沒有信息嗎?這段文字和諸如 “勞崙衣普桑,認至將指點效則機,最你更枝” 或者 “想極整月正進好志次回總般,段然取向使張規軍證回,世市總李率英茄持伴” 之類的廢話有區別嗎?一點都沒有!這樣的一段文本會給你提供關於所選字體的信息、字母的書寫方式以及對外觀的印象。該文本應包含字母表中的所有字母,並且應使用原始語言編寫。不需要特別的內容,但字長要與語言相匹配。
           }
    , JP = {
              こんにちは、ここに意味のないテキストがあります。 このテキストは、この場所で印刷されたテキストがどのように見えるかを示す必要があります。 このテキストを読んでも、情報は得られません。 本当に? 情報はありませんか? このテキストと「アでニンはすミ」のようなナンセンスとの間に違いはありますか? 全くない! このようなブラインドテキストは、選択したフォント、文字の書き方、外観の印象に関する情報を提供します。 このテキストにはアルファベットのすべての文字が含まれている必要があり、元の言語で書かれている必要があります。 特別なコンテンツは必要ありませんが、単語の長さは言語と一致している必要があります。
           }
    , RU = {
              Здравствуйте,~вот~какой-то~текст~без~смысла.~Этот~текст~должен~показывать,~как~будет~выглядеть~печатный~текст~в~этом~месте.~Если~вы~прочитаете~этот~текст,~вы~не~получите~никакой~информации.~Действительно?~Нет~информации?~Есть~ли~разница~между~этим~текстом~и~какой-то~чепухой~вроде~``Бзостачщв~дрероих''?~Нисколько!~Слепой~текст,~подобный~этому,~дает~вам~информацию~о~выбранном~шрифте,~о~том,~как~написаны~буквы,~и~о~впечатлении~от~внешнего~вида.~Этот~текст~должен~содержать~все~буквы~алфавита~и~должен~быть~написан~на~языке~оригинала.~В~специальном~содержании~нет~необходимости,~но~длина~слов~должна~соответствовать~языку.
           }
  }

\cs_new:Nn \projlib_draft_blind_text:n
  {
    \int_set:Nn \l_tmpa_int { #1 }
    \int_do_until:nNnn { \l_tmpa_int } = { 0 }
      {
        \projlib_draft_blind_text_tl
        \c_space_tl
        \int_add:Nn \l_tmpa_int { -1 }
      }
  }

\hook_gput_code:nnn { begindocument/before } { projlib-draft }
  {
    \ProvideDocumentCommand \blindtext { O{} }
      {
        \tl_if_blank:nTF { #1 }
          {
            \projlib_draft_blind_text_tl
          }
          {
            \projlib_draft_blind_text:n { #1 }
          }
      }
  }

\endinput
%%
%% End of file `projlib-draft.sty'.