ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Support for Optional Content Groups
       [not found] <947663393.140271.1404401839314.JavaMail.zimbra@pentandra.com>
@ 2014-07-03 15:55 ` Chris Chapman
  2014-07-03 16:33   ` Wolfgang Schuster
  2014-07-03 17:54   ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Chris Chapman @ 2014-07-03 15:55 UTC (permalink / raw)
  To: ntg-context

I am new to ConTeXt (coming from LaTeX), and am really impressed. Great work!

I am working on a document that has layers that I want to be screen-only, similar in approach to this: 
http://tex.stackexchange.com/questions/167846/implementing-full-page-screen-only-print-only-in-pdf

I am assuming that Optional Content Groups would be the best way to do this. How would I set something up like this in ConTeXt/LuaTeX? I know I could make a screen-only version and a print version of the output pdf, but I want to have my cake and eat it too ;)

Thanks in advance,

Chris Chapman
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for Optional Content Groups
  2014-07-03 15:55 ` Support for Optional Content Groups Chris Chapman
@ 2014-07-03 16:33   ` Wolfgang Schuster
  2014-07-03 17:54   ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2014-07-03 16:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 03.07.2014 um 17:55 schrieb Chris Chapman <chris@pentandra.com>:

> I am new to ConTeXt (coming from LaTeX), and am really impressed. Great work!
> 
> I am working on a document that has layers that I want to be screen-only, similar in approach to this: 
> http://tex.stackexchange.com/questions/167846/implementing-full-page-screen-only-print-only-in-pdf
> 
> I am assuming that Optional Content Groups would be the best way to do this. How would I set something up like this in ConTeXt/LuaTeX? I know I could make a screen-only version and a print version of the output pdf, but I want to have my cake and eat it too ;)


You can test if the layers are hidden when you print the following example, I tried the Adobe Reader on my Mac and they where still visible.

\setupinteraction[state=start]

\defineoverlay[PageBackground] [\startMPcode fill fullsquare xyscaled(OverlayWidth,OverlayHeight) withcolor \MPcolor{orange} ; \stopMPcode]
\defineoverlay[FrameBackground][\startMPcode fill fullsquare xyscaled(OverlayWidth,OverlayHeight) withcolor \MPcolor{green} ;  \stopMPcode]

%\setupbackgrounds[page][background=color,backgroundcolor=orange] % doesn’t work because you can only hide the background together with the text
\setupbackgrounds[page][background=PageBackground]

\setupviewerlayer[printable=no]

\defineviewerlayer[mylayer]

%\showlayoutcomponents % use this to enable/disable certain text areas

\starttext

\input knuth

\startviewerlayer[mylayer]
\input ward
\stopviewerlayer

\input tufte

\startframedtext[width=max,background=FrameBackground]
\input weisman
\stopframedtext

\stoptext

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for Optional Content Groups
  2014-07-03 15:55 ` Support for Optional Content Groups Chris Chapman
  2014-07-03 16:33   ` Wolfgang Schuster
@ 2014-07-03 17:54   ` Hans Hagen
  2014-07-03 18:08     ` Chris Chapman
  2016-05-22  9:22     ` Meer, Hans van der
  1 sibling, 2 replies; 7+ messages in thread
From: Hans Hagen @ 2014-07-03 17:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1901 bytes --]

On 7/3/2014 5:55 PM, Chris Chapman wrote:
> I am new to ConTeXt (coming from LaTeX), and am really impressed. Great work!
>
> I am working on a document that has layers that I want to be screen-only, similar in approach to this:
> http://tex.stackexchange.com/questions/167846/implementing-full-page-screen-only-print-only-in-pdf
>
> I am assuming that Optional Content Groups would be the best way to do this. How would I set something up like this in ConTeXt/LuaTeX? I know I could make a screen-only version and a print version of the output pdf, but I want to have my cake and eat it too ;)

(also see wolfgangs mail)

I tried this in acrobat:

\defineviewerlayer[visibleandprint]      [printable=yes,state=start]
\defineviewerlayer[visibleandnotprint]   [printable=no, state=start]
\defineviewerlayer[notvisibleandprint]   [printable=yes,state=stop]
\defineviewerlayer[notvisibleandnotprint][printable=no, state=stop]

\setupinteraction[state=start]

\starttext

\startviewerlayer[visibleandprint]       visible and print 
\stopviewerlayer \blank
\startviewerlayer[visibleandnotprint]    visible and not print 
\stopviewerlayer \blank
\startviewerlayer[notvisibleandprint]    not visible and print 
\stopviewerlayer \blank
\startviewerlayer[notvisibleandnotprint] not visible and not print 
\stopviewerlayer \blank

\stoptext

and found out that we need an extra piece of info for acrobat to be 
happy. I'll upload a beta with that addition.

I wonder if other viewers handle layers well.

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------

[-- Attachment #2: print-001.pdf --]
[-- Type: application/x-pdf, Size: 6475 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for Optional Content Groups
  2014-07-03 17:54   ` Hans Hagen
