-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlatex.db
More file actions
4544 lines (4171 loc) · 304 KB
/
latex.db
File metadata and controls
4544 lines (4171 loc) · 304 KB
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[article]
tex_output = mydoc.tex
tex = \documentclass{article}
\begin{document}
Hello.
\end{document}
[hzbeamer]
description = The hzbeamer class is available from https://github.com/YiHoze/HzGuide.
tex_output = mydoc.tex
tex = documentclass[10pt,flier=false,hangul=true]{hzbeamer}
\usepackage{csquotes}
\MakeOuterQuote{"} %%"
\title{}
\author{}
\institute{}
\date{}
\begin{document}
\begin{frame}[fragile, allowframebreaks=1]{}
Hello.
\end{frame}
\end{document}
[hzguide]
description = The hzguide class is available from https://github.com/YiHoze/HzGuide.
tex_output = mydoc.tex
tex = \documentclass[Noto]{hzguide}
\LayoutSetup{}
\begin{document}
Hello.
\end{document}
[memoir]
tex_output = mydoc.tex
tex = \documentclass{memoir}
\usepackage{fontspec}
\begin{document}
Hello.
\end{document}
[oblivoir]
tex_output = mydoc.tex
tex = \documentclass{oblivoir}
\usepackage{fapapersize}
\usefapapersize{*,*,30mm,*,30mm,*}
\begin{document}
Hello.
\end{document}
[manual]
description = Use this template to write a manual such as user guide.
This requires the hzguide class, which is available from https://github.com/YiHoze/HzGuide.
compiler = -w
tex_output = manual.tex
tex = \documentclass[10pt, openany, english, template]{hzguide}
\LayoutSetup{}
\HeadingSetup{chapterstyle=tandh}
\setsecnumdepth{chapter}
\SectionNewpageOn
\DecolorHyperlinks*[blue]
\ChapterContentsEnable(5)
\CoverSetup{
FrontLogoImage = {alertsymbol},
BackLogoImage = {alertsymbol},
ProductImage = {uncertain},
title = {Product X},
DocumentType = {User Guide},
revision = {Rev. 1},
note = {Keep this manual for later use.},
manufacturer = Manufacturer,
address = Seoul
}
\begin{document}
\frontmatter*
\FrontCover
\tableofcontents
\mainmatter*
\chapter{Introduction}\tplpara
\section{Features}\tpllist
\section{Package Items}\tplimagetable
\section{Specifications}\tplspectables
\chapter{Safety}
\section{General Precautions}\tpllist[itemize][itemize]
\section{Tools}\tplimagetable
\section{Safety Gear}\tplimagetable
\chapter{Installation}
\section{Installation Requirements}\tpllist
\section{Installing X}\tplprocedure[5]
\section{Checking X}\tplprocedure
\section{Starting X}\tpllist*
\chapter{Operation}\tpltopics
\chapter{Maintenance}
\section{Precautions for Maintenance}\tpllist
\section{Scheduled Inspection}\tpllist
\chapter{Troubleshooting}\tplproblems
\chapter{Warranty}
\section{Warranty Coverage}\tplpara*
\section{Limitation of Liability}\tplpara*\tpllist
\section{Contact Information}\tplpara*
\appendix
\chapter{Technical Information}\tplspectables
\chapter{Glossary}\tpllist[terms]
\BackCover
\end{document}
[album]
description = This template generates an album which contains the image files (jpg, png, pdf) gathered from the current directory.
This requires the hzguide class, which is available from https://github.com/YiHoze/HzGuide.
usage: mytex.py album -s IMAGE_SCALE
defaults: 1
image_list = image_list.txt
compiler = -c
tex_output = album.tex
placeholders = 1
defaults = 1
tex =
```\documentclass{hzguide}
```
```\LayoutSetup{ulmargin=15mm, lrmargin=15mm}
```\HeadingSetup{article}
```
```\begin{document}
```\MakeAlbum[\1]{image_list.txt}
```%% use \MakeAlbum* to hide image names.
```\end{document}
[merge]
description = Use this template to merge multiple PDF files different from one another in paper size.
However, this template would not be needed but cpdf would be adequate in most cases. For example:
cpdf.exe -scale-to-fit "5.5in 8.5in" foo.pdf -o out.pdf
cpdf.exe -scale-to-fit "176mm 250mm" A4.pdf -o B5_1.pdf
cpdf.exe -scale-to-fit "176mm 250mm" A5.pdf -o B5_2.pdf
cpdf.exe -merge B5_1.pdf B5_2.pdf -o B5.pdf
usage: mytex.py merge -s PAPER_WIDTH PAPER_HEIGHT TARGET_PDF_FILES
defaults: "210mm, 297mm, foo,..."
placeholders = 3
defaults = 210mm, 297mm, foo,...
tex_output = merged.tex
tex =
```\documentclass{minimal}
```
```\usepackage[a4paper]{geometry}
```\geometry{paperwidth=\1, paperheight=\2, margin={0pt, 0pt}}
```\usepackage{graphicx}
```
```\ExplSyntaxOn
```\sys_if_engine_pdftex:T { \pdfminorversion=6 }
```
```\NewDocumentCommand \mergepdf { m }
```{
``` \bool_gset_false:N \g_tmpa_bool %% Not to break the last page
``` \clist_set:Nn \l_tmpa_clist { #1 }
``` \int_set:Nn \l_tmpa_int { \clist_count:N \l_tmpa_clist }
``` \int_step_inline:nn { \l_tmpa_int }
``` {
``` \clist_pop:NN \l_tmpa_clist \l_tmpa_tl
``` \int_compare:nT { ##1 == \l_tmpa_int }
``` {
``` \bool_gset_true:N \g_tmpa_bool
``` }
``` \fetchpage{ \l_tmpa_tl }
``` }
```}
```
```\int_new:N \g_lastximage_int
```\NewDocumentCommand \lastpageofpdf { m }
```{
``` \get_last_page_of_pdf:nN { #1 } \g_lastximage_int
```}
```
```\cs_new_nopar:Npn \get_last_page_of_pdf:nN #1 #2
```{
``` \str_case_e:nn { \c_sys_engine_str }
``` {
``` { xetex } {
``` \int_gset:Nn #2 { \xetex_pdfpagecount:D "#1" }
``` }
``` { pdftex } {
``` \pdfximage{#1}
``` \int_gset:Nn #2 { \pdflastximagepages }
``` }
``` { luatex } {
``` \saveimageresource { #1 }
``` \int_gset:Nn #2 { \lastsavedimageresourcepages }
``` }
``` }
```}
```
```\NewDocumentCommand \fetchpage { m }
```{
``` \lastpageofpdf{#1.pdf}
``` \int_step_inline:nn { \g_lastximage_int }
``` {
``` \mbox{}\vfill
``` \centering{\includegraphics[width=\paperwidth, page=##1]{#1}}
``` \vfill
``` \bool_if:NTF \g_tmpa_bool
``` {
``` \int_compare:nT { ##1 < \g_lastximage_int }
``` {
``` \break
``` }
``` }{
``` \break
``` }
``` }
```}
```\ExplSyntaxOff
```
```\begin{document}
```\mergepdf{\3}
```\end{document}
[permute]
description = Use this template to permute letters
usage: mytex.py permute -s LETTERS
defaults: adei
compiler = -L -c
tex_output = permute.tex
placeholders = 1
defaults = adei
tex =
```\documentclass{article}
```\usepackage{kotex}
```\ExplSyntaxOn
```\tl_new:N \l_out_tl
```\NewDocumentCommand \PermuteWord { m }
```{
``` \v_permute_word:nno { #1 } { 1 } { \tl_count:n { #1 } }
```}
```\cs_new:Npn \v_permute_word:nnn #1 #2 #3
```{
``` \int_compare:nTF { #2 == #3 }
``` {
``` \v_print_swapped_word:n { #1 }
``` }
``` {
``` \int_step_inline:nnn { #2 } { #3 }
``` {
``` \v_tlswap_fn:nnnN { #2 } { ##1 } { #1 } \l_out_tl
``` \v_permute_word:Von \l_out_tl { \int_eval:n { #2 + 1 } } { #3 }
``` }
``` }
```}
```\cs_generate_variant:Nn \v_permute_word:nnn { Von, nno }
```\cs_new:Npn \v_tlswap_fn:nnnN #1 #2 #3 #4
```{
``` \tl_clear:N #4
``` \tl_set:Nx \l_tmpa_tl { #3 }
```
``` \int_step_inline:nn { \tl_count:N \l_tmpa_tl }
``` {
``` \int_case:nnF { ##1 }
``` {
``` { #1 } { \tl_put_right:Nx #4 { \tl_item:Nn \l_tmpa_tl { #2 } } }
``` { #2 } { \tl_put_right:Nx #4 { \tl_item:Nn \l_tmpa_tl { #1 } } }
``` }
``` {
``` \tl_put_right:Nx #4 { \tl_item:Nn \l_tmpa_tl { ##1 } }
``` }
``` }
```}
```\cs_new:Npn \v_print_swapped_word:n #1
```{
``` \mbox{ #1 }
``` \space\space
```}
```\ExplSyntaxOff
```\setlength\parindent{0pt}
```\begin{document}
```\PermuteWord{\1}
```\end{document}
[lotto]
description = Use this template to pick lotto numbers randomly.
usage: mytex.py lotto -s "WEEKS, FREQUENCY"
defaults: 8, 5
compiler = -L -c
tex_output = lotto.tex
placeholders = 2
defaults = 8, 5
tex = ```
```\documentclass[10pt, twocolumn]{article}
```\usepackage[a5paper,margin=2cm]{geometry}
```\usepackage{luacode}
```\usepackage{tikz}
```
```\NewDocumentCommand{\lottoBall}{m}{%%
``` \luaexec{
``` tex.print(string.format("\\definecolor{ball}{RGB}{\%%d, \%%d, \%%d}",
``` math.random(0, 255),
``` math.random(0, 255),
``` math.random(0, 255))
``` )
``` }%%
``` \tikz\node[
``` circle,shade,draw=white,thin,inner sep=1pt,
``` ball color=ball,
``` text width=1em,
``` font=\sffamily,text badly centered,white
``` ]{#1};%%
```}
```
```\begin{luacode}
```function drawLotto()
``` local m, n = 6, 45
``` local balls, tmps = {}, {}
```
``` for i = n-m+1, n do
``` local drawn = math.random(i)
``` if not tmps[drawn] then
``` tmps[drawn] = drawn
``` else
``` tmps[i] = i
``` drawn = i
``` end
``` balls[\#balls+1] = drawn
``` end
``` table.sort(balls)
``` return balls
```end
```
```function getNextSaturday(date)
``` local fiducialTimeStamp, daysUntilSaturday, nextSaturdayStamp
``` local dateTable = {}
``` if date ~= nil then
``` for i in date:gmatch("[^-]+") do
``` table.insert(dateTable, tonumber(i))
``` end
``` end
``` if date == nil or \#dateTable < 3 then
``` fiducialTimeStamp = os.time()
``` else
``` fiducialTimeStamp = os.time{year=dateTable[1], month=dateTable[2], day=dateTable[3]}
``` end
``` daysUntilSaturday = (6 - os.date("\%%w", fiducialTimeStamp) + 7) \%% 7
``` nextSaturdayStamp = fiducialTimeStamp + 86400 * daysUntilSaturday
``` return nextSaturdayStamp
```end
```
```function lottoPlan(tickets, weeks, fromWhatDate)
``` local tickets = tickets or 5
``` local weeks = weeks or 8
``` local fromWhatDate = fromWhatDate
```
``` local nextSaturdayStamp = getNextSaturday(fromWhatDate)
``` for i=1, weeks do
``` local nextSaturday = os.date("\%%Y-\%%m-\%%d", (nextSaturdayStamp + 86400 * (i-1) * 7))
``` tex.print("\\subsubsection*{", nextSaturday, "}")
``` for j=1, tickets do
``` local lotto = drawLotto()
``` for _, v in ipairs(lotto) do
``` tex.print("\\lottoBall{", v, "}")
``` end
``` if j < tickets then
``` tex.print("\\newline")
``` end
``` end
``` end
```end
```\end{luacode}
```
```\setlength\parindent{0pt}
```\raggedbottom
```
```\begin{document}
```%% \luaexec{lottoPlan()}
```\luaexec{lottoPlan(5, 52, "2024-01-01")}
```\end{document}
[tys]
description = Use this template to convert numbers to ancient Chinese numerals.
The Apple Symbols font is required.
usage: mytex.py tys -s NUMBERS
defaults: "12.86,302.9534,-8276.1,5.1064,389.56"
compiler = -X -c
tex_output = tys.tex
placeholders = 1
defaults = 12.86,302.9534,-8276.1,5.1064,389.56
tex = \documentclass[a4paper]{article}
\usepackage{tys}
\begin{document}
\Tys{\1}
\end{document}
style_output = tys.sty
style =
```\RequirePackage{fontspec}
```\RequirePackage{xcolor}
```\RequirePackage{cancel}
```\RequirePackage{varwidth}
```
```\providecommand\disablekoreanfonts{}
```
```\ExplSyntaxOn
```\keys_define:nn { tys }
```{
``` tysfont .tl_set:N = \l_tys_font_tys_tl,
``` otherfont .tl_set:N = \l_tys_font_other_tl,
``` fontsize .tl_set:N = \l_tys_font_size_tl,
``` charwidth .dim_set:N = \l_tys_char_width_dim,
``` decimalsymbol .tl_set:N = \l_tys_decimal_symbol_tl,
``` zerosymbol .tl_set:N = \l_tys_zero_symbol_tl,
``` linespacing .tl_set:N = \l_tys_linespacing_tl,
``` poscolor .tl_set:N = \l_tys_positive_color_tl,
``` negcolor .tl_set:N = \l_tys_negative_color_tl,
```}
```
```\NewDocumentCommand \TysSetup { m }
```{
``` \keys_set:nn { tys }{ #1 }
```}
```
```\bool_new:N \l_tys_minus_bool
```\bool_new:N \l_tys_before_decimal_bool
```\bool_new:N \l_tys_after_decimal_bool
```\bool_new:N \l_tys_horizon_bool
```\tl_new:N \l_tys_absolute_tl
```\int_new:N \l_tys_decimal_position_int
```\int_new:N \l_tys_digits_before_decimal_int
```\int_new:N \l_tys_digits_after_decimal_int
```\int_new:N \l_tys_cnt_int
```\int_new:N \l_tys_digit_int
```\int_new:N \l_tys_space_int
```
```\NewDocumentCommand \Tys { o >{\SplitList{,}} m }
```{
``` \group_begin:
``` \IfValueT {#1} {
``` \keys_set:nn { tys }{ #1 }
``` }
``` \begin{varwidth}{\linewidth}
``` \disablekoreanfonts
``` \setlength\parindent{0pt}
``` \tl_set:Nn \baselinestretch {\l_tys_linespacing_tl}
``` \int_zero:N \l_tys_decimal_position_int
``` \int_zero:N \l_tys_digits_before_decimal_int
``` \int_zero:N \l_tys_digits_after_decimal_int
``` \ProcessList{#2}{ \tys_get_decimal_position:n }
``` \ProcessList{#2}{ \tys_process:n }
``` \vspace{-\baselineskip}
``` \end{varwidth}
``` \group_end:
```}
```
```\cs_new:Npn \tys_get_decimal_position:n #1
```{
``` \exp_args:Nx \tl_if_eq:nnTF { \tl_head:n {#1} }{-}
``` {
``` \tl_set:Nn \l_tys_absolute_tl { \tl_tail:n {#1} }
``` }{
``` \tl_set:Nn \l_tys_absolute_tl {#1}
``` }
``` \int_zero:N \l_tys_cnt_int
``` \exp_args:Nx \tl_map_inline:nn { \l_tys_absolute_tl }
``` {
``` \int_incr:N \l_tys_cnt_int
``` \tl_if_eq:nnT {##1}{.}
``` {
``` \int_compare:nT { \l_tys_decimal_position_int < \l_tys_cnt_int }
``` {
``` \int_set:Nn \l_tys_decimal_position_int { \l_tys_cnt_int }
``` }
``` }
``` }
```}
```
```\cs_new:Npn \tys_process:n #1
```{
``` \fp_compare:nTF { #1 < 0 }
``` {
``` \bool_set_true:N \l_tys_minus_bool
``` }{
``` \bool_set_false:N \l_tys_minus_bool
``` }
``` \exp_args:Nx \tl_if_eq:nnTF { \tl_head:n {#1} }{-}
``` {
``` \tl_set:Nn \l_tys_absolute_tl { \tl_tail:n {#1} }
``` }{
``` \tl_set:Nn \l_tys_absolute_tl {#1}
``` }
```
``` \int_zero:N \l_tys_cnt_int
``` \exp_args:Nx \tl_map_inline:nn { \l_tys_absolute_tl }
``` {
``` \int_incr:N \l_tys_cnt_int
``` \tl_if_eq:nnT {##1}{.}
``` {
``` \int_set:Nn \l_tys_space_int { \l_tys_decimal_position_int - \l_tys_cnt_int }
``` }
``` }
``` \int_step_inline:nnnn {1}{1}{ \l_tys_space_int } { \hspace*{\l_tys_char_width_dim} }
``` \exp_args:Nx \tys_convert:n { \l_tys_absolute_tl }
```}
```
```\cs_new:Npn \tys_convert:n #1
```{
``` \bool_if:NTF \l_tys_minus_bool
``` {
``` \color{\l_tys_negative_color_tl}
``` }{
``` \color{\l_tys_positive_color_tl}
``` }
``` \tys_get_digit_numbers:n {#1}
``` \int_if_even:nTF { \l_tys_digits_before_decimal_int }
``` {
``` \bool_set_true:N \l_tys_horizon_bool
``` }{
``` \bool_set_false:N \l_tys_horizon_bool
``` }
``` \int_set:Nn \l_tys_cnt_int { \l_tys_digits_before_decimal_int }
``` \tl_map_inline:nn {#1}
``` {
``` \tl_if_eq:nnTF {##1}{.}
``` {
``` \fontspec{\l_tys_font_other_tl}
``` \l_tys_font_size_tl
``` \l_tys_decimal_symbol_tl
``` \bool_set_true:N \l_tys_horizon_bool
``` }{
``` \bool_if:NTF \l_tys_horizon_bool
``` {
``` \tyschar*{##1}
``` \bool_set_false:N \l_tys_horizon_bool
``` }{
``` \int_compare:nTF { \l_tys_cnt_int = 1 }
``` {
``` \bool_if:NTF \l_tys_minus_bool
``` { \tyschar|{##1} }
``` { \tyschar{##1} }
``` }{
``` \tyschar{##1}
``` }
``` \bool_set_true:N \l_tys_horizon_bool
``` }
``` }
``` \int_decr:N \l_tys_cnt_int
``` }
``` \newline
```}
```
```\cs_new:Npn \tys_get_digit_numbers:n #1
```{
``` \bool_set_true:N \l_tys_before_decimal_bool
``` \bool_set_false:N \l_tys_after_decimal_bool
``` \int_zero:N \l_tys_cnt_int
``` \tl_map_inline:nn {#1}
``` {
``` \int_incr:N \l_tys_cnt_int
``` \tl_if_eq:nnT {##1}{.}
``` {
``` \int_zero:N \l_tys_cnt_int
``` \bool_set_false:N \l_tys_before_decimal_bool
``` \bool_set_true:N \l_tys_after_decimal_bool
``` }
``` \bool_if:NT \l_tys_before_decimal_bool
``` {
``` \int_set:Nn \l_tys_digits_before_decimal_int { \l_tys_cnt_int }
``` }
``` \bool_if:NT \l_tys_after_decimal_bool
``` {
``` \int_set:Nn \l_tys_digits_after_decimal_int { \l_tys_cnt_int }
``` }
``` }
```}
```
```%% 1D360 = 119648 : 1, 100, ...
```%% 1D369 = 119657 : 10, 1000, ...
```\NewDocumentCommand \tyschar { s t{|} m }
```{
``` \group_begin:
``` \l_tys_font_size_tl
``` \tl_if_eq:nnTF {#3}{0}
``` {
``` \fontspec{\l_tys_font_other_tl}
``` \makebox[\l_tys_char_width_dim]{
``` \l_tys_zero_symbol_tl
``` }
``` }{
``` \IfBooleanTF {#1}
``` {
``` \int_set:Nn \l_tys_digit_int { #3 + 119656 }
``` }{
``` \int_set:Nn \l_tys_digit_int { #3 + 119647 }
``` }
``` \fontspec{\l_tys_font_tys_tl}
``` \makebox[\l_tys_char_width_dim]{
``` \IfBooleanTF {#2}
``` {
``` \cancel{\char"\int_to_Hex:n{\l_tys_digit_int} }
``` }{
``` \char"\int_to_Hex:n{\l_tys_digit_int}
``` }
``` }
``` }
``` \group_end:
```}
```\ExplSyntaxOff
```
```\TysSetup{
``` linespacing=1,
``` tysfont={Apple Symbols},
``` otherfont={Arial},
``` fontsize=\normalsize,
``` charwidth=0.5em,
``` decimalsymbol=.,
``` zerosymbol={\char"25CB}, %%"
``` poscolor=black,
``` negcolor=black
```}
[leaflet]
description = Use this template to impose multiple pages in a sheet.
However, this template would not be needed but the pdfpages package would be adequate in most cases. For example:
\includepdf[pages={1-3, 12, 4, 5}, nup=3x2]{foo.pdf}
usage: mytex.py leaflet -s "TARGET_PDF, COLUMNS, LAST_PAGE"
defalts: "foo.pdf, 3, 12"
tex_output = myleaflet.tex
placeholders = 3
defaults = foo.pdf, 3, 12
tex =
```\documentclass{minimal}
```
```\usepackage{graphicx}
```\usepackage[a4paper]{geometry}
```\usepackage{pdfpages}
```
```\setlength\fboxsep{0pt}
```\setlength\parindent{0pt}
```
```\ExplSyntaxOn
```\tl_new:N \leaflet_target_file_tl
```\int_new:N \leaflet_logic_number
```\int_new:N \leaflet_real_number
```\int_new:N \leaflet_back_position
```\dim_new:N \leaflet_vspace_dim
```\keys_define:nn { leaflet }
```{
``` scale .tl_set:N = \leaflet_scale_tl,
``` column .int_set:N = \leaflet_column_int,
``` last .int_set:N = \leaflet_last_page_int,
``` hspace .dim_set:N = \leaflet_hspace_dim,
``` vspace .code:n = { \dim_set:Nn \leaflet_vspace_dim { #1 -\baselineskip - 0.01pt} },
``` frame .bool_set:N = \leaflet_frame_bool,
```}
```
```\NewDocumentCommand \LeafletSetup { m }
```{
``` \keys_set:nn { leaflet } {#1}
```}
```
```\cs_new:Npn \leaflet_impose:n #1
```{
``` \hspace{\leaflet_hspace_dim}
``` \bool_if:NTF \leaflet_frame_bool
``` { \fbox{\includegraphics[scale=\leaflet_scale_tl, page=#1]{\leaflet_target_file_tl}} }
``` { \includegraphics[scale=\leaflet_scale_tl, page=#1]{\leaflet_target_file_tl} }
``` \int_compare:nTF { \int_mod:nn {\leaflet_logic_number}{\leaflet_column_int} = 0 }
``` {
``` \int_compare:nT { \leaflet_logic_number < \leaflet_last_page_int }
``` { \vspace{\leaflet_vspace_dim} \newline }
``` }{
``` \hspace{\leaflet_hspace_dim}
``` }
```}
```
```\NewDocumentCommand \LeafletImpose { s O{} m }
```{
``` \LeafletSetup{#2}
``` \tl_set:Nn \leaflet_target_file_tl {#3}
```
``` \int_compare:nTF { \leaflet_last_page_int = 4 }
``` {
``` \int_set:Nn \leaflet_back_position {1}
``` }{
``` \int_set:Nn \leaflet_back_position { \leaflet_column_int + 1 }
``` }
```
``` \int_do_until:nn { \leaflet_logic_number = \leaflet_last_page_int }
``` {
``` \int_incr:N \leaflet_logic_number
``` \int_incr:N \leaflet_real_number
``` \IfBooleanT {#1}
``` {
``` \int_compare:nT { \leaflet_logic_number = \leaflet_back_position }
``` {
``` \leaflet_impose:n { \leaflet_last_page_int }
``` \int_incr:N \leaflet_logic_number
``` }
``` }
``` \leaflet_impose:n { \leaflet_real_number }
``` }
```}
```\ExplSyntaxOff
```
```\geometry{
``` papersize={464mm, 440mm},
``` layoutsize={444mm, 420mm},
``` margin={0pt, 0pt},
``` layoutoffset={10mm, 10mm},
``` showcrop
```}
```
```\LeafletSetup{
``` frame=false,
``` scale=1,
``` hspace=0pt,
``` vspace=0pt
```}
```
```\begin{document}
```\LeafletImpose*[column=\2, last=\3]{\1}
```%%\includepdf[pages={1-3, 12, 4, 5}, nup=3x2]{\1}
```%%\includepdf[pages={6-11}, nup=3x2]{\1}
```\end{document}
[lettercolor]
description = Use this template to apply gradient or random colors to letters.
Applying different colors to jamo requires lualatex and the colorjamo package, which is available from https://github.com/dohyunkim/colorjamo
usage: mytex.py lettercolor -s FONT
default: "Noto Serif KR"
compiler = -L
tex_output = lettercolor.tex
placeholders = 1
defaults = Noto Serif KR
tex =
\documentclass{article}
\usepackage{lettercolor}
\setlength\parskip{.5\baselineskip}
\setlength\parindent{0pt}
\begin{document}
\LetterColorSetup{
letters = 5,
font = \bfseries,
foreground = orange,
background = blue,
grad-continue = true,
grad-RGB = FF0000,
grad-step = 3,
cho = FF0000,
jung = 00FF00,
jong = 0000FF
}
\subsection*{글자 색을 서서히 바꾸기}
\begin{LetterColor}[effect=letter, transition=gradient]
I am happy to join with you today in what will go down in history as the greatest demonstration for freedom in the history of our nation.
우리 역사에서 자유를 위한 가장 훌륭한 시위가 있던 날로 기록될 오늘 이 자리에 여러분과 함께하게 된 것을 기쁘게 생각합니다.
\end{LetterColor}
\subsection*{글자 색을 아무렇게나 바꾸기}
\begin{LetterColor}[effect=letter, transition=random]
Five score years ago, a great American, in whose symbolic shadow we stand today, signed the Emancipation Proclamation. This momentous decree came as a great beacon light of hope to millions of Negro slaves who had been seared in the flames of withering injustice. It came as a joyous daybreak to end the long night of their captivity.
백 년 전, 위대한 어느 미국인이 노예해방령에 서명을 했습니다. 지금 우리가 서 있는 이곳이 바로 그 자리입니다. 그 중대한 선언은 불의의 불길에 시들어가고 있던 수백만 흑인 노예들에게 희망의 횃불로 다가왔습니다. 그것은 그 긴 속박의 밤을 끝낼 흥겨운 새벽으로 왔습니다.
\end{LetterColor}
\subsection*{단어의 첫자만 색칠하기}
\begin{LetterColor}[effect=initial, transition=none]
I am happy to join with you today in what will go down in history as the greatest demonstration for freedom in the history of our nation.
우리나라 역사상 자유를 위한 가장 위대한 시위가 있었던 날로서 역사에 기록될 오늘 나는 여러분과 함께 하게 되어 행복합니다.
\end{LetterColor}
\subsection*{첫자 색을 서서히 바꾸기}
\begin{LetterColor}[effect=initial, transition=gradient]
Five score years ago, a great American, in whose symbolic shadow we stand today, signed the Emancipation Proclamation.
백년 전, 오늘 우리가 서있는 자리의 상징적 그림자의 주인공인, 한 위대한 미국인이, 노예해방선언문에 서명하였습니다.
\end{LetterColor}
\subsection*{첫자 색을 아무렇게나 바꾸기}
\begin{LetterColor}[effect=initial, transition=random]
This momentous decree came as a great beacon light of hope to millions of Negro slaves who had been seared in the flames of withering injustice.
그 중대한 법령은 억압적 불평등의 불길에 타들어가던 수백만 흑인 노예들에게 위대한 희망의 횃불로서 다가왔습니다.
\end{LetterColor}
\subsection*{글자를 공에 넣기}
\begin{LetterColor}[effect=ball, transition=none, foreground=yellow, font=\sffamily\bfseries]
It came as a joyous daybreak to end the long night of their captivity.
그 법령은 그들의 길었던 구속의 밤을 종식하는 기쁨의 새벽이었습니다.
\end{LetterColor}
\subsection*{글자 색과 공 색을 서서히 바꾸기}
\begin{LetterColor}[effect=ball, transition=gradient, font=\sffamily\bfseries]
But one hundred years later, the Negro still is not free.
그러나 백년이 지난 후에도, 흑인들은 여전히 자유롭지 못합니다.
\end{LetterColor}
\subsection*{글자 색과 공 색을 아무렇게나 바꾸기}
\begin{LetterColor}[effect=ball, transition=random, font=\sffamily\bfseries]
One hundred years later, the life of the Negro is still sadly crippled by the manacles of segregation and the chains of discrimination.
백년이 지난 후에도, 분리의 수갑과 차별의 쇠사슬에 의해 흑인들의 삶은 여전히 슬픈 불구의 상태입니다.
\end{LetterColor}
\subsection*{다섯 자 이상인 단어만 색칠하기}
\begin{LetterColor}[effect=count, letters=5, transition=none]
One hundred years later, the Negro lives on a lonely island of poverty in the midst of a vast ocean of material prosperity.
백년이 지난 후에도, 물질적 번영이라는 거대한 대양의 한가운데 홀로 떨어진 빈곤의 섬에서 흑인들은 살아가고 있습니다.
\end{LetterColor}
\subsection*{네 자 이상인 단어의 색을 서서히 바꾸기}
\begin{LetterColor}[effect=count, letters=4, transition=gradient, grad-step=5, grad-continue=false, font=\itshape\bfseries]
One hundred years later, the Negro is still languished in the corners of American society and finds himself an exile in his own land.
백년이 지난 후에도, 흑인들은 미국사회의 한 구석에서 여전히 풀이 죽고 자신의 땅에서 유배당한 자신을 보게 됩니다.
\end{LetterColor}
\LetterColorSetup{
words={자유, 권리, 정의, 헌법, 민주주의, freedom, right, justice, liberty, Constitution, democracy}
}
\subsection*{특정 단어들을 색칠하기: 자유, 권리, ..., freedom, right, ...}
\begin{LetterColor}[effect=word, transition=none, foreground=blue]
And so we’ve come here today to dramatize a shameful condition.
그래서 이 수치스런 상황을 알리고 바꾸고자 우리는 오늘 이 자리에 나온 것입니다.
In a sense we’ve come to our nation’s capital to cash a check.
어떤 의미로는 수표를 현금으로 바꾸기 위해서 우리는 우리나라의 수도에 온 것입니다.
When the architects of our republic wrote the magnificent words of the Constitution and the Declaration of Independence, they were signing a promissory note to which every American was to fall heir.
우리나라를 건국한 사람들은 헌법과 독립선언문에 숭고한 단어들을 써넣었으며, 모든 미국인들이 상속받게 될 약속어음에 서명하였습니다.
This note was a promise that all men, yes, black men as well as white men, would be guaranteed the “unalienable Rights” of “Life, Liberty and the pursuit of Happiness.”
그 약속어음은 모든 사람들에게, 예, 백인들처럼 흑인들에게도, 생존, 자유, 그리고 행복추구라는 양도할 수 없는 권리가 보장된다는 하나의 약속이었습니다.
It is obvious today that America has defaulted on this promissory note, insofar as her citizens of color are concerned.
오늘날 미국이 시민들의 피부색과 관련하여서만은 지금까지 그 약속어음 대로 이행하지 않고 있다는 것이 명백합니다.
Instead of honoring this sacred obligation, America has given the Negro people a bad check, a check which has come back marked “insufficient funds.”
이 신성한 의무를 존중하지 않고서, 미국은 잔고부족이라고 표기되어 되돌아 온 수표, 부도수표를 흑인들에게 주었습니다.
\end{LetterColor}
\subsection*{특정 단어들의 색을 서서히 바꾸기}
\begin{LetterColor}[effect=word, transition=gradient, grad-continue=false, grad-step=15]
But we refuse to believe that the bank of justice is bankrupt.
그러나 우리는 정의의 은행이 파산했다고 믿기를 거부합니다.
We refuse to believe that there are insufficient funds in the great vaults of opportunity of this nation.
우리는 이 기회의 나라의 금고에 자금이 부족하다고 믿기를 거부합니다.
And so, we’ve come to cash this check, a check that will give us upon demand the riches of freedom and the security of justice.
그래서 우리는 우리에게 넘치는 자유와 정의의 보장을 가져다 줄 수표, 그 수표를 현금으로 바꾸기 위해서 여기에 왔습니다.
We have also come to this hallowed spot to remind America of the fierce urgency of now.
우리는 또한 미국으로 하여금 지금의 이 무서운 절박함을 깨닫게 해주기 위해 이 신성한 장소에 왔습니다.
This is no time to engage in the luxury of cooling off or to take the tranquilizing drug of gradualism.
지금은 ‘냉정하자’ 라는 사치스런 말이나 점진주의라는 안정제를 취할 때가 아닙니다.
Now is the time to make real the promises of democracy.
지금은 민주주의에 대한 약속을 지켜야 할 때입니다.
Now is the time to rise from the dark and desolate valley of segregation to the sunlit path of racial justice.
지금은 어둡고 황량한 차별의 계곡에서 양지 바른 인종적 정의의 길로 나와야 할 때입니다.
Now is the time to lift our nation from the quicksands of racial injustice to the solid rock of brotherhood.
지금은 인종적 불평등이라는 모래에서 형제애라는 단단한 바위 위로 우리 나라를 들어올려야 할 때입니다.
Now is the time to make justice a reality for all of God’s children.
지금은 모든 하느님의 자식들을 위해 정의를 현실화 해야 할 때입니다.
It would be fatal for the nation to overlook the urgency of the moment.
지금의 절박함을 무시한다면 그것은 이 나라에 치명적이 될 것입니다.
This sweltering summer of the Negro’s legitimate discontent will not pass until there is an invigorating autumn of freedom and equality.
흑인들의 정당한 불만으로 가득찬 이 무더운 여름은 자유와 평등이라는 상쾌한 가을이 오기까지 사라지지 않을 것입니다.
Nineteen sixty-three is not an end, but a beginning.
1963년은 끝이 아니라 시작입니다.
And those who hope that the Negro needed to blow off steam and will now be content will have a rude awakening, if the nation returns to business as usual.
흑인들이 흥분을 가라앉힐 필요가 있고 적당히 만족할 것을 바라는 사람들은 만약 이 나라가 예전의 그 일상으로 되돌아 가려고 한다면, 거친 깨달음을 얻게 될 것 입니다.
And there will be neither rest nor tranquility in America until the Negro is granted his citizenship rights.
흑인들이 그들의 시민권을 인정받기 전까지 미국에는 휴식도 평온도 없을 것입니다.
The whirlwinds of revolt will continue to shake the foundations of our nation until the bright day of justice emerges.
저항의 회오리바람은 정의가 출현하는 밝은 날이 올 때까지 우리나라의 기반을 흔들 것입니다.
But there is something that I must say to my people, who stand on the warm threshold which leads into the palace of justice.
그러나 정의의 궁전에 이르는 흥분되는 입구에 서있는 여러분께 내가 드려야 할 말이 있습니다.
In the process of gaining our rightful place, we must not be guilty of wrongful deeds.
우리의 정당한 지위를 얻는 과정에서 우리는 불법행위에 따른 범법자가 되어서는 안됩니다.
Let us not seek to satisfy our thirst for freedom by drinking from the cup of bitterness and hatred.
비통과 증오의 잔에서 흘러내린 물로써 자유를 향한 우리의 갈증을 풀려고 하지 맙시다.
We must forever conduct our struggle on the high plane of dignity and discipline.
우리는 품위와 절제의 고귀한 수준을 유지해 가면서 우리의 투쟁을 영원히 수행해 나가야 합니다.
We must not allow our creative protest to degenerate into physical violence.
우리의 건설적 항거가 물리적 파괴로 변질되도록 해서는 안될 것입니다.
Again and again, we must rise to the majestic heights of meeting physical force with soul force.
계속, 계속해서, 우리는 영혼의 힘과 물리적 힘을 함께 만날 수 있는 저 장엄한 고지를 올라가야 합니다.
The marvelous new militancy which has engulfed the Negro community must not lead us to a distrust of all white people.
흑인사회를 휘감고 있는 새로운 투쟁의 기운이 우리를 모든 백인들의 불신의 대상으로 이끌지 않도록 해야 합니다.
For many of our white brothers, as evidenced by their presence here today, have come to realize that their destiny is tied up with our destiny.
오늘 이 자리의 참석으로 증명되듯, 많은 우리의 백인형제들은, 그들의 운명이 우리의 운명과 맺어져 있음을 깨달았습니다.
And they have come to realize that their freedom is inextricably bound to our freedom.
그리고 그들의 자유가 우리의 자유와 떨어질 수 없게 묶여져 있음을 깨달았습니다.
We cannot walk alone.
우리는 홀로 걸어갈 수 없습니다.
And as we walk, we must make the pledge that we shall always march ahead.
그리고 걸으며, 우리는 언제나 행진에 앞장설 것을 맹세해야 합니다.
We cannot turn back.
우리는 되돌아갈 수 없습니다.
There are those who are asking the devotees of civil rights, “When will you be satisfied? ”
인권운동가들에게 다음과 같이 묻는 사람들이 있습니다, “언제쯤 당신들은 만족하겠느냐? ”
We can never be satisfied as long as the Negro is the victim of the unspeakable horrors of police brutality.
우리는 절대 만족할 수 없습니다, 흑인들이 경찰들의 만행에 아무런 말도 할 수 없는 두려움의 희생자가 되는 한.
We can never be satisfied as long as our bodies, heavy with the fatigue of travel, cannot gain lodging in the motels of the highways and the hotels of the cities.
우리는 절대 만족할 수 없습니다, 우리의 몸이 여행의 피곤으로 무거울 때 고속도로의 모텔과 시내의 호텔에서 잠자리를 얻지 못하는 한.
We cannot be satisfied as long as the Negro’s basic mobility is from a smaller ghetto to a larger one.
우리는 만족할 수 없습니다, 흑인들의 이동이 작은 빈민가에서 큰 빈민가로 가는 한.
We can never be satisfied as long as our children are stripped of their selfhood and robbed of their dignity by signs stating “for white only.”
우리는 절대 만족할 수 없습니다, 우리의 어린이들이 자존심을 박탈당하고 “백인 전용”이라 쓰여진 문구에 자신들의 존엄성을 강탈당하는 한.