summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tagpdf/tagpdf-luatex.def
blob: 7ce0ccbd05b416b26021f6730cbdcbae2175d8d8 (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
%%
%% This is file `tagpdf-luatex.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tagpdf-backend.dtx  (with options: `luatex')
%% 
%% Copyright (C) 2019 Ulrike Fischer
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    https://www.latex-project.org/lppl.txt
%% 
%% This file is part of the "tagpdf bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%% 
%% File: tagpdf-backend.dtx
\ProvidesExplFile {tagpdf-luatex.def} {2021/05/14} {0.81}
  {tagpdf~driver~for~luatex}

\newattribute \l__tag_mc_type_attr     %the value represent the type
\newattribute \l__tag_mc_cnt_attr      %will hold the \c@g__tag_MCID_abs_int value

\newattribute \g__tag_interwordspace_attr
\newattribute \g__tag_interwordfont_attr

{
  \fontencoding{TU}\fontfamily{lmr}\fontseries{m}\fontshape{n}\fontsize{10pt}{10pt}\selectfont
}
\directlua { tagpdf=require('tagpdf.lua') }

%%%% driver (lualatex) commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\cs_new_protected:Nn \__tag_prop_new:N
  {
    \prop_new:N #1
    \directlua { ltx.__tag.tables.\cs_to_str:N#1 = {} }
  }

\cs_new_protected:Nn \__tag_seq_new:N
  {
    \seq_new:N #1
    \directlua { ltx.__tag.tables.\cs_to_str:N#1 = {} }
  }

\cs_new_protected:Nn \__tag_prop_gput:Nnn
  {
    \prop_gput:Nnn #1 { #2 } { #3 }
    \directlua { ltx.__tag.tables.\cs_to_str:N#1 ["#2"] = "#3" }
  }

\cs_new_protected:Nn \__tag_seq_gput_right:Nn
  {
    \seq_gput_right:Nn #1 { #2 }
    \directlua { table.insert(ltx.__tag.tables.\cs_to_str:N#1, "#2") }
  }


\cs_new:Npn \__tag_seq_item:cn #1 #2
  {
    \directlua { tex.print(ltx.__tag.tables.#1[#2]) }
  }

\cs_new:Npn \__tag_prop_item:cn #1 #2
  {
    \directlua { tex.print(ltx.__tag.tables.#1["#2"]) }
  }

\cs_new_protected:Nn \__tag_seq_show:N
  {
    \seq_show:N #1
    \directlua { ltx.__tag.trace.log ("lua~sequence~array~\cs_to_str:N#1",1) }
    \directlua { ltx.__tag.trace.show_seq (ltx.__tag.tables.\cs_to_str:N#1) }
  }

\cs_new_protected:Nn \__tag_prop_show:N
  {
    \prop_show:N #1
    \directlua {ltx.__tag.trace.log  ("lua~property~table~\cs_to_str:N#1",1) }
    \directlua {ltx.__tag.trace.show_prop (ltx.__tag.tables.\cs_to_str:N#1) }
 }
%% 
%%
%% End of file `tagpdf-luatex.def'.