Hiding the content (drawing empty boxes?)
Hello, Some TeX challenge (probably not solvable?): for gurus only. Is there a way to somehow \starthidden ... \stophidden, which would leave exactly the same amount of blank space as if the content would be typeset? Adam suggested to use transparent font colour, but this doesn't solve the problem as this won't stop the images, frames and nested \color[red]{font color changing commands} being displayed. I tried to adapt the macro \demobox from the TeXBOOK which processes token by token and draws an empty box instead of that token. It works perfectly as long as there is only plain text between the braces, but as soon there is something more complex, it breaks. This behaviour is probably to be expected, but I have no idea how to let all the commands do what they are expected to do and only prohibit placing any boxes with some content. Thanks, Mojca
Mojca Miklavec wrote:
Hello,
Some TeX challenge (probably not solvable?): for gurus only.
Is there a way to somehow
\starthidden ... \stophidden,
which would leave exactly the same amount of blank space as if the content would be typeset?
Adam suggested to use transparent font colour, but this doesn't solve the problem as this won't stop the images, frames and nested \color[red]{font color changing commands} being displayed.
I tried to adapt the macro \demobox from the TeXBOOK which processes token by token and draws an empty box instead of that token. It works perfectly as long as there is only plain text between the braces, but as soon there is something more complex, it breaks. This behaviour is probably to be expected, but I have no idea how to let all the commands do what they are expected to do and only prohibit placing any boxes with some content.
well, how about: \defineproperty[mojcas-secrets][layer][state=top] \starttext \input tufte \startproperty[mojcas-secrets]\input knuth \stopproperty \input tufte \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
Mojca Miklavec wrote:
Is there a way to somehow
\starthidden ... \stophidden,
which would leave exactly the same amount of blank space as if the content would be typeset?
well, how about:
\defineproperty[mojcas-secrets][layer][state=top]
\starttext
\input tufte
\startproperty[mojcas-secrets]\input knuth \stopproperty
\input tufte
\stoptext
Great! Thank you, Hans. That's "unfair" again: it seems too easy to be possible, but it actually works ... -) Just a hint: don't ever expect my secrets to be hidden that way. They are way too precious to be seen by others by simply switching them on again in Acrobat :) Mojca
Mojca Miklavec said this at Fri, 8 Jul 2005 00:33:38 +0200:
Just a hint: don't ever expect my secrets to be hidden that way. They are way too precious to be seen by others by simply switching them on again in Acrobat :)
It's not hidden in other PDF viewers, such as Apple's native one. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Adam Lindsay wrote:
Mojca Miklavec said this at Fri, 8 Jul 2005 00:33:38 +0200:
Just a hint: don't ever expect my secrets to be hidden that way. They are way too precious to be seen by others by simply switching them on again in Acrobat :)
It's not hidden in other PDF viewers, such as Apple's native one.
as long as it's only mojca's password that needs to be hidden, she can use: \starttext \input tufte \startproperty[hidden] mojca's secret code hidden for adam's apple \stopproperty \input tufte \stoptext Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
as long as it's only mojca's password that needs to be hidden, she can use:
Well, it is still in the pdf file, so I'd rather not store my passwords there. Patrick -- ConTeXt wiki and more: http://contextgarden.net
Hans Hagen said this at Fri, 8 Jul 2005 09:12:01 +0200:
as long as it's only mojca's password that needs to be hidden
:) Well, someone could cut-and-paste that invisible text... But that certainly works better on Apple's Preview.app, and probably is mostly appropriate for the intended use... (hiding stuff in presentations, making them non-Acrobat/JS dependent) Except that it doesn't seem to hide framed content. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Adam Lindsay wrote:
Hans Hagen said this at Fri, 8 Jul 2005 09:12:01 +0200:
as long as it's only mojca's password that needs to be hidden
If I'm ever going to store my password in PDF files, I'll wait for pdfTeX support for password-protected files first :)
:) Well, someone could cut-and-paste that invisible text...
The problem is not in cutting-and-pasting at all. If I make a presentation, people won't mind cutting and pasting on my computer while I talk. But as long as it is only supported by Adobe >= 6, it's only suboptimal. :( If someone could hack the plain TeX macro, it would probably do exactly what I would expect it to do, but it doesn't sound easy at all.
But that certainly works better on Apple's Preview.app, and probably is mostly appropriate for the intended use... (hiding stuff in presentations, making them non-Acrobat/JS dependent)
Except that it doesn't seem to hide framed content.
Tu sum it up: - the adapted plain TeX trick with boxes doesn't place any content, but only works for plain text (not useful) - \startproperty[mysecret] hides the content (works satisfactory in that view), but only works on Adebe Acrobat, not even in the Wiki - \startproperty[hidden] works on more browsers, but has the same effect as making fonts transparent: it doesn't influence any rules, figures, ... only fonts. For those complaining that hiding doesn't work on other PDF viewers: Adobe also gives up (one of those nice "undocummented features", one could also call them bugs) if I try to save the resulting file as TXT. I just wanted to check if the hidden content will be saved, but I didn't manage to save anything anyway. Thanks for all the comments, Mojca
Mojca Miklavec wrote:
Tu sum it up: - the adapted plain TeX trick with boxes doesn't place any content, but only works for plain text (not useful) - \startproperty[mysecret] hides the content (works satisfactory in that view), but only works on Adebe Acrobat, not even in the Wiki - \startproperty[hidden] works on more browsers, but has the same effect as making fonts transparent: it doesn't influence any rules, figures, ... only fonts.
For those complaining that hiding doesn't work on other PDF viewers: Adobe also gives up (one of those nice "undocummented features", one could also call them bugs) if I try to save the resulting file as TXT. I just wanted to check if the hidden content will be saved, but I didn't manage to save anything anyway.
i've added printable support (was already there but no key available) \setupinteraction[state=start] \defineproperty [mojca] [layer] [state=stop] \starttext \input ward \startproperty[mojca]I hate hacking TeX!\stopproperty \input davis \button{Show Mojca's Secret}[VideLayer{mojca}] \button{Hide Mojca's Secret}[HideLayer{mojca}] \button{Toggle Mojca's Secret}[ToggleLayer{mojca}] \stoptext the bad news is is that acrobat does not handle it (my guess is that such features don't work becausethey have no way of testing it) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
i've added printable support (was already there but no key available)
\setupinteraction[state=start] \defineproperty [mojca] [layer] [state=stop]
\starttext \input ward \startproperty[mojca]I hate hacking TeX!\stopproperty \input davis
\button{Show Mojca's Secret}[VideLayer{mojca}] \button{Hide Mojca's Secret}[HideLayer{mojca}] \button{Toggle Mojca's Secret}[ToggleLayer{mojca}]
\stoptext
the bad news is is that acrobat does not handle it (my guess is that such features don't work becausethey have no way of testing it)
Hans
Here it works in both Adobe Acrobat Professional 6.0.1 and Adobe Reader 7.0.1. Thanks for those examples too, Mojca
participants (4)
-
Adam Lindsay
-
Hans Hagen
-
Mojca Miklavec
-
Patrick Gundlach