Skip to content

Commit

Permalink
documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Jul 26, 2024
1 parent c3265bd commit 7d22a50
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 49 deletions.
2 changes: 2 additions & 0 deletions build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ docfiles = {"tagpdf.tex",
"tagpdf.bib",
"link-figure-input.tex",
"pac3.PNG",
"pac2024-version.png",
"pac2024-report.png",
"acrobat.png",
"global-ex.png",
"examples/mc/ex-*.tex",
Expand Down
6 changes: 3 additions & 3 deletions doc/link-figure-input.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
\NewDocumentCommand\balloon{m}{%
\node[fit={(pic cs:#1-first) (pic cs:#1-end)
([yshift=7pt]pic cs:#1-end)},balloon](#1){};}
\begin{tikzpicture}[overlay,remember picture]
\begin{tikzpicture}[overlay,remember picture,alt={Illustration of link annotation structure}]
\balloon{link}
\balloon{structparent}
\balloon{OBJR}
Expand All @@ -45,7 +45,7 @@
\draw[ref] (kid)--(OBJR);
\draw[ref] (OBJR)--(linkref);
\end{tikzpicture}
\begin{lstlisting}[name=OBJR]
\begin{taglstlisting}[name=OBJR]
*\tikzmark{link-first}*18 0 obj*\tikzmark{link-end}* %Link Object
<< /Type /Annot /Subtype/Link
/Rect [ 196.109 494.573 399.167 506.831 ]
Expand All @@ -67,4 +67,4 @@
<< /Nums
[... *\tikzmark{pnum-first}*16*\tikzmark{pnum-end}* *\tikzmark{pref-first}*17 0 R*\tikzmark{pref-end}* ...] >>
endobj
\end{lstlisting}
\end{taglstlisting}
Binary file added doc/pac2024-report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/pac2024-version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 19 additions & 45 deletions doc/tagpdf.tex
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,15 @@ \subsection{Proof of concept: the tagging of the documentation itself}
the \PDF\ management code and is now much better. Only a few
structures---mostly some from currently unsupported packages--- still need
manual tagging. But sadly the output of the validators don't quite reflect
the improvements. The documentation uses now \PDF~2.0 and PAC~2024 can't handle
this, it claims that the file is damaged. The Adobe validator has a bug and
the improvements. The documentation uses now \PDF~2.0 and while the newest
PAC~2024 can at least open the file it can not validate properly the file. For example
it complains about the tabular header cells as it doesn't follow attribute classes.
The Adobe validator has a bug and
doesn't like the (valid) use of the \texttt{Lbl} tag for the section numbers
(see figure~\ref{fig:adobe}).


But even if the documentation passed the tests of the validators: as
But even if the documentation would pass all the tests of the validators: as
mentioned above passing a formal test doesn't mean that the content is really
good and usable. The user commands used for the tagging and also some of the
patches used are still rather crude. So there is lot space for improvement.
Expand All @@ -354,8 +356,9 @@ \subsection{Proof of concept: the tagging of the documentation itself}
current version of the pdfmanagment-testphase package is needed.
\end{tcolorbox}

\includegraphics[alt=PAC 3 report]{pac3}
\includegraphics[alt=PAC 2024 complains about PDF version]{pac2024-version}

\includegraphics[alt=PAC 2024 complains about table header cells]{pac2024-report}

\begin{figure}

Expand Down Expand Up @@ -504,6 +507,10 @@ \subsection{Setup and activation}\label{ssec:setup}
least \PrintKeyName{activate/mc} has been used.
The old name of the key |interwordspace| is still supported but deprecated.

\item[\PrintKeyName{activate/softhyphen}] Boolean. luamode only.
The key activates/deactivates the replacing of hard hyphens from hyphenation
by soft hyphens. By default this is activated.


\item[\PrintKeyName{role/new-tag}] Allows to define new tag names, see
section \ref{sec:new-tag} for a description.
Expand Down Expand Up @@ -721,32 +728,22 @@ \subsection{Three tasks}

\minisec{Page stream with marked content}

\tagpdfparaOff

\tagstructbegin{tag=Figure,alt={Illustration of page stream with marked content},attribute=bbox}%
\tagmcbegin{tag=Figure}%
\begin{tikzpicture}[baseline=(a.north),node distance=2pt,remember picture]
\begin{tikzpicture}[baseline=(a.north),node distance=2pt,remember picture,
alt={Illustration of page stream with marked content}]
\node(start){\ldots~\ldots~\ldots};
\node[draw,base right = of start](a) {mc-chunk 1};
\node[draw,base right = of a](b) {mc-chunk 2};
\node[draw,base right = of b](c) {mc-chunk 3};
\node[draw,base right = of c](d) {mc-chunk 3};
\node[base right = of d] {\ldots~\ldots};
\end{tikzpicture}
\tagmcend\tagstructend

\tagpdfparaOn


\minisec{Structure}

\tagpdfparaOff

\newlength\ydistance\setlength\ydistance{-0.8cm}
\tagstructbegin{tag=Figure,alt={Illustration of structure},attribute=bbox}%
\tagmcbegin{tag=Figure}%
\begin{tikzpicture}[remember picture,baseline=(root.north)]

\begin{tikzpicture}[remember picture,baseline=(root.north),alt={Illustration of structure}]
\node[draw,anchor=base west] (root) at (0,0) {Sect (start section)};
\node[draw,anchor=base west] at (0.3,\ydistance) {H (header section)};
\node[draw,anchor=base west](aref) at (0.6,2\ydistance){mc-chunk 1};
Expand All @@ -758,17 +755,12 @@ \subsection{Three tasks}
\node[draw,anchor=base west] at (0.3,8\ydistance){/P (end paragraph)};
\node[draw,anchor=base west] at (0,9\ydistance){/Sect (end section)};
\end{tikzpicture}

\begin{tikzpicture}[remember picture, overlay]
\draw[->,red](aref)-|(a);
\draw[->,red](bref)-|(b);
\draw[->,red](cref)-|(c);
\draw[->,red](dref)-|(d);

\end{tikzpicture}
\tagmcend\tagstructend

\tagpdfparaOn

\end{tcolorbox}

Expand Down Expand Up @@ -1283,13 +1275,8 @@ \subsubsection{Tips}


\begin{figure}
\tagpdfparaOff

\tagstructbegin{tag=Figure,alt={Illustration of link annotation structure},attribute=bbox}\tagmcbegin{tag=Figure}
\tagstop
\input{link-figure-input}
\tagstart
\tagmcend\tagstructend

\caption{Structure needed for a link annotation}\label{fig:linkannot}

Expand Down Expand Up @@ -3061,18 +3048,15 @@ \section{Some remarks about the \PDF{} syntax}
\item[postfix notation] \PDF{} uses in various places postfix
notation. This means that the operator is behind its arguments:

\tagpdfparaOff

\tagstructbegin{tag=Figure,alt={Illustration of postfix notation},attribute=bbox}\tagmcbegin{tag=Figure}
\begin{tikzpicture}[baseline=(c.base)]
\begin{tikzpicture}[baseline=(c.base),alt={Illustration of postfix notation}]
\node[arg](a1) {18};
\node[arg,right=of a1.east](a2) {0};
\node[operator,right= of a2.east](c) {obj};
\draw[->] (c.south) --++(0,-2mm) -| (a1);
\draw[->] (c.south) --++(0,-2mm) -| (a2);
\end{tikzpicture}

\begin{tikzpicture}[baseline=(c.base)]
\begin{tikzpicture}[baseline=(c.base),alt={Illustration of postfix notation}]
\node[arg](a1) {18};
\node[arg,right=of a1.east](a2) {0};
\node[operator,right= of a2.east](c) {R};
Expand All @@ -3081,7 +3065,7 @@ \section{Some remarks about the \PDF{} syntax}
\end{tikzpicture} (a reference (operator R) to an object


\begin{tikzpicture}[baseline=(c.base)]
\begin{tikzpicture}[baseline=(c.base),alt={Illustration of postfix notation}]
\node[arg](a1) {1};
\node[arg,right = of a1.east](a2) {0};
\node[arg,right = of a2.east](a3) {0};
Expand All @@ -3097,19 +3081,15 @@ \section{Some remarks about the \PDF{} syntax}
\draw[->] (c.south) --++(0,-2mm) -|(a1);
\end{tikzpicture}

\begin{tikzpicture}[baseline=(c.base)]
\begin{tikzpicture}[baseline=(c.base),alt={Illustration of postfix notation}]
\node[arg](a1) {/P};
\node[arg,right = of a1.east](a2) {<</MCID 0>>};
\node[operator,right = of a2.east](c) {BDC};
\draw[->] (c.south) --++(0,-2mm) -| (a1);
\draw[->] (c.south) --++(0,-2mm) -| (a2);
\end{tikzpicture}
\tagmcend\tagstructend



\tagpdfparaOn

\item[Names] \PDF{} knows a sort of variable called a
\enquote{name}. Names start with a slash and may include any regular
characters, but not delimiter or white-space characters. Uppercase
Expand Down Expand Up @@ -3152,19 +3132,13 @@ \section{Some remarks about the \PDF{} syntax}
\mbox{\texttt{[0 15 0 R (hello) <</Type /X>> [1 2 3]]}}


\tagpdfparaOff

\tagstructbegin{tag=Figure,alt={Illustration of array},attribute=bbox}\tagmcbegin{tag=Figure}
\begin{tikzpicture}[baseline=(c.base)]
\begin{tikzpicture}[baseline=(c.base),alt={Illustration of array}]
\node[arg](a1) {0};
\node[arg,right = of a1.east](a2) {15 0 R};
\node[arg,right = of a2.east](a3) {(hello)};
\node[arg,right = of a3.east](a4) {<</Type /X>>};
\node[arg,right = of a4.east](a5) {[1 2 3]};
\end{tikzpicture}
\tagmcend\tagstructend

\tagpdfparaOn


\item[Dictionaries] Dictionaries are enclosed by double angle
Expand Down
3 changes: 2 additions & 1 deletion doc/tagpdfsetup-keys.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

activate & activate & boolean &meta & tagpdf \\
activate/all & activate-all & boolean &meta & tagpdf\\
activate/mc & activate-mc & boolean &bool & tagpdf\\
activate/mc & activate-mc & boolean &bool & tagpdf\\
activate/softhyphen & --- & boolean &bool & tagpdf \\
activate/spaces & interwordspace & boolean &code & tagpdf-space\\
activate/struct & activate-struct & boolean &bool & tagpdf\\
activate/struct-dest & no-struct-dest&boolean &bool & tagpdf\\
Expand Down

0 comments on commit 7d22a50

Please sign in to comment.