Skip to content

Commit

Permalink
rename keys, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Feb 14, 2024
1 parent cc7213b commit 0d2da70
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 46 deletions.
29 changes: 15 additions & 14 deletions doc/tagpdf.tex
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ \section{Loading}

When loading \pkg{tagpdf} through the \texttt{testphase} keys, it is automatically activated.
To deactivate it while still retaining all the other new code from the latex-lab testphase files,
use in the preamble |\tagpdfsetup{activate-all=false}|. You can additionally also deactivate the
use in the preamble |\tagpdfsetup{activate/all=false}|. You can additionally also deactivate the
paratagging and the interword space code.
To suppress the loading of the package altogether you can try

Expand Down Expand Up @@ -464,29 +464,30 @@ \subsection{Setup and activation}\label{ssec:setup}
The key-val list understands the following keys:

\begin{description}
\item[\PrintKeyName{activate-all}] Boolean, initially false. Activates
\item[\PrintKeyName{activate/all}] Boolean, initially false. Activates
everything, that's normally the sensible thing to do.

\item [\PrintKeyName{activate}] Like |activate-all|,
\item [\PrintKeyName{activate}] Like |activate/all|,
\emph{additionally} is opens at begin document a structure with
|\tagstructbegin| and closes it at end document. The key accepts as
value a tag name which is used as the tag of the structure. The
default value is |Document|.

\item[\PrintKeyName{activate-mc}] Boolean, initially false. Activates
\item[\PrintKeyName{activate/mc}] Boolean, initially false. Activates
the code related to marked content.

\item[\PrintKeyName{activate-struct}] Boolean, initially
\item[\PrintKeyName{activate/struct}] Boolean, initially
false. Activates the code related to structures. Should be used only
if \PrintKeyName{activate-mc} has been used too.
if \PrintKeyName{activate/mc} has been used too.

