| 1 |
\documentclass[% |
| 2 |
fleqn,% |
| 3 |
paper=a4paper,% |
| 4 |
fontsize=10pt,% |
| 5 |
open_bracket_pos=zenkakunibu_nibu,% |
| 6 |
hanging_punctuation,% |
| 7 |
]% |
| 8 |
{jlreq} |
| 9 |
\jlreqsetup{% |
| 10 |
itemization_beforeafter_space=0pt,% |
| 11 |
itemization_itemsep=0pt% |
| 12 |
} |
| 13 |
\makeatletter |
| 14 |
\RequirePackage{luatexja} |
| 15 |
\RequirePackage{luatexja-otf} |
| 16 |
\RequirePackage{graphicx} |
| 17 |
\RequirePackage{amsmath} |
| 18 |
\DeclareRobustCommand{\metaphysicaicon}{\raisebox{-4.0pt}{\includegraphics[width=16pt]{metaphysicaicon.pdf}}} |
| 19 |
\RequirePackage[normalem]{ulem} |
| 20 |
\RequirePackage[explicit]{titlesec} |
| 21 |
\titleformat{\section}[hang]{}{}{0pt}{\uuline{\raisebox{1pt}{\textsf{\thesection\quad #1}}}}[\vspace{0.35\baselineskip}] |
| 22 |
\renewcommand{\thesection}{\S\,\arabic{section}} |
| 23 |
\let\originalsection\section |
| 24 |
\DeclareRobustCommand{\section}{\@ifstar{\@metaphysica@section@star}{\@metaphysica@section@nostar}} |
| 25 |
\DeclareRobustCommand{\@metaphysica@section@star}[1]{\vspace{0.5\baselineskip}\originalsection{#1}\vspace*{-\baselineskip}} |
| 26 |
\DeclareRobustCommand{\@metaphysica@section@nostar}[1]{\vspace{0.5\baselineskip}\originalsection{#1}} |
| 27 |
\RequirePackage[% |
| 28 |
truedimen,% |
| 29 |
margin=30truemm, |
| 30 |
includehead% |
| 31 |
]{geometry} |
| 32 |
\RequirePackage{lastpage} |
| 33 |
\RequirePackage{fancyhdr} |
| 34 |
\pagestyle{fancy} |
| 35 |
\DeclareRobustCommand{\headertitle}[2][\metaphysicaicon]{% |
| 36 |
\rhead[#2]{#1{}\quad\thepage{}/{}\pageref{LastPage}}% |
| 37 |
\lhead[\thepage{}/{}\pageref{LastPage}\quad{}#1]{#2}% |
| 38 |
\cfoot{}% |
| 39 |
} |
| 40 |
\RequirePackage{setspace} |
| 41 |
\setstretch{1.155} |
| 42 |
\DeclareRobustCommand{\linespace}{\@ifstar{\vspace{\baselineskip}}{\vspace{0.25\baselineskip}}} |
| 43 |
\DeclareRobustCommand{\linesmash}{\@ifstar{\vspace{-\baselineskip}}{\vspace{-0.25\baselineskip}}} |
| 44 |
\AtBeginDocument{% |
| 45 |
\abovedisplayskip =0.125\abovedisplayskip |
| 46 |
\abovedisplayshortskip=0.125\abovedisplayshortskip |
| 47 |
\belowdisplayskip =0.125\belowdisplayskip |
| 48 |
\belowdisplayshortskip=0.125\belowdisplayshortskip} |
| 49 |
\setlength{\jot}{0pt}% |
| 50 |
\setlength{\mathindent}{2\zw}% |
| 51 |
\renewcommand{\floatpagefraction}{0.75} |
| 52 |
\allowdisplaybreaks[2] |
| 53 |
\RequirePackage[no-math]{fontspec} |
| 54 |
\RequirePackage[no-math,deluxe,haranoaji]{luatexja-preset} |
| 55 |
\RequirePackage{multicolpar} |
| 56 |
\RequirePackage[style=iso]{datetime2} |
| 57 |
\RequirePackage[unicode]{hyperref} |
| 58 |
\RequirePackage{xparse} |
| 59 |
\RequirePackage{dashbox} |
| 60 |
\newcounter{psuedosectioncounter} |
| 61 |
\setcounter{psuedosectioncounter}{1} |
| 62 |
\newcounter{psuedocontentscounter} |
| 63 |
\setcounter{psuedocontentscounter}{1} |
| 64 |
\DeclareRobustCommand{\psuedosection}[3]{% |
| 65 |
\hypertarget{#1}{\mbox{}}\begin{multicolpar}{2}% |
| 66 |
\noindent\uuline{{\raisebox{1pt}{\textsf{\S\ \thepsuedosectioncounter\quad #2}}}} |
| 67 |
|
| 68 |
\noindent\uuline{{\raisebox{1pt}{\textsf{\S\ \thepsuedosectioncounter\quad #3}}}} |
| 69 |
\end{multicolpar}% |
| 70 |
\stepcounter{psuedosectioncounter}% |
| 71 |
\vspace{\baselineskip}% |
| 72 |
} |
| 73 |
\DeclareRobustCommand{\psuedocontents}[3]{% |
| 74 |
\begin{multicolpar}{2}% |
| 75 |
\noindent{\textsf{\hyperlink{#1}{\S\ \thepsuedocontentscounter\quad #2}}} |
| 76 |
|
| 77 |
\noindent{\textsf{\hyperlink{#1}{\S\ \thepsuedocontentscounter\quad #3}}}\end{multicolpar}% |
| 78 |
\stepcounter{psuedocontentscounter}% |
| 79 |
} |
| 80 |
\newenvironment{translateing}% |
| 81 |
{\begin{multicolpar}{2}} |
| 82 |
{\end{multicolpar}\vspace{\baselineskip}} |
| 83 |
\DeclareRobustCommand{\maketitletranslating}% |
| 84 |
{\maketitle\thispagestyle{fancy} |
| 85 |
\vspace{\baselineskip}\begin{multicolpar}{2} |
| 86 |
\textsf{English} |
| 87 |
|
| 88 |
\noindent |
| 89 |
\textsf{日本語 (Japanese)} |
| 90 |
\end{multicolpar}\vspace{\baselineskip}} |
| 91 |
\NewDocumentCommand\macroexplanation{v}{% |
| 92 |
\noindent\hspace*{\fill}{\texttt{#1}}\hspace*{\fill}\linespace% |
| 93 |
} |
| 94 |
\NewDocumentEnvironment{macroexample}{O{0.625} +b}{% |
| 95 |
\noindent\hspace*{\fill}\dbox{\parbox{#1\textwidth}{% |
| 96 |
#2% |
| 97 |
}}\hspace*{\fill}}% |
| 98 |
{\vspace{\baselineskip}} |
| 99 |
\NewDocumentEnvironment{macroexample*}{O{0.625} m +b}{% |
| 100 |
\noindent\hspace*{\fill}\dbox{\parbox{#1\textwidth}{% |
| 101 |
\vspace{-0.5\baselineskip}\begin{#2}% |
| 102 |
#3 |
| 103 |
\end{#2}% |
| 104 |
}}\hspace*{\fill}} |
| 105 |
{\vspace{\baselineskip}} |
| 106 |
\let\code\texttt |
| 107 |
\setlength{\fboxsep}{1em} |
| 108 |
\setstretch{1.05} |
| 109 |
\DeclareRobustCommand{\commandtojskip}{\hspace{2.40554pt plus 1.49994pt minus 0.59998pt}} |
| 110 |
\RequirePackage{listings, jlisting} |
| 111 |
\lstset{ |
| 112 |
language=[LaTeX]TeX, |
| 113 |
basicstyle={\ttfamily}, |
| 114 |
identifierstyle={\small}, |
| 115 |
commentstyle={\small\itshape}, |
| 116 |
keywordstyle={\small\bfseries}, |
| 117 |
ndkeywordstyle={\small}, |
| 118 |
stringstyle={\small\ttfamily}, |
| 119 |
frame=single, |
| 120 |
breaklines=true, |
| 121 |
columns=[l]{fullflexible}, |
| 122 |
stepnumber=1, |
| 123 |
xrightmargin=0.1709\textwidth, |
| 124 |
xleftmargin=0.1709\textwidth, |
| 125 |
lineskip=-0.5ex |
| 126 |
} |
| 127 |
\RequirePackage{bxtexlogo} |
| 128 |
\RequirePackage{shortvrb} |
| 129 |
\MakeShortVerb{\|} |
| 130 |
\RequirePackage[luacircled]{inlinelabel} |
| 131 |
\makeatother |
| 132 |
% |
| 133 |
\hypersetup{% |
| 134 |
bookmarksnumbered=true,% |
| 135 |
colorlinks=true,% |
| 136 |
linkcolor=blue,% |
| 137 |
urlcolor=blue,% |
| 138 |
setpagesize=false,% |
| 139 |
pdftitle={The inlinelabel package},% |
| 140 |
pdfauthor={Yukoh KUSAKABE},% |
| 141 |
pdfsubject={The inlinelabel package},% |
| 142 |
pdfkeywords={TeX LaTeX inlinel label}} |
| 143 |
\title{The \code{inlinelabel} package:\\[0.25\baselineskip] |
| 144 |
assign equation numbers to inline equations} |
| 145 |
\author{Yukoh KUSAKABE} |
| 146 |
%\author{Y\=uk\=o KUSAKABE} |
| 147 |
\date{\today} |
| 148 |
\headertitle[Yukoh KUSAKABE\quad\metaphysicaicon]{The \code{inlinelabel} package} |
| 149 |
%\headertitle[Y\=uk\=o KUSAKABE\quad\metaphysicaicon]{The \code{inlinelabel} package} |
| 150 |
\begin{document} |
| 151 |
\maketitletranslating |
| 152 |
|
| 153 |
\begin{translateing} |
| 154 |
This package can assign equation numbers to inline equations. When Japanese is supported, you can switch to circled equation numbers. |
| 155 |
|
| 156 |
このパッケージは,インライン数式に数式番号を振ることができます。また,日本語を扱えるときには,丸で囲まれた数式番号に切り替えることができます。 |
| 157 |
\end{translateing} |
| 158 |
|
| 159 |
%\psuedocontents{inlinelabel} |
| 160 |
%{Package \code{inlinelabel}} |
| 161 |
%{\code{inlinelabel} パッケージ} |
| 162 |
|
| 163 |
\psuedocontents{Requirements}{System Requirements}{前提条件} |
| 164 |
|
| 165 |
\psuedocontents{Installation}{Installation}{インストール} |
| 166 |
|
| 167 |
\psuedocontents{Loading}{Loading}{読み込み} |
| 168 |
|
| 169 |
\psuedocontents{Usage}{Usage}{使用方法} |
| 170 |
|
| 171 |
\psuedocontents{moreinfo}{For More Information}{問い合わせ・詳しくは} |
| 172 |
|
| 173 |
%\psuedosection{inlinelabel}{Package \code{inlinelabel}}{\code{inlinelabel} パッケージ} |
| 174 |
% |
| 175 |
%\begin{translateing} |
| 176 |
%This package can assign equation numbers to inline equations. When Japanese is supported, you can switch to circled equation numbers. |
| 177 |
% |
| 178 |
%このパッケージは,インライン数式に数式番号を振ることができます。また,日本語を扱えるときには,丸で囲まれた数式番号に切り替えることができます。 |
| 179 |
%\end{translateing} |
| 180 |
|
| 181 |
\psuedosection{Requirements}{System Requirements}{前提条件} |
| 182 |
|
| 183 |
\begin{translateing} |
| 184 |
\textbullet\ \LaTeXe\ format\\ |
| 185 |
\textbullet\ \code{amsmath} package\\ |
| 186 |
\textbullet\ \code{refcount} package\\ |
| 187 |
\textbullet\ \pTeX\ engine (\code{[circled]} only)\\ |
| 188 |
\textbullet\ \code{japanese-otf} package (\code{[circled]} only)\\ |
| 189 |
\textbullet\ \LuaTeX\ engine (\code{[luacircled]} only)\\ |
| 190 |
\textbullet\ \scalebox{0.95}[1]{\code{luatexja-otf} package (\code{[luacircled]} only)} |
| 191 |
|
| 192 |
\noindent |
| 193 |
\textbullet\ \LaTeXe フォーマット\\ |
| 194 |
\textbullet\ \code{amsmath} パッケージ\\ |
| 195 |
\textbullet\ \code{refcount} パッケージ\\ |
| 196 |
\textbullet\ \pTeX エンジン(\code{[circled]}使用時)\\ |
| 197 |
\textbullet\ \scalebox{0.9}[1]{\code{japanese-otf} パッケージ(\code{[circled]}使用時)}\\ |
| 198 |
%\textbullet\ \code{luatexja-otf} パッケージ\\ |
| 199 |
%\hfill (\code{[luacircled]}使用時) |
| 200 |
\textbullet\ \LuaTeX エンジン(\code{[luacircled]}使用時)\!\\ |
| 201 |
\textbullet\ \scalebox{0.8375}[1]{\code{luatexja-otf} パッケージ(\code{[luacircled]}使用時)} |
| 202 |
\end{translateing} |
| 203 |
|
| 204 |
\newpage |
| 205 |
\psuedosection{Installation}{Installation}{インストール} |
| 206 |
|
| 207 |
\begin{translateing} |
| 208 |
If not available, move inlinelabel.sty file to\\\code{\$TEXMF/tex/latex/inlinelabel}. |
| 209 |
|
| 210 |
直ちに使えなければ,inlinelabel.sty を\\\code{\$TEXMF/tex/latex/inlinelabel}\\%(\TeX が見つけられる場所) |
| 211 |
に置いてください。 |
| 212 |
\end{translateing} |
| 213 |
|
| 214 |
\psuedosection{Loading}{Loading}{読み込み} |
| 215 |
|
| 216 |
\begin{translateing} |
| 217 |
To use this package, load .sty file with |\usepackage{inlinelabel}| command in |
| 218 |
preamble. |
| 219 |
|
| 220 |
このパッケージを使用するには,プリアンブルに\commandtojskip|\usepackage{inlinelabel}|\commandtojskip と書いてください。 |
| 221 |
%\end{translateing} |
| 222 |
|
| 223 |
%\begin{translateing} |
| 224 |
There are three options:\\ |
| 225 |
\textbullet\ |[nospace]| swaps with no space command and with space command.\\ |
| 226 |
\textbullet\ |[circled]| switches to circled equation numbers on \pLaTeX, which is an engine for Japanese.\\ |
| 227 |
\textbullet\ |[luacircled]| switches to circled equation numbers on \LuaLaTeX\ (and Japanese environment required). |
| 228 |
|
| 229 |
3つのオプションがあります。\\ |
| 230 |
\textbullet\ |[nospace]|はスペースなし命令とスペースあり命令が入れ替えます。\\ |
| 231 |
\textbullet\ |[circled]|は丸で囲まれた数式番号に切り替えます(\pLaTeX 用)。\\ |
| 232 |
\textbullet\ |[luacircled]|は丸で囲まれた数式番号に切り替えます(\LuaLaTeX 用)。 |
| 233 |
\end{translateing} |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
\psuedosection{Usage}{Usage}{使用方法} |
| 238 |
|
| 239 |
\macroexplanation{\inlinelabel{<label>}} |
| 240 |
|
| 241 |
\begin{translateing} |
| 242 |
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>}|. |
| 243 |
|
| 244 |
インラインの数式番号を置きます。引数にラベルの名前を取ります。数式(\$--\$)の外に置いてください。自然に見せるために,前後に少しの余白を取ります。余白がいらないときは\commandtojskip|\inlinelabel*{<label>}|\commandtojskip を使ってください。 |
| 245 |
% |
| 246 |
%If you don't want margins (not in Japanese), use |\inlinelabel*{<label>}|. |
| 247 |
% |
| 248 |
%日本語組版を念頭に作っていますので,英語では |\inlinelabel*{<label>}| を使って原稿でスペースを入れるのが自然でしょう。 |
| 249 |
|
| 250 |
For inconvenience, there is the |[nospace]| option. |
| 251 |
In this case, |\inlinelabel{<label>}| is swapped with no space and |\inlinelabel*{<label>}| has space. |
| 252 |
|
| 253 |
それが面倒なときのために,|[nospace]|オプションが用意されています。 |
| 254 |
このとき,|\inlinelabel{<label>}|\commandtojskip がスペースなし,|\inlinelabel*{<label>}|\commandtojskip がスペースありに入れ替わります。 |
| 255 |
\end{translateing} |
| 256 |
|
| 257 |
\begin{lstlisting} |
| 258 |
An inlinelabel makes |
| 259 |
$e^{i\theta}=\cos\theta+i\sin\theta$\inlinelabel{test1}. |
| 260 |
|
| 261 |
An asterisked one makes |
| 262 |
$e^{i\pi}+1=0$\inlinelabel*{test2}. |
| 263 |
\end{lstlisting} |
| 264 |
|
| 265 |
\begin{macroexample} |
| 266 |
An inlinelabel makes $e^{i\theta}=\cos\theta+i\sin\theta$\hspace{0.5em}(1)\hspace{0.5em}. |
| 267 |
|
| 268 |
An asterisked one makes $e^{i\pi}+1=0$(2). |
| 269 |
\end{macroexample} |
| 270 |
|
| 271 |
\begin{translateing} |
| 272 |
The |<label>| can be used for |\ref|. |
| 273 |
|
| 274 |
|<label>|\commandtojskip を\commandtojskip|\ref|で使うことができます。 |
| 275 |
\end{translateing} |
| 276 |
|
| 277 |
\begin{lstlisting} |
| 278 |
Substituting $\theta=\pi$ |
| 279 |
for (\ref{test1}) yields (\ref{test2}). |
| 280 |
\end{lstlisting} |
| 281 |
|
| 282 |
\begin{macroexample} |
| 283 |
Substituting $\theta=\pi$ for (\ref*{test1}) yields (\ref*{test2}). |
| 284 |
\end{macroexample} |
| 285 |
|
| 286 |
\macroexplanation{Options [circled] [luacircled]} |
| 287 |
|
| 288 |
\begin{translateing} |
| 289 |
Assuming you are using a Japanese environment. Switch to circled equation numbers. All equation numbers are rewritten, not just the inline equation numbers. |
| 290 |
|
| 291 |
あなたが日本語の環境を使用していることを前提とします。丸で囲まれた数式番号に切り替えます。インラインの数式番号だけでなく,すべての数式番号が書き換えられます。 |
| 292 |
|
| 293 |
When using \pLaTeX\ with the \code{japanese-otf} package, specify \code{[circled]}; when using \LuaLaTeX\ with the \code{luatexja-otf} package, specify \code{[luacircled]}. |
| 294 |
|
| 295 |
\pLaTeX を使っているときは,\code{japanese-otf} パッケージの読み込みとともに\code{[circled]}オプションを指定してください。 |
| 296 |
\LuaLaTeX を使っているときは,\code{luatexja-otf} パッケージの読み込みとともに\code{[luacircled]}オプションを指定してください。 |
| 297 |
\end{translateing} |
| 298 |
% |
| 299 |
%\begin{lstlisting} |
| 300 |
%$e^{i\theta}=\cos\theta+i\sin\theta$\inlinelabel{test1}はテストです。 |
| 301 |
% |
| 302 |
%アスタリスクをつけると$e^{i\pi}+1=0$\inlinelabel*{test2}です。 |
| 303 |
%\end{lstlisting} |
| 304 |
|
| 305 |
\begin{macroexample} |
| 306 |
$e^{i\theta}=\cos\theta+i\sin\theta$\inlinelabel{test1}はテストです。 |
| 307 |
|
| 308 |
アスタリスクをつけると$e^{i\pi}+1=0$\inlinelabel*{test2}です。 |
| 309 |
\end{macroexample} |
| 310 |
|
| 311 |
\begin{translateing} |
| 312 |
The following example is just an align environment. |
| 313 |
|
| 314 |
次の例は単なる align 環境です。 |
| 315 |
\end{translateing} |
| 316 |
|
| 317 |
\begin{lstlisting} |
| 318 |
\begin{align} |
| 319 |
&\phantom{=}\log_{3}x+\log_{3}(6-x)\\ |
| 320 |
&=\log_{3}x(6-x)\\ |
| 321 |
&=\log_{3}(-(x-3)^{2}+9) |
| 322 |
\end{align} |
| 323 |
\end{lstlisting} |
| 324 |
|
| 325 |
%\equationreset |
| 326 |
\begin{macroexample*}{align} |
| 327 |
&\phantom{=}\log_{3}x+\log_{3}(6-x)\\ |
| 328 |
&=\log_{3}x(6-x)\\ |
| 329 |
&=\log_{3}(-(x-3)^{2}+9) |
| 330 |
\end{macroexample*} |
| 331 |
|
| 332 |
\macroexplanation{\circledref{<label>} \equationref{<label>}} |
| 333 |
|
| 334 |
\begin{translateing} |
| 335 |
These commands are only valid when \code{[circled]} or \code{[luacircled]} option is loaded. |
| 336 |
They refer to the circled equation number. |
| 337 |
|
| 338 |
\code{[circled]}または\code{[luacircled]}オプションを読み込んでいるときにのみ有効です。 |
| 339 |
丸で囲まれた数式番号を参照します。 |
| 340 |
\end{translateing} |
| 341 |
|
| 342 |
\begin{translateing} |
| 343 |
|\equationref| is synonym with |\circledref|. |
| 344 |
|
| 345 |
|\equationref|は\commandtojskip|\circledref|の別名です。 |
| 346 |
\end{translateing} |
| 347 |
|
| 348 |
\begin{lstlisting} |
| 349 |
Substituting $\theta=\pi$ |
| 350 |
for \equationref{test1} yields \equationref{test2}. |
| 351 |
\end{lstlisting} |
| 352 |
|
| 353 |
\begin{macroexample} |
| 354 |
Substituting $\theta=\pi$ for \equationref{test1} yields \equationref{test2}. |
| 355 |
\end{macroexample} |
| 356 |
|
| 357 |
\macroexplanation{\equationreset} |
| 358 |
|
| 359 |
\begin{translateing} |
| 360 |
Reset the equation number back to 1. |
| 361 |
|
| 362 |
数式番号を1に戻します。 |
| 363 |
\end{translateing} |
| 364 |
|
| 365 |
\psuedosection{moreinfo}{For More Information}{問い合わせ・詳しくは} |
| 366 |
|
| 367 |
\noindent\hspace*{\fill}\begin{tabular}{rl} |
| 368 |
The inlinelabel package:&\url{https://www.metaphysica.info/technote/package_inlinelabel/}\\ |
| 369 |
Yukoh KUSAKABE:&\url{https://www.metaphysica.info/}\\ |
| 370 |
&\url{https://twitter.com/metaphysicainfo}\\ |
| 371 |
&(screen-name, 日下部幽考 in Japanese) |
| 372 |
\end{tabular}\hspace*{\fill} |
| 373 |
\end{document} |