@ 2014-07-03 18:08     ` Chris Chapman
  2016-05-22  9:22     ` Meer, Hans van der
  1 sibling, 0 replies; 7+ messages in thread
From: Chris Chapman @ 2014-07-03 18:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks Hans and Wolfgang! Yes, it looks like most PDF viewers don't handle layers right now, but I'm fine with Acrobat for this use case. 

Chris Chapman
Pentandra


----- Original Message -----
> From: "Hans Hagen" <pragma@wxs.nl>
> To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
> Sent: Thursday, July 3, 2014 11:54:27 AM
> Subject: Re: [NTG-context] Support for Optional Content Groups
> 
> On 7/3/2014 5:55 PM, Chris Chapman wrote:
> > I am new to ConTeXt (coming from LaTeX), and am really impressed. Great
> > work!
> >
> > I am working on a document that has layers that I want to be screen-only,
> > similar in approach to this:
> > http://tex.stackexchange.com/questions/167846/implementing-full-page-screen-only-print-only-in-pdf
> >
> > I am assuming that Optional Content Groups would be the best way to do
> > this. How would I set something up like this in ConTeXt/LuaTeX? I know I
> > could make a screen-only version and a print version of the output pdf,
> > but I want to have my cake and eat it too ;)
> 
> (also see wolfgangs mail)
> 
> I tried this in acrobat:
> 
> \defineviewerlayer[visibleandprint]      [printable=yes,state=start]
> \defineviewerlayer[visibleandnotprint]   [printable=no, state=start]
> \defineviewerlayer[notvisibleandprint]   [printable=yes,state=stop]
> \defineviewerlayer[notvisibleandnotprint][printable=no, state=stop]
> 
> \setupinteraction[state=start]
> 
> \starttext
> 
> \startviewerlayer[visibleandprint]       visible and print
> \stopviewerlayer \blank
> \startviewerlayer[visibleandnotprint]    visible and not print
> \stopviewerlayer \blank
> \startviewerlayer[notvisibleandprint]    not visible and print
> \stopviewerlayer \blank
> \startviewerlayer[notvisibleandnotprint] not visible and not print
> \stopviewerlayer \blank
> 
> \stoptext
> 
> and found out that we need an extra piece of info for acrobat to be
> happy. I'll upload a beta with that addition.
> 
> I wonder if other viewers handle layers well.
> 
> Hans
> 
> 
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                               | www.pragma-pod.nl
> -----------------------------------------------------------------
> 
> ___________________________________________________________________________________
> 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  : http://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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Support for Optional Content Groups
  2014-07-03 17:54   ` Hans Hagen
  2014-07-03 18:08     ` Chris Chapman
@ 2016-05-22  9:22     ` Meer, Hans van der
  2016-05-22  9:36       ` Framing multiline equations L.S.-Soc&Gam
  1 sibling, 1 reply; 7+ messages in thread
From: Meer, Hans van der @ 2016-05-22  9:22 UTC (permalink / raw)
  To: NTG ConTeXt


> On 03 Jul 2014, at 19:54, Hans Hagen <pragma@wxs.nl> wrote:
> 
> I tried this in acrobat:
> 
> \defineviewerlayer[visibleandprint]      [printable=yes,state=start]
> \defineviewerlayer[visibleandnotprint]   [printable=no, state=start]
> \defineviewerlayer[notvisibleandprint]   [printable=yes,state=stop]
> \defineviewerlayer[notvisibleandnotprint][printable=no, state=stop]
> 
> \setupinteraction[state=start]
> 
> \starttext
> 
> \startviewerlayer[visibleandprint]       visible and print \stopviewerlayer \blank
> \startviewerlayer[visibleandnotprint]    visible and not print \stopviewerlayer \blank
> \startviewerlayer[notvisibleandprint]    not visible and print \stopviewerlayer \blank
> \startviewerlayer[notvisibleandnotprint] not visible and not print \stopviewerlayer \blank
> 
> \stoptext
> 
> and found out that we need an extra piece of info for acrobat to be happy. I'll upload a beta with that addition.
> 
> I wonder if other viewers handle layers well.

