blob: 4531b795333ee40ae76997377ae2602bc7a11e46 (
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
114
115
116
117
|
% !Mode:: "TeX:UTF-8:Main"
% !Mode:: "TeX:UTF-8:Main"
\DocumentMetadata{testphase={phase-III,firstaid}}
% # store and restore section command:
\makeatletter
\let\ori@startsection\@startsection
\let\ori@xsect\@xsect
\let\ori@sect\@sect
\let\ori@ssect\@ssect
\documentclass[]{acmart}
\let\@startsection\ori@startsection %acmart definition is like kernel, so tagging version should be ok
\let\@xsect\ori@xsect %acmart definition is like kernel, so tagging version should be ok
% everyone patches \@sect and @ssect, here we should change the internal nameref version ;-(
\let\NR@ssect\ori@ssect %acmart definition is like kernel, so tagging version should be ok
\let\NR@sect\ori@sect %TODO: must be checked! acmart definition is slightly different.
% part is level 9??? It must be checked if this confuse the new tagging code.
\renewcommand\part{\@startsection{part}{9}{\z@}%
{-10\p@ \@plus -4\p@ \@minus -2\p@}%
{4\p@}%
{\ACM@NRadjust\@parfont}}
\def\toclevel@part{9} %???
% # tableofcontents. Insert hooks into \tocline (I hope arguments + placement are correct)
\def\@tocline#1#2#3#4#5#6#7{\relax
\ifnum #1>\c@tocdepth % then omit
\else
\par \addpenalty\@secpenalty\addvspace{#2}%
\begingroup \hyphenpenalty\@M
\@ifempty{#4}{%
\@tempdima\csname r@tocindent\number#1\endcsname\relax
}{%
\@tempdima#4\relax
}%
\parindent\z@ \leftskip#3\relax \advance\leftskip\@tempdima\relax
\rightskip\@pnumwidth plus4em \parfillskip-\@pnumwidth
#5\leavevmode\hskip-\@tempdima
\UseHookWithArguments{contentsline/text/before}{4}{#1}{#6}{#7}{\@contentsline@destination}%NEW
#6%
\UseHookWithArguments{contentsline/text/after}{4}{#1}{#6}{#7}{\@contentsline@destination}%NEW
\nobreak\relax
\hfil\hbox to\@pnumwidth{%
\UseHookWithArguments{contentsline/page/before}{4}{#1}{#6}{#7}{\@contentsline@destination}%NEW
\@tocpagenum{#7}
\UseHookWithArguments{contentsline/page/after}{4}{#1}{#6}{#7}{\@contentsline@destination}%NEW
}\par
\nobreak
\endgroup
\fi}
% add config points to starttoc
% TODO: extend kernel version so that acmart no longer has to redefine it.
\def\@starttoc#1#2{\begingroup\makeatletter
\setTrue{#1}%
\par\removelastskip\vskip\z@skip
\@startsection{section}\@M\z@{\linespacing\@plus\linespacing}%
{.5\linespacing}{\centering\contentsnamefont}{#2}%
\@starttoc@cfgpoint@before{#1}%NEW<<<<<<<<<< (name will change)
\@input{\jobname.#1}%
\@starttoc@cfgpoint@after{#1}%NEW<<<<<<<<<<<< (name will change)
\if@filesw
\@xp\newwrite\csname tf@#1\endcsname
\immediate\@xp\openout\csname tf@#1\endcsname \jobname.#1\relax
\fi
\global\@nobreakfalse \endgroup
\addvspace{32\p@\@plus14\p@}%
}
% # maketitle is much too complex, so we stop all tagging for now
\ExplSyntaxOn
\AddToHook{cmd/maketitle/before}
{\tagstructbegin{tag=Title}\tagmcbegin{} \tag_stop:}
\AddToHook{cmd/maketitle/after}
{\tag_start:\tagmcend\tagstructend }
\ExplSyntaxOff
% # TODO
% \endminipage must be restored (acmart wants to remove the footnoterule.)
% \@footnotetext is changed, but no in all variants
\title{title}
\usepackage{blindtext}
\begin{document}
\maketitle
\tableofcontents
\section{section}
\subsection{sub}
\subsubsection{subsub}
\paragraph{paragraph} some text\footnote{xxxx}
\subsection{sub}
\subsubsection{subsub}
\paragraph{paragraph} some text
\begin{figure}
a figure
\caption{test caption figure}
\end{figure}
\begin{table}
a table
\caption{test caption table}
\end{table}
\blinddocument
\end{document}
|