Re: http://archive.contextgarden.net/message/20050707.214524.2b87e5f1.en.html Mojca asked...
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?
What's the current status on this issue ? Alan
On Thu, Jul 24, 2008 at 12:51 PM, Alan Stone
Re: http://archive.contextgarden.net/message/20050707.214524.2b87e5f1.en.html
Mojca asked...
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?
What's the current status on this issue ?
What's wrong with the methods offered in the thread. Do you want to hide only text or also figures, tables, formulae etc. Is the content to be hidden on one page or do you need a solution that will work also over page breaks. Wolfgang
I understood from this post http://archive.contextgarden.net/message/20050708.105010.33153980.en.html there were issues with the different solutions offered.
Do you want to hide only text or also figures, tables, formulae etc.
For the time being there's only text, however in a later stage there will be figures/pics too.
do you need a solution that will work also over page breaks.
Yes, to make a preview version of a book.
Alan
On Thu, Jul 24, 2008 at 12:51 PM, Alan Stone
Re: http://archive.contextgarden.net/message/20050707.214524.2b87e5f1.en.html
Mojca asked...
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?
What's the current status on this issue ?
Alan
On Thu, Jul 24, 2008 at 2:34 PM, Alan Stone
I understood from this post http://archive.contextgarden.net/message/20050708.105010.33153980.en.html there were issues with the different solutions offered.
You should give it a try, a few of the points concerned security reasons and old version of Acrobat Reader, there is also a wiki page about this topic. http://wiki.contextgarden.net/Hiding_Content
Do you want to hide only text or also figures, tables, formulae etc.
For the time being there's only text, however in a later stage there will be figures/pics too.
do you need a solution that will work also over page breaks.
Yes, to make a preview version of a book.
And you want to hide part of the content for ... Wolfgang
And you want to hide part of the content for ...
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version. Alan On Thu, Jul 24, 2008 at 3:03 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote:
On Thu, Jul 24, 2008 at 2:34 PM, Alan Stone
wrote: I understood from this post
http://archive.contextgarden.net/message/20050708.105010.33153980.en.html
there were issues with the different solutions offered.
You should give it a try, a few of the points concerned security reasons and old version of Acrobat Reader, there is also a wiki page about this topic.
http://wiki.contextgarden.net/Hiding_Content
Do you want to hide only text or also figures, tables, formulae etc.
For the time being there's only text, however in a later stage there will be figures/pics too.
do you need a solution that will work also over page breaks.
Yes, to make a preview version of a book.
And you want to hide part of the content for ...
Wolfgang
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
On Thu, Jul 24, 2008 at 3:21 PM, Alan Stone
And you want to hide part of the content for ...
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version.
In this case the solution offered in the thread are no solution for your, it's too easy for the customers to make the hidden content visible. Wolfgang PS: Can you try to avoid top posts.
On Thu, Jul 24, 2008 at 3:32 PM, Wolfgang Schuster wrote:
On Thu, Jul 24, 2008 at 3:21 PM, Alan Stone
wrote: And you want to hide part of the content for ...
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version.
In this case the solution offered in the thread are no solution for your, it's too easy for the customers to make the hidden content visible.
True. Most readers don't even hide the content if you use javascript to hide it. If you want to prevent people from seing the content, you may not put your text there on the first place. But the exact usage depends. I would only send them a few pages out of the whole document, I would not try to send them 500 pages with 5.000 words. Mojca
On Thu, Jul 24 2008, Wolfgang Schuster wrote:
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version.
In this case the solution offered in the thread are no solution for your, it's too easy for the customers to make the hidden content visible.
Shouldn't it be very easy with MKIV, to replace the content to hide with whatever you want? Examples: - the replacement are only the corresponding line-skips - the replacement are random letters printed in white Cheers, Peter -- http://pmrb.free.fr/contact/
On Thu, Jul 24, 2008 at 9:43 PM, Peter Münster
On Thu, Jul 24 2008, Wolfgang Schuster wrote:
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version.
In this case the solution offered in the thread are no solution for your, it's too easy for the customers to make the hidden content visible.
Shouldn't it be very easy with MKIV, to replace the content to hide with whatever you want? Examples: - the replacement are only the corresponding line-skips
this is easy if the text is a complete paragraph and no linebreaks are involved but it's going to be complicated with headers, linebreaks, tables, figures etc.
- the replacement are random letters printed in white
% engine=luatex \definestartstop [randomized] [before={\bgroup\setcharactercasing[5]}, after=\egroup] \starttext \input knuth \startrandomized \input knuth \stoprandomized \input knuth \stoptext Regards, Wolfgang
On Thu, Jul 24, 2008 at 9:43 PM, Peter Münster
On Thu, Jul 24 2008, Wolfgang Schuster wrote:
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version.
In this case the solution offered in the thread are no solution for your, it's too easy for the customers to make the hidden content visible.
Shouldn't it be very easy with MKIV, to replace the content to hide with whatever you want? Examples: - the replacement are only the corresponding line-skips
%\disablemode[hiding] \enablemode[hiding] \unprotect \def\starthiding {\dostartbuffer[hiddencontent][starthiding][stophiding]} \def\stophiding {\bgroup \setbox\scratchbox\vbox{\getbuffer[hiddencontent]}% \getnoflines{\dimexpr\ht\scratchbox+\dp\scratchbox\relax}% \dorecurse{\number\noflines}{\blank[\v!force,\v!line]}% \egroup} \protect \startnotmode[hiding] \let\starthiding\relax \let\stophiding \relax \stopnotmode %\showgrid \starttext \dorecurse{2}{\input knuth\par} \starthiding \input tufte \stophiding \dorecurse{2}{\input ward\par} \starthiding \input zapf \stophiding \input knuth \stoptext
- the replacement are random letters printed in white
Cheers, Peter
Regards, Wolfgang
How come this doesn't work ? \defineblock[prev] \defineblock[full] \hideblocks[full] %\hideblocks[prev] \def\previewMsg{This part is hidden} \def\showPreviewMsg{\beginprev \hairline \previewMsg \hairline \endprev} \starttext \input tufte \showPreviewMsg % it doesn't show %\beginprev % \hairline % \previewMsg % \hairline %\endprev \beginfull \input knuth \endfull \input tufte \stoptext Alan P.S. What is the \processblocks command for ?
Peter Münster wrote:
On Thu, Jul 24 2008, Wolfgang Schuster wrote:
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version. In this case the solution offered in the thread are no solution for your, it's too easy for the customers to make the hidden content visible.
Shouldn't it be very easy with MKIV, to replace the content to hide with whatever you want?
Yes, pretty easy, but it depends a bit on what you want. Here is a solution that really removes selected boxes from the output PDF (it is un-optimised on purpose): % engine = luatex \defineattribute [ghosted] \def\starthidden {\dosetattribute{ghosted}\plusone} \def\stophidden {\doresetattribute{ghosted}} \ctxlua{ callback.register ('pre_output_filter', function (h) for v in node.traverse(h) do if ( ( v.id == node.id('hlist') or v.id == node.id('vlist') ) and ( node.has_attribute(v,\dogetattributeid{ghosted}) ) ) then node.free(v.list) v.list = nil end end return true end) }
Examples: - the replacement are only the corresponding line-skips - the replacement are random letters printed in white
You can get those effects by changing the lua loop node.traverse to do something more interesting (perhaps by recursive descend). Best wishes, Taci
Why not, if all else fails, do a run of the completed matter to see what the pagination would be, then do something like: \newif\ifhidden % Uncomment this if you want to hide content. % \hiddentrue \ifhidden % . . . preferrably use ConTeXt-friendly pagination % commands; this was taken from a plain old TeX file. % Shove in white space or \phantom{} boxes with dummy text of % equivalent length; ConTeXt likes its own \blank{} macro. % Raw TeX stuff can mess up pagination and spacing. % % I'm not sure if a \vbox to <dimen> {} works well or not here. % Just try a few ways to see. \else % Put all your usual content here. \fi It's a kludge, but it should work in a pinch. Charles On Thu, 2008-07-24 at 15:21 +0200, Alan Stone wrote:
And you want to hide part of the content for ...
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version.
Alan
On Thu, Jul 24, 2008 at 3:03 PM, Wolfgang Schuster
wrote: On Thu, Jul 24, 2008 at 2:34 PM, Alan Stone wrote: > I understood from this post > http://archive.contextgarden.net/message/20050708.105010.33153980.en.html > there were issues with the different solutions offered.
You should give it a try, a few of the points concerned security reasons and old version of Acrobat Reader, there is also a wiki page about this topic.
http://wiki.contextgarden.net/Hiding_Content
>>Do you want to hide only text or also figures, tables, formulae etc. > > For the time being there's only text, however in a later stage there will be > figures/pics too. > >>do you need a solution that >>will work also over page breaks. > > Yes, to make a preview version of a book.
And you want to hide part of the content for ...
Wolfgang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
What do you mean by "do a run of the completed matter to see what
the pagination would be" ?
Alan
On Thu, Jul 24, 2008 at 5:26 PM, Charles P. Schaum
Why not, if all else fails, do a run of the completed matter to see what the pagination would be, then do something like:
\newif\ifhidden
% Uncomment this if you want to hide content. % \hiddentrue
\ifhidden % . . . preferrably use ConTeXt-friendly pagination % commands; this was taken from a plain old TeX file. % Shove in white space or \phantom{} boxes with dummy text of % equivalent length; ConTeXt likes its own \blank{} macro. % Raw TeX stuff can mess up pagination and spacing. % % I'm not sure if a \vbox to <dimen> {} works well or not here. % Just try a few ways to see. \else % Put all your usual content here. \fi
It's a kludge, but it should work in a pinch.
Charles
On Thu, 2008-07-24 at 15:21 +0200, Alan Stone wrote:
And you want to hide part of the content for ...
Enabling people to view the pdf preview version (limited, containing excerpts) before acquiring the full version.
Alan
On Thu, Jul 24, 2008 at 3:03 PM, Wolfgang Schuster
wrote: On Thu, Jul 24, 2008 at 2:34 PM, Alan Stone wrote: > I understood from this post >
http://archive.contextgarden.net/message/20050708.105010.33153980.en.html
> there were issues with the different solutions offered.
You should give it a try, a few of the points concerned security reasons and old version of Acrobat Reader, there is also a wiki page about this topic.
http://wiki.contextgarden.net/Hiding_Content
>>Do you want to hide only text or also figures, tables, formulae etc. > > For the time being there's only text, however in a later stage there will be > figures/pics too. > >>do you need a solution that >>will work also over page breaks. > > Yes, to make a preview version of a book.
And you want to hide part of the content for ...
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to
___________________________________________________________________________________ the Wiki!
maillist : ntg-context@ntg.nl /
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net
___________________________________________________________________________________
Instead of looking to insert "exactly the same amount of blank space as if the content would be typeset", is it possible to generate, in one compile job, the document's preview version (*) with its full version (non-interactive) table of contents (TOC), index, list of figures, ... instead ? (*) using hidden texblocks, or \new\ifhidden ... \ifhidden ... \else ... \fi ( without the spooky phantom thingies ), showing a text block indicating "this part is hidden", to hide whatever is required ( headers, linebreaks, tables, figures etc. ) Or... Create a batch file to - first generate the full version, then - generate the preview version, then - replace the preview version's TOC, index, list of figures, ... with the full version's (non-interactive one) ? Alan
participants (6)
-
Alan Stone
-
Charles P. Schaum
-
Mojca Miklavec
-
Peter Münster
-
Taco Hoekwater
-
Wolfgang Schuster