summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/uplatex/base/uplvers.dtx
blob: baf1b85cef82f040de8b1bf8038b8768ddbfc5dc (plain)
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
% \iffalse meta-comment
%% File: uplvers.dtx
%
%    pLaTeX version setting file:
%       Copyright 1995-2006 ASCII Corporation.
%    and modified for upLaTeX
%
%  Copyright (c) 2010 ASCII MEDIA WORKS
%  Copyright (c) 2016 Takuji Tanaka
%  Copyright (c) 2016-2017 Japanese TeX Development Community
%
%  This file is part of the upLaTeX2e system (community edition).
%  --------------------------------------------------------------
%
% \fi
%
%
% \setcounter{StandardModuleDepth}{1}
% \StopEventually{}
%
% \iffalse
% \changes{v1.0}{1995/05/16}{p\LaTeXe\ 用に\file{ltvers.dtx}を修正}
% \changes{v1.0a}{1995/08/30}{\LaTeX\ \texttt{!<1995/06/01!>}版用に修正}
% \changes{v1.0b}{1996/01/31}{\LaTeX\ \texttt{!<1995/12/01!>}版用に修正}
% \changes{v1.0c}{1997/01/11}{\LaTeX\ \texttt{!<1996/06/01!>}版用に修正}
% \changes{v1.0d}{1997/01/23}{\LaTeX\ \texttt{!<1996/12/01!>}版用に修正}
% \changes{v1.0e}{1997/07/02}{\LaTeX\ \texttt{!<1997/06/01!>}版用に修正}
% \changes{v1.0f}{1998/02/17}{\LaTeX\ \texttt{!<1997/12/01!>}版用に修正}
% \changes{v1.0g}{1998/09/01}{\LaTeX\ \texttt{!<1998/06/01!>}版用に修正}
% \changes{v1.0h}{1999/04/05}{\LaTeX\ \texttt{!<1998/12/01!>}版用に修正}
% \changes{v1.0i}{1999/08/09}{\LaTeX\ \texttt{!<1999/06/01!>}版用に修正}
% \changes{v1.0j}{2000/02/29}{\LaTeX\ \texttt{!<1999/12/01!>}版用に修正}
% \changes{v1.0k}{2000/11/03}{\LaTeX\ \texttt{!<2000/06/01!>}版用に修正}
% \changes{v1.0l}{2001/09/04}{\LaTeX\ \texttt{!<2001/06/01!>}版用に修正}
% \changes{v1.0m}{2004/08/10}{\LaTeX\ \texttt{!<2003/12/01!>}版対応確認}
% \changes{v1.0n}{2005/01/04}{plfonts.dtxバグ修正}
% \changes{v1.0o}{2006/01/04}{plfonts.dtxバグ修正}
% \changes{v1.0p}{2006/06/27}{plfonts.dtx \LaTeX\ \texttt{!<2005/12/01!>}対応}
% \changes{v1.0q}{2006/11/10}{plfonts.dtxバグ修正}
% \changes{v1.0q-u00}{2011/05/07}{p\LaTeX{}用からup\LaTeX{}用に修正。}
% \changes{v1.0r}{2016/01/26}{plcore.dtx p\TeX\ (r28720)対応}
% \changes{v1.0s}{2016/02/01}{\LaTeX\ \texttt{!<2015/01/01!>}のlatexreleaseに
%    対応するためのコードを導入}
% \changes{v1.0t}{2016/02/03}{\cs{plIncludeInRelease}と
%    \cs{plEndIncludeInRelease}を新設。}
% \changes{v1.0u}{2016/04/17}{\LaTeX\ \texttt{!<2016/03/31!>}版対応確認}
% \changes{v1.0u-u00}{2016/04/17}{p\LaTeX{}の変更に追随。}
% \changes{v1.0v}{2016/05/07}{パッチファイルをロードするのをやめた。}
% \changes{v1.0v}{2016/05/07}{起動時の文字列を最新の\LaTeX{}に合わせた。}
% \changes{v1.0w}{2016/05/12}{起動時の文字列に入れる\LaTeX{}のバージョンを
%    元の\LaTeX{}のバナーから引き継ぐように改良}
% \changes{v1.0w-u00}{2016/05/12}{起動時の文字列に入れるBabelのバージョンを
%    元の\LaTeX{}のバナーから取得するコードを\file{uplatex.ini}から取り入れた}
% \changes{v1.0w-u01}{2016/05/21}{サポート外の\LaTeX~2.09互換モードが
%    使われた場合に明確なエラーを出すようにした。}
% \changes{v1.0x}{2016/06/19}{パッチレベルを\file{plvers.dtx}で設定}
% \changes{v1.0x-u01}{2016/06/19}{p\LaTeX{}の変更に追随。}
% \changes{v1.0y-u01}{2016/06/29}{\file{uplatex.cfg}の読み込みを追加}
% \changes{v1.0z-u01}{2016/08/26}{\file{uplatex.cfg}の読み込みを
%    \file{uplcore.ltx}から\file{uplatex.ltx}へ移動}
% \changes{v1.1}{2016/09/14}{起動時のバナーを取得するコードを改良}
% \changes{v1.1-u01}{2016/09/14}{p\LaTeX{}の変更に追随。}
% \changes{v1.1a}{2017/02/20}{\LaTeX\ \texttt{!<2017/01/01!>}版対応確認}
% \changes{v1.1a-u01}{2017/03/05}{p\LaTeX{}の変更に追随。}
% \changes{v1.1b}{2017/03/19}{\cs{l@nohyphenation}の定義を保証
%    (sync with ltfinal 2017/03/09 v2.0t)}
% \changes{v1.1b}{2017/03/19}{\cs{document@default@language}の定義を保証
%    (sync with ltfinal 2017/03/09 v2.0t)}
% \changes{v1.1b-u01}{2017/03/19}{p\LaTeX{}の変更に追随。}
% \changes{v1.1c}{2017/04/23}{\LaTeX\ \texttt{!<2017/04/15!>}版対応確認}
% \changes{v1.1c-u01}{2017/05/04}{p\LaTeX{}の変更に追随。}
% \changes{v1.1d}{2017/09/24}{パッチレベルが負の数の場合をpre-release扱いへ}
% \changes{v1.1d-u01}{2017/09/24}{p\LaTeX{}の変更に追随。}
% \fi
%
% \iffalse
%<*driver>
% \fi
\ProvidesFile{uplvers.dtx}[2017/09/24 v1.1d-u01 upLaTeX Kernel (Version Info)]
% \iffalse
\documentclass{jltxdoc}
\GetFileInfo{uplvers.dtx}
\author{Ken Nakano \& Hideaki Togashi \& TTK}
\title{\filename}
\date{作成日:\filedate}
\begin{document}
  \maketitle
  \DocInput{\filename}
