From 0596b70ef858295d6f164ff4603a889c42876365 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 13 May 2018 21:53:15 +0000 Subject: endnotesj (13may18) git-svn-id: svn://tug.org/texlive/trunk@47703 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/endnotesj/LICENSE | 27 + Master/texmf-dist/doc/latex/endnotesj/Makefile | 26 + Master/texmf-dist/doc/latex/endnotesj/README.md | 25 + .../doc/latex/endnotesj/endnotesj-ja.pdf | Bin 0 -> 146998 bytes .../doc/latex/endnotesj/endnotesj-ja.tex | 232 +++++++ .../texmf-dist/tex/latex/endnotesj/endnotesj.sty | 664 +++++++++++++++++++++ 6 files changed, 974 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/endnotesj/LICENSE create mode 100644 Master/texmf-dist/doc/latex/endnotesj/Makefile create mode 100644 Master/texmf-dist/doc/latex/endnotesj/README.md create mode 100644 Master/texmf-dist/doc/latex/endnotesj/endnotesj-ja.pdf create mode 100644 Master/texmf-dist/doc/latex/endnotesj/endnotesj-ja.tex create mode 100644 Master/texmf-dist/tex/latex/endnotesj/endnotesj.sty (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/endnotesj/LICENSE b/Master/texmf-dist/doc/latex/endnotesj/LICENSE new file mode 100644 index 00000000000..99a0c323d19 --- /dev/null +++ b/Master/texmf-dist/doc/latex/endnotesj/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016-2018 Hironobu Yamashita +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Master/texmf-dist/doc/latex/endnotesj/Makefile b/Master/texmf-dist/doc/latex/endnotesj/Makefile new file mode 100644 index 00000000000..831ffc14685 --- /dev/null +++ b/Master/texmf-dist/doc/latex/endnotesj/Makefile @@ -0,0 +1,26 @@ +KANJI = -kanji=utf8 +FONTMAP = -f ipaex.map -f ptex-ipaex.map +TEXMF = $(shell kpsewhich -var-value=TEXMFHOME) + +all: endnotesj-ja.pdf + +.SUFFIXES: .tex .dvi .pdf +.tex.dvi: + platex $(KANJI) $< + platex $(KANJI) $< + rm *.aux *.log +.dvi.pdf: + dvipdfmx $(FONTMAP) $< + +.PHONY: install clean +install: + mkdir -p ${TEXMF}/doc/latex/endnotesj + cp ./Makefile ${TEXMF}/doc/latex/endnotesj/ + cp ./LICENSE ${TEXMF}/doc/latex/endnotesj/ + cp ./README.md ${TEXMF}/doc/latex/endnotesj/ + cp ./*.pdf ${TEXMF}/doc/latex/endnotesj/ + cp ./*.tex ${TEXMF}/doc/latex/endnotesj/ + mkdir -p ${TEXMF}/tex/latex/endnotesj + cp ./*.sty ${TEXMF}/tex/latex/endnotesj/ +clean: + rm -f *.dvi *.pdf diff --git a/Master/texmf-dist/doc/latex/endnotesj/README.md b/Master/texmf-dist/doc/latex/endnotesj/README.md new file mode 100644 index 00000000000..4d7a3a4247b --- /dev/null +++ b/Master/texmf-dist/doc/latex/endnotesj/README.md @@ -0,0 +1,25 @@ +# endnotesj + +This bundle provides customized styles for endnote +to be used with Japanese documents (pLaTeX, upLaTeX and LuaLaTeX). + +## Installation + +- *.sty -> $TEXMF/tex/latex/endnotesj +- *.tex, *.pdf -> $TEXMF/doc/latex/endnotesj + +## Repository + +The bundle is maintained on GitHub: +https://github.com/aminophen/endnotesj + +## License + +The bundle may be distributed and/or modified under the terms of +the 3-clause BSD license (see [LICENSE](./LICENSE)). + +## Release Date + +2018-05-13 + +Hironobu Yamashita diff --git a/Master/texmf-dist/doc/latex/endnotesj/endnotesj-ja.pdf b/Master/texmf-dist/doc/latex/endnotesj/endnotesj-ja.pdf new file mode 100644 index 00000000000..0b66ad6d8a0 Binary files /dev/null and b/Master/texmf-dist/doc/latex/endnotesj/endnotesj-ja.pdf differ diff --git a/Master/texmf-dist/doc/latex/endnotesj/endnotesj-ja.tex b/Master/texmf-dist/doc/latex/endnotesj/endnotesj-ja.tex new file mode 100644 index 00000000000..9a3dc838511 --- /dev/null +++ b/Master/texmf-dist/doc/latex/endnotesj/endnotesj-ja.tex @@ -0,0 +1,232 @@ +%# -*- coding: utf-8 -*- +\ifdefined\epTeXinputencoding % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +% +% 日本語論文用 後註生成マクロ for pLaTeX2e 付属ドキュメント +% +% endnotesj.sty v3.0 系列は、熊本学園大学経済学部の +% 小川弘和さんによる endnotesj.sty 2003/02/12 v2.1 に対し、 +% 許可を得て山下弘展がいくつかの修正・拡張を施したものです。 +% +% この文書は、原著者である小川さんの文書 +% aboutendnotesj.sjis +% を山下が LaTeX ソース化し、適宜記述を追加したものです。 +% +% 元のファイル (v2.1) は、2016 年 9 月 8 日に +% JIS X 0212 for pTeX +% http://www2.kumagaku.ac.jp/teacher/herogw/ +% から取得しました。著作表記は、以下のとおりでした。 +% +% ============================================================= +% 改造者:小川弘和(熊本学園大学経済学部) +% mail:dokuroishi@mac.com,herogw@kumagaku.ac.jp +% web:http://homepage.mac.com/dokuroryokan/index.html +% http://www2.kumagaku.ac.jp/teacher/herogw/index.html +% +% based on "endnotes.sty" written by John Lavagnino +% lav@brandeis.bitnet, 9/23/88 +% Department of English and American Literature, +% Brandeis University +% ============================================================= +% + +\documentclass[a4paper]{jsarticle} +\usepackage{doc} +\usepackage{endnotesj} +\GetFileInfo{endnotesj.sty} +\def\Lpack#1{\textsf{#1}} +\def\Lopt#1{\texttt{#1}} +\title{\Lpack{\filename} \fileversion\\ + 日本語論文用 後註生成マクロ} +\author{小川 弘和(熊本学園大学経済学部)\\ + modified by 山下 弘展} +\date{\filedate} +\begin{document} + +\maketitle + +日本史・国文学関係論文作成に必要な、縦型の“(連数字)”形式 +註番号および、複数行にわたる註部分テキストの2行目以降を、先頭行 +テキスト開始位置に揃える表記を可能とした、後註生成マクロです。 +縦組論文での使用を意図して作成していますが、横組論文でもその +まま使用可能です。 + +このバージョン(\fileversion)は、旧版との互換性を極力維持しつつ、 +内部マクロを本家(\Lpack{endnotes.sty})最新版に合わせて更新し、さらに +機能拡張を施したものです。旧版同様にp\LaTeX/up\LaTeX{}で動作する +ことに加え、Lua\LaTeX\ (Lua\TeX-ja)にも対応しています。 +最新版はGitHubリポジトリ +\begin{verbatim} + https://github.com/aminophen/endnotesj +\end{verbatim} +で管理しています。 + +\section{コマンド・マニュアル} + +コマンド自体はオリジナルである\Lpack{endnotes.sty}と同じです。 + +\begin{itemize} +\item \verb+\endnote{註}+\\ + 本文中に挿入することで自動的に、\verb+{}+に挟まれたテキストを、 + 連番を付した後註として扱います。つまり、このコマンドの埋め込 + まれた位置の本文肩に註番号を生成するとともに、後に解説する + \verb+\theendnotes+コマンドによって、\verb+{}+に挟まれたテキ + ストの冒頭に同様の番号を付したうえで、後註として列挙するわけ + です。 +\item \verb+\endnote[数字]{註}+\\ + \verb+[数字]+部分に任意の数字を埋め込むことで、数字で指定した + 数を註番号とする後註を生成します。 + このコマンドによって生成された註は、上記\verb+\endnote{註}+に + よって生成される註とは別グループとして扱われるため、そちら + の番号に影響を与えることはありません。 + よって表記を改良すれば補注用として利用可能ですが、現状では + 通常の註と同スタイルのため紛らわしいので、使用は勧められません。 +\item \verb+\endnotemark[数字]+\\ + 実際には後註を生成せぬままで、本文肩に任意の註番号を生成します。 + また、\verb+[数字]+オプションを用いた場合、以降の註番号は任意 + の番号にスキップしたうえで生成されていくことになります。 +\item \verb+\endnotetext[数字]{註}+\\ + 番号を表立って表記せぬ後註を生成します。このコマンドの場合 + でも、内部的には註番号はカウントされています。 + なお[数字]オプションの機能は\verb+\endnotemark+と同様です。 +\item \verb+\theendnotes+\\ + 本文中に挿入することでその位置に、それまで\verb+\endnote+等の + コマンドによって生成された後註を列挙表示します。 + なお、\verb+\setcounter{endnote}{0}+コマンドを用いると、その + 後の註番号が再び(1)より開始されますので、本コマンドとの組合せ + によって、容易に章・節ごとの後註が作成できます。 +\end{itemize} + +\section{パッケージ・オプション} + +次に、パッケージのオプションを説明します。 +これらは\Lpack{endnotesj.sty}独自のものです。 + +\subsection{注釈印の書式} + +プリアンブルで +\begin{verbatim} + \usepackage{endnotesj} +\end{verbatim} +とすることで、縦組用の“(連数字)”型注(『日本史研究』等の形式。 +本文中では、注挿入指定位置直前の文字の直上に注No.を配置する。)が +使用可能に、 +\begin{verbatim} + \usepackage[yoko]{endnotesj} +\end{verbatim} +とすることで、横組用の“(数字)”型注(本文中では、注挿入指定 +位置直前の文字の直後上方に、ほぼ1/4倍角で注No.を配置する。)が +使用可能に、 +\begin{verbatim} + \usepackage[single]{endnotesj} +\end{verbatim} +とすることで、横組用の“数字)”型注(『歴史学研究』等の形式。 +本文中では、注挿入指定位置直前の文字の直後上方に、ほぼ1/4倍角で +注No.を配置する。)が使用可能になります。 + +\subsection{\Lpack{otf}パッケージを用いた注釈印の書式} + +\Lpack{otf}パッケージをインストールしてある環境であれば、 +注番号の数字に詰数字を用い、より奇麗に表示可能です。 +この機能を使うには +\begin{verbatim} + \usepackage[otf]{endnotesj} +\end{verbatim} +と指定します。\Lopt{otf}はv3.0で新設されたオプションで、 +旧バージョンv2.1にあった\Lopt{utf}も同じ意味になります。 + +このオプションを指定すると、 +\Lpack{otf.sty}および\Lpack{ajmacros.sty}で定義されている +\verb+\UTF+・\verb+\ajTumesuji+コマンドに動作が依存します。 +そのため、これらのパッケージを自動で読み込みます +\footnote{古い環境で\Lpack{utf.sty}および\Lpack{utfmacro.sty}しか +利用できない場合は、これらにフォールバックします。}。このため、 +別途これらのパッケージを\verb+\usepackage+する必要はありませんが、 +\Lpack{otf.sty}の各種オプション(\Lopt{expert}など)を用いたい場合は +\Lpack{endnotesj.sty}より\emph{前}に指定してください。 + +\subsection{後注列挙部分のタイトル} + +ここまでの節で紹介したオプション以外が\verb+\usepackage+の +オプションに指定された場合は、それを後注列挙部分のタイトルと +して用います。たとえば、 +\begin{verbatim} + \usepackage[注]{endnotesj} +\end{verbatim} +オプションで、文末の後注列挙部分の先頭に「注」、 +\begin{verbatim} + \usepackage[註]{endnotesj} +\end{verbatim} +オプションで「註」と表記されます(v2.1以前は「注」と「註」のみ +サポートしていましたが、v3.0以降は「注釈」や「後註」なども +自由に指定できます)。オプション無指定の場合には、何も表記せぬ +まま、注が列挙されていきます。 + +\section{行数・桁数指定マクロ} + +\Lpack{endnotesj.sty}には、 +『\LaTeX{}スタイル・マクロ ポケットリファレンス』(技術評論社)、 +いわゆるポケリで紹介されている行数・桁数指定マクロも組み込んで +あり、使用することが可能です。用紙サイズにあわせて自動的に字間 +配置を調整する\TeX{}には本来は、行数・桁数指定は馴染まないので +すが、投稿規定上、行数・文字数を固定する必要がある場合に用いて +ください。 + +基本的な記述法は以下の通りです。 +\begin{verbatim} + \kcharparline{30} + \begin{document} + \linesparpage{20} +\end{verbatim} + +\verb+\kcharparline{30}+が、用紙縦方向の文字数指定。 +この場合、30文字に指定しています。 +なお、このコマンドはプリアンプルで指定します。 + +\verb+\linesparpage{20}+が、用紙横方向の文字数指定。 +ここでは、20文字に指定しています。こちらは本文で指定するか、 +\verb+\AtBeginDocument{}+に入れて使用します。 + +\section{旧版(v2.1以前)との違い} + +% ---- 細かい挙動なので削除 ---- +% v2.1以前とv3.0以降の唯一の違いとして、v2.1では「注」と「註」を +% 同時に指定した場合には「注」が優先されましたが、v3.0以降は +% 「複数指定されたうちの最後の一つ」が優先されます。同時に指定 +% するという使い方は全く無意味でしたから、影響はないと思います。 + +% ----- 2018 年となっては 15 年以上前の話なので削除 ----- +% なお、v2よりもっと古く配布していた、横組用“数字)”型表記用 +% マクロendnotesjs.styは、endnotesj.styに機能が改良統合された +% ため、廃止しました。また、以前は本文肩註番号表記の実現に際し、 +% 金水敏氏が作成された訓点資料表記用マクロkunten2e.styに定義され +% ている\verb+\MigiNakaTn+コマンドに依存しておりましたが、記述を +% 見直すことにより、非依存となりました。 + +旧版(v2.1)からv3.0での変更点は、以下のとおりです。 +\begin{itemize} +\item パッケージのコード本体からASCII文字以外を排除。 +\item 後註内部マクロを最新の\Lpack{endnotes.sty}% + \footnote{Date of this version: 15 January 2003.}ベースに更新。 + これにより、例えば本文中で合印直前で行分割することがあった問題が + 解決しました。 +\item パッケージのオプションを拡張。 + 組方向(縦・横)に応じて適切な注の印が出る\Lopt{auto-tateyoko}を + 新設し、これをデフォルトに設定しました。 + また、「注」「註」以外のタイトル形式を可能になりました。 +\item もし本家パッケージ(\Lpack{endnotes.sty})が存在する場合で、 + \Lpack{endnotesj.sty}が読み込まれた時点で未読み込みならば、 + 読み込み済み扱いするようにした(そうしないと、後で意図せず + 読み込まれて、日本語対応コードが上書きされるかもしれないため。) +\item \verb+\linesparpage+の修正(行間の数ではなく行数で割って + いたため、行数が合わないことがありました。また、\verb+\topskip+の + 分を差し引いておらず、正しい行間隔になっていませんでした。) +\end{itemize} + +\section{実際のスタイル見本(日本語版)} + +スタイル見本はGitHubのsamplesディレクトリを参照してください。 + +\end{document} diff --git a/Master/texmf-dist/tex/latex/endnotesj/endnotesj.sty b/Master/texmf-dist/tex/latex/endnotesj/endnotesj.sty new file mode 100644 index 00000000000..66848a93196 --- /dev/null +++ b/Master/texmf-dist/tex/latex/endnotesj/endnotesj.sty @@ -0,0 +1,664 @@ +% +% Package ``endnotesj.sty'' for endnotes in Japanese articles, +% written by Hirokazu OGAWA and Hironobu YAMASHITA +% +% This package is part of the endnotesj bundle. +% https://github.com/aminophen/endnotesj +% +% Authors: +% * Hirokazu OGAWA (Kumamoto Gakuen University) +% Mail: herogw at kumagaku.ac.jp +% Web: http://www2.kumagaku.ac.jp/teacher/herogw/index.html +% * Hironobu YAMASHITA +% Mail: h.y.acetaminophen at gmail.com +% Github: @aminophen +% +% This work is based on ``endnotes.sty'' (15 January 2003) +% written by John Lavagnino. +% +% **************************************** +% * ENDNOTE MACROS * +% **************************************** +% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{endnotesj} + [2018/05/13 v3.0 endnotesj (H. Ogawa and H. Yamashita)] +% +%% Requirements: engine & format +% +% This package supports pTeX/upTeX and LuaTeX-ja only; +% otherwise, throw an error +% When the error is ignored, fall back to endnotes.sty and exit +% (--> unsupported feature, of course) +\ifx\pfmtname\@undefined + \expandafter\ifx\csname ver@luatexja.sty\endcsname\relax + \PackageError{endnotesj}{% + Unsupported engine detected!\MessageBreak + Please use pLaTeX, upLaTeX or LuaTeX-ja instead}{% + I will load `endnotes.sty' instead, but + the result will be undesired.} + \RequirePackage{endnotes} + \expandafter\expandafter\expandafter\endinput\expandafter\fi +\fi +% +% Ensure compatibility in units between pTeX/upTeX and LuaTeX-ja +% * \endnj@zw = width of the current full-width Japanese font +% (zen-kaku width) +% * \endnj@zh = height of the current full-width Japanese font +% (zen-kaku height) +\ifx\directlua\@undefined + % pTeX/upTeX should have `zw' and `zh' + \def\endnj@zw{zw} + \def\endnj@zh{zh} +\else + % LuaTeX-ja should have `\zw` and `\zh' + \def\endnj@zw{\zw} + \def\endnj@zh{\zh} +\fi +% +%% Ensure that endnotes.sty is NOT loaded after this package +% +\@ifpackageloaded{endnotes}{}{% + \IfFileExists{endnotes.sty}{% + \expandafter\def\csname ver@endnotes.sty\endcsname{}}{}} +% +%% Initialize \notesname +% +\def\notesname{} % should be empty by default (endnotesj.sty original) +% +%% Package options (endnotesj original) +%% * Note that the order of declarations is also important, especially +%% for options which compete with each other (e.g. tate/yoko) +%% cf. ltclass.dtx +%% "In the case of \ProcessOptions, they are processed in the +%% order that they were declared in the class or package." +% +% Directions - force yoko (horizontal) or tate (vertical)? +\newif\if@endnj@tate \@endnj@tatefalse +\newif\if@endnj@yoko \@endnj@yokofalse +\newif\if@endnj@autotateyoko \@endnj@autotateyokofalse +\DeclareOption{tate}{\@endnj@autotateyokofalse\@endnj@tatetrue\@endnj@yokofalse} +\DeclareOption{yoko}{\@endnj@autotateyokofalse\@endnj@yokotrue\@endnj@tatefalse} +% +% Use conditional definitions for switching marks depending on +% vertical/horizontal Japanese writing direction +\DeclareOption{auto-tateyoko}{\@endnj@autotateyokotrue\@endnj@tatefalse\@endnj@yokofalse} +% +% Brackets - single or twin? +\newif\if@endnj@single \@endnj@singlefalse +\DeclareOption{twin}{\@endnj@singlefalse} % => default +\DeclareOption{single}{\@endnj@singletrue} +% +% Use utf/otf package? +\newif\if@endnj@utf \@endnj@utffalse +\DeclareOption{utf}{\@endnj@utftrue} +\DeclareOption{otf}{\@endnj@utftrue} +% +% `ver3' mode - Use improved styles of \@makeenmark (endnote marks) and +% \enoteformat (the endnote format) +\def\endnj@vermode{3} +\DeclareOption{ver3}{\def\endnj@vermode{3}} % => future default +% +% `ver2' mode - For backward compatibility: use styles of \@makeenmark +% and \enoteformat which are inherited from previous +% versions of endnotesj.sty +\DeclareOption{ver2}{\typeout{*** endnotesj version 2 compatibility mode ***}% + \def\endnj@vermode{2}} +% +% Other options are unknown, however endnotesj.sty accepts only one +% unknown option, which is then regarded as \notesname (= endnote section title) +% If more than one unknown options are requested, the last one is chosen; +% the others are simply ignored, so throw an error (for fear of misspelling) +\def\endnj@temp@ptions{} +\DeclareOption*{\ifx\endnj@temp@ptions\@empty + \edef\endnj@temp@ptions{\CurrentOption}% + \else + \edef\endnj@temp@ptions{\endnj@temp@ptions,\CurrentOption}% + \fi + \edef\notesname{\CurrentOption}} +\ExecuteOptions{auto-tateyoko,twin,ver3} +\ProcessOptions +% +%% Option handlings +% +% Throw an error for more than one unknown options +% Also, show info about what will be used as `\notesname' +\@for\reserved@a:=\endnj@temp@ptions\do{% + \ifx\reserved@a\notesname + \typeout{*** Package endnotesj will use `\notesname' as \string\notesname. ***}% + \else + \ifx\reserved@a\@empty\else + \PackageError{endnotesj}{% + Unknown option `\reserved@a' ignored!\MessageBreak + It seems that more than one unknown options\MessageBreak + were requested, and `\notesname' was taken as\MessageBreak + \string\notesname. Perhaps you misspelled some options}{% + The options `\endnj@temp@ptions' were not declared in package endnotesj.\MessageBreak + Package endnotesj accepts ONLY ONE unknown option (the last one;\MessageBreak + in this case `\notesname'), which is regarded as \string\notesname.\MessageBreak + The others will be simply ignored.} + \fi + \fi} +% +% If `single' is specified, `tate' should be false +\if@endnj@single + \if@endnj@tate + \PackageWarning{endnotesj}{% + Option `single' cannot be used with `tate'.\MessageBreak + Please use `auto-tateyoko' or `yoko'.\MessageBreak + Entering `auto-tateyoko' mode} + \@endnj@autotateyokotrue\@endnj@tatefalse\@endnj@yokofalse + \fi +\fi +% +% If `otf'/`utf' options are specified, load either of otf.sty/utf.sty +\if@endnj@utf +\ifx\directlua\@undefined + \@ifpackageloaded{utf}{}{\@ifpackageloaded{otf}{}{% + \IfFileExists{otf.sty}{\RequirePackage{otf}}{% + \IfFileExists{utf.sty}{\RequirePackage{utf}}{% + \PackageError{endnotesj}{Neither otf.sty nor utf.sty found}\@ehc + \@endnj@utffalse}% fall back + }}} +\else + \@ifpackageloaded{luatexja-otf}{}{% + \IfFileExists{luatexja-otf.sty}{\RequirePackage{luatexja-otf}}{% + \PackageError{endnotesj}{luatexja-otf.sty not found}\@ehc + \@endnj@utffalse}% fall back + } +\fi +\fi +% +%% Misc helpers +% +% fallback from #1 to #2 (tate-single -> tate-twin) +% once #1 is executed, throw a warning and replace its definition with +% the definition of #2, and execute it +\def\endnj@tate@single@unavailable#1#2{% + \def#1{% + \PackageWarning{endnotesj}{% + `single' style is unavailable in `tate' direction.\MessageBreak + I'll use `twin' style instead.}% + \global\let#1#2% + #1}% +} +% +% +%%%%% Import from endnotes.sty +% +\@definecounter{endnote} +\def\theendnote{\arabic{endnote}} +% +%%%%% End +% +% +%% Customized endnote marks inside the main text for Japanese documents +% +% [1] `tate' & `twin' +% Common style for vertical writing with twin full-width round brackets +% like "Journal of Japanese history" (Nihonshi kenkyu) +% +% *** ver 2 *** +\def\endnj@ii@tate@makeenmark{% + \kern -1.2\endnj@zw% + \raisebox{.8\endnj@zh}{\tiny \char\jis"214A\relax\hspace{0.2\endnj@zw}% + \hbox{\yoko\@theenmark}% + \hspace{0.2\endnj@zw}\char\jis"214B\relax + }% +} +% *** ver 3 *** +\def\endnj@iii@tate@makeenmark{% + \hb@xt@\z@{% + \kern -1.2\endnj@zw\hss + \raisebox{.8\endnj@zh}{\tiny \char\jis"214A\relax\hspace{0.1\endnj@zw}% + \hbox{\yoko\@theenmark}% + \hspace{0.1\endnj@zw}\char\jis"214B\relax + }% + }% +} +% +% [1'] `tate' & `twin' & `utf' +% More beautiful output using "tsume-suji" requires otf/utf package +% +% *** ver 2 *** +\def\endnj@ii@tate@utf@makeenmark{% + \kern -1.2\endnj@zw% + \raisebox{.8\endnj@zh}{\tiny \char\jis"214A\relax + \hbox{\yoko\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \char\jis"214B\relax + }% +} +% *** ver 3 *** +\def\endnj@iii@tate@utf@makeenmark{% + \hb@xt@\z@{% + \kern -1.2\endnj@zw\hss + \raisebox{.8\endnj@zh}{\tiny \char\jis"214A\relax + \hbox{\yoko\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \char\jis"214B\relax + }% + }% +} +% +% [2] `yoko' & `twin' +% Common style for horizontal writing with twin round brackets +% +% *** ver 2 *** +\def\endnj@ii@yoko@makeenmark{% + \raisebox{.5\endnj@zh}{\tiny (\hspace{0.2\endnj@zw}% + \hbox{\@theenmark}% + )% + }% +} +% *** ver 3 *** (using twin full-width round brackets) +\def\endnj@iii@yoko@makeenmark{% + \raisebox{.5\endnj@zh}{\tiny \char\jis"214A\relax\hspace{0.1\endnj@zw}% + \hbox{\@theenmark}% + \hspace{0.1\endnj@zw}\char\jis"214B\relax + }% +} +% +% [2'] `yoko' & `twin' & `utf' +% More beautiful output using "tsume-suji" requires otf/utf package +% +% *** ver 2 *** +\def\endnj@ii@yoko@utf@makeenmark{% + \raisebox{.5\endnj@zh}{\tiny \char\jis"214A\relax + \hbox{\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \char\jis"214B\relax + }% +} +% *** ver 3 *** +\let\endnj@iii@yoko@utf@makeenmark\endnj@ii@yoko@utf@makeenmark +% +% [3] `yoko' & `single' +% Style for horizontal writing with single round bracket +% like "Journal of historical studies" (Rekishigaku kenkyu) +% +% *** ver 2 *** +\def\endnj@ii@yoko@single@makeenmark{% + \raisebox{.5\endnj@zh}{\tiny + \hbox{\@theenmark}% + )% + }% +} +% *** ver 3 *** +\let\endnj@iii@yoko@single@makeenmark\endnj@ii@yoko@single@makeenmark +% +% [3'] `yoko' & `single' & `utf' +% More beautiful output using "tsume-suji" requires otf/utf package +% +% *** ver 2 *** +\def\endnj@ii@yoko@single@utf@makeenmark{% + \raisebox{.5\endnj@zh}{\tiny + \hbox{\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \char\jis"214B\relax + }% +} +% *** ver 3 *** +\let\endnj@iii@yoko@single@utf@makeenmark\endnj@ii@yoko@single@utf@makeenmark +% +% [4] `tate' & `single' (& `utf') +% Not available! - fallback definitions +% +\endnj@tate@single@unavailable\endnj@ii@tate@single@makeenmark\endnj@ii@tate@makeenmark +\endnj@tate@single@unavailable\endnj@iii@tate@single@makeenmark\endnj@iii@tate@makeenmark +\endnj@tate@single@unavailable\endnj@ii@tate@single@utf@makeenmark\endnj@ii@tate@utf@makeenmark +\endnj@tate@single@unavailable\endnj@iii@tate@single@utf@makeenmark\endnj@iii@tate@utf@makeenmark +% +% Current names of the commands for `tate' and `yoko' +% +\expandafter\def\expandafter\endnj@tate@makeenmark\expandafter{% + \csname endnj@% + \romannumeral\endnj@vermode @% + tate@% + \if@endnj@single single@\fi% + \if@endnj@utf utf@\fi% + makeenmark\endcsname} +\expandafter\def\expandafter\endnj@yoko@makeenmark\expandafter{% + \csname endnj@% + \romannumeral\endnj@vermode @% + yoko@% + \if@endnj@single single@\fi% + \if@endnj@utf utf@\fi% + makeenmark\endcsname} +% +% Now, redefine \@makeenmark using above definitions +% +\if@endnj@tate + \let\@makeenmark\endnj@tate@makeenmark +\fi +\if@endnj@yoko + \let\@makeenmark\endnj@tate@makeenmark +\fi +% +%% End +% +% +%%%%% Import from endnotes.sty +% +\def\makeenmark{\@makeenmark} % Added in endnotes.sty (JL 12 January 2003) +\def\theenmark{\@theenmark} % Added in endnotes.sty (JL 12 January 2003) +% +\newdimen\endnotesep +% +\def\endnote{\@ifnextchar[\@xendnote{\stepcounter{endnote}% + \protected@xdef\@theenmark{\theendnote}% + \@endnotemark\@endnotetext}} +% +\def\@xendnote[#1]{% + \begingroup + \c@endnote=#1\relax + \unrestored@protected@xdef\@theenmark{\theendnote}% + \endgroup + \@endnotemark\@endnotetext} +% +\let\@doanenote=0 +\let\@endanenote=0 +% +\newwrite\@enotes +\newif\if@enotesopen \global\@enotesopenfalse +% +\def\@openenotes{\immediate\openout\@enotes=\jobname.ent\relax + \global\@enotesopentrue} +% +\long\def\@endnotetext#1{% + \if@enotesopen \else \@openenotes \fi + \immediate\write\@enotes{\@doanenote{\@theenmark}}% + \begingroup + \def\next{#1}% + \newlinechar='40 + \immediate\write\@enotes{\meaning\next}% + \endgroup + \immediate\write\@enotes{\@endanenote}} +% +\long\def\addtoendnotes#1{% + \if@enotesopen \else \@openenotes \fi + \begingroup + \newlinechar='40 + \let\protect\string + \immediate\write\@enotes{#1}% + \endgroup} +% +\def\endnotemark{% + \@ifnextchar[\@xendnotemark + {\stepcounter{endnote}% + \protected@xdef\@theenmark{\theendnote}% + \@endnotemark}} +% +\def\@xendnotemark[#1]{% + \begingroup + \c@endnote #1\relax + \unrestored@protected@xdef\@theenmark{\theendnote}% + \endgroup + \@endnotemark} +% +\def\@endnotemark{% + \leavevmode + \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi + \makeenmark + \ifhmode\spacefactor\@x@sf\fi + \relax} +% +\def\endnotetext{% + \@ifnextchar [\@xendnotenext + {\protected@xdef\@theenmark{\theendnote}% + \@endnotetext}} +% +\def\@xendnotenext[#1]{% + \begingroup + \c@endnote=#1\relax + \unrestored@protected@xdef\@theenmark{\theendnote}% + \endgroup + \@endnotetext} +% +\def\enoteheading{\section*{\notesname + \@mkboth{\MakeUppercase{\notesname}}{\MakeUppercase{\notesname}}}% + \mbox{}\par\vskip-\baselineskip} +% +%%%%% End +% +% +%% Settings of endnote formatting at the end of Japanese documents +%% (The numbering styles and indentation are considered.) +% +% [1] `tate' & `twin' +% Common style for vertical writing with twin full-width round brackets +% like "Journal of Japanese history" (Nihonshi kenkyu) +% +% *** ver 2 *** +\def\endnj@ii@tate@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{\raisebox{.07\endnj@zh}{(}\hspace{0.2\endnj@zw}% + \hbox{\yoko\@theenmark}% + \hspace{0.2\endnj@zw}\raisebox{.07\endnj@zh}{)}% + }#1% +} +% *** ver 3 *** +\def\endnj@iii@tate@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{\mbox{}\char\jis"214A\relax\hspace{0.1\endnj@zw}% + \hbox{\yoko\@theenmark}% + \hspace{0.1\endnj@zw}\char\jis"214B\relax\mbox{}% + }#1% +} +% +% [1'] `tate' & `twin' & `utf' +% More beautiful output using "tsume-suji" requires otf/utf package +% +% *** ver 2 *** +\def\endnj@ii@tate@utf@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{\UTF{FE35}% + \hbox{\yoko\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \UTF{FE36}% + }#1% +} +% *** ver 3 *** +\def\endnj@iii@tate@utf@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{\mbox{}\char\jis"214A\relax + \hbox{\yoko\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \char\jis"214B\relax\mbox{}% + }#1% +} +% +% [2] `yoko' & `twin' +% Common style for horizontal writing with twin round brackets +% +% *** ver 2 *** +\def\endnj@ii@yoko@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{(\hspace{0.2\endnj@zw}% + \hbox{\@theenmark}% + \hspace{0.2\endnj@zw})% + }#1% +} +% *** ver 3 *** (using twin full-width round brackets) +\def\endnj@iii@yoko@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{\mbox{}\char\jis"214A\relax\hspace{0.1\endnj@zw}% + \hbox{\@theenmark}% + \hspace{0.1\endnj@zw}\char\jis"214B\relax\mbox{}% + }#1% +} +% +% [2'] `yoko' & `twin' & `utf' +% More beautiful output using "tsume-suji" requires otf/utf package +% +% *** ver 2 *** +\def\endnj@ii@yoko@utf@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{\char\jis"214A\relax% + \hbox{\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \char\jis"214B\relax + }#1% +} +% *** ver 3 *** +\def\endnj@iii@yoko@utf@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{\mbox{}\char\jis"214A\relax% + \hbox{\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \char\jis"214B\relax\mbox{}% + }#1% +} +% +% [3] `yoko' & `single' +% Style for horizontal writing with single round bracket +% like "Journal of historical studies" (Rekishigaku kenkyu) +% +% *** ver 2 *** +\def\endnj@ii@yoko@single@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{% + \hbox{\@theenmark}% + )% + }#1% +} +% *** ver 3 *** +\let\endnj@iii@yoko@single@enoteformat\endnj@ii@yoko@single@enoteformat +% +% [3'] `yoko' & `single' & `utf' +% More beautiful output using "tsume-suji" requires otf/utf package +% +% *** ver 2 *** +\def\endnj@ii@yoko@single@utf@enoteformat#1{% + \parindent 1em\noindent + \@hangfrom{% + \hbox{\expandafter\ajTumesuji\expandafter*\expandafter{\number\@theenmark}}% + \char\jis"214B\relax + }#1% +} +% *** ver 3 *** +\let\endnj@iii@yoko@single@utf@enoteformat\endnj@ii@yoko@single@utf@enoteformat +% +% [4] `tate' & `single' (& `utf') +% Not available! - fallback definitions +% +\endnj@tate@single@unavailable\endnj@ii@tate@single@enoteformat\endnj@ii@tate@enoteformat +\endnj@tate@single@unavailable\endnj@iii@tate@single@enoteformat\endnj@iii@tate@enoteformat +\endnj@tate@single@unavailable\endnj@ii@tate@single@utf@enoteformat\endnj@ii@tate@utf@enoteformat +\endnj@tate@single@unavailable\endnj@iii@tate@single@utf@enoteformat\endnj@iii@tate@utf@enoteformat +% +% Current names of the commands for `tate' and `yoko' +% +\expandafter\def\expandafter\endnj@tate@enoteformat\expandafter{% + \csname endnj@% + \romannumeral\endnj@vermode @% + tate@% + \if@endnj@single single@\fi% + \if@endnj@utf utf@\fi% + enoteformat\endcsname} +\expandafter\def\expandafter\endnj@yoko@enoteformat\expandafter{% + \csname endnj@% + \romannumeral\endnj@vermode @% + yoko@% + \if@endnj@single single@\fi% + \if@endnj@utf utf@\fi% + enoteformat\endcsname} +% +% Now, redefine \enoteformat using above definitions +% +\if@endnj@tate + \let\enoteformat\endnj@tate@enoteformat +\fi +\if@endnj@yoko + \let\enoteformat\endnj@yoko@enoteformat +\fi +% +%% End +% +% +\def\enotesize{\small} % endnotesj.sty original +% +%%%%% Import from endnotes.sty +% +\def\theendnotes{\immediate\closeout\@enotes \global\@enotesopenfalse + \begingroup + \makeatletter + % + % The machinery with \@ResetGT and > here ensures that + % \@doanenote works properly even if > is an active character + % at the point where \theendnotes is invoked. > needs to have + % catcode 12 when the arguments of \@doanenote are scanned, so + % that the > in the string "macro:->" is matched. The actual + % footnote text is not an argument to \@doanenote, but just + % follows it in the .ent file; so \@ResetGT can reset the + % category code for > that should be used when processing + % that text. That resetting takes place within a + % \begingroup-\endgroup block set up by \@doanenote and + % \@endanenote, so the catcode for > is back to 12 for the + % next note. + % + \edef\@tempa{`\string >}% + \ifnum\catcode\@tempa=12% + \let\@ResetGT\relax + \else + \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}% + \@makeother\>% + \fi + \def\@doanenote##1##2>{\def\@theenmark{##1}\par\begingroup + \@ResetGT + \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}% + \enoteformat} + \def\@endanenote{\par\endgroup}% + \enoteheading + \enotesize + \input{\jobname.ent}% + \endgroup} +% +%%%%% End +% +% +%% Definitions for auto-tateyoko option +% +\ifx\directlua\@undefined + \catcode`\L=14\relax + \catcode`\P=9\relax +\else + \catcode`\L=9\relax + \catcode`\P=14\relax +\fi +\if@endnj@autotateyoko + \def\@makeenmark{% +P \iftdir +L \ifnum\numexpr +L \ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8=3\relax + \endnj@tate@makeenmark + \else + \endnj@yoko@makeenmark + \fi} + \def\enoteformat{% +P \iftdir +L \ifnum\numexpr +L \ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8=3\relax + \endnj@tate@enoteformat + \else + \endnj@yoko@enoteformat + \fi} +\fi +\catcode`\L=11\relax +\catcode`\P=11\relax +% +% +% **************************************** +% * Lines per page & Characters per line * +% **************************************** +% +% Changes in v3.0: +% * \linesparpage: the number of interline skip is fewer +% than the number of lines +% * \linesparpage: subtract \topskip from \textheight +% * \kcharparline: add \relax at the end of definition +% +\def\linesparpage#1{% + \@tempcnta=#1\relax + \advance\@tempcnta by \m@ne + \baselineskip=\textheight + \advance\baselineskip by -\topskip + \divide\baselineskip by \@tempcnta\relax} +\def\kcharparline#1{% + \xkanjiskip 0mm plus 0.2mm minus 0.2mm + \settowidth{\textwidth}{\char\jis"2422}% + \multiply\textwidth by #1\relax} +% +\endinput -- cgit v1.2.3