\item[\PrintKeyName{no-struct-dest}] Starting with version 0.93
\item[\PrintKeyName{activate/struct-dest}] Boolean, initially true.
Starting with version 0.93
\pkg{tagpdf} will create automatically structure destinations (see
section~\ref{sec:struct-dest} if \pkg{hyperref} is used, if the
engine supports it and if the pdf version is 2.0. With this key this
section~\ref{sec:struct-dest} if \pkg{hyperref} is used and if the
engine supports it. With this key this
can be suppressed.

\item[\PrintKeyName{activate-tree}] Boolean, initially
\item[\PrintKeyName{activate/tree}] Boolean, initially
false. Activates the code related to trees. Should be used only if
the two other keys has been used too.

Expand All @@ -498,10 +499,10 @@ \subsection{Setup and activation}\label{ssec:setup}
\PrintKeyName{false}/\PrintKeyName{off}. The key
activates/deactivates the insertion of space glyphs, see
section~\ref{sec:spacechars}. In the luamode it only works if at
least \PrintKeyName{activate-mc} has been used.
least \PrintKeyName{activate/mc} has been used.
The old name of the key |interwordspace| is still supported but deprecated.

\item[\PrintKeyName{log}] Choice key, possible values
\item[\PrintKeyName{debug/log}] Choice key, possible values
\PrintKeyName{none}, \PrintKeyName{v}, \PrintKeyName{vv},
\PrintKeyName{vvv}, \PrintKeyName{all}. Setups the log level.
Changing the value affects currently mostly the luamode:
Expand Down Expand Up @@ -545,7 +546,7 @@ \subsection{Setup and activation}\label{ssec:setup}
accessibility checks. So I added it. Currently the tabsorder is the
same for all pages. Perhaps this should be changed \ldots.

\item[\PrintKeyName{tagunmarked}] Boolean,\sidenote{luamode} initially
\item[\PrintKeyName{activate/tagunmarked}] Boolean,\sidenote{luamode} initially
true. When this boolean is true, the lua code will try to mark
everything that has not been marked yet as an artifact. The benefit
is that one doesn't have to mark up every deco rule oneself. The
Expand Down Expand Up @@ -1004,7 +1005,7 @@ \subsubsection{Commands to mark content and chunks}

The\sidenote{lua mode only} lua mode will mark up everything unmarked as
\texttt{artifact=notype}. You can suppress this behavior by setting the
tagpdfsetup key \texttt{tagunmarked} to false. See section
tagpdfsetup key \texttt{activate/tagunmarked} to false. See section
\ref{ssec:setup}.

\item[\PrintKeyName{stash}] Normally marked content will be stored in the
Expand Down
12 changes: 6 additions & 6 deletions doc/tagpdfsetup-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ to the PDF processing.
```
activate .meta:n
OK activate/spaces (boolean, old interwordspace) in tagpdf-space.dtx
activate/mc (boolean, old: activate-mc)
activate/tree (boolean, old: activate-tree)
activate/struct (boolean, old: activate-struct)
activate/all (boolean, old: activate-all)
activate/tagunmarked (boolean, old: tagunmarked)
OK activate/mc (boolean, old: activate-mc)
OK activate/tree (boolean, old: activate-tree)
OK activate/struct (boolean, old: activate-struct)
OK activate/all (boolean, old: activate-all)
OK activate/tagunmarked (boolean, old: tagunmarked)
activate/socket (boolean, temporary until tagging-sockets are in the kernel)
activate/struct-dest (boolean, old: no-struct-dest)
activate/mathml-tags (boolean, old: mathml-tags, adds them to the global rolemap)
Expand Down Expand Up @@ -93,4 +93,4 @@ OK table/header-rows .clist_set:N (old: table-header-rows)

## Example

`\tagpdfsetup{debug/log = vv, debug/show = para, table/tagging = layout, math/mathml-template}`
`\tagpdfsetup{debug/log = vv, debug/show = para, table/tagging = layout, math/mathml-template}`
8 changes: 4 additions & 4 deletions tagpdf-user.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
%
% \begin{function}{activate (setup-key)}
% And additional setup key which combine the other activate keys
% |activate-mc|, |activate-tree|, |activate-struct| and additionally
% |activate/mc|, |activate/tree|, |activate/struct| and additionally
% add a document structure.
% \end{function}
%
Expand Down Expand Up @@ -664,7 +664,7 @@
%<*package>
% \end{macrocode}
% \subsection{Document structure}
% \begin{macro}{\g_@@_root_default_tl,activate (setup-key),activate-socket (setup-key)}
% \begin{macro}{\g_@@_root_default_tl,activate (setup-key),activate/socket (setup-key)}
% \begin{macrocode}
\tl_new:N\g_@@_root_default_tl
\tl_gset:Nn\g_@@_root_default_tl {Document}
Expand All @@ -674,11 +674,11 @@

\keys_define:nn { @@ / setup}
{
activate-socket .bool_set:N = \l_@@_active_socket_bool,
activate/socket .bool_set:N = \l_@@_active_socket_bool,
activate .code:n =
{
\keys_set:nn { @@ / setup }
{ activate-mc,activate-tree,activate-struct,activate-socket }
{ activate/mc,activate/tree,activate/struct,activate/socket }
\tl_gset:Nn\g_@@_root_default_tl {#1}
},
activate .default:n = Document
Expand Down
60 changes: 38 additions & 22 deletions tagpdf.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@
% interword spaces. It replaces the deprecated key |interwordspace|.
% \end{function}
%
% \begin{function}{activate-mc (setup-key),
% activate-tree (setup-key),
% activate-struct (setup-key),
% activate-all (setup-key)}
% Keys to activate the various tagging steps
% \begin{function}{activate/mc (setup-key),
% activate/tree (setup-key),
% activate/struct (setup-key),
% activate/all (setup-key),
% activate-mc (deprecated),
% activate-tree (deprecated),
% activate-struct (deprecated),
% activate-all (deprecated),
% }
% Keys to activate the various tagging steps.
% \end{function}
%\begin{function}{no-struct-dest (setup-key)}
% The key allows to suppress the creation of structure destinations
Expand Down Expand Up @@ -537,36 +542,43 @@
%
%
% \section{Keys for tagpdfsetup}

%
% TODO: the log-levels must be sorted
%
% \begin{macro}
% {
% activate-space (setup-key),
% activate-mc (setup-key),
% activate-tree (setup-key),
% activate-struct (setup-key),
% activate-all (setup-key),
% no-struct-dest (setup-key),
% activate/mc (setup-key),
% activate/tree (setup-key),
% activate/struct (setup-key),
% activate/all (setup-key),
% activate/struct-dest (setup-key),
% }
% Keys to (globally) activate tagging.
% |activate-space| activates the additional parsing needed for
% interword spaces. It is not documented, the parsing is currently
% implicitly activated by the known key |interwordspace|, as the code will
% perhaps move to some other place, now that it is better separated.
% |no-struct-dest| allows to suppress structure destinations.
% |activate/spaces| activates the additional parsing needed for
% interword spaces. It is defined in tagpdf-space.
% |activate/struct-dest| allows to activate or suppress structure destinations.
% \begin{macrocode}
%<*package>
\keys_define:nn { @@ / setup }
{
activate/mc .bool_gset:N = \g_@@_active_mc_bool,
activate/tree .bool_gset:N = \g_@@_active_tree_bool,
activate/struct .bool_gset:N = \g_@@_active_struct_bool,
activate/all .meta:n =
{activate/mc={#1},activate/tree={#1},activate/struct={#1}},
activate/all .default:n = true,
activate/struct-dest .bool_gset:N = \g_@@_active_struct_dest_bool,
% \end{macrocode}
% old, deprecated names
% \begin{macrocode}
activate-mc .bool_gset:N = \g_@@_active_mc_bool,
activate-tree .bool_gset:N = \g_@@_active_tree_bool,
activate-struct .bool_gset:N = \g_@@_active_struct_bool,
activate-all .meta:n =
{activate-mc={#1},activate-tree={#1},activate-struct={#1}},
{activate/mc={#1},activate/tree={#1},activate/struct={#1}},
activate-all .default:n = true,
no-struct-dest .bool_gset_inverse:N = \g_@@_active_struct_dest_bool,
% \end{macrocode}
no-struct-dest .bool_gset_inverse:N = \g_@@_active_struct_dest_bool,
% \end{macrocode}
% \end{macro}
% \begin{macro}{debug/show (setup-key)}
% Subkeys are defined in various other places.
Expand Down Expand Up @@ -598,8 +610,12 @@
% This key allows to set if (in luamode) unmarked text should be
% marked up as artifact. The initial value is true.
% \begin{macrocode}
tagunmarked .bool_gset:N = \g_@@_tagunmarked_bool,
tagunmarked .initial:n = true,
activate/tagunmarked .bool_gset:N = \g_@@_tagunmarked_bool,
activate/tagunmarked .initial:n = true,
% \end{macrocode}
% deprecated name
% \begin{macrocode}
tagunmarked .meta:n = {activate/tagunmarked ={#1}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{tabsorder (setup-key)}
Expand Down

0 comments on commit 0d2da70

Please sign in to comment.