\end{document}
%</driver>
% \fi
%
% \section{バージョンの設定}
% まず、このディストリビューションでのup\LaTeXe{}の日付とバージョン番号
% を定義します。また、up\LaTeXe{}が起動されたときに表示される文字列の
% 設定もします。
%
% \changes{v1.0}{1995/05/16}{p\LaTeXe\ 用に\file{ltvers.dtx}を修正}
% \changes{v1.0a}{1995/08/30}{\LaTeX\ \texttt{!<1995/06/01!>}版用に修正}
% \changes{v1.0b}{1996/01/31}{\LaTeX\ \texttt{!<1995/12/01!>}版用に修正}
% \changes{v1.0c}{1997/01/11}{\LaTeX\ \texttt{!<1996/06/01!>}版用に修正}
% \changes{v1.0d}{1997/01/23}{\LaTeX\ \texttt{!<1996/12/01!>}版用に修正}
% \changes{v1.0e}{1997/07/02}{\LaTeX\ \texttt{!<1997/06/01!>}版用に修正}
% \changes{v1.0f}{1998/02/17}{\LaTeX\ \texttt{!<1997/12/01!>}版用に修正}
% \changes{v1.0g}{1998/09/01}{\LaTeX\ \texttt{!<1998/06/01!>}版用に修正}
% \changes{v1.0h}{1999/04/05}{\LaTeX\ \texttt{!<1998/12/01!>}版用に修正}
% \changes{v1.0i}{1999/08/09}{\LaTeX\ \texttt{!<1999/06/01!>}版用に修正}
% \changes{v1.0j}{2000/02/29}{\LaTeX\ \texttt{!<1999/12/01!>}版用に修正}
% \changes{v1.0k}{2000/11/03}{\LaTeX\ \texttt{!<2000/06/01!>}版用に修正}
% \changes{v1.0l}{2001/09/04}{\LaTeX\ \texttt{!<2001/06/01!>}版用に修正}
% \changes{v1.0m}{2004/08/10}{\LaTeX\ \texttt{!<2003/12/01!>}版対応確認}
% \changes{v1.0s}{2016/02/01}{\LaTeX\ \texttt{!<2015/01/01!>}版用に修正}
% \changes{v1.0u}{2016/04/17}{\LaTeX\ \texttt{!<2016/03/31!>}版対応確認}
% \changes{v1.1a}{2017/02/20}{\LaTeX\ \texttt{!<2017/01/01!>}版対応確認}
% \changes{v1.1c}{2017/04/23}{\LaTeX\ \texttt{!<2017/04/15!>}版対応確認}
%
% このバージョンのup\LaTeXe{}は、次のバージョンの\LaTeX{}\footnote{%
% \LaTeX\ authors: Johannes Braams, David Carlisle, Alan Jeffrey,
%   Leslie Lamport, Frank Mittelbach, Chris Rowley, Rainer Sch\"opf}を
% もとにしています。
%    \begin{macrocode}
%<*2ekernel>
%\def\fmtname{LaTeX2e}
%\edef\fmtversion
%</2ekernel>
%<latexrelease>\edef\latexreleaseversion
%<platexrelease>\edef\p@known@latexreleaseversion
%<*2ekernel|latexrelease|platexrelease>
   {2017/04/15}
%</2ekernel|latexrelease|platexrelease>
%    \end{macrocode}
%
% \begin{macro}{\pfmtname}
% \begin{macro}{\pfmtversion}
% \begin{macro}{\ppatch@level}
% up\LaTeXe{}のフォーマットファイル名とバージョンです。
% \changes{v1.0x}{2016/06/19}{パッチレベルを\file{plvers.dtx}で設定}
%    \begin{macrocode}
%<*plcore>
\def\pfmtname{pLaTeX2e}
\def\pfmtversion
%</plcore>
%<platexrelease>\edef\platexreleaseversion
%<*plcore|platexrelease>
   {2017/10/28u01}
%</plcore|platexrelease>
%<*plcore>
\def\ppatch@level{1}
%</plcore>
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{\LaTeX~2.09互換モードの抑制}
%
% \begin{macro}{\documentstyle}
% p\LaTeX{}は、|\documentclass|の代わりに|\documentstyle|が使われると
% \LaTeX~2.09互換モードに入ります。しかし、up\LaTeX{}は新しいマクロ
% パッケージですので、\LaTeX~2.09互換モードをサポートしません。
% このため、\file{plcore.dtx}の定義を上書きして明確なエラーを出します。
% \changes{v1.0w-u01}{2016/05/21}{サポート外の\LaTeX~2.09互換モードが
%    使われた場合に明確なエラーを出すようにした。}
%    \begin{macrocode}
%<*plfinal>
\def\documentstyle{%
  \@latex@error{upLaTeX does NOT support LaTeX 2.09 compatibility
    mode.\MessageBreak Use \noexpand\documentclass instead}{%
    \noexpand\documentstyle is an old convention of LaTeX 2.09,
    which has been\MessageBreak obsolete since 1995. upLaTeX is
    first released in 2007, so we do\MessageBreak not provide any
    emulation of the LaTeX 2.09 author environment.\MessageBreak
    New documents should use Standard LaTeX conventions, and
    start\MessageBreak with the \noexpand\documentclass command.}%
  \documentclass}
%    \end{macrocode}
% \end{macro}
%
% \subsection{パッチファイルのロード}
%
% 次の部分は、up\LaTeXe{}のパッチファイルをロードするためのコードです。
% バグを修正するためのパッチを配布するかもしれません。
%
% パッチファイルをロードするコードはコメントアウトしました。
% \changes{v1.0v}{2016/05/07}{パッチファイルをロードするのをやめた。}
%    \begin{macrocode}
%\IfFileExists{uplpatch.ltx}
%  {\typeout{************************************^^J%
%            * Appliying patch file uplpatch.ltx *^^J%
%            ************************************}
%  \def\pfmtversion@topatch{unknown}
%  \input{uplpatch.ltx}
%  \ifx\pfmtversion\pfmtversion@topatch
%    \ifx\ppatch@level\@undefined
%      \typeout{^^J^^J^^J%
%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
%   !! Patch file `uplpatch.ltx' (for version <\pfmtversion@topatch>)^^J%
%   !! is not suitable for version <\pfmtversion> of upLaTeX.^^J^^J%
%   !! Please check if iniptex found an old patch file:^^J%
%   !! --- if so, rename it or delete it, and redo the^^J%
%   !!     iniptex run.^^J%
%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}%
%      \batchmode \@@end
%    \fi
%  \else
%      \typeout{^^J^^J^^J%
%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J%
%   !! Patch file `uplpatch.ltx' (for version <\pfmtversion@topatch>)^^J%
%   !! is not suitable for version <\pfmtversion> of upLaTeX.^^J%
%   !!^^J%
%   !! Please check if iniptex found an old patch file:^^J%
%   !! --- if so, rename it or delete it, and redo the^^J%
%   !!     iniptex run.^^J%
%   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!^^J}%
%      \batchmode \@@end
%  \fi
%  \let\pfmtversion@topatch\relax
%  }{}
%    \end{macrocode}
%
% \subsection{起動時に表示するバナー}
%
% \begin{macro}{\everyjob}
% 起動時に表示される文字列です。
% \LaTeX{}にパッチがあてられている場合は、それも表示します。
%
%\iffalse
% この実装については\file{uplatex.dtx}のコメントを参照。(2016/09/14)
%\fi
%
% \changes{v1.0v}{2016/05/07}{起動時の文字列を最新の\LaTeX{}に合わせた。}
% \changes{v1.0w}{2016/05/12}{起動時の文字列に入れる\LaTeX{}のバージョンを
%    元の\LaTeX{}のバナーから引き継ぐように改良}
% \changes{v1.1}{2016/09/14}{起動時のバナーを取得するコードを改良}
% \changes{v1.1d}{2017/09/24}{パッチレベルが負の数の場合をpre-release扱いへ}
%    \begin{macrocode}
\ifx\patch@level\@undefined % fallback if undefined in LaTeX
  \def\patch@level{0}\fi
\ifx\ppatch@level\@undefined % fallback if undefined in upLaTeX
  \def\ppatch@level{0}\fi
\begingroup
  \def\parse@@BANNER\typeout#1\typeout#2#3\relax{#1}
  \edef\platexTMP{%
    \ifnum\ppatch@level=0
      \everyjob{\noexpand\typeout{%
        \pfmtname\space<\pfmtversion>\space
          (based on \expandafter\parse@@BANNER\platexBANNER)}}%
    \else\ifnum\ppatch@level>0
      \everyjob{\noexpand\typeout{%
        \pfmtname\space<\pfmtversion>+\ppatch@level\space
          (based on \expandafter\parse@@BANNER\platexBANNER)}}%
    \else
      \everyjob{\noexpand\typeout{%
        \pfmtname\space<\pfmtversion>-pre\ppatch@level\space
          (based on \expandafter\parse@@BANNER\platexBANNER)}}%
    \fi\fi
  }
\expandafter
\endgroup \platexTMP
%    \end{macrocode}
%
% p\LaTeX{}やup\LaTeX{}は、独自のハイフネーション・パターンを定義していません。
% \TeX\ Liveの標準的インストールでは、代わりに\LaTeX{}が読み込んでいる
% Babelパッケージのものが適用されるはずですから、起動時の文字列にも
% \file{hyphen.cfg}のバージョンを反映します(Babelパッケージの
% \file{hyphen.cfg}でない場合は、何も表示されず空行になるはずです)。
%
%\iffalse
% この実装については\file{uplatex.dtx}のコメントを参照。(2016/09/14)
%\fi
%
% \changes{v1.0w-u00}{2016/05/12}{起動時の文字列に入れるBabelのバージョンを
%    元の\LaTeX{}のバナーから取得するコードを\file{uplatex.ini}から取り入れた}
%    \begin{macrocode}
\begingroup
  \def\parse@@BANNER\typeout#1\typeout#2#3\relax{#2}
  \edef\platexTMP{%
    \the\everyjob\noexpand\typeout{\expandafter\parse@@BANNER\platexBANNER}%
  }
  \everyjob=\expandafter{\platexTMP}%
  \edef\platexTMP{%
    \noexpand\let\noexpand\platexBANNER=\noexpand\@undefined
    \noexpand\everyjob={\the\everyjob}%
  }
  \expandafter
\endgroup \platexTMP
%</plfinal>
%    \end{macrocode}
% \end{macro}
%
% ^^A 起動時に\file{uplatex.cfg}がある場合、それを読み込むようにする
% ^^A コードは、\file{uplcore.ltx}から\file{uplatex.ltx}へ移動しました。
% \changes{v1.0y-u01}{2016/06/29}{\file{uplatex.cfg}の読み込みを追加}
% \changes{v1.0z-u01}{2016/08/26}{\file{uplatex.cfg}の読み込みを
%    \file{uplcore.ltx}から\file{uplatex.ltx}へ移動}
%
% \subsection{ハイフネーション関連}
%
% \begin{macro}{\l@nohyphenation}
% \LaTeXe\ 2017-04-15で、|\verb|の途中でハイフネーションが起きないように
% する修正が入りました。この修正には|\l@nohyphenation|が定義済みでなければ
% なりませんが、通常はBabelの定義ファイルによって提供されています。
% \LaTeXe{}は特殊な状況も想定してltfinalで対策しているようですので、
% p\LaTeXe{}も念のためplfinalで対策します(参考:latex2e svn r1405)。
% \changes{v1.1b}{2017/03/19}{\cs{l@nohyphenation}の定義を保証
%    (sync with ltfinal 2017/03/09 v2.0t)}
%    \begin{macrocode}
%<*plfinal>
\ifx\l@nohyphenation \@undefined
  \newlanguage\l@nohyphenation
\fi
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\document@default@language}
% \LaTeXe\ 2017-04-15で導入されたパラメータです。更新タイミングのずれの
% 可能性を考慮し、p\LaTeXe{}でも準備しておきます。verbatim環境の途中で
% 改ページが起きた場合にヘッダでハイフネーションが抑制されないように、
% |\@outputpage|で|\language|をリセットするときに使われます
% (参考:latex2e svn r1407)。
% \changes{v1.1b}{2017/03/19}{\cs{document@default@language}の定義を保証
%    (sync with ltfinal 2017/03/09 v2.0t)}
%    \begin{macrocode}
\ifx\document@default@language \@undefined
  \let\document@default@language\m@ne
