-
Notifications
You must be signed in to change notification settings - Fork 1
/
texlive-ja.sty
295 lines (253 loc) · 9.04 KB
/
texlive-ja.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
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
% TeX Live documentation style. Written by many people over many years.
% Edited by Takuto Asakura for Japanese version.
% Public domain.
\NeedsTeXFormat{pLaTeX2e}[2018/03/09]
\ProvidesPackage{texlive-ja}[2019/09/24 Japanese TeX Live Guide style]
% ------------------------------------------------------------- Packages
\RequirePackage[T1]{fontenc}
\RequirePackage{alltt}
\RequirePackage{array}
\RequirePackage{colortbl}
\RequirePackage{comment}
\RequirePackage{float}
\RequirePackage{graphicx}
\RequirePackage{longtable}
\RequirePackage{enumitem}
\RequirePackage[normalem]{ulem}
\RequirePackage[obeyspaces]{url}
\RequirePackage{textcomp}% including \textbullet
\RequirePackage{fancyvrb}
\RequirePackage[verb]{bxghost}
\RequirePackage{pxrubrica}
\RequirePackage{hyperref}
% ------------------------------------------------------------- LaTeX style
\pagestyle{headings}
\renewcommand{\topfraction}{0.85}
\renewcommand{\floatpagefraction}{0.86}
\renewcommand{\textfraction}{0.1}
\renewcommand{\abovecaptionskip}{4pt}
\renewcommand{\belowcaptionskip}{4pt}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\setcounter{topnumber}{5}
\setcounter{totalnumber}{5}
% linebreaking, etc.
\hbadness=4000
\vbadness=4000
\emergencystretch=.1\hsize
\relpenalty=500
% font
\DeclareTextFontCommand{\emph}{\sffamily\gtfamily}
% ------------------------------------------------------------- Markup commands
\def\p.{p.\,}
\renewcommand*{\slash}{/\penalty\z@\hskip\z@skip }
% various sorts of names
\newcommand*{\pkg}[1]{\eghostguarded{{\chardef\_=`\_\textsf{#1}}}}
\newcommand*{\prog}[1]{\eghostguarded{\textsf{#1}}}
\newcommand*{\dir}[1]{\path{#1}}% \eghostguarded is unnecessary for \path
\newcommand*{\file}[1]{\path{#1}}
\newcommand*{\cmd}[1]{\eghostguarded{\texttt{#1}}}
\newcommand*{\code}[1]{\eghostguarded{\texttt{#1}}}
\newcommand*{\sopt}[1]{\code{\hyph#1}}
\newcommand*{\lopt}[1]{\code{\hyph{}\hyph#1}}
\newcommand*{\var}[1]{{\chardef\_=`\_\code{#1}}}
\newcommand*{\meta}[1]{$\langle$\mbox{}{\normalfont #1}\mbox{}$\rangle$}
\newcommand*{\optional}[1]{\textrm{[\code{#1}]}}
\newcommand*{\samp}[1]{`\texttt{#1}'\@}
% Windows-specific
\newcommand*{\winenv}[1]{\code{\%#1\%}}
\newcommand*{\winpath}[1]{{\def\\{\char`\\}\code{#1}}}
% special names
\newcommand*{\dpi}{$\,$dpi}
\newcommand*{\bs}{\char`\\}
\newcommand*{\cs}[1]{\eghostguarded{\texttt{\bs #1}}}
\newcommand*{\Q}[1]{\par\vskip6pt\leftline{#1}\par}
\newcommand*{\hyph}{-}
% abbreviations
\newcommand*{\KPS}{Kpathsea}
\newcommand*{\PS}{Post\-Script}
\newcommand*{\WEB}{\texttt{WEB}}
\newcommand*{\Webc}{Web2C}
% ------------------------------------------------------------- TeX logos
\RequirePackage{bxtexlogo}% use instead of texnames
\bxtexlogoimport{*,HanTheThanh,PiCTeX,LaTeXTeX,%
logoOmega,logoLambda,logoLamed,logoAleph}
% aliases
\let\MF\METAFONT
\let\MP\METAPOST
\let\AllTeX\LaTeXTeX
\let\Thanh\HanTheThanh
\newcommand{\OMEGA}{\eghostguarded{\logoOmega}}
\newcommand{\LAMBDA}{\eghostguarded{\logoLambda}}
\newcommand{\LAMED}{\eghostguarded{\logoLamed}}
\newcommand{\ALEPH}{\eghostguarded{\logoAleph}}
% logos not in bxtexlogo
\DeclareRobustCommand{\TL}{\texorpdfstring{\TeX\,\,Live}{TeX Live}}
\DeclareRobustCommand{\TeXXeT}{\TeX-{}-%
\kern-.1emX\kern-.125em\lower.5ex\hbox{E}\kern-.1667emT\@}
\DeclareRobustCommand{\MIKTEX}{MiK\kern-.025em \TeX}% per www.miktex.org
\DeclareRobustCommand{\ProTeXt}{pro\TeX t}
\DeclareRobustCommand{\teTeX}{\textrm{te}\TeX}
\DeclareRobustCommand{\MacTeX}{Mac\TeX}
% ------------------------------------------------------------- Verbatim
\DefineVerbatimEnvironment{verbatim}{Verbatim}{fontsize=\normalsize}
\DefineVerbatimEnvironment{fverbatim}{Verbatim}{fontsize=\footnotesize}
\DefineVerbatimEnvironment{sverbatim}{Verbatim}{fontsize=\small}
\DefineVerbatimEnvironment{boxedverbatim}
{Verbatim}{fontsize=\footnotesize,frame=single}
\DefineVerbatimEnvironment{Verbatim}{Verbatim}{fontsize=\normalsize}
\def\verbatiminput#1{\VerbatimInput[fontsize=\scriptsize]{#1}}
\def\boxedverbatiminput#1{\VerbatimInput[frame=single,fontsize=\scriptsize]{#1}}
\def\listinginput#1#2{\VerbatimInput[fontsize=\scriptsize,firstnumber=#1,numbers=left]{#2}}
%\MakeShortVerb\|
% ------------------------------------------------------------- Graphics
% graphics path
\graphicspath{{texlive-common/}{img/}}
\def\tlpng#1#2{%
\par
\centerline{\includegraphics[width=#2]{#1.png}}%
}
% ------------------------------------------------------------- Lists
% description-like environment that uses tt instead of bf, and doesn't
% go to the left margin. Without the \hfil, get an underfull box.
% Don't know why \descriptionlabel doesn't.
\newenvironment{ttdescription}{%
\list{label must be supplied}{%
\parindent=0pt
\itemsep=0pt % these lists tend to have short descriptions
\labelwidth=\leftmargin
\labelsep=1zw
\advance\labelwidth by -\labelsep
\let\makelabel=\ttdescriptionlabel}}{\endlist}
\newcommand*\ttdescriptionlabel[1]{%
%\hspace\labelsep
\normalfont\ttfamily #1\hfil}
% Likewise, for commands using sans serif.
\newenvironment{cmddescription}{%
\list{label must be supplied}{%
\itemsep=0pt
\labelwidth=\leftmargin
\labelsep=1zw
\advance\labelwidth by -\labelsep
\let\makelabel=\cmddescriptionlabel}}{\endlist}
\newcommand*\cmddescriptionlabel[1]{%
%\hspace\labelsep
\normalfont\sffamily #1\hfil}
\newsavebox{\wbox}
\newenvironment{warningbox}
{\begin{lrbox}{\wbox}
\begin{minipage}{.95\textwidth}}
{\end{minipage}\end{lrbox}\fbox{\usebox{\wbox}}}
%
% lrbox is used as a representation marking. I changed it to
% lrBox in tne source file, to get closer to logical marking
\newsavebox{\mylrbox}
\newenvironment{lrBox}
{\begin{lrbox}{\mylrbox}}
{\end{lrbox}}
% ------------------------------------------------------------- Boxes
\RequirePackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\newtcolorbox{janote}
{
empty, left=2mm, right=2mm, top=-1mm,
attach boxed title to top left={xshift=1.2zw},
boxed title style={
empty, left=-1mm, right=-1mm,
},
colframe=black, coltitle=black, coltext=black, breakable,
underlay unbroken={
\draw [black, line width=.5pt]
(title.east) -- (title.east-|frame.east) -- (frame.south east)
-- (frame.south west) -- (title.west-|frame.west) -- (title.west);
},
underlay first={
\draw [black, line width=.5pt] (title.east) -- (title.east-|frame.east)
-- (frame.south east);
\draw [black, line width=.5pt] (frame.south west)
-- (title.west-|frame.west) -- (title.west);
},
underlay middle={
\draw [black, line width=.5pt]
(frame.north east) -- (frame.south east) ;
\draw [black, line width=.5pt] (frame.south west) -- (frame.north west) ;
},
underlay last={
\draw [black, line width=.5pt] (frame.north east) -- (frame.south east)
-- (frame.south west) -- (frame.north west) ;
},
fonttitle=\sffamily\gtfamily,
title={日本語\TeX ユーザ向けノート},
}
% ------------------------------------------------------------- LaTeX hacks
% Japanese translaion supports only PDF (HTML version is not available)
\typeout{TeX Live documentation in PDF format}
% title
\def\Title#1{\gdef\@title{{\huge #1}}}
\def\Editor#1{\gdef\@editor{#1}}
\def\Translator#1{\gdef\@translator{#1}}
\def\Website#1{\gdef\@website{\url{#1}}}
\author{%
{\@editor} 編 \\
{\@translator} 訳 \\[3mm]
\@website}
% hyperref settings
\newcommand*{\email}[1]{\href{mailto:#1}{\path{#1}}} % \path comes from url
\definecolor{hypercolor}{rgb}{0.5,0.0,0.5} % purplish external links.
\hypersetup{
breaklinks, colorlinks, linkcolor=hypercolor, citecolor=hypercolor,
urlcolor=hypercolor, filecolor=hypercolor, bookmarksopen, hyperindex
}
\AtBeginDocument{%
\hypersetup{
pdftitle = {\@title},
pdfauthor = {\@editor,\@translator,ほか},
}
}
% array package stuff
\def\arraybackslash{\let\\=\@arraycr}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
% shaded rows (using facilities of colortbl)
\definecolor{pale}{gray}{.9}
\newcount\colrow
\gdef\RowColor{pale}
\def\SetRowColor{%
\rowcolor{\RowColor}%
\global\advance\colrow by1\relax
\ifodd\colrow
\gdef\RowColor{pale}%
\else
\gdef\RowColor{white}%
\fi
}
% redefine to hack up a reference even though we don't need it...
\renewcommand\@bibitem[1]{\if@filesw \immediate\write\@auxout
{\string\bibcite{#1}{?}}\fi\ignorespaces}
% \unknownTeXlive is a dummy texlive entry for the biblio
\newcommand\unknownTeXlive[2][\relax]{\textbf{\textsc{unknown}}%
\global\@all@unknown\expandafter{\the\@all@unknown{#2}}%
}
\newtoks\@all@unknown
\global\@all@unknown{}
\AtEndDocument{\@message@unknowns}
\def\@message@unknowns{\edef\@tempa{\the\@all@unknown}%
\ifx\@tempa\@empty
\else
\def\@tempa{*** TeX Live package location of }%
\expandafter\@output@unknowns\the\@all@unknown\@empty
\fi
}
\def\@output@unknowns#1{\edef\@tempb{#1}%
\ifx\@tempb\@empty
\typeout{ unknown}%
\else
\message{\@tempa#1,}%
\def\@tempa{}%
\expandafter\@output@unknowns
\fi
}
% Silence font warnings about no bold typewriter in LM.
\def\@font@warning#1{}%
% Silence hyperref warnings about \kern.
\def\HyPsd@Warning#1{}%
\endinput