Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am looking a way to generate a toggle region in PDF compiled by pdflatex. Something like this implemented with javascript in html

http://www.randomsnippets.com/2008/02/12/how-to-hide-and-show-your-div/

I remember long time ago I saw a post online to implement this function but I can't find that post anymore.

share|improve this question
2  
you can search for ocgx from Paul Gaborit. The manual has a few nifty examples. tex.stackexchange.com/questions/65096/… –  percusse Feb 1 '13 at 1:20
1  
But collapsing won't be possible. –  AlexG Feb 1 '13 at 9:27

1 Answer 1

Your best bet would be to use PDF layers, i.e. . That's the only way you can emulate collapsing.

share|improve this answer
    
I doubt that collapsing works in addition to hide/display page content using ocgs. The reason is that the effect of changing the current transformation matrix within marked content (BDC ... EMC) is not local. –  AlexG Feb 1 '13 at 12:03
    
@AlexG: You would have to put the rest of the page/block for both case (collapsed/uncollapsed) on different layers. Ugly, but it may work (I haven't tested this for pages, I know it works for blocks). –  Martin Schröder Feb 1 '13 at 12:07
    
Ok, this may indeed be possible, but difficult in case of multiple vertically aligned collapsable blocks. Every possible combination of expanded and collapsed blocks would have to be prepared beforehand. –  AlexG Feb 1 '13 at 13:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.