\fi
%</plfinal>
%    \end{macrocode}
% \end{macro}
%
% \subsection{latexreleaseパッケージへの対応}
%
% 最後に、latexreleaseパッケージへの対応です。
% \begin{macro}{\plIncludeInRelease}
% \changes{v1.0t}{2016/02/03}{\cs{plIncludeInRelease}と
%    \cs{plEndIncludeInRelease}を新設。}
%    \begin{macrocode}
%<*plcore|platexrelease>
\def\plIncludeInRelease#1{\kernel@ifnextchar[%
  {\@plIncludeInRelease{#1}}
  {\@plIncludeInRelease{#1}[#1]}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@plIncludeInRelease#1[#2]{\@plIncludeInRele@se{#2}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\@plIncludeInRele@se#1#2#3{%
  \toks@{[#1] #3}%
  \expandafter\ifx\csname\string#2+\@currname+IIR\endcsname\relax
    \ifnum\expandafter\@parse@version#1//00\@nil
          >\expandafter\@parse@version\pfmtversion//00\@nil
      \GenericInfo{}{Skipping: \the\toks@}%
     \expandafter\expandafter\expandafter\@gobble@plIncludeInRelease
    \else
      \GenericInfo{}{Applying: \the\toks@}%
      \expandafter\let\csname\string#2+\@currname+IIR\endcsname\@empty
    \fi
  \else
    \GenericInfo{}{Already applied: \the\toks@}%
    \expandafter\@gobble@plIncludeInRelease
  \fi
}
%    \end{macrocode}
%
%    \begin{macrocode}
\long\def\@gobble@plIncludeInRelease#1\plEndIncludeInRelease{}
\let\plEndIncludeInRelease\relax
%</plcore|platexrelease>
%    \end{macrocode}
% \end{macro}
%
% \LaTeXe{}が提供するlatexreleaseパッケージが読み込まれていて、
% かつp\LaTeXe{}が提供するplatexreleaseパッケージが読み込まれていない
% 場合は、警告を出します。
% \changes{v1.0s}{2016/02/01}{latexrelease利用時に警告を出すようにした}
%    \begin{macrocode}
%<*plfinal>
\AtBeginDocument{%
  \@ifpackageloaded{latexrelease}{%
    \@ifpackageloaded{platexrelease}{}{%
      \@latex@warning@no@line{%
        Package latexrelease is loaded.\MessageBreak
        Some patches in pLaTeX2e core may be overwritten.\MessageBreak
        Consider using platexrelease.\MessageBreak
        See platex.pdf for detail}%
    }%
  }{}%
}
%</plfinal>
%    \end{macrocode}
%
% \Finale
%
\endinput