Questions tagged [ocgx2]
This package {ocgx2} serves as a drop-in replacement for the packages ocgx by Paul Gaborit and ocg-p by Werner Moshammer for the creation of PDF Layers.
40 questions
5 votes
1 answer
96 views
Visual overflow of maths into bottom margin with ocgx2 or footmisc, and ebproof
A strange overflow of math-mode content can happen when either footmisc or ocgx2 (or both) packages are used. The package ebproof is used to create a Gentzen style formal proof. What's wrong: ...
1 vote
0 answers
68 views
Print links in black, but make layers inaccessible
Currently, I am using ocgx2 to make hyperlinks print in black: \documentclass{article} \usepackage[allcolors=red,colorlinks]{hyperref} \usepackage[ocgcolorlinks,showingui=false]{ocgx2} \begin{...
1 vote
0 answers
44 views
ocgx2 links have rugged edges or disappear entirely
I am using ocgx2 to have the hyperref links printed in black on paper. If the package is included with the ocgcolorlinks options, the text of all links becomes rugged/fringy/frayed. See this example: \...
0 votes
0 answers
81 views
\ocgbutton undefined after clean TeX Live 2025 install from ISO (LuaLaTeX/pdfLaTeX)
I am experiencing a very persistent and unusual issue with the ocgx2 package in TeX Live 2025 on my Linux system (Ubuntu/Debian or similar). The \ocgbutton command consistently results in an Undefined ...
2 votes
0 answers
95 views
Is there a bug in ocgx2? [closed]
When this document is compiled twice in a row, the angle measurement (38) should not be displayed, but it is. It should be displayed by clicking on the angle. This was not a problem this summer. What ...
2 votes
1 answer
82 views
Wrapping minted-Enviroment in a ocg-Enviroment
I cannot wrap my minted-Environment, which is wrapped in a tcolorbox into an ocg-Environment. The wrapping of the minted-Environment into the tcolorbox is working fine. Does anyone more competent than ...
5 votes
1 answer
125 views
Error with tagging-project, 'ocgx2' package and TOC
This mwe: \DocumentMetadata{testphase=new-or-1} \documentclass{book} \usepackage{hyperref} \usepackage[ocgcolorlinks]{ocgx2} \begin{document} \tableofcontents \chapter{first chapter} \end{document} ...
8 votes
2 answers
278 views
New color command \colorPlus[<color-when-printed>]{<color-in-PDF>} that behaves differently when viewed and printed
The aim is to define a new command \colorPlus[<color-when-printed>]{<color-in-PDF>} that works exactly like the usual \color{<color-in-PDF-and-print>} when used without optional ...
0 votes
1 answer
297 views
Working slider in LaTeX with TikZ and ocgx2
Is there a way of creating an interactive slider by using TikZ and ocgx2 like this? Multiple instances of \actionsocg[onmouseall]{}{convenient code}{convenient code}{convenient space} are put side by ...
2 votes
0 answers
493 views
How to create a document with collapsible proofs?
I am trying to create a document which has a series of theorems and proofs, one right after the other. I would like it so that in the pdf, one can click a button next to a proof that collapses that ...
5 votes
1 answer
289 views
Using ocgx2 instead of ocg-p: \AddToShipoutPictureBG not recognized
I want to use the ocgx2 package under luatex. In the past, I used the ocg-p package but the ocg-p package does not work with luatex, see ocg-p: Optional Content Groups in LuaTeX. My (apparently wrong) ...
1 vote
0 answers
143 views
Button to show and hyperref hidden page [closed]
As the title says I want to create a button which triggers hyperlink to a page but also shows a hidden layer. I found many Ocgx2 soutions to hide/show layers from @alexG, but I couldn't find a ...
0 votes
0 answers
91 views
ocgx2, expl3: splitting comma separated OCMD/OCGs lists of arguments for references automation (bis)
Thanks to @AlexG and @Marcel Kruger, elaborating MCQs can be done with the different links below. (1) ocgx2: verify and reset of Multiple Choice Questions with OCGs (2) ocgx2, xparse, expl3: splitting ...
1 vote
0 answers
105 views
How to fix placement of layers in Apple Preview (works in Adobe Reader and others)
I am trying to create an interactive PDF where one can switch between a color and a grayscale image using the ocgx2 package. It works on Adobe (with interactive element), and displays fine in most ...
0 votes
0 answers
230 views
How to combine a JavaScript code and OCG/OCMG layers within LaTeX source/macro?
This question is a "work in progress" in order to find a solution to the following previous question: (1) ocgx2: Multiple Choice Questions up to three automatic trials As suggested by @AlexG ...