Skip to content

Commit

Permalink
switch to suspend/resume
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Sep 16, 2024
1 parent e855137 commit fc72182
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 30 deletions.
8 changes: 6 additions & 2 deletions doc/tagpdf.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ \subsection{Interrupting the tagging}
keep track of paragraphs if the correct wrapper commands are used.

Restarting tagging is normally only needed if groups can't be used and then
must be done with care: |\tagstart| should normally only restart tagging if
must be done with care: |\tag_resume:n| should normally only restart tagging if
the corresponding stop command actually stopped tagging. This is implement
through a local counter which keeps track of the level.

Expand Down Expand Up @@ -3068,7 +3068,11 @@ \subsection{Changes in version 0.98l}
compilations. The new code requires a current pdfmanagement-testphase and
is then used automatically if the new engines are detected.

\subsection{}
\subsection{Changes in version 0.99f}

Deprecated |\tag_start:|, |\tag_stop:|, |\tag_stop:n| and
|\tag_start:n| in favor of |\tag_suspend:n| and |\tag_resume:n|.

\printbibliography[heading=bibintoc]


Expand Down
4 changes: 2 additions & 2 deletions tagpdf-mc-shared.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,12 @@
\tag_mc_end_push:
\tag_mc_begin:n {artifact=#1}
\group_begin:
\tag_stop:n{artifact-group}
\tag_suspend:n{artifact-group}
}

\cs_set_protected:Npn \tag_mc_artifact_group_end:
{
\tag_start:n{artifact-group}
\tag_resume:n{artifact-group}
\group_end:
\tag_mc_end:
\tag_mc_begin_pop:n{}
Expand Down
12 changes: 6 additions & 6 deletions tagpdf-user.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -866,9 +866,9 @@
{\tagmcbegin{tag=Lbl}}
{#1}
}
\tag_stop:n{hangfrom}
\tag_suspend:n{hangfrom}
\hangindent \wd\@tempboxa\noindent
\tag_start:n{hangfrom}
\tag_resume:n{hangfrom}
\tagmcbegin{}\box\@tempboxa\tagmcend\tagstructend\tagmcbegin{}
}
}
Expand Down Expand Up @@ -1246,11 +1246,11 @@
\bool_gset_false:N \g_@@_in_mc_bool
}
\tag_mc_begin:n {artifact}
\tag_stop:n{headfoot}
\tag_suspend:n{headfoot}
}
\cs_new_protected:Npn \@@_exclude_headfoot_end:
{
\tag_start:n{headfoot}
\tag_resume:n{headfoot}
\tag_mc_end:
\bool_if:NTF \g_@@_mode_lua_bool
{
Expand All @@ -1277,12 +1277,12 @@
}
\tag_struct_begin:n{tag=Artifact,attribute-class=@@/attr/#1}
\tag_mc_begin:n {artifact=#1}
\tag_stop:n{headfoot}
\tag_suspend:n{headfoot}
}

\cs_new_protected:Npn \@@_exclude_struct_headfoot_end:
{
\tag_start:n{headfoot}
\tag_resume:n{headfoot}
\tag_mc_end:
\tag_struct_end:
\bool_if:NTF \g_@@_mode_lua_bool
Expand Down
16 changes: 8 additions & 8 deletions testfiles/test-start-stop-notag.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

\TEST{tag-stop}
{
\tag_stop:
\tag_suspend:n{A}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
Expand All @@ -30,29 +30,29 @@
\TEST{tag-stop-label1}
{
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_stop:n{L1}
\tag_suspend:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:n{L1}
\tag_resume:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
}

\TEST{tag-stop-label2}
{
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_stop:n{L1}
\tag_suspend:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:n{LXX}
\tag_resume:n{LXX}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
}

\tag_stop:
\tag_suspend:n{A}

\TEST{tag-stop-label2}
{
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_stop:n{L1}
\tag_suspend:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:n{L1}
\tag_resume:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
}
\ExplSyntaxOff
Expand Down
24 changes: 12 additions & 12 deletions testfiles/test-start-stop.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,40 @@

\TEST{tag-stop}
{
\tag_stop:
\tag_suspend:n{A}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:
\tag_resume:n{A}
\ASSERTSTR{\tag_status:}{ACTIVE}
}

\TEST{tag-stop-label1}
{
\ASSERTSTR{\tag_status:}{ACTIVE}
\tag_stop:n{L1}
\tag_suspend:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:n{L1}
\tag_resume:n{L1}
\ASSERTSTR{\tag_status:}{ACTIVE}
}

\TEST{tag-stop-label1}
{
\ASSERTSTR{\tag_status:}{ACTIVE}
\tag_stop:n{L1}
\tag_suspend:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:n{L1}
\tag_resume:n{L1}
\ASSERTSTR{\tag_status:}{ACTIVE}
}

\TEST{tag-stop-label-nested}
{
\ASSERTSTR{\tag_status:}{ACTIVE}
\tag_stop:n{L1}
\tag_suspend:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_stop:n{L2}
\tag_suspend:n{L2}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:n{L2}
\tag_resume:n{L2}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:n{L1}
\tag_resume:n{L1}
\ASSERTSTR{\tag_status:}{ACTIVE}
}

Expand All @@ -64,9 +64,9 @@
\TEST{tag-stop-label2}
{
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_stop:n{L1}
\tag_suspend:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
\tag_start:n{L1}
\tag_resume:n{L1}
\ASSERTSTR{\tag_status:}{NOT~ACTIVE}
}
\ExplSyntaxOff
Expand Down

0 comments on commit fc72182

Please sign in to comment.