summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/inlinelabel/inlinelabel.tex
blob: 66f961ce7b80bda15b8ad88eadc72109944ccc90 (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
\documentclass[%
fleqn,%
paper=a4paper,%
fontsize=10pt,%
open_bracket_pos=zenkakunibu_nibu,%
hanging_punctuation,%
]%
{jlreq}
\jlreqsetup{%
itemization_beforeafter_space=0pt,%
itemization_itemsep=0pt%
}
\makeatletter
\RequirePackage{luatexja}
\RequirePackage{luatexja-otf}
\RequirePackage{graphicx}
\RequirePackage{amsmath}
\DeclareRobustCommand{\metaphysicaicon}{\raisebox{-4.0pt}{\includegraphics[width=16pt]{metaphysicaicon.pdf}}}
\RequirePackage[normalem]{ulem}
\RequirePackage[explicit]{titlesec}
\titleformat{\section}[hang]{}{}{0pt}{\uuline{\raisebox{1pt}{\textsf{\thesection\quad #1}}}}[\vspace{0.35\baselineskip}]
\renewcommand{\thesection}{\S\,\arabic{section}}
\let\originalsection\section
\DeclareRobustCommand{\section}{\@ifstar{\@metaphysica@section@star}{\@metaphysica@section@nostar}}
\DeclareRobustCommand{\@metaphysica@section@star}[1]{\vspace{0.5\baselineskip}\originalsection{#1}\vspace*{-\baselineskip}}
\DeclareRobustCommand{\@metaphysica@section@nostar}[1]{\vspace{0.5\baselineskip}\originalsection{#1}}
\RequirePackage[%
truedimen,%
margin=30truemm,
includehead%
]{geometry}
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\DeclareRobustCommand{\headertitle}[2][\metaphysicaicon]{%
\rhead[#2]{#1{}\quad\thepage{}/{}\pageref{LastPage}}%
\lhead[\thepage{}/{}\pageref{LastPage}\quad{}#1]{#2}%
\cfoot{}%
}
\RequirePackage{setspace}
\setstretch{1.155}
\DeclareRobustCommand{\linespace}{\@ifstar{\vspace{\baselineskip}}{\vspace{0.25\baselineskip}}}
\DeclareRobustCommand{\linesmash}{\@ifstar{\vspace{-\baselineskip}}{\vspace{-0.25\baselineskip}}}
\AtBeginDocument{%
\abovedisplayskip     =0.125\abovedisplayskip
\abovedisplayshortskip=0.125\abovedisplayshortskip
\belowdisplayskip     =0.125\belowdisplayskip
\belowdisplayshortskip=0.125\belowdisplayshortskip}
\setlength{\jot}{0pt}%
\setlength{\mathindent}{2\zw}%
\renewcommand{\floatpagefraction}{0.75}
\allowdisplaybreaks[2]
\RequirePackage[no-math]{fontspec}
\RequirePackage[no-math,deluxe,haranoaji]{luatexja-preset}
\RequirePackage{multicolpar}
\RequirePackage[style=iso]{datetime2}
\RequirePackage[unicode]{hyperref}
\RequirePackage{xparse}
\RequirePackage{dashbox}
\newcounter{psuedosectioncounter}
\setcounter{psuedosectioncounter}{1}
\newcounter{psuedocontentscounter}
\setcounter{psuedocontentscounter}{1}
\DeclareRobustCommand{\psuedosection}[3]{%
\hypertarget{#1}{\mbox{}}\begin{multicolpar}{2}%
\noindent\uuline{{\raisebox{1pt}{\textsf{\S\ \thepsuedosectioncounter\quad #2}}}}

\noindent\uuline{{\raisebox{1pt}{\textsf{\S\ \thepsuedosectioncounter\quad #3}}}}
\end{multicolpar}%
\stepcounter{psuedosectioncounter}%
\vspace{\baselineskip}%
}
\DeclareRobustCommand{\psuedocontents}[3]{%
\begin{multicolpar}{2}%
\noindent{\textsf{\hyperlink{#1}{\S\ \thepsuedocontentscounter\quad #2}}}

\noindent{\textsf{\hyperlink{#1}{\S\ \thepsuedocontentscounter\quad #3}}}\end{multicolpar}%
\stepcounter{psuedocontentscounter}%
}
\newenvironment{translateing}%
{\begin{multicolpar}{2}}
{\end{multicolpar}\vspace{\baselineskip}}
\DeclareRobustCommand{\maketitletranslating}%
{\maketitle\thispagestyle{fancy}
\vspace{\baselineskip}\begin{multicolpar}{2}
\textsf{English}

\noindent
\textsf{日本語 (Japanese)}
\end{multicolpar}\vspace{\baselineskip}}
\NewDocumentCommand\macroexplanation{v}{%
\noindent\hspace*{\fill}{\texttt{#1}}\hspace*{\fill}\linespace%
}
\NewDocumentEnvironment{macroexample}{O{0.625} +b}{%
\noindent\hspace*{\fill}\dbox{\parbox{#1\textwidth}{%
#2%
}}\hspace*{\fill}}%
{\vspace{\baselineskip}}
\NewDocumentEnvironment{macroexample*}{O{0.625} m +b}{%
\noindent\hspace*{\fill}\dbox{\parbox{#1\textwidth}{%
\vspace{-0.5\baselineskip}\begin{#2}%
#3
\end{#2}%
}}\hspace*{\fill}}
{\vspace{\baselineskip}}
\let\code\texttt
\setlength{\fboxsep}{1em}
\setstretch{1.05}
\DeclareRobustCommand{\commandtojskip}{\hspace{2.40554pt plus 1.49994pt minus 0.59998pt}}
\RequirePackage{listings, jlisting}
\lstset{
  language=[LaTeX]TeX,
  basicstyle={\ttfamily},
  identifierstyle={\small},
  commentstyle={\small\itshape},
  keywordstyle={\small\bfseries},
  ndkeywordstyle={\small},
  stringstyle={\small\ttfamily},
  frame=single,
  breaklines=true,
  columns=[l]{fullflexible},
  stepnumber=1,
  xrightmargin=0.1709\textwidth,
  xleftmargin=0.1709\textwidth,
  lineskip=-0.5ex
}
\RequirePackage{bxtexlogo}
\RequirePackage{shortvrb}
\MakeShortVerb{\|}
\RequirePackage[luacircled]{inlinelabel}
\makeatother
%
\hypersetup{%
bookmarksnumbered=true,%
colorlinks=true,%
linkcolor=blue,%
urlcolor=blue,%
setpagesize=false,%
pdftitle={The inlinelabel package},%
pdfauthor={Yukoh KUSAKABE},%
pdfsubject={The inlinelabel package},%
pdfkeywords={TeX LaTeX inlinel label}}
\title{The \code{inlinelabel} package:\\[0.25\baselineskip]
assign equation numbers to inline equations}
\author{Yukoh KUSAKABE}
%\author{Y\=uk\=o KUSAKABE}
\date{\today}
\headertitle[Yukoh KUSAKABE\quad\metaphysicaicon]{The \code{inlinelabel} package}
%\headertitle[Y\=uk\=o KUSAKABE\quad\metaphysicaicon]{The \code{inlinelabel} package}
\begin{document}
\maketitletranslating

\begin{translateing}
This package can assign equation numbers to inline equations. When Japanese is supported, you can switch to circled equation numbers.

このパッケージは,インライン数式に数式番号を振ることができます。また,日本語を扱えるときには,丸で囲まれた数式番号に切り替えることができます。
\end{translateing}

%\psuedocontents{inlinelabel}
%{Package \code{inlinelabel}}
%{\code{inlinelabel} パッケージ}

\psuedocontents{Requirements}{System Requirements}{前提条件}

\psuedocontents{Installation}{Installation}{インストール}

\psuedocontents{Loading}{Loading}{読み込み}

\psuedocontents{Usage}{Usage}{使用方法}

\psuedocontents{moreinfo}{For More Information}{問い合わせ・詳しくは}

%\psuedosection{inlinelabel}{Package \code{inlinelabel}}{\code{inlinelabel} パッケージ}
%
%\begin{translateing}
%This package can assign equation numbers to inline equations. When Japanese is supported, you can switch to circled equation numbers.
%
%このパッケージは,インライン数式に数式番号を振ることができます。また,日本語を扱えるときには,丸で囲まれた数式番号に切り替えることができます。
%\end{translateing}

\psuedosection{Requirements}{System Requirements}{前提条件}

\begin{translateing}
\textbullet\ \LaTeXe\ format\\
\textbullet\ \code{amsmath} package\\
\textbullet\ \code{refcount} package\\
\textbullet\ \pTeX\ engine (\code{[circled]} only)\\
\textbullet\ \code{japanese-otf} package (\code{[circled]} only)\\
\textbullet\ \LuaTeX\ engine (\code{[luacircled]} only)\\
\textbullet\ \scalebox{0.95}[1]{\code{luatexja-otf} package (\code{[luacircled]} only)}

\noindent
\textbullet\ \LaTeXe フォーマット\\
\textbullet\ \code{amsmath} パッケージ\\
\textbullet\ \code{refcount} パッケージ\\
\textbullet\ \pTeX エンジン(\code{[circled]}使用時)\\
\textbullet\ \scalebox{0.9}[1]{\code{japanese-otf} パッケージ(\code{[circled]}使用時)}\\
%\textbullet\ \code{luatexja-otf} パッケージ\\
%\hfill (\code{[luacircled]}使用時)
\textbullet\ \LuaTeX エンジン(\code{[luacircled]}使用時)\!\\
\textbullet\ \scalebox{0.8375}[1]{\code{luatexja-otf} パッケージ(\code{[luacircled]}使用時)}
\end{translateing}

\newpage
\psuedosection{Installation}{Installation}{インストール}

\begin{translateing}
If not available, move inlinelabel.sty file to\\\code{\$TEXMF/tex/latex/inlinelabel}.

直ちに使えなければ,inlinelabel.sty を\\\code{\$TEXMF/tex/latex/inlinelabel}\\%(\TeX が見つけられる場所)
に置いてください。
\end{translateing}

\psuedosection{Loading}{Loading}{読み込み}

\begin{translateing}
To use this package, load .sty file with |\usepackage{inlinelabel}| command in
preamble.

このパッケージを使用するには,プリアンブルに\commandtojskip|\usepackage{inlinelabel}|\commandtojskip と書いてください。
%\end{translateing}

%\begin{translateing}
There are three options:\\
\textbullet\ |[nospace]| swaps with no space command and with space command.\\
\textbullet\ |[circled]| switches to circled equation numbers on \pLaTeX, which is an engine for Japanese.\\
\textbullet\ |[luacircled]| switches to circled equation numbers on \LuaLaTeX\ (and Japanese environment required).

3つのオプションがあります。\\
\textbullet\ |[nospace]|はスペースなし命令とスペースあり命令が入れ替えます。\\
\textbullet\ |[circled]|は丸で囲まれた数式番号に切り替えます(\pLaTeX 用)。\\
\textbullet\ |[luacircled]|は丸で囲まれた数式番号に切り替えます(\LuaLaTeX 用)。
\end{translateing}



\psuedosection{Usage}{Usage}{使用方法}

\macroexplanation{\inlinelabel{<label>}}

\begin{translateing}
This command puts the inline equation number. It takes the name of the label as an argument. Place it outside of the equation (outside of the \$--\$). It makes a small margin before and after the text to make it look natural (in Japanese). If you don't want margins, use |\inlinelabel*{<label>}|.

インラインの数式番号を置きます。引数にラベルの名前を取ります。数式(\$--\$)の外に置いてください。自然に見せるために,前後に少しの余白を取ります。余白がいらないときは\commandtojskip|\inlinelabel*{<label>}|\commandtojskip を使ってください。
%
%If you don't want margins (not in Japanese), use |\inlinelabel*{<label>}|.
%
%日本語組版を念頭に作っていますので,英語では |\inlinelabel*{<label>}| を使って原稿でスペースを入れるのが自然でしょう。

For inconvenience, there is the |[nospace]| option.
In this case, |\inlinelabel{<label>}| is swapped with no space and |\inlinelabel*{<label>}| has space.

それが面倒なときのために,|[nospace]|オプションが用意されています。
このとき,|\inlinelabel{<label>}|\commandtojskip がスペースなし,|\inlinelabel*{<label>}|\commandtojskip がスペースありに入れ替わります。
\end{translateing}

\begin{lstlisting}
An inlinelabel makes 
$e^{i\theta}=\cos\theta+i\sin\theta$\inlinelabel{test1}.

An asterisked one makes 
$e^{i\pi}+1=0$\inlinelabel*{test2}.
\end{lstlisting}

\begin{macroexample}
An inlinelabel makes $e^{i\theta}=\cos\theta+i\sin\theta$\hspace{0.5em}(1)\hspace{0.5em}.

An asterisked one makes $e^{i\pi}+1=0$(2).
\end{macroexample}

\begin{translateing}
The |<label>| can be used for |\ref|.

|<label>|\commandtojskip を\commandtojskip|\ref|で使うことができます。
\end{translateing}

\begin{lstlisting}
Substituting $\theta=\pi$
for (\ref{test1}) yields (\ref{test2}).
\end{lstlisting}

\begin{macroexample}
Substituting $\theta=\pi$ for (\ref*{test1}) yields (\ref*{test2}).
\end{macroexample}

\macroexplanation{Options [circled] [luacircled]}

\begin{translateing}
Assuming you are using a Japanese environment. Switch to circled equation numbers. All equation numbers are rewritten, not just the inline equation numbers.

あなたが日本語の環境を使用していることを前提とします。丸で囲まれた数式番号に切り替えます。インラインの数式番号だけでなく,すべての数式番号が書き換えられます。

When using \pLaTeX\ with the \code{japanese-otf} package, specify \code{[circled]}; when using \LuaLaTeX\ with the \code{luatexja-otf} package, specify \code{[luacircled]}.

\pLaTeX を使っているときは,\code{japanese-otf} パッケージの読み込みとともに\code{[circled]}オプションを指定してください。
\LuaLaTeX を使っているときは,\code{luatexja-otf} パッケージの読み込みとともに\code{[luacircled]}オプションを指定してください。
\end{translateing}
%
%\begin{lstlisting}
%$e^{i\theta}=\cos\theta+i\sin\theta$\inlinelabel{test1}はテストです。
%
%アスタリスクをつけると$e^{i\pi}+1=0$\inlinelabel*{test2}です。
%\end{lstlisting}

\begin{macroexample}
$e^{i\theta}=\cos\theta+i\sin\theta$\inlinelabel{test1}はテストです。

アスタリスクをつけると$e^{i\pi}+1=0$\inlinelabel*{test2}です。
\end{macroexample}

\begin{translateing}
The following example is just an align environment.

次の例は単なる align 環境です。
\end{translateing}

\begin{lstlisting}
\begin{align}
&\phantom{=}\log_{3}x+\log_{3}(6-x)\\
&=\log_{3}x(6-x)\\
&=\log_{3}(-(x-3)^{2}+9)
\end{align}
\end{lstlisting}

%\equationreset
\begin{macroexample*}{align}
&\phantom{=}\log_{3}x+\log_{3}(6-x)\\
&=\log_{3}x(6-x)\\
&=\log_{3}(-(x-3)^{2}+9)
\end{macroexample*}

\macroexplanation{\circledref{<label>}  \equationref{<label>}}

\begin{translateing}
These commands are only valid when \code{[circled]} or \code{[luacircled]} option is loaded.
They refer to the circled equation number.

\code{[circled]}または\code{[luacircled]}オプションを読み込んでいるときにのみ有効です。
丸で囲まれた数式番号を参照します。
\end{translateing}

\begin{translateing}
|\equationref| is synonym with |\circledref|.

|\equationref|は\commandtojskip|\circledref|の別名です。
\end{translateing}

\begin{lstlisting}
Substituting $\theta=\pi$
for \equationref{test1} yields \equationref{test2}.
\end{lstlisting}

\begin{macroexample}
Substituting $\theta=\pi$ for \equationref{test1} yields \equationref{test2}.
\end{macroexample}

\macroexplanation{\equationreset}

\begin{translateing}
Reset the equation number back to 1.

数式番号を1に戻します。
\end{translateing}

\psuedosection{moreinfo}{For More Information}{問い合わせ・詳しくは}

\noindent\hspace*{\fill}\begin{tabular}{rl}
The inlinelabel package:&\url{https://www.metaphysica.info/technote/package_inlinelabel/}\\
Yukoh KUSAKABE:&\url{https://www.metaphysica.info/}\\
&\url{https://twitter.com/metaphysicainfo}\\
&(screen-name, 日下部幽考 in Japanese)
\end{tabular}\hspace*{\fill}
\end{document}