summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-07-05 21:45:46 +0000
committerKarl Berry <karl@freefriends.org>2018-07-05 21:45:46 +0000
commiteef245751e7d3cec3ce8db3dda9f93818e1a7118 (patch)
tree995036273168036838cec88e6ff67d05b7942319 /Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty
parentf8fda7824b2b8cdebc2f57a8dc1aefdec29b14e9 (diff)
tagpdf (5jul18)
git-svn-id: svn://tug.org/texlive/trunk@48146 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty57
1 files changed, 57 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty
new file mode 100644
index 00000000000..006014432c2
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tagpdf/tagpdf-mc-code-shared.sty
@@ -0,0 +1,57 @@
+\ProvidesExplPackage {tagpdf-mc-code-shared} {2018/07/04} {0.1}
+ {part of tagpdf - code related to marking chunks - code shared by generic and luamode }
+
+% I use a latex counter for the absolute count, so that it is added to
+% \cl@@ckpt and restored e.g. in tabulars and align
+% \int_new:N \c@g__uftag_MCID_int and
+% \tl_put_right:Nn\cl@@ckpt{\@elt{g_uf_test_int}}
+% would work too, but as the name is not expl3 then too, why bother?
+% the absolute counter can be used to label and to check if the page
+% counter needs a reset.
+
+\newcounter { g__uftag_MCID_abs_int }
+\cs_new:Nn \__uftag_get_mc_abs_cnt: { \int_use:N \c@g__uftag_MCID_abs_int }
+
+% tagmcabs is the label name of the absolute count which is used to identify the chunk
+\zref@newprop {tagmcabs} [0] { \int_use:N \c@g__uftag_MCID_abs_int }
+\zref@addprop {tagpdf} {tagmcabs}
+\zref@addprop {LastPage} {tagmcabs}
+
+%stores labels of mcid.
+\cs_new:Nn \__uftag_mc_handle_mc_label:n
+ {
+ \zref@labelbylist{tagpdf-#1}{tagpdf}
+ }
+
+% will hold the structure numbers for the parenttree
+% key: absolute number of the mc (tagmcabs)
+% value: the structure number the mc is in
+\__uftag_prop_new:N \g__uftag_mc_parenttree_prop
+
+%to test nesting mc:
+\bool_new:N \g__uftag_in_mc_bool
+
+\prg_new_conditional:Nnn \_uftag_mc_if_in: {p,T,F,TF}
+ {
+ \bool_if:NTF \g__uftag_in_mc_bool
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+
+%shared keys
+%the rest are in the splitted code
+\tl_new:N \l__uftag_mc_artifact_type_tl
+
+\keys_define:nn { tagpdf / mc }
+ {
+ stash .bool_set:N = \l__uftag_mc_key_stash_bool,
+ artifact-bool .bool_set:N = \l__uftag_mc_artifact_bool,
+ artifact-type .choice:,
+ artifact-type / pagination .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Pagination }},
+ artifact-type / layout .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Layout }},
+ artifact-type / page .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Page }},
+ artifact-type / background .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl { Background }},
+ artifact-type / notype .code:n = {\tl_set:Nn \l__uftag_mc_artifact_type_tl {}},
+ }
+
+\endinput