summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-enotez.sty
blob: a061b8d71d35029b198d71dec1ace0f3199dcbd6 (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
%%
%% This is file `lwarp-enotez.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `enotez')
%% This is a generated file.
%% Copyright 2016-2020 Brian Dunn
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
\LWR@ProvidesPackagePass{enotez}[2020/12/13]
\ExplSyntaxOn
\AtBeginDocument{
    \bool_set_true:N \l__enotez_hyperref_bool
    \bool_set_true:N \l__enotez_hyperfootnotes_bool
}
\cs_gset_protected:Npn \enotez_write_mark:nn #1#2
  {
    \bool_if:NTF \l__enotez_hyperfootnotes_bool
      {
        \enotezwritemark { \hyperlink {enz.#1} { \enmarkstyle #2 } }
        \bool_if:NT \l__enotez_hyperbackref_bool
          {
                    \hypertarget {enz.#1.backref} { }
          }
      }
      { \enotezwritemark { \enmarkstyle #2 } }
  }
\cs_generate_variant:Nn \enotez_write_mark:nn {x}
\cs_gset_protected:Npn \enotez_write_list_number:n #1
  {
    \bool_if:NT \l__enotez_hyperfootnotes_bool
      {
            \hypertarget {enz.#1} { }
      }
    \tl_use:N \l__enotez_list_number_format_tl
    \tl_if_eq:nxTF {a} { \prop_item:Nn \g__enotez_endnote_man_prop {#1} }
      {
        \bool_if:nTF
          { \l__enotez_hyperfootnotes_bool && \l__enotez_hyperbackref_bool }
          {
            \exp_args:Nnx
            \hyperlink {enz.#1.backref}
              { \exp_not:V \l__enotez_endnote_mark_tl }
          }
          { \prop_item:Nn \g__enotez_endnote_mark_prop {#1} }
      }
      {
        \bool_if:nTF
          { \l__enotez_hyperfootnotes_bool && \l__enotez_hyperbackref_bool }
          {
            \exp_args:Nnx
            \hyperlink {enz.#1.backref}
              { \exp_not:V \l__enotez_endnote_mark_tl }
          }
          { \tl_use:N \l__enotez_endnote_mark_tl }
      }
  }
\DeclareTemplateCode {enotez-list} {paragraph} {1}
  {
    heading       = \enotez_list_heading:n           ,
    format        = \l__enotez_list_format_tl        ,
    number        = \enotez_list_number:n            ,
    number-format = \l__enotez_list_number_format_tl ,
    notes-sep     = \l__enotez_list_notes_sep_dim
  }
  {
    \AssignTemplateKeys
    \enotez_set_totoc:
    \enotez_list_heading:n { \l__enotez_list_name_tl }
    \enotez_list_preamble:
    \enotez_build_print_list:nnnn {#1}
      {}
      {
        \par\noindent
        \group_begin:
          \tl_use:N \l__enotez_list_format_tl
              \enotez_list_number:n
                { \enotez_write_list_number:n {##1} }
              \tl_use:N \c_space_tl
          % \cs_set:cpn {@currentlabel}
          %   { \p@endnote \l__enotez_endnote_mark_tl }
          \tl_use:N \g__enotez_endnote_text_tl
          \par
          \dim_compare:nT { \l__enotez_list_notes_sep_dim != 0pt }
            { \addvspace { \l__enotez_list_notes_sep_dim } }
        \group_end:
      }
      {}
    \enotez_list_postamble:
  }

\ExplSyntaxOff
\begin{warpMathJax}
\def\endnotename{endnote}
\appto\LWR@syncnotenumbers{\LWR@synconenotenumber{LWRendnote}{\theendnote}}
\appto\LWR@syncnotenames{\LWR@synconenotename{LWRendnote}{\endnotename}}
\CustomizeMathJax{\def\LWRendnote{1}}
\CustomizeMathJax{\newcommand{\endnote}[2][\LWRendnote]{{}^{\mathrm{#1}}}}
\CustomizeMathJax{\newcommand{\endnotemark}[1][\LWRendnote]{{}^{\mathrm{#1}}}}
\end{warpMathJax}


\endinput
%%
%% End of file `lwarp-enotez.sty'.