summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/inlinelabel/inlinelabel.sty
blob: 93c4822c8375a3fd79ee76664dc53c7f1cb1821b (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
%%
%% inlinelabel.sty
%%
%% Copyright (C) 2022 Yukoh KUSAKABE (screen-name)
%%   https://www.metaphysica.info/
%%   https://twitter.com/metaphysicainfo
%%
%% This package released under
%% [the MIT license](https://ctan.org/license/mit).
%%
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{inlinelabel}[2022/06/28 v1.0]
%
% When you meet ''Package pxufont Error: You must load this package
% after 'otf'.'', move \usepackage{otf} to a forward row.
%
%% \if@inlinelabel@circled
\newif\if@inlinelabel@circled
\@inlinelabel@circledfalse
%
%% [circled]
\DeclareOption{circled}{\@inlinelabel@circledtrue}
%
\ExecuteOptions{}
\ProcessOptions\relax
%
% for \tagform@ \maketag@@@
\RequirePackage{amsmath}
%
%% When [circled]
\if@inlinelabel@circled
%
% for \ajMaru
\RequirePackage{otf}
% for \getrefnumber
\RequirePackage{refcount}
%
% renew tagform
\def\tagform@#1{\maketag@@@{\ldots\ignorespaces\ajMaru{#1}\unskip\@@italiccorr}}%
%
%% \circledref{<label>}
%% \equationref{<label>}
\DeclareRobustCommand{\circledref}[1]{\mbox{\ajMaru{\getrefnumber{#1}}}}
\DeclareRobustCommand{\equationref}[1]{\mbox{\ajMaru{\getrefnumber{#1}}}}
%
\fi
%%
%
%% \inlinelabel{<label>}
\DeclareRobustCommand{\inlinelabel}{\@ifstar{\@inlinelabelstar}{\@inlinelabelnostar}}
\DeclareRobustCommand{\@inlinelabelstar}[1]{\refstepcounter{equation}\tagform@\theequation\expandafter\label{#1}}
\DeclareRobustCommand{\@inlinelabelnostar}[1]{\hspace{0.5em}\refstepcounter{equation}\tagform@\theequation\expandafter\label{#1}\hspace{0.5em}}
%
%% EOF