I tried this today and report the results, curious to see how on my Apple Macintosh the following readers cope with this:

- Adobe Acrobat Reader DC version 15.016.20041 (most recent): does as is intended
- Apple Preview: shows all four, definitely a bad score for Apple here. 

Hans van der Meer




___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Framing multiline equations
  2016-05-22  9:22     ` Meer, Hans van der
@ 2016-05-22  9:36       ` L.S.-Soc&Gam
  2016-05-22 15:56         ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: L.S.-Soc&Gam @ 2016-05-22  9:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello together,

I'm having trouble framing multiline equations. Problem is that either I 
get an error or the equation gets framed while the multiline is 
converted into a single line. Here is my code:

---------------------
\starttext

\startformula                                 <- works like a charm
\mframed[offset=1mm,loffset=3mm,roffset=3mm]
     {a + b = c}
\stopformula

\startformula \startalign                         <- that's an example 
multiline equation
\NC c - a = \NC b \NR                            <- unframed it works
\NC d + c - b = \NC a \NR
\stopalign \stopformula

\startformula \framed{\startalign <- \mframed gives an error. \framed 
works, but then the eq
\NC c - a = \NC b \NR           <- gets converted into a single line eq.
\NC d + c - b = \NC a \NR
\stopalign} \stopformula

\stoptext
---------------------

I tried to place \mframed at different locations. But the example above 
is the only one that doesn't give an error.
How would an experienced CTX user frame multiline equations?
I think it would work with natural TABLES. But i would only use that 
way, when nothing else works...


Greetings, Seba
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Framing multiline equations
  2016-05-22  9:36       ` Framing multiline equations L.S.-Soc&Gam
@ 2016-05-22 15:56         ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2016-05-22 15:56 UTC (permalink / raw)
  To: ntg-context

On 5/22/2016 11:36 AM, L.S.-Soc&Gam wrote:
> Hello together,
>
> I'm having trouble framing multiline equations. Problem is that either I
> get an error or the equation gets framed while the multiline is
> converted into a single line. Here is my code:
>
> ---------------------
> \starttext
>
> \startformula                                 <- works like a charm
> \mframed[offset=1mm,loffset=3mm,roffset=3mm]
>     {a + b = c}
> \stopformula
>
> \startformula \startalign                         <- that's an example
> multiline equation
> \NC c - a = \NC b \NR                            <- unframed it works
> \NC d + c - b = \NC a \NR
> \stopalign \stopformula
>
> \startformula \framed{\startalign <- \mframed gives an error. \framed
> works, but then the eq
> \NC c - a = \NC b \NR           <- gets converted into a single line eq.
> \NC d + c - b = \NC a \NR
> \stopalign} \stopformula
>
> \stoptext
> ---------------------
>
> I tried to place \mframed at different locations. But the example above
> is the only one that doesn't give an error.
> How would an experienced CTX user frame multiline equations?
> I think it would work with natural TABLES. But i would only use that
> way, when nothing else works...

next beta:

\starttext

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

\startformula \startalign
     \NC c - a     = \NC b \NR
     \NC d + c - b = \NC a \NR
\stopalign \stopformula

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

\startformula
\mframed
     [offset=1mm,loffset=3mm,roffset=3mm] {
         a + b = c
     }
\stopformula

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

\startformula
\mframed
     [offset=1mm,loffset=3mm,roffset=3mm] {
         \startalign
             \NC c - a     = \NC b \NR
             \NC d + c - b = \NC a \NR
         \stopalign
     }
\stopformula

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

\stoptext

i'll sort out spacing later


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-05-22 15:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <947663393.140271.1404401839314.JavaMail.zimbra@pentandra.com>
2014-07-03 15:55 ` Support for Optional Content Groups Chris Chapman
2014-07-03 16:33   ` Wolfgang Schuster
2014-07-03 17:54   ` Hans Hagen
2014-07-03 18:08     ` Chris Chapman
2016-05-22  9:22     ` Meer, Hans van der
2016-05-22  9:36       ` Framing multiline equations L.S.-Soc&Gam
2016-05-22 15:56         ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).