Skip to content

Commit

Permalink
document keys
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Feb 21, 2024
1 parent d36b195 commit a1b3274
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 11 deletions.
1 change: 1 addition & 0 deletions build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ elseif string.match (file, "%.sty$" ) then
docfiles = {"tagpdf.tex",
"tagpdf-code.tex",
"tagpdfdocu-patches.sty",
"tagpdfsetup-keys.tex",
"tagpdf.bib",
"link-figure-input.tex",
"pac3.PNG",
Expand Down
2 changes: 1 addition & 1 deletion doc/tagpdf.bib
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ @book{pdfspec-iso32000-2_2020
@online{pac2024,
title = {PDF Accessibility Checker (PAC 2024)},
url = {https://pac.pdf-accessibility.org/},
urldate ={2024-17-02}}
urldate ={2024-02-17}}

@online{verapdf,
title = {veraPDF},
Expand Down
25 changes: 15 additions & 10 deletions doc/tagpdf.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

\usepackage[noparboxrestore]{marginnote}
\reversemarginpar

\usepackage{booktabs}
\usepackage{tcolorbox}

\usepackage{tikz}
Expand Down Expand Up @@ -463,7 +463,12 @@ \subsection{Setup and activation}\label{ssec:setup}
The command should be normally used only in the preamble
(for a few keys it could also make sense to change them in the document).

The key-val list understands the following keys:
The key-val list understands at least the following keys. More keys are defined in some of the latex-lab module, see table~\ref{tab:setupkey} for an overview which also includes older, now deprecated names.

\begin{table}
\caption{Overview over keys for \cs{tagpdfsetup}}\label{tab:setupkey}
\input{tagpdfsetup-keys}
\end{table}

\begin{description}
\item[\PrintKeyName{activate/all}] Boolean, initially false. Activates
Expand Down Expand Up @@ -1906,7 +1911,7 @@ \subsubsection{Attributes and attribute classes}\label{sec:attributes}


To use such attributes you must at first declare it in \verb+\tagpdfsetup+
with the key \texttt{newattribute}. This key takes two argument, a name and
with the key \texttt{role/new-attribute}. This key takes two argument, a name and
the content of the attribute. The name should be a sensible key name, it is
converted to a pdf name with \verb+\pdf_name_from_unicode_e:n+, so slashes
and spaces are allow. The content should be a dictionary without the
Expand All @@ -1916,9 +1921,9 @@ \subsubsection{Attributes and attribute classes}\label{sec:attributes}
\begin{taglstlisting}
\tagpdfsetup
{
newattribute =
role/new-attribute =
{TH-col}{/O /Table /Scope /Column},
newattribute =
role/new-attribute =
{TH-row}{/O /Table /Scope /Row},
}
\end{taglstlisting}
Expand Down Expand Up @@ -2578,7 +2583,7 @@ \subsection{Putting everything together}
tagging commands) the following strategy can be used:

\begin{itemize}
\item when storing the box put around it a structure as need by the
\item when storing the box put around it a structure as needed by the
tagged variant:
\begin{verbatim}
\tag_mc_end_push: % interrupt an open mc
Expand Down Expand Up @@ -2773,7 +2778,7 @@ \subsection{Changes in version 0.8}
commands starting with |\uftag| will stay valid for some time but
then be deprecated.

\item \textbf{Breaking change!} The argument of \texttt{newattribute}
\item \textbf{Breaking change!} The argument of \texttt{role/new-attribute} (old key name: \texttt{newattribute})
option should no longer add the dictionary bracket \verb+<<..>>+,
they are added by the code.

Expand Down Expand Up @@ -2869,10 +2874,10 @@ \subsection{Changes in version 0.90}
places, it also ate spaces in places where this wasn't expected. From
now on both commands behave exactly like the expl3 versions.
\item The lua-code to add real space glyphs has been separated from the
tagging code. This means that |interwordspace| now works also if
tagging code. This means that |activate/spaces| now works also if
tagging is not active.
\item The key |activate| has been added, it open the first structure, see
below.
above.
\end{itemize}

\subsection{Changes in version 0.92}
Expand Down Expand Up @@ -3015,7 +3020,7 @@ \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{}
\printbibliography[heading=bibintoc]


Expand Down
69 changes: 69 additions & 0 deletions doc/tagpdfsetup-keys.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
%% Overview over tagpdfsetup keys
%% The keys are split in a number of key pathes.
\tagpdfsetup{table/header-rows=1}
\begin{tabular}{lllll}
\toprule
new key name & old key name & value &type & defined in \\\midrule
--- & root-AF & string &code &tagpdf-struct\\[4pt]\midrule
%% activate key path
%% activate` is used for keys that enable
%% general, typically document wide tagging options
%% related to the PDF processing.

activate & activate & boolean &meta & tagpdf \\
activate/all & activate-all & boolean &meta & tagpdf\\
activate/mc & activate-mc & boolean &bool & tagpdf\\
activate/spaces & interwordspace & boolean/choice &code & tagpdf-space\\
activate/struct & activate-struct & boolean &bool & tagpdf\\
activate/struct-dest & no-struct-dest&boolean &bool & tagpdf\\
activate/tagunmarked& tagunmarked & boolean &bool & tagpdf\\
activate/tree & activate-tree & boolean &bool & tagpdf\\[4pt]\midrule
% temporary until tagging-sockets are in the kernel:
% activate/socket & --- & boolean & bool & tagpdf\\
%% role key path. For everything related to tag and attribute names
%% adds mathml to the global rolemap, should perhaps be default
role/mathml-tags & mathml-tags & boolean &bool & tagpdf-roles\\
role/new-tag & add-new-tag & string &code & tagpdf-roles\\
role/new-attribute&newattribute & string &code & tagpdf-struct\\
% values: latex, pdf, default is latex, with pdf only PDF-tags are used
role/tagset & --- & choice & code & tagpdf-roles\\[4pt]\midrule
%% debug key path
%% for logging and showing
debug/show &various &choice &code & various \\
debug/show=para & paratagging-show& --- &code & tagpdf-user\\
debug/show=paraOff& & --- &code & tagpdf-user\\
debug/show=spaces & show-spaces & --- &code & tagpdf-spaces\\
debug/show=spacesOff& --- & --- &code & tagpdf-spaces\\
debug/log & log & choice &code & tagpdf \\
debug/uncompress & uncompress & --- &code & tagpdf\\[4pt]\midrule
%% viewer key path.
%% viewer keys influence some display options in a pdf viewer.
%% There is an overlap with similar "non-tagging" options.
% TODO viewer/display-title
%% show mathml-files in attachment pane (old mathml-panel)
viewer/pane/mathml & --- & boolean &bool &latex-lab-math (dev)\\
viewer/pane/mathsource& --- &boolean &bool &latex-lab-math (dev)\\[4pt]\midrule
%%% Document element keys
%% page key path
page/tabsorder &tabsorder & choice & code & tagpdf\\
page/exclude-header-footer & exclude-header-footer &choice & code &tagpdf-user\\[4pt]\midrule
%% para key path
para/tagging &paratagging &boolean &bool &tagpdf-user\\
para/tag &paratag &string &code &tagpdf-user\\
para/maintag &--- &string &code &tagpdf-user\\
para/flattened &--- &boolean &bool &tagpdf-user\\[4pt]\midrule
%% math key path
% use the /Alt key, currently clashes with mathml-AF in foxit,
% so false if mathml handling is activated
math/alt/use &--- &boolean &bool &latex-lab-math\\
math/mathml/write-dummy & --- &--- &code &latex-lab-math\\
% mathml source files:
math/mathml/sources &--- & clist &clist &latex-lab-math\\
math/mathml/AF &--- &boolean &bool &latex-lab-math\\
math/tex/AF & --- &boolean &bool &latex-lab-math\\
% TODO math/alt/type = source|manual| (later)
%% table key path
% true/false/layout
table/tagging & table-tagging &choice &code &latex-lab-table\\
table/header-rows & table-header-rows& clist &clist &latex-lab-table\\
\end{tabular}

0 comments on commit a1b3274

Please sign in to comment.