-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmine.sty
198 lines (178 loc) · 5.94 KB
/
mine.sty
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
% レイアウト
\usepackage[driver=dvipdfm,hmargin=19.05truemm,vmargin=25.40truemm]{geometry}
\usepackage{setspace}
% ページ数が足りないときの最終手段
% \renewcommand{\baselinestretch}{1.08}
% float関連処理(なるべく上側へ)
\setcounter{topnumber}{4}
\setcounter{bottomnumber}{0}
\setcounter{totalnumber}{4}
\renewcommand{\topfraction}{1}
\renewcommand{\bottomfraction}{0}
\renewcommand{\textfraction}{0}
\renewcommand{\floatpagefraction}{1}
% フォント
\usepackage[ScaleRM=1.04]{libertinus-type1}
\usepackage{libertinust1math}
\usepackage[scaled=0.93]{helvet}
\usepackage[scaled=0.91]{beramono}
\usepackage[T1]{fontenc}
\makeatletter
\def\bfseries@rm{bx}
\makeatother
% 日本語フォント
\usepackage[expert,deluxe,jis2004,uplatex]{otf}
% フォントを変えたいなら pxchfon パッケージを使うとよい
% 参考: https://qiita.com/zr_tex8r/items/15ec2848371ec19d45ed
% \usepackage[noalphabet]{pxchfon}
% \setlightminchofont{AP-OTF-BunkyuMinPr6N-R.otf}
% \setmediumminchofont{A-OTF-RyuminPr6N-Regular.otf}
% \setboldminchofont{A-OTF-RyuminPr6N-Bold.otf}
% \setmediumgothicfont{A-OTF-ShinGoPr6N-Regular.otf}
% \setboldgothicfont{A-OTF-ShinGoPr6N-Bold.otf}
% \setxboldgothicfont{UDTypos515Std-Regular.otf}
% \setmarugothicfont{FOT-SeuratProN-M.otf}
% その他文章処理
\usepackage{okumacro}
\usepackage{pxrubrica}
\usepackage{url}
\newcommand{\enhance}[1]{{\gtfamily\sffamily#1}}
% 数式・科学表記
\usepackage{amsmath,amssymb,bm,mleftright,diffcoeff}
\usepackage{siunitx}
% 数式略記
\DeclareMathOperator*{\argmax}{arg~max}
\DeclareMathOperator*{\argmin}{arg~min}
\DeclareMathOperator{\tr}{tr}
\newcommand{\paren}[1]{\mleft(#1\mright)}
\newcommand{\sbra}[1]{\mleft\lbrack#1\mright\rbrack}
\newcommand{\cbra}[1]{\mleft\lbrace#1\mright\rbrace}
\newcommand{\abs}[1]{\mleft|#1\mright|}
\newcommand{\norm}[1]{\mleft\|#1\mright\|}
\newcommand{\relmiddle}[1]{\mathrel{}\middle#1\mathrel{}}
\newcommand{\agivenb}[2]{#1\relmiddle|#2}
\newcommand{\agivenbp}[2]{\paren{\agivenb{#1}{#2}}}
% 画像処理
\usepackage[dvipdfmx]{graphicx}
\usepackage[dvipsnames,svgnames,x11names,dvipdfmx,table,xcdraw]{xcolor}
\usepackage{tikz}
% 表処理
\usepackage{booktabs}
\usepackage{multirow}
% 参考文献スタイル指定
\usepackage[nobreak]{cite}
\usepackage[resetlabels]{multibib}
\newcites{pubs}{発表文献}
\bibliographystyle{jplain}
\bibliographystylepubs{junsrt}
\nocitepubs{*}
% キャプション
\usepackage{subcaption}
\captionsetup{labelsep=quad}
\def\thesection{第\arabic{section}章}
% 相互参照
\usepackage[noabbrev]{cleveref}
\let\nref\ref
\let\ref\cref
\crefformat{section}{#2#1#3}
\crefformat{subsection}{#2#1{}節#3}
\crefformat{subsubsection}{#2#1{}節#3}
\crefname{figure}{図}{図}
\crefname{table}{表}{表}
\crefname{equation}{式}{式}
\crefname{section}{}{}
\crefname{appendix}{}{}
\def\crefrangeconjunction{--}
\def\crefpairconjunction{,}
\def\crefmiddleconjunction{,}
\def\creflastconjunction{,}
\def\crefpairgroupconjunction{,}
\def\crefmiddlegroupconjunction{,}
\def\creflastgroupconjunction{,}
% 互換性用
\newcommand{\figref}[1]{\ref{fig:#1}}
\newcommand{\tblref}[1]{\ref{tbl:#1}}
\renewcommand{\eqref}[1]{\ref{eq:#1}}
\let\secref\ref
% サブキャプション簡略化
\newcommand{\twofigure}[3]{%
\begin{figure}\centering\begin{minipage}[b]{.5\linewidth}\centering #1\end{minipage}%
\begin{minipage}[b]{.5\linewidth}\centering #2\end{minipage}#3\end{figure}}
\newcommand{\twofigurec}[3]{%
\begin{figure*}\centering\begin{minipage}[b]{.5\linewidth}\centering #1\end{minipage}%
\begin{minipage}[b]{.5\linewidth}\centering #2\end{minipage}#3\end{figure*}}
\newcommand{\twofiguret}[3]{%
\begin{figure}\centering\begin{minipage}[b]{\linewidth}\centering #1\end{minipage}\\%
\begin{minipage}[b]{\linewidth}\centering #2\end{minipage}#3\end{figure}}
% maketitle
\makeatletter
\def\thetitle{\@title}
\def\thesubtitle{\@subtitle}
\def\theauthor{\@author}
\def\theteacher{\@teacher}
\def\thegakka{\@gakka}
\def\thedate{\@date}
\def\@subtitle{}
\def\@teacher{}
\def\@gakka{}
\def\@date{\today}
\def\subtitle#1{\def\@subtitle{#1}}
\def\teacher#1{\def\@teacher{#1}}
\def\gakka#1{\def\@gakka{#1}}
\makeatother
\renewcommand{\maketitle}{%
\pagestyle{empty}\null\vfill
\begin{center}
\bfseries\begin{spacing}{1.1}
\fontsize{42pt}{42pt}\selectfont\thetitle
\vspace{60pt}\par\Huge
\thesubtitle
\vspace{50pt}\par
\thedate\ 提出
\vspace{70pt}\par
指導教員
\begin{minipage}[t]{10em}
\begin{flushright}
\Huge\textbf{\theteacher}
\end{flushright}
\end{minipage}
\vspace{60pt}\par
\thegakka\\\theauthor
\end{spacing}
\end{center}
\vfill
\clearpage
}
% 見出し
\usepackage[explicit]{titlesec}
\newcommand{\sectionbreak}{\clearpage\suppressfloats[t]}
\titleformat{\section}[display]{\normalfont\Large\bfseries}
{\titlerule\vspace{3.6ex}\filleft\Huge{\thesection}}
{3.6ex}{\titlerule\vspace{2ex}#1\filright}[\vspace{2ex}\titlerule]
\titlespacing{\section}{0pt}{0ex}{4ex}
\titleformat{\subsection}[hang]{\normalfont\gtfamily\sffamily\large}{{\color{Gray}\vrule width 2pt \hspace{.7em}}\thesubsection}{1em}{#1}
\titlespacing{\subsection}{0pt}{4ex}{1.9ex}
\titleformat{\subsubsection}[hang]{\normalfont\gtfamily\sffamily}{\thesubsubsection}{1em}{#1}
\titlespacing{\subsubsection}{0pt}{3ex}{1.7ex}
% 脚注
\let\oldthefootnote\thefootnote
\def\thefootnote{{\color{darkgray}\oldthefootnote}}
\let\oldthempfootnote\thempfootnote
\def\thempfootnote{{\color{darkgray}$\dagger$\arabic{mpfootnote}}}
\renewcommand{\footnoterule}{\noindent\tikz\draw[dotted,darkgray] (0,0)--(5,0);\vspace{5pt}}
% jsclasses 用 mpfootnotemark
\makeatletter
\def\mpfootnotemark{%
\@ifnextchar[\@xmpfootnotemark
{\stepcounter{footnote}%
\protected@xdef\@thefnmark{\thempfn}%
\@footnotemark}}
\def\@xmpfootnotemark[#1]{%
\begingroup
\c@mpfootnote #1\relax
\unrestored@protected@xdef\@thefnmark{\thempfn}%
\endgroup
\@footnotemark}
\let\mpfootnotemarks@ve=\mpfootnotemark
\def\mpfootnotemark{\inhibitglue\mpfootnotemarks@ve}
\makeatother