Guest User

Beginner tagging of the table

a guest
Nov 3rd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. \documentclass{article}
  2. \usepackage{tagpdf}
  3. \tagpdfsetup{tabsorder=structure,uncompress,activate-all,add-new-tag=Title/P,interwordspace=true}
  4. \ExplSyntaxOn
  5. \makeatletter
  6. \prop_gset_from_keyval:Nn{\g__tables_prop}{table=0,endtable=1,table*=0,endtable*=1,tabular=0,endtabular=1,tabular*=0,endtabular*=1,tabbing=0,endtabbing=1,tabbing*=0,endtabbing*=1}
  7. \prop_map_inline:Nn \g__tables_prop{
  8. \cs_set_eq:cc{orig@#1}{#1}
  9. \int_case:nnF{#2}
  10. {
  11. {0} %somethin with \begin,e.g \begin{tabular}
  12. {
  13. \cs_gset_protected:cpn{#1}##1 ##2{
  14. \cs_new_protected:Npn \l__tab_char: {
  15. \tagmcend
  16. \tagstructend
  17. \tagstructend
  18. \tagstructbegin{tag=TD}
  19. \tagstructbegin{tag=P}
  20. \tagmcbegin{tag=P}
  21. \c_alignment_token
  22. }
  23. \char_set_active_eq:NN \& \l__tab_char:
  24. \char_set_catcode_active:N \&
  25. \tagstructbegin{tag=Table}
  26. \tagstructbegin{tag=TBody}
  27. \use:c{orig@#1}{##1}{##2}
  28. \message{argument~##1}
  29. }
  30. }
  31. {1} %somethin with \end,e.g \end{tabular}
  32. {
  33. \cs_gset_protected:cpn{#1}{
  34. \use:c{orig@#1}
  35. \tagstructend
  36. \tagstructend
  37. }
  38. }
  39. }
  40. {}
  41. }
  42. \makeatother
  43. \ExplSyntaxOff
  44. \author{Alexandr Kozlovskiy}
  45. \title{test}
  46. \begin{document}
  47. \tagstructbegin{tag=Document}
  48. \maketitle{} %error
  49. \makeatletter
  50. %this code works ok.
  51. \begin{tabular}{ccc}
  52. 1&2&3
  53. \end{tabular}
  54. \tagstructend
  55. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment