ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Placing arbitrary pdf bookmarks
@ 2014-03-22 15:35 Jean-Philippe Rey
  2014-03-22 16:31 ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Philippe Rey @ 2014-03-22 15:35 UTC (permalink / raw)
  To: conteXt mail

Hello all,

I am willing to use ConTeXt to produce a bunch of stickers. My stickers are grouped into categories but I don't want any headers or titles to interfere with the layout of the stickers, so I didn't use \startchapter and the likes. However, I would like to add pdf bookmarks in order to quickly jump to the start of a category. After taking a look at strc-bkm.mkiv, I tried the following

 		\setupinteraction[state=start]
		\definelist[building]
		\definelist[aisle]
		\placebookmarks[building,aisle]
		
		\starttext
		
		\bookmark[building]{B1}
		\bookmark[aisle]{A1}
		
		Sticker 1
		
		Sticker 2
		
		\page
		\bookmark[aisle]{A2}
		
		Sticker 3
		
		Sticker 4
		
		\page
		\bookmark[building]{B2}
		\bookmark[aisle]{A3}
		
		Sticker 5
		
		Sticker 6
		
		\stoptext


But it didn't worked. I didn't get any error message but no bookmark either.

How can I directly add a bookmark to the pdf table of contents ? Previously I was using the ReportLab toolkit which provided for this purpose the bookmarkPage and addOutlineEntry functions. Is there a similar solution with ConTeXt ?

Thanks for your help,

-- 
Jean-Philippe Rey                 Professeur - École Centrale Paris
jean-philippe.rey@ecp.fr          92295 Châtenay-Malabry Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

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

* Re: Placing arbitrary pdf bookmarks
  2014-03-22 15:35 Placing arbitrary pdf bookmarks Jean-Philippe Rey
@ 2014-03-22 16:31 ` Pablo Rodriguez
  2014-03-22 18:11   ` Jean-Philippe Rey
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2014-03-22 16:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 03/22/2014 04:35 PM, Jean-Philippe Rey wrote:
> Hello all,
> 
> I am willing to use ConTeXt to produce a bunch of stickers. My
> stickers are grouped into categories but I don't want any headers or
> titles to interfere with the layout of the stickers, so I didn't use
> \startchapter and the likes.

Hi Jean-Philippe,

I think there is workaround for your case: not placing heads in document.

Here you have a shorter sample

    \setupinteraction[state=start]
    \placebookmarks[chapter,section]
    \setuphead[chapter,section][placehead=no]
    \starttext

    \chapter{B1}
    \section{A1}

    Sticker 1

    Sticker 2

    \page
    \chapter{A2}

    Sticker 3

    Sticker 4
    \stoptext

BTW, those links doesn’t seem to works with evince or xpdf. SumatraPDF
seems to have no problem with them. (Just in case you happen to use any
of these PDF viewers [I’m reporting the issue to evince developers].)

I hope it helps,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 5+ messages in thread

* Re: Placing arbitrary pdf bookmarks
  2014-03-22 16:31 ` Pablo Rodriguez
@ 2014-03-22 18:11   ` Jean-Philippe Rey
  2014-03-22 19:00     ` Pablo Rodriguez
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Philippe Rey @ 2014-03-22 18:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Pablo,

Le 22 mars 2014 à 17:31, Pablo Rodriguez <oinos@gmx.es> a écrit :

> On 03/22/2014 04:35 PM, Jean-Philippe Rey wrote:
>> Hello all,
>> 
>> I am willing to use ConTeXt to produce a bunch of stickers. My
>> stickers are grouped into categories but I don't want any headers or
>> titles to interfere with the layout of the stickers, so I didn't use
>> \startchapter and the likes.
> 
> I think there is workaround for your case: not placing heads in document.

Very good hint, thank you. It works perfectly fine with MkII. With MkIV, although the head is not printed, some whitespace is added that disturbs the layout. I tried

	\setuphead[chapter,section][placehead=hidden]

and got rid of the spurious whitespace ... but also of the pdf bookmarks :-(

	\setuphead[chapter,section][placehead=no,page=no,before=,after=]

don't work either.

Here is an example to demonstrate the problem (again, it works fine with MkII, unfortunately I am using lua to compose my stickers).


 		\setupinteraction[state=start]
		\placebookmarks[chapter,section]
		\setuphead[chapter,section][placehead=no]
		\starttext
		
		\chapter{B1}
		\section{A1}
		
		Sticker 1
		
		Sticker 2
		
		\page
		
		Sticker 3
		
		\section{A2}
		
		Sticker 4
		
		\page
		\chapter{B2}
		
		Sticker 5
		
		\section{A3}
		
		Sticker 6
		
		\stoptext




-- 
Jean-Philippe Rey                 Professeur - École Centrale Paris
jean-philippe.rey@ecp.fr          92295 Châtenay-Malabry Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

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

* Re: Placing arbitrary pdf bookmarks
  2014-03-22 18:11   ` Jean-Philippe Rey
@ 2014-03-22 19:00     ` Pablo Rodriguez
  2014-03-22 21:07       ` Jean-Philippe Rey
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Rodriguez @ 2014-03-22 19:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 03/22/2014 07:11 PM, Jean-Philippe Rey wrote:
> [...]
> Very good hint, thank you. It works perfectly fine with MkII. With
> MkIV, although the head is not printed, some whitespace is added that
> disturbs the layout. I tried
> 
> 	\setuphead[chapter,section][placehead=hidden]
> 
> and got rid of the spurious whitespace ... but also of the pdf bookmarks :-(
> 
> 	\setuphead[chapter,section][placehead=no,page=no,before=,after=]
> 
> don't work either.

Jean-Philippe,

my fault, this is the right head configuration:

    \setuphead[chapter,section][placehead=empty,before=,after=,]

This should work now:

    \showgrid
    \setupinteraction[state=start]
    \placebookmarks[chapter,section]
    \setuphead[chapter,section][placehead=empty,before=,after=,]
    \starttext

    \chapter{B1}
    \section{A1}

    Sticker 1

    Sticker 2

    \page

    Sticker 3

    \section{A2}

    Sticker 4

    \page
    \chapter{B2}

    Sticker 5

    \section{A3}

    Sticker 6

    \stoptext

I hope it helps now,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 5+ messages in thread

* Re: Placing arbitrary pdf bookmarks
  2014-03-22 19:00     ` Pablo Rodriguez
@ 2014-03-22 21:07       ` Jean-Philippe Rey
  0 siblings, 0 replies; 5+ messages in thread
From: Jean-Philippe Rey @ 2014-03-22 21:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Pablo,

Le 22 mars 2014 à 20:00, Pablo Rodriguez <oinos@gmx.es> a écrit :

> my fault, this is the right head configuration:
> 
>    \setuphead[chapter,section][placehead=empty,before=,after=,]

Works perfectly. Thank you very much.

-- 
Jean-Philippe Rey                 Professeur - École Centrale Paris
jean-philippe.rey@ecp.fr          92295 Châtenay-Malabry Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

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

end of thread, other threads:[~2014-03-22 21:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-22 15:35 Placing arbitrary pdf bookmarks Jean-Philippe Rey
2014-03-22 16:31 ` Pablo Rodriguez
2014-03-22 18:11   ` Jean-Philippe Rey
2014-03-22 19:00     ` Pablo Rodriguez
2014-03-22 21:07       ` Jean-Philippe Rey

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