ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Strange bug with overviewpage module.
@ 2014-12-20  5:51 Aditya Mahajan
  2014-12-20  6:14 ` Otared Kavian
  0 siblings, 1 reply; 8+ messages in thread
From: Aditya Mahajan @ 2014-12-20  5:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 908 bytes --]

Hi,

Some time ago, Hans had helped me to write an 'overviewpage' module, that 
makes it easy to show a overview of the important slides at the end of a 
presentation. I have tweaked this module slightly to be able to save an 
arbitrary page by using

\saveoverviewpage{reference}

and reuse the page by

\useoverviewpage{reference}

An example is:

\usemodule[overviewpage]
\setuppapersize[S4]

\setupframedtext[rulethickness=3pt]

\starttext

\startframedtext
   \input ward
\stopframedtext
\saveoverviewpage{ward}
\page

\input tufte
\page

\scale[width=0.5\textwidth]{\useoverviewpage{ward}}

\stoptext


However, when I save a page that contains a framed box (as in the above 
example), the box looses its right frame when it is displayed again (see 
page 3 of the attached pdf). It appears that the left edge is twice as 
thick.

Any idea why this is happening and how I can avoid this?

Thanks,
Aditya

[-- Attachment #2: Type: APPLICATION/pdf, Size: 11510 bytes --]

[-- Attachment #3: Type: TEXT/PLAIN, Size: 3941 bytes --]

%D \module
%D   [     file=t-overviewpage,
%D      version=2013.08.31,
%D        title=\CONTEXT\ User Module,
%D     subtitle=Page Overviews,
%D       author=Aditya Mahajan and Hans Hagen,
%D         date=\currentdate,
%D    copyright=Aditya Mahajan,
%D        email=adityam <at> ieee <dot> org,
%D      license=Simplified BSD License]

\writestatus{loading}{Overview Page (ver: 2013.08.31)}

\startmodule [overviewpage]

\unprotect

\setupmodule
  [\c!level=]

\installnamespace{overviewpage}

\initializeboxstack{\????overviewpage}

\newconditional\c_overviewpage_state

\unexpanded\def\enablesaveoverviewpage
  {\global\settrue\c_overviewpage_state}

\unexpanded\def\saveoverviewpage#1%
  {\enablesaveoverviewpage
   \setevalue{\????overviewpage:page:#1}{\the\realpageno}}

\unexpanded\def\useoverviewpage#1%
  {\writestatus{overviewpage}{using page #1 (\getvalue{\????overviewpage:page:#1})}%
   \expanded{\foundbox{\????overviewpage}{\getvalue{\????overviewpage:page:#1}}}}

\unexpanded\def\overviewpage_save_page#1%
  {\ifconditional\c_overviewpage_state
     \setbox\nextbox\hbox{#1}%
     \setbox\scratchbox\copy\nextbox
     \cleanupbox\scratchbox % remove nodes that should not be seen in the backend twice
     \writestatus{overviewpage}{saving overviewpage \the\realpageno}%
     \savebox{\????overviewpage}{\the\realpageno}{\box\scratchbox}%
     \global\setfalse\c_overviewpage_state
     \page_shipouts_normal{\box\nextbox}%
   \else
     \page_shipouts_normal{#1}%
   \fi}

\appendtoks
    \doif {\headparameter{option:overviewpage}} \v!yes \enablesaveoverviewpage
\to \everyheadsynchronization

\installshipoutmethod{overviewpage}\overviewpage_save_page

\unexpanded\def\overviewpage_setup_head#1%
  {\setuphead[#1][option:overviewpage=\v!yes]}

\appendtoks
    \processcommacommand
      [\moduleparameter{overviewpage}\c!level]
      \overviewpage_setup_head
\to \everysetupmodule


\the\everysetupmodule

\setuppaper
  [\c!method=overviewpage]

\definelistalternative
  [overviewpage]
  [\c!renderingsetup=\??listrenderings:overview]

\setuplistalternative
  [overviewpage]
  [\c!before=\dontleavehmode,
   \c!after=\hskip\zeropoint\relax,
 % \c!width=\ctxlua{moduledata.overviewpage.calculatedwidth(\listlength)}]
   \c!width=\ctxlua{moduledata.overviewpage.calculatedwidth(structures.lists.size())}]

\startsetups[\??listrenderings:overview]
    \doifboxelse{\????overviewpage}{\structurelistrealpagenumber}
       {\listalternativeparameter\c!before
        \startcurrentlistentrywrapper
          \scale
            [\c!width=\listalternativeparameter\c!width]
            {\foundbox{\????overviewpage}{\structurelistrealpagenumber}}%
        \stopcurrentlistentrywrapper
        \listalternativeparameter\c!after}
       {}%
\stopsetups

\definemakeup
  [overviewpage]
  [\c!align=\v!middle]

\definelayout
  [overviewpage]
  [\v!page]

\startluacode
    moduledata              = moduledata              or { }
    moduledata.overviewpage = moduledata.overviewpage or { }

    function moduledata.overviewpage.calculatedwidth(pages)
        context("%f\\textwidth",1/math.ceil(math.sqrt(pages)))
    end
\stopluacode

% Ideally, we would like to simply use the definition below. 
% However, the `before` and `after` keys are not used with `\placecombinedlist`. 
% Therefore we use a more manual solution.
%
\definecombinedlist
    [overviewpage]
    [\moduleparameter{overviewpage}\c!level]
    [
      %\c!before=\startoverviewpagemakeup,
      %\c!after=\stopoverviewpagemakeup,
      \c!criterium=\v!all,
      \c!alternative=overviewpage,
    ]

\unexpanded\def\placeoverviewpage
  {\dosingleargument\doplaceoverviewpage}

\def\doplaceoverviewpage[#1]%
  {\startoverviewpagemakeup
      \placecombinedlist[overviewpage][#1]
   \stopoverviewpagemakeup}

\protect

\stopmodule

[-- Attachment #4: 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] 8+ messages in thread

* Re: Strange bug with overviewpage module.
  2014-12-20  5:51 Strange bug with overviewpage module Aditya Mahajan
@ 2014-12-20  6:14 ` Otared Kavian
  2014-12-20  7:20   ` Aditya Mahajan
  0 siblings, 1 reply; 8+ messages in thread
From: Otared Kavian @ 2014-12-20  6:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

Hi Aditya,

Thanks for sharing, but here your module works fine…
Please see the attached file.
Best regards: OK


[-- Attachment #2: overviwepage-test.pdf --]
[-- Type: application/pdf, Size: 11575 bytes --]

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


> On 20 Dec 2014, at 06:51, Aditya Mahajan <adityam@umich.edu> wrote:
> 
> Hi,
> 
> Some time ago, Hans had helped me to write an 'overviewpage' module, that makes it easy to show a overview of the important slides at the end of a presentation. I have tweaked this module slightly to be able to save an arbitrary page by using
> 
> \saveoverviewpage{reference}
> 
> and reuse the page by
> 
> \useoverviewpage{reference}
> 
> An example is:
> 
> \usemodule[overviewpage]
> \setuppapersize[S4]
> 
> \setupframedtext[rulethickness=3pt]
> 
> \starttext
> 
> \startframedtext
>  \input ward
> \stopframedtext
> \saveoverviewpage{ward}
> \page
> 
> \input tufte
> \page
> 
> \scale[width=0.5\textwidth]{\useoverviewpage{ward}}
> 
> \stoptext
> 
> 
> However, when I save a page that contains a framed box (as in the above example), the box looses its right frame when it is displayed again (see page 3 of the attached pdf). It appears that the left edge is twice as thick.
> 
> Any idea why this is happening and how I can avoid this?
> 
> Thanks,
> Aditya<test.pdf><t-overviewpage.mkiv>___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #4: 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] 8+ messages in thread

* Re: Strange bug with overviewpage module.
  2014-12-20  6:14 ` Otared Kavian
