Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make package info on doc title page easier to be selected #225

Closed
muzimuzhi opened this issue Mar 28, 2023 · 4 comments
Closed

Make package info on doc title page easier to be selected #225

muzimuzhi opened this issue Mar 28, 2023 · 4 comments
Assignees

Comments

@muzimuzhi
Copy link
Contributor

Currently it's not convenient to select the package info (e.g., release date or author name) on doc title page, because the title page is filled by a grid of slanted text boxes as a background.

This issue suggests to make the background non-selectable (need PDF reader's support), by using accsupp package which makes use of PDF's support for accessibility.

tcolorbox-bg-nonselectable.pdf

diff --git a/doc/latex/tcolorbox/tcolorbox.doc.abstract.tex b/doc/latex/tcolorbox/tcolorbox.doc.abstract.tex
index 0bdfb28..0860a2f 100644
--- a/doc/latex/tcolorbox/tcolorbox.doc.abstract.tex
+++ b/doc/latex/tcolorbox/tcolorbox.doc.abstract.tex
@@ -9,6 +9,7 @@
 \coordinate (A) at (0,0); \coordinate (B) at (21,29.7);
 \path[use as bounding box] (A) rectangle coordinate (C) (B);
 \node[transform shape,xslant=0.7,rotate=-10,xshift=0cm] at (C) {%
+  \BeginAccSupp{method=plain,ActualText={}}%
   \begin{tcbraster}[raster columns=4,title=tcolorbox \version,
     fonttitle=\small\bfseries,raster width=50cm]
   \foreach \b in {1,...,28} {\begin{tcolorbox}[enhanced,
@@ -18,6 +19,7 @@
     colbacktitle=boxcol!!+!50!black!30!white,
     colupper=black!30!white]\lipsum[2]\end{tcolorbox}}
   \end{tcbraster}%
+  \EndAccSupp{}%
 };
 \node at (C) {%
   \begin{tcbitemize}[title=tcolorbox \version,fonttitle=\small\bfseries,
diff --git a/doc/latex/tcolorbox/tcolorbox.doc.s_main.sty b/doc/latex/tcolorbox/tcolorbox.doc.s_main.sty
index 3aae917..e1ff256 100644
--- a/doc/latex/tcolorbox/tcolorbox.doc.s_main.sty
+++ b/doc/latex/tcolorbox/tcolorbox.doc.s_main.sty
@@ -40,6 +40,7 @@
   \tcbset{listing engine=listings,initialize@reset={listing engine=listings}}%
 }

+\RequirePackage{accsupp}
 \RequirePackage{hyperref}

@T-F-S
Copy link
Owner

T-F-S commented Mar 31, 2023

Well, there is always page 3 with the relevant information.
Nevertheless, I will follow your suggestion for adding accsupp. On my system, it works for Acrobat Reader, but not for SumatraPDF.

@T-F-S T-F-S self-assigned this Mar 31, 2023
@dbitouze
Copy link
Contributor

accsupp works well for most PDF viewers on GNU/Linux.

@muzimuzhi
Copy link
Contributor Author

Well, there is always page 3 with the relevant information.

Oh my... I'm just too used to jump to the first page with a keyboard shortcut (Home).

@T-F-S
Copy link
Owner

T-F-S commented Jun 20, 2023

@T-F-S T-F-S closed this as completed Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants