-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBookTemplate.tex
More file actions
230 lines (202 loc) · 7.14 KB
/
BookTemplate.tex
File metadata and controls
230 lines (202 loc) · 7.14 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
\documentclass[10pt, twoside]{book}
%\usepackage[chinese]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%%%%% Pacchetti
\usepackage{FileAusiliari/Layout} % Contiene i pacchetti e le impostazioni per il layout
\usepackage{FileAusiliari/Pacchetti} % Pacchetti aggiuntivi di vario tipo (senza tikz)
\usepackage{FileAusiliari/TikZ} % Ambiente tikzpicture
\usepackage{FileAusiliari/Definizioni} % Definizioni di colori, variabili globali ecc.
\usepackage{FileAusiliari/Environments} % Impostazioni TOC, bibliografia e indice analitico + environments vari per il contenuto del documento
\usepackage{FileAusiliari/Custom} % Tutto ciò che è personalizzabile normalmente dall'utente (tranne i colori per collegamenti ipertestuali, citazioni, link, che sono da modificare in Referencing)
\input{FileAusiliari/Referencing.tex} % Collegamenti ipertestuali e indice analitico
\usepackage{FileAusiliari/Comandi} % Comandi vari
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}
\usepackage{makeidx}
\usepackage{xcolor}
\usepackage{multirow}
\usepackage{fontspec} % 字體
\usepackage{xeCJK} % 中文支持
\setmainfont{Times New Roman} % 主字體
\setCJKmainfont{Noto Sans CJK TC} % 中文黑體 思源黑體
\linespread{1.5}
\newcommand{\CJKsection}[1]{{\CJKfamily{titlefont}#1}} % 中文支持 Section Title
\titleformat{\section}{\Large\bfseries\CJKsection}{\thesection}{1em}{}
\titleformat{\subsection}{\large\bfseries\CJKsection}{\thesubsection}{1.5em}{}
\titleformat{\subsubsection}{\normalsize\bfseries\CJKsection}{\thesubsubsection}{2em}{}
% 自定義命令
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\term}[1]{\textit{#1}}
\renewcommand{\bold}[1]{\textbf{#1}}
\newcommand{\figref}[1]{\textbf{Figure~\ref{#1}}}
\newcommand{\tabref}[1]{\textbf{Table~\ref{#1}}}
\newcommand{\lstref}[1]{\textbf{Listing~\ref{#1}}}
\newcommand{\chapref}[1]{\textbf{Chapter~\ref{#1}}}
\newcommand{\secref}[1]{\textbf{Section~\ref{#1}}}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour}, commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=t,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%% TITOLO
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \input{FileAusiliari/Titolo}
\input{FileAusiliari/Titolo2}
%%%%%%%%%%%%%%%%%%%%%%%%%%%% FRONTMATTER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\frontmatter
\pagestyle{fancyfront}
%%%%% INDICE
\begingroup
{
\let\cleardoublepage\relax
%%%%% Nome Indice (NASCOSTO E CREATO A PARTE)
\renewcommand\contentsname{}
\begin{tikzpicture}[remember picture, overlay]
\clip (-80,-95) rectangle (40,10);
\pgftext[x=.8\textwidth, y=0.2cm]{\HUGE\bfseries
目錄} % Titolo indice
\end{tikzpicture}
\vspace{-1cm}
\tableofcontents
\vspace{.25cm}
}
%%%%% INTRODUZIONE
\input{FileAusiliari/Introduzione}
\input{FileAusiliari/Rule}
\endgroup
%%%%% ERRATA
\iffalse
\titleformat{\chapter}
[hang]
{\huge}
{}
{0em}
{}
[\large {\begin{tikzpicture} [remember picture, overlay]
\pgftext[right,x=14.75cm,y=0.2cm]{\color{black}\Huge\bfseries
Errata corrige \& Aggiunte};
\end{tikzpicture}}]
\chapter*{}\normalfont \addcontentsline{toc}{part}{Errata corrige \& Aggiunte}
\begin{longtable}{p{2.55cm}p{1.45cm}p{9cm}}
Data di \newline correzione & Pagina&\\\hline
24/10/2023 & ? & ?
\end{longtable}
\fi
%%%%%%%%%%%%%%%%%%%%%%%%%%%% MAINMATTER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mainmatter
\pagestyle{fancymain}
\titleformat{\chapter}[display]{\bfseries\Large} {\filleft\MakeUppercase{\chaptertitlename} \HUGE\thechapter}{.5ex}{\titlerule\vspace{1ex}\filleft}[\vspace{3.5ex}]
\titlespacing*{\chapter}{0pt}{0.1\baselineskip}{0.5\baselineskip}
\fancyheadoffset[L]{\dimexpr\oddsidemargin-0in\relax}
\fancyheadoffset[R]{\dimexpr\oddsidemargin-0in\relax}
\normalfont
\normalsize
% \newgeometry{top=35mm, bottom=35mm, left=15mm, right=15mm, headheight=0pt, headsep=0pt, marginparsep=0pt, marginparwidth=0pt, footskip=0pt, footnotesep=0pt}
% % \part*{\HUGE Parte 1}\label{Parte1}
% \restoregeometry
%%%%% CAPITOLI
\input{Chapters/Chap1}
\input{Chapters/Chap2}
\input{Chapters/Chap3}
\input{Chapters/Chap4}
\input{Chapters/Chap5}
\input{Chapters/Chap6}
\input{Chapters/Chap7}
\input{Chapters/Chap8}
\input{Chapters/Chap9}
\input{Chapters/Chap10}
\input{Chapters/Chap11}
\input{Chapters/Chap12}
\input{Chapters/Chap13}
%%%%% APPENDICI
\newgeometry{top=35mm, bottom=35mm, left=15mm, right=15mm, headheight=0pt, headsep=0pt, marginparsep=0pt, marginparwidth=0pt, footskip=0pt, footnotesep=0pt}
\part*{\HUGE Appendici}
\titleformat{\chapter}[display] {\bfseries\large\raggedright} {\vspace{-2.35cm} \MakeUppercase{\chaptertitlename}\ \Huge \thechapter} {.125ex} {\raggedleft\vspace{-1cm}\Huge\makebox[.5\textwidth]{}}
\titlespacing*{\chapter}{0pt}{6\baselineskip}{2.5\baselineskip}
\restoregeometry
% Capitoli
\titlecontents{chapter}[2.5pc]
{\addvspace{15pt}}
{\begin{tikzpicture}
\pgftext{\LArge\bfseries\bfseries\color{black}\hspace{-1cm} Appendix \ \thecontentslabel{\color{white}.}\hspace{.5cm} }
\end{tikzpicture}\Large }
{}
{\color{black}\titlerule\; \;\Large\bfseries Pagina \thecontentspage}
\pagestyle{fancyapp}
\begin{appendices}
\input{Appendici/AppendiceA}
\input{Appendici/AppendiceB}
\input{Appendici/AppendiceC}
%%%%%%%%%%%%%%%%%%%%%%%%%%%% BACKMATTER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\backmatter
%%%%% BIBLIOGRAFIA
\pagestyle{fancyBibliografia}
\titleformat{\chapter}
[hang]
{\vspace{-2cm}\Huge}
{}
{0em}
{}
[\Large {\begin{tikzpicture} [remember picture, overlay]
\pgftext[right,x=14.75cm,y=0.2cm]{\HUGE\bfseries
Bibliography}
\end{tikzpicture}}]
\nocite{*}
\bibliographystyle{amsalpha}
\bibliography{FileAusiliari/Bibliografia}
\addcontentsline{toc}{part}{Bibliography}
\cleardoublepage
%INDICE ANALITICO
\begin{comment}
\pagestyle{fancyIndiceAnalitico}
\renewcommand{\indexname}{}
% SISTEMA IL PROBLEMA DEL LINK ALL'INDICE ANALITICO
\let\cleardoublepage\relax
\titleformat{\chapter}[hang]{}{}{0em}{}[]
\chapter*{}
\titleformat{\chapter}
[hang]
{\Huge}
{}
{0em}
{}
[\Large {\begin{tikzpicture} [remember picture, overlay]
\pgftext[right,x=14.75cm,y=0.2cm]{\HUGE\bfseries
Indice analitico}
\end{tikzpicture}}]
\titlespacing*{\chapter}{0pt}{0\baselineskip}{5\baselineskip}
\addcontentsline{toc}{part}{Indice analitico}
\vspace{-2cm}
\printindex
\end{comment}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{appendices}
\end{document}