@ 2014-12-20  7:20   ` Aditya Mahajan
  2014-12-21 13:21     ` Otared Kavian
  0 siblings, 1 reply; 8+ messages in thread
From: Aditya Mahajan @ 2014-12-20  7:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 230 bytes --]

On Sat, 20 Dec 2014, Otared Kavian wrote:

> Hi Aditya,
>
> Thanks for sharing, but here your module works fine…
> Please see the attached file.

Otared, thanks for testing! Updating ConTeXt does fix this issue.

Aditya

[-- Attachment #2: 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] 8+ messages in thread

* Re: Strange bug with overviewpage module.
  2014-12-20  7:20   ` Aditya Mahajan
@ 2014-12-21 13:21     ` Otared Kavian
  2014-12-21 18:50       ` Aditya Mahajan
  0 siblings, 1 reply; 8+ messages in thread
From: Otared Kavian @ 2014-12-21 13:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Aditya,

Now that you realize that your module works so well, I have two questions :—)
How can one tweak your module so that in a presentation:
	1) each overviewpage is included at the end;
	2) each oveviewpage is clickabel and linked to the corresponding page of the presentation.

If this is already implemented and if you have an example presentation, could you please share it?

Best regards: OK

> On 20 Dec 2014, at 08:20, Aditya Mahajan <adityam@umich.edu> wrote:
> 
> On Sat, 20 Dec 2014, Otared Kavian wrote:
> 
>> Hi Aditya,
>> 
>> Thanks for sharing, but here your module works fine…
>> Please see the attached file.
> 
> Otared, thanks for testing! Updating ConTeXt does fix this issue.
> 
> Aditya___________________________________________________________________________________
> 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] 8+ messages in thread

* Re: Strange bug with overviewpage module.
  2014-12-21 13:21     ` Otared Kavian
@ 2014-12-21 18:50       ` Aditya Mahajan
  2014-12-21 20:00         ` jdh
  2014-12-23  9:06         ` Otared Kavian
  0 siblings, 2 replies; 8+ messages in thread
From: Aditya Mahajan @ 2014-12-21 18:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 679 bytes --]

On Sun, 21 Dec 2014, Otared Kavian wrote:

> Hi Aditya,
>
> Now that you realize that your module works so well, I have two questions :—)
> How can one tweak your module so that in a presentation:
> 	1) each overviewpage is included at the end;
> 	2) each oveviewpage is clickabel and linked to the corresponding page of the presentation.
>
> If this is already implemented and if you have an example presentation, could you please share it?

That was the original idea of the module. See: 
http://randomdeterminism.wordpress.com/2014/01/01/announcing-the-overview-module/

I am thinking of adding the abilityto manually create overview pages as 
well.

Aditya

[-- Attachment #2: 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] 8+ messages in thread

* Re: Strange bug with overviewpage module.
  2014-12-21 18:50       ` Aditya Mahajan
@ 2014-12-21 20:00         ` jdh
  2014-12-21 23:03           ` Aditya Mahajan
  2014-12-23  9:06         ` Otared Kavian
  1 sibling, 1 reply; 8+ messages in thread
From: jdh @ 2014-12-21 20:00 UTC (permalink / raw)
  To: ntg-context

I am using the standalone context ( $ mtxrun --version  gives me ==>  
ConTeXt TDS Runner Tool 1.31 )

I want to try the overview module.  I copied the example given on the 
references html page, but context needs the module to parse it.

How do I install a module?  ( This one specifically if different from 
others in installation.)

Regards


On 2014年12月21日 10:50, Aditya Mahajan wrote:
> On Sun, 21 Dec 2014, Otared Kavian wrote:
>
>> Hi Aditya,
>>
>> Now that you realize that your module works so well, I have two 
>> questions :—)
>> How can one tweak your module so that in a presentation:
>>     1) each overviewpage is included at the end;
>>     2) each oveviewpage is clickabel and linked to the corresponding 
>> page of the presentation.
>>
>> If this is already implemented and if you have an example 
>> presentation, could you please share it?
>
> That was the original idea of the module. See: 
> http://randomdeterminism.wordpress.com/2014/01/01/announcing-the-overview-module/
>
> I am thinking of adding the abilityto manually create overview pages 
> as well.
>
> Aditya
>
>
> ___________________________________________________________________________________
> 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] 8+ messages in thread

* Re: Strange bug with overviewpage module.
  2014-12-21 20:00         ` jdh
@ 2014-12-21 23:03           ` Aditya Mahajan
  0 siblings, 0 replies; 8+ messages in thread
From: Aditya Mahajan @ 2014-12-21 23:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 21 Dec 2014, jdh wrote:

> I am using the standalone context ( $ mtxrun --version  gives me ==> 
> ConTeXt TDS Runner Tool 1.31 )
>
> I want to try the overview module.  I copied the example given on the 
> references html page, but context needs the module to parse it.
>
> How do I install a module?  ( This one specifically if different from 
> others in installation.)

I wasn't sure whether others would be interested in the module, so I did 
not upload it to context garden. To test the module, download 
t-overviewpage.mkiv from

https://raw.githubusercontent.com/adityam/context-overviewpage/master/t-overviewpage.mkiv

and put it in the current directory.

Aditya
___________________________________________________________________________________
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] 8+ messages in thread

* Re: Strange bug with overviewpage module.
  2014-12-21 18:50       ` Aditya Mahajan
  2014-12-21 20:00         ` jdh
@ 2014-12-23  9:06         ` Otared Kavian
  1 sibling, 0 replies; 8+ messages in thread
From: Otared Kavian @ 2014-12-23  9:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Aditya,

Thanks for sharing your nice module.
I think it would be nice and useful for many people to have this module accessible when updating or installing a stand alone ConTeXt.

Best regards: OK

> On 21 Dec 2014, at 19:50, Aditya Mahajan <adityam@umich.edu> wrote:
> 
> On Sun, 21 Dec 2014, Otared Kavian wrote:
> 
>> Hi Aditya,
>> 
>> Now that you realize that your module works so well, I have two questions :—)
>> How can one tweak your module so that in a presentation:
>> 	1) each overviewpage is included at the end;
>> 	2) each oveviewpage is clickabel and linked to the corresponding page of the presentation.
>> 
>> If this is already implemented and if you have an example presentation, could you please share it?
> 
> That was the original idea of the module. See: http://randomdeterminism.wordpress.com/2014/01/01/announcing-the-overview-module/
> 
> I am thinking of adding the abilityto manually create overview pages as well.
> 
> Aditya___________________________________________________________________________________
> 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] 8+ messages in thread

end of thread, other threads:[~2014-12-23  9:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-20  5:51 Strange bug with overviewpage module Aditya Mahajan
2014-12-20  6:14 ` Otared Kavian
2014-12-20  7:20   ` Aditya Mahajan
2014-12-21 13:21     ` Otared Kavian
2014-12-21 18:50       ` Aditya Mahajan
2014-12-21 20:00         ` jdh
2014-12-21 23:03           ` Aditya Mahajan
2014-12-23  9:06         ` Otared Kavian

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).