-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtemplate2.tex
943 lines (878 loc) · 25.7 KB
/
template2.tex
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
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
$endif$
$if(dir)$
$if(latex-dir-rtl)$
\PassOptionsToPackage{RTLdocument}{bidi}
$endif$
$endif$
%
%%% PDF/X-1a出力用
$if(pdfx1a)$
\begin{filecontents*}{\jobname.xmpdata}
\Title{C++book}
\Author{$author$}
\Keywords{C++}
\end{filecontents*}
$endif$
%%%
\documentclass[
$if(fontsize)$
$fontsize$,
$endif$
$if(lang)$
$babel-lang$,
$endif$
$if(papersize)$
$papersize$paper,
%%% 長さでの用紙サイズ指定
$else$
$if(geometry)$
paper={$geometry.width$}{$geometry.height$},
$endif$
$endif$
$if(beamer)$
ignorenonframetext,
$if(handout)$
handout,
$endif$
$if(aspectratio)$
aspectratio=$aspectratio$,
$endif$
$endif$
$for(classoption)$
$classoption$$sep$,
$endfor$
]{$documentclass$}
$if(beamer)$
$if(background-image)$
\usebackgroundtemplate{%
\includegraphics[width=\paperwidth]{$background-image$}%
}
$endif$
\usepackage{pgfpages}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{caption label separator}{: }
\setbeamercolor{caption name}{fg=normal text.fg}
\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
$for(beameroption)$
\setbeameroption{$beameroption$}
$endfor$
% Prevent slide breaks in the middle of a paragraph
\widowpenalties 1 10000
\raggedbottom
$if(section-titles)$
\setbeamertemplate{part page}{
\centering
\begin{beamercolorbox}[sep=16pt,center]{part title}
\usebeamerfont{part title}\insertpart\par
\end{beamercolorbox}
}
\setbeamertemplate{section page}{
\centering
\begin{beamercolorbox}[sep=12pt,center]{part title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\setbeamertemplate{subsection page}{
\centering
\begin{beamercolorbox}[sep=8pt,center]{part title}
\usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
}
\AtBeginPart{
\frame{\partpage}
}
\AtBeginSection{
\ifbibliography
\else
\frame{\sectionpage}
\fi
}
\AtBeginSubsection{
\frame{\subsectionpage}
}
$endif$
$endif$
$if(beamerarticle)$
\usepackage{beamerarticle} % needs to be loaded first
$endif$
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
$if(linestretch)$
\usepackage{setspace}
$endif$
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
$if(mathspec)$
\ifxetex
\usepackage{mathspec}
\else
\usepackage{unicode-math}
\fi
$else$
\usepackage{unicode-math}
$endif$
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
$if(mainfont)$
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$endif$
$if(sansfont)$
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$endif$
$if(monofont)$
\setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
$endif$
$for(fontfamilies)$
\newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
$endfor$
$if(mathfont)$
$if(mathspec)$
\ifxetex
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
\else
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
\fi
$else$
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$endif$
$endif$
$if(CJKmainfont)$
\ifxetex
\usepackage[space]{xeCJK}
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
\fi
$endif$
%%% ゴシックフォントとコードブロックでの和文フォントの指定
%%% 参考 : https://blog.atusy.net/2019/05/14/rmd2pdf-any-font/
$if(CJKmonofont)$
\ifxetex
\usepackage[space]{xeCJK}
\usepackage{zxjatype}
\setCJKmonofont[]{$CJKmonofont$}
\fi
$endif$
$if(CJKsansfont)$
\ifxetex
\usepackage[space]{xeCJK}
\usepackage{zxjatype}
\setCJKsansfont[]{$CJKsansfont$}
\fi
$endif$
%%%
$if(luatexjapresetoptions)$
\ifluatex
\usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
\fi
$endif$
$if(CJKmainfont)$
\ifluatex
\usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
\setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
\fi
$endif$
\fi
$if(beamer)$
$if(theme)$
\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
$endif$
$if(colortheme)$
\usecolortheme{$colortheme$}
$endif$
$if(fonttheme)$
\usefonttheme{$fonttheme$}
$endif$
$if(mainfont)$
\usefonttheme{serif} % use mainfont rather than sansfont for slide text
$endif$
$if(innertheme)$
\useinnertheme{$innertheme$}
$endif$
$if(outertheme)$
\useoutertheme{$outertheme$}
$endif$
$endif$
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
$if(indent)$
\usepackage{indentfirst}
$else$
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
$endif$
$if(verbatim-in-note)$
\usepackage{fancyvrb}
$endif$
\usepackage{xcolor, colortbl}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
$if(title-meta)$
pdftitle={$title-meta$},
$endif$
$if(author-meta)$
pdfauthor={$author-meta$},
$endif$
$if(lang)$
pdflang={$lang$},
$endif$
$if(subject)$
pdfsubject={$subject$},
$endif$
$if(keywords)$
pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
$endif$
$if(colorlinks)$
colorlinks=true,
linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
filecolor=$if(filecolor)$$filecolor$$else$Maroon$endif$,
citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
$else$
hidelinks,
$endif$
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
$if(verbatim-in-note)$
\VerbatimFootnotes % allow verbatim text in footnotes
$endif$
$if(geometry)$
$if(beamer)$
\geometry{$for(geometry)$$geometry$$sep$,$endfor$}
$else$
%%%\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
$endif$
$endif$
$if(beamer)$
\newif\ifbibliography
$endif$
$if(listings)$
\usepackage{listings}
\newcommand{\passthrough}[1]{#1}
\lstset{defaultdialect=[5.3]Lua}
\lstset{defaultdialect=[x86masm]Assembler}
$endif$
$if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$
$if(highlighting-macros)$
$highlighting-macros$
$endif$
$if(tables)$
\usepackage{longtable,booktabs}
$if(beamer)$
\usepackage{caption}
% Make caption package work with longtable
\makeatletter
\def\fnum@table{\tablename~\thetable}
\makeatother
$else$
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
$endif$
$endif$
$if(graphics)$
%%\usepackage{graphicx}
\usepackage[dvipdfmx,hiresbb]{graphicx}
\makeatletter
% 画像のリサイズ対応
% https://github.com/Wandmalfarbe/pandoc-latex-template/issues/391
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
$endif$
$if(links-as-notes)$
% Make links footnotes instead of hotlinks:
\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
$endif$
$if(strikeout)$
\usepackage[normalem]{ulem}
% Avoid problems with \sout in headers with hyperref
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
$endif$
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
$if(numbersections)$
\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
$else$
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
$endif$
$if(beamer)$
$else$
$if(block-headings)$
% Make \paragraph and \subparagraph free-standing
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
$endif$
$endif$
$if(pagestyle)$
\pagestyle{$pagestyle$}
$endif$
$for(header-includes)$
$header-includes$
$endfor$
$if(lang)$
\ifxetex
% Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
\usepackage{polyglossia}
\setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
$for(polyglossia-otherlangs)$
\setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
$endfor$
\else
\usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
$if(babel-newcommands)$
$babel-newcommands$
$endif$
\fi
$endif$
$if(dir)$
\ifxetex
% Load bidi as late as possible as it modifies e.g. graphicx
\usepackage{bidi}
\fi
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\TeXXeTstate=1
\newcommand{\RL}[1]{\beginR #1\endR}
\newcommand{\LR}[1]{\beginL #1\endL}
\newenvironment{RTL}{\beginR}{\endR}
\newenvironment{LTR}{\beginL}{\endL}
\fi
$endif$
$if(natbib)$
\usepackage[$natbiboptions$]{natbib}
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
$endif$
$if(biblatex)$
\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
$for(bibliography)$
\addbibresource{$bibliography$}
$endfor$
$endif$
$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{cslreferences}%
{$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
{\par}
$endif$
$if(title)$
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
$endif$
$if(subtitle)$
$if(beamer)$
$else$
\usepackage{etoolbox}
\makeatletter
\providecommand{\subtitle}[1]{% add subtitle to \maketitle
\apptocmd{\@title}{\par {\large #1 \par}}{}{}
}
\makeatother
$endif$
\subtitle{$subtitle$}
$endif$
$if(author)$
\author{$for(author)$$author$$sep$ \and $endfor$}
$endif$
\date{$date$}
$if(beamer)$
$if(institute)$
\institute{$for(institute)$$institute$$sep$ \and $endfor$}
$endif$
$if(titlegraphic)$
\titlegraphic{\includegraphics{$titlegraphic$}}
$endif$
$if(logo)$
\logo{\includegraphics{$logo$}}
$endif$
$endif$
\usepackage{ascmac}
%%% タイトルページ画像IN
$if(graphics)$
$else$
\usepackage[dvipdfmx,hiresbb]{graphicx}
$endif$
%%% 奥付用
\usepackage{booktabs}
%%% PDF/X-1a出力
$if(pdfx1a)$
\usepackage[x-1a1]{pdfx}
$endif$
%%% セクション修飾
%%% 参考 : https://www.latexstudio.net/archives/2439?replytocom=41413
%%% 参考 : https://qiita.com/krtx/items/deeec0843caf37b66054
%%% 参考 : http://abenori.blogspot.com/2018/05/titlesec.html
\usepackage[]{titlesec}
%%% 見出し3の黒四角を抑制する
%%% https://ja.osdn.net/projects/luatex-ja/forums/25558/41527/
\renewcommand{\jsParagraphMark}{}
%%% 見出し修飾の色指定
$if(titlecolor)$
$if(color_cmyk)$
\definecolor{titlecolor1}{cmyk}{$titlecolor.color1.c$,$titlecolor.color1.m$,$titlecolor.color1.y$,$titlecolor.color1.k$}
\definecolor{titlecolor2}{cmyk}{$titlecolor.color2.c$,$titlecolor.color2.m$,$titlecolor.color2.y$,$titlecolor.color2.k$}
$else$
\definecolor{titlecolor1}{rgb}{$titlecolor.color1.r$,$titlecolor.color1.g$,$titlecolor.color1.b$}
\definecolor{titlecolor2}{rgb}{$titlecolor.color2.r$,$titlecolor.color2.g$,$titlecolor.color2.b$}
$endif$
$else$
\definecolor{titlecolor1}{rgb}{0.984314,0.894118,0.5}
\definecolor{titlecolor2}{rgb}{0.960784,0.498039,0.356863}
$endif$
%%% 見出しの修飾設定
\newcommand{\mytitle}[1]{
\begin{tabular}{p{0.01\textwidth}p{0.99\textwidth}}
\cellcolor{titlecolor1} &\cellcolor{titlecolor2} \textcolor{white}
{ \newline \sffamily \thesection .\ #1}
\end{tabular}
\arrayrulewidth=0.4pt
}
\titleformat{\section}[hang]{ \huge }
{}{0pt}
{
\thispagestyle{plain}
\hspace{-1.0cm}
\mytitle
}
\titleformat{\subsection}[block]
{}{}{0pt}
{
\thispagestyle{headings}
\colorbox{titlecolor2}{\begin{picture}(0,10)\end{picture}}
\hspace{0pt}
\normalfont \Large\sffamily \thesubsection
\hspace{1pt}
}
[
\begin{picture}(100,0)
\put(3,18){\color{titlecolor2}\line(1,0){390}}
\end{picture}
\\
\vspace{-30pt}
]
\titleformat{\subsubsection}[block]
{}{}{0pt}
{
\thispagestyle{headings}
\colorbox{titlecolor2}{\begin{picture}(1,10)\end{picture}}
%\hspace{0pt}
\normalfont \Large\sffamily \thesubsubsection
\hspace{1pt}
}
%%%
%%% 目次のフォント修正
\usepackage{tocloft}
\renewcommand{\cfttoctitlefont}{\large\bfseries\sffamily}
%%%
%%%
%\newcommand{\mypagestyle}{\underline{\thesection . \ \ \section}}
%%%
%%% コードブロックの詳細指定
$if(listings)$
% 色
% 入稿用PDFはsRGBをサポートしないバージョンなので、色指定はCMYKとして読み取られているらしい。そのため少し薄くなる
% 入稿用の時は必要に応じてCMYKで色を指定する必要がありそう
$if(listings-disable-color)$
\definecolor{listing-background}{HTML}{F7F7F7}
\definecolor{listing-rule}{HTML}{000000}
\definecolor{listing-numbers}{HTML}{000000}
\definecolor{listing-text-color}{HTML}{000000}
\definecolor{listing-keyword}{HTML}{000000} % キーワードの色、識別子と同じ
\definecolor{listing-keyword-2}{HTML}{000000}
\definecolor{listing-keyword-3}{HTML}{000000}
\definecolor{listing-identifier}{HTML}{000000}
\definecolor{listing-string}{HTML}{000000}
\definecolor{listing-comment}{HTML}{000000}
$else$
\definecolor{listing-background}{HTML}{F7F7F7}
\definecolor{listing-rule}{HTML}{B3B2B3}
\definecolor{listing-numbers}{HTML}{B3B2B3}
\definecolor{listing-text-color}{HTML}{000000}
%\definecolor{listing-keyword-2}{HTML}{1284CA}
%\definecolor{listing-keyword-3}{HTML}{9137CB}
%\definecolor{listing-string}{HTML}{00999A}
\definecolor{listing-string}{HTML}{F6AA00}
%\definecolor{listing-comment}{HTML}{8E8E8E}
\definecolor{listing-comment}{HTML}{77D9A8}
%\definecolor{listing-comment}{HTML}{D8F255}
$if(color_cmyk)$
\definecolor{listing-background}{cmyk}{0.036, 0.033, 0.0, 0.0}
\definecolor{listing-keyword}{cmyk}{0.5, 0.5, 0.5, 1.0} % キーワードの色、識別子と同じ
\definecolor{listing-identifier}{cmyk}{0.5, 0.5, 0.5, 1.0}
\definecolor{listing-plane-color}{cmyk}{0.5, 0.5, 0.5, 1.0}
\definecolor{listing-comment}{cmyk}{0.531, 0.442, 0.4, 0.0}
\definecolor{listing-string}{cmyk}{0.5, 0.5, 0.5, 1.0}
$else$
%\definecolor{listing-keyword}{HTML}{9A0079} % キーワードの色、識別子と同じ
\definecolor{listing-keyword}{HTML}{FF8082} % キーワードの色、識別子と同じ
%\definecolor{listing-keyword}{HTML}{005AFF} % キーワードの色、識別子と同じ
%\definecolor{listing-identifier}{HTML}{435489}
\definecolor{listing-identifier}{HTML}{005AFF}
%\definecolor{listing-identifier}{HTML}{66CCFF}
\definecolor{listing-plane-color}{HTML}{000000}
$endif$
$endif$
% 基本スタイル
\lstdefinestyle{planetext}{
language =,
$if(listings-disable-line-numbers)$
xleftmargin = 0.6em,
framexleftmargin = 0.4em,
$else$
numbers = left,
xleftmargin = 2.7em,
framexleftmargin = 2.5em,
$endif$
backgroundcolor = \color{listing-background},
basicstyle = \color{listing-text-color}\linespread{1.0}$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$\ttfamily{},
breaklines = true, % はみ出したときに自動改行するかどうか
frame = lines, % 枠線の種類
framesep = 0.19em, % 枠線太さ
rulecolor = \color{listing-rule},
frameround = ffff,
tabsize = 4,
numberstyle = \color{listing-numbers},
aboveskip = 1.0em,
belowskip = 0.1em,
abovecaptionskip = 0em,
belowcaptionskip = 1.0em,
keywordstyle = {\color{listing-plane-color}\bfseries},
keywordstyle = [1]{\color{listing-plane-color}\bfseries},
keywordstyle = [2]{\color{listing-plane-color}\bfseries},
keywordstyle = [3]{\color{listing-plane-color}\bfseries\itshape},
sensitive = false, % 大文字小文字の区別
identifierstyle = \color{listing-plane-color},
commentstyle = \color{listing-plane-color},
stringstyle = \color{listing-plane-color},
showstringspaces = false,
escapeinside = {/*@}{@*/} % コードブロック中でLatexコマンドを使うためのエスケープ文字列
}
% C++固有指定
\lstdefinelanguage{C++}{
morekeywords=[1]{
% 予約語
break,case,catch,class,continue,default,virtual,
do,else,enum,export,for,if,new,private,auto,register,
protected,public,requires,return,static,switch,
this,throw,try,volatile,while,concept,template,typename,
co_await,co_return,co_yield,static_cast,reinterpret_cast,dynamic_cast,
% コンテキスト依存のキーワード
override,final,import,module
},
% データ型
morekeywords=[2]{
bool,char,char8_t,chra16_t,char32_t,double,float,int,long,short,unsigned,void
},
% 組み込みリテラル
morekeywords=[3]{
nullptr,true,false
},
sensitive = true,
morecomment = [l]//,
morecomment = [s]{/*}{*/},
morecomment = [s]{/**}{*/},
morestring = [b]",
morestring = [b]',
}
% C++std宣言表示
\lstdefinestyle{cppstddecl}{
language = C++,
$if(listings-disable-line-numbers)$
xleftmargin = 0.6em,
framexleftmargin = 0.4em,
$else$
numbers = left,
xleftmargin = 2.7em,
framexleftmargin = 2.5em,
$endif$
backgroundcolor = \color{listing-background},
basicstyle = \color{listing-text-color}\linespread{1.0}$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$\ttfamily{},
breaklines = true, % はみ出したときに自動改行するかどうか
frame = TbrL, % 枠線の種類
framesep = 0.19em, % 枠線太さ
rulecolor = \color{listing-rule},
frameround = tttt, % 角の種類
tabsize = 4,
numberstyle = \color{listing-numbers},
aboveskip = 1.0em,
belowskip = 0.1em,
abovecaptionskip = 0em,
belowcaptionskip = 1.0em,
keywordstyle = {\color{listing-keyword}\bfseries},
keywordstyle = [1]{\color{listing-keyword}\bfseries},
keywordstyle = [2]{\color{listing-keyword}\bfseries},
keywordstyle = [3]{\color{listing-keyword}\bfseries\itshape},
sensitive = true, % 大文字小文字の区別
identifierstyle = \color{listing-identifier},
commentstyle = \color{listing-comment},
stringstyle = \color{listing-string},
showstringspaces = false,
escapeinside = {/*@}{@*/} % コードブロック中でLatexコマンドを使うためのエスケープ文字列
}
% C++カスタムスタイル
\lstdefinestyle{custom_cpp_style}{
language = C++,
$if(listings-disable-line-numbers)$
xleftmargin = 0.6em,
framexleftmargin = 0.4em,
$else$
numbers = left,
xleftmargin = 2.7em,
framexleftmargin = 2.5em,
$endif$
backgroundcolor = \color{listing-background},
basicstyle = \color{listing-text-color}\linespread{1.0}$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$\ttfamily{},
breaklines = true, % はみ出したときに自動改行するかどうか
frame = single, % 枠線の種類
framesep = 0.19em, % 枠線太さ
% コードブロックの文字間隔
% https://qiita.com/s417-lama/items/565167b40c28099abb04
columns = fixed,
basewidth = 0.5em,
rulecolor = \color{listing-rule},
frameround = ffff,
tabsize = 4,
numberstyle = \color{listing-numbers},
aboveskip = 1.0em,
belowskip = 0.1em,
abovecaptionskip = 0em,
belowcaptionskip = 1.0em,
keywordstyle = {\color{listing-keyword}\bfseries},
keywordstyle = [1]{\color{listing-keyword}\bfseries},
keywordstyle = [2]{\color{listing-keyword}\bfseries},
keywordstyle = [3]{\color{listing-keyword}\bfseries\itshape},
sensitive = true, % 大文字小文字の区別
identifierstyle = \color{listing-identifier},
commentstyle = \color{listing-comment},
stringstyle = \color{listing-string},
showstringspaces = false,
escapeinside = {/*@}{@*/} % コードブロック中でLatexコマンドを使うためのエスケープ文字列
}
\lstset{language=C++, style=custom_cpp_style}
$endif$
%%%
\begin{document}
%%% タイトル画像挿入
%%% 入稿時に表紙と本文が別になる場合は表紙を入れない
$if(separate_cover)$
$else$
$if(coverimage)$
\enlargethispage{\paperwidth}
\thispagestyle{empty}
\vspace*{-1truein}
\vspace*{-\topmargin}
\vspace*{-\headheight}
\vspace*{-\headsep}
\vspace*{-\topskip}
\noindent\hspace*{-1in}\hspace*{-\oddsidemargin}
\includegraphics[width=\paperwidth,height=\paperheight]{$coverimage$}
$else$
表紙
$endif$
\clearpage
%% 表紙裏の空白ページ
\clearpage
$endif$
%%% 中表紙
$if(has-frontmatter)$
\frontmatter
$endif$
$if(title)$
$if(beamer)$
\frame{\titlepage}
$else$
\maketitle
$endif$
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$
$endif$
\clearpage %%中表紙改ページ
%%% ページスタイル変更
\pagestyle{headings}
%\markboth{\mypagestyle}{\mypagestyle}
%\pagestyle{myheadings}
$for(include-before)$
$include-before$
$endfor$
$if(toc)$
$if(toc-title)$
\renewcommand*\contentsname{$toc-title$}
$endif$
$if(beamer)$
\begin{frame}
$if(toc-title)$
\frametitle{$toc-title$}
$endif$
\tableofcontents[hideallsubsections]
\end{frame}
$else$
{
$if(colorlinks)$
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
$endif$
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
}
$endif$
$endif$
$if(lot)$
\listoftables
$endif$
$if(lof)$
\listoffigures
$endif$
$if(linestretch)$
\setstretch{$linestretch$}
$endif$
$if(has-frontmatter)$
\mainmatter
$endif$
$body$
$if(has-frontmatter)$
\backmatter
$endif$
$if(natbib)$
$if(bibliography)$
$if(biblio-title)$
$if(has-chapters)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
$if(beamer)$
\begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
$endif$
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
$if(beamer)$
\end{frame}
$endif$
$endif$
$endif$
$if(biblatex)$
$if(beamer)$
\begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
\printbibliography[heading=none]
\end{frame}
$else$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
$endif$
$for(include-after)$
$include-after$
$endfor$
%% 奥付
\clearpage
%%% ページスタイル変更
\pagestyle{empty}
\begin{itemize}
\item 表紙・裏表紙のイラスト・画像を除いて、この本の内容はCC-BY4.0の元で提供します。ただし、必要である範囲において他の著作物を引用していることがあります。
\item 落丁・乱丁の場合は下記連絡先までご一報ください。
\item 内容について明らかな間違いや不備、軽微なtypoなどを見つけた場合は下記連絡先もしくはGithubリポジトリまでご一報ください。
\end{itemize}
\vspace*{\stretch{1}}
\begin{center}
\textsf{$title$}
$if(subtitle)$
$subtitle$
$endif$
\begin{tabular}{ll}
$if(okuduke.revision)$
$okuduke.revision$ & $date$ \\
$endif$
\end{tabular}
\begin{tabular}{ll} \toprule
発行 & Cryptomycocolacales \\
著者 & $author$ \\
連絡先 & ↓のtwitterからお願いします \\
twitter & \verb|@onihusube9| \\
Githubリポジトリ & \verb|https://github.com/onihusube/books| \\
Webサイト & \verb|https://onihusube.hatenablog.com/| \\
$if(okuduke.printing)$
印刷 & $okuduke.printing$ \\
$endif$
\end{tabular}
\end{center}
%%% 裏表紙画像挿入
%%% 入稿時に表紙と本文が別になる場合は表紙を入れない
$if(separate_cover)$
$else$
\clearpage
%% 裏表紙前の空白ページ
\clearpage
$if(backcoverimage)$
\enlargethispage{\paperwidth}
\thispagestyle{empty}
\vspace*{-1truein}
\vspace*{-\topmargin}
\vspace*{-\headheight}
\vspace*{-\headsep}
\vspace*{-\topskip}
\noindent\hspace*{-1in}\hspace*{-\evensidemargin}
\includegraphics[width=\paperwidth,height=\paperheight]{$backcoverimage$}
$else$
裏表紙
$endif$
$endif$
\end{document}