ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* TeX markup in \setupinteraction for PDF metadata fields
@ 2016-01-17 16:56 Kate F
  2016-01-17 17:00 ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Kate F @ 2016-01-17 16:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

Is it possible to have TeX markup executed in the text fields for
\setupinteraction?
I would like to do something like:

\definemarking[xyz]
\marking[xyz]{Hello}
\setupinteraction[state=start]
\setupinteraction[title={\getmarking[xyz][current]}]
\setupinteraction[author={\getmarking[xyz][current]}]
\starttext
xyz=\getmarking[xyz][current]
\stoptext

But my generated PDF has literally "\getmarking[xyz][current]}" for
the title and author.

Thanks,

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

* Re: TeX markup in \setupinteraction for PDF metadata fields
  2016-01-17 16:56 TeX markup in \setupinteraction for PDF metadata fields Kate F
@ 2016-01-17 17:00 ` Wolfgang Schuster
  2016-01-17 17:53   ` Kate F
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2016-01-17 17:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 654 bytes --]

> Kate F <mailto:kate@elide.org>
> 17. Januar 2016 um 17:56
> Hi,
>
> Is it possible to have TeX markup executed in the text fields for
> \setupinteraction?
> I would like to do something like:
>
> \definemarking[xyz]
> \marking[xyz]{Hello}
> \setupinteraction[state=start]
> \setupinteraction[title={\getmarking[xyz][current]}]
> \setupinteraction[author={\getmarking[xyz][current]}]
> \starttext
> xyz=\getmarking[xyz][current]
> \stoptext
>
> But my generated PDF has literally "\getmarking[xyz][current]}" for
> the title and author.
Are you sure you want to use marks to store text because the mechanism
works only in headers and footers.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1679 bytes --]

[-- 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] 9+ messages in thread

* Re: TeX markup in \setupinteraction for PDF metadata fields
  2016-01-17 17:00 ` Wolfgang Schuster
@ 2016-01-17 17:53   ` Kate F
  2016-01-17 18:27     ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Kate F @ 2016-01-17 17:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 17 January 2016 at 17:00, Wolfgang Schuster
<schuster.wolfgang@gmail.com> wrote:
> Kate F
> 17. Januar 2016 um 17:56
> Hi,
>
> Is it possible to have TeX markup executed in the text fields for
> \setupinteraction?
> I would like to do something like:
>
> \definemarking[xyz]
> \marking[xyz]{Hello}
> \setupinteraction[state=start]
> \setupinteraction[title={\getmarking[xyz][current]}]
> \setupinteraction[author={\getmarking[xyz][current]}]
> \starttext
> xyz=\getmarking[xyz][current]
> \stoptext
>
> But my generated PDF has literally "\getmarking[xyz][current]}" for
> the title and author.
>
> Are you sure you want to use marks to store text because the mechanism
> works only in headers and footers.

I don't know, actually. In this case these are values which remain
constant throughout the document. So all I'm after here is a mechanism
for storing variables by name. Is there something more appropriate to
use for those kind of variables?

I didn't know markings only exist in headers and footers! Thanks.

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

* Re: TeX markup in \setupinteraction for PDF metadata fields
  2016-01-17 17:53   ` Kate F
@ 2016-01-17 18:27     ` Wolfgang Schuster
  2016-01-17 18:55       ` Alan BRASLAU
  2016-01-17 19:48       ` Kate F
  0 siblings, 2 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2016-01-17 18:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1110 bytes --]

> Kate F <mailto:kate@elide.org>
> 17. Januar 2016 um 18:53
> On 17 January 2016 at 17:00, Wolfgang Schuster
>
> I don't know, actually. In this case these are values which remain
> constant throughout the document. So all I'm after here is a mechanism
> for storing variables by name. Is there something more appropriate to
> use for those kind of variables?
You can use the \setvariables command the set the values and access them 
with \getvariables:

\setvariables
   [information]
   [title=Document title,
    author=Author name]

\setupinteraction
   [ state=start,
     title=\getvariable{information}{title},
    author=\getvariable{information}{title}]

\starttext
\unknown
\stoptext


There is also the \setupdocument command (a simple wrapper for the 
\setvariables command)
which uses predefined keywords to set fields in the pdf file. You can 
access the values from
\setupdocument command in your document with \documentvariable{<KEY>}.

\setupdocument
   [ metadata:title=Document title,
    metadata:author=Author name]

\setupinteraction[state=start]

\starttext
\unknown
\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2323 bytes --]

[-- 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] 9+ messages in thread

* Re: TeX markup in \setupinteraction for PDF metadata fields
  2016-01-17 18:27     ` Wolfgang Schuster
@ 2016-01-17 18:55       ` Alan BRASLAU
  2016-01-17 19:09         ` Wolfgang Schuster
  2016-01-17 19:48       ` Kate F
  1 sibling, 1 reply; 9+ messages in thread
From: Alan BRASLAU @ 2016-01-17 18:55 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On Sun, 17 Jan 2016 19:27:31 +0100
Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> > Kate F <mailto:kate@elide.org>
> > 17. Januar 2016 um 18:53
> > On 17 January 2016 at 17:00, Wolfgang Schuster
> >
> > I don't know, actually. In this case these are values which remain
> > constant throughout the document. So all I'm after here is a
> > mechanism for storing variables by name. Is there something more
> > appropriate to use for those kind of variables?
> You can use the \setvariables command the set the values and access
> them with \getvariables:
> 
> \setvariables
>    [information]
>    [title=Document title,
>     author=Author name]
> 
> \setupinteraction
>    [ state=start,
>      title=\getvariable{information}{title},
>     author=\getvariable{information}{title}]
> 
> \starttext
> \unknown
> \stoptext
> 
> 
> There is also the \setupdocument command (a simple wrapper for the 
> \setvariables command)
> which uses predefined keywords to set fields in the pdf file. You can 
> access the values from
> \setupdocument command in your document with \documentvariable{<KEY>}.
> 
> \setupdocument
>    [ metadata:title=Document title,
>     metadata:author=Author name]
> 
> \setupinteraction[state=start]
> 
> \starttext
> \unknown
> \stoptext
> 
> Wolfgang


How does this play with
\startdocument
  [title=Document title,
   author=Me]

Here, I learn about metadata:title=
which suggests that I could do without
\setupinteraction
  [state=start,
   title={\getvariable{document}{title}},
   author={\getvariable{document}{author}}]

But, if I want to use the title etc. in the title page, should I do
something like:

\starttitlepagemakeup
  \getvariable{document}{metadata:title}
\stoptitlepagemakeup

Thanks

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

* Re: TeX markup in \setupinteraction for PDF metadata fields
  2016-01-17 18:55       ` Alan BRASLAU
@ 2016-01-17 19:09         ` Wolfgang Schuster
  2016-01-17 22:39           ` Alan BRASLAU
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2016-01-17 19:09 UTC (permalink / raw)
  To: Alan BRASLAU; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 907 bytes --]

> Alan BRASLAU <mailto:alan.braslau@cea.fr>
> 17. Januar 2016 um 19:55
> On Sun, 17 Jan 2016 19:27:31 +0100
>
>
> How does this play with
> \startdocument
> [title=Document title,
> author=Me]
It doesn’t matter if you set the values with \setupdocument or 
\startdocument.
> Here, I learn about metadata:title=
> which suggests that I could do without
> \setupinteraction
> [state=start,
> title={\getvariable{document}{title}},
> author={\getvariable{document}{author}}]
You can use \documentvariable{...} to access the values.
> But, if I want to use the title etc. in the title page, should I do
> something like:
>
> \starttitlepagemakeup
> \getvariable{document}{metadata:title}
> \stoptitlepagemakeup
It depends, when you want the title in the pdf without a manual setting
with \setupinteraction you can use the value of “metadata:title” in your
document.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2485 bytes --]

[-- 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] 9+ messages in thread

* Re: TeX markup in \setupinteraction for PDF metadata fields
  2016-01-17 18:27     ` Wolfgang Schuster
  2016-01-17 18:55       ` Alan BRASLAU
@ 2016-01-17 19:48       ` Kate F
  1 sibling, 0 replies; 9+ messages in thread
From: Kate F @ 2016-01-17 19:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 17 January 2016 at 18:27, Wolfgang Schuster
<schuster.wolfgang@gmail.com> wrote:
> Kate F
> 17. Januar 2016 um 18:53
> On 17 January 2016 at 17:00, Wolfgang Schuster
>
> I don't know, actually. In this case these are values which remain
> constant throughout the document. So all I'm after here is a mechanism
> for storing variables by name. Is there something more appropriate to
> use for those kind of variables?
>
> You can use the \setvariables command the set the values and access them
> with \getvariables:
>
> \setvariables
>   [information]
>   [title=Document title,
>    author=Author name]
>
> \setupinteraction
>   [ state=start,
>     title=\getvariable{information}{title},
>    author=\getvariable{information}{title}]
>
> \starttext
> \unknown
> \stoptext
>
>
> There is also the \setupdocument command (a simple wrapper for the
> \setvariables command)
> which uses predefined keywords to set fields in the pdf file. You can access
> the values from
> \setupdocument command in your document with \documentvariable{<KEY>}.
>
> \setupdocument
>   [ metadata:title=Document title,
>    metadata:author=Author name]
>
> \setupinteraction[state=start]
>
> \starttext
> \unknown
> \stoptext
>
> Wolfgang

Thanks! I remembered about \setvariables just after asking. I think
that suits my situation more than \setupdocument, since I'm doing this
from handling various different kinds of XML, and this way I can keep
the call to \setupinteraction shared between all of them.

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

* Re: TeX markup in \setupinteraction for PDF metadata fields
  2016-01-17 19:09         ` Wolfgang Schuster
@ 2016-01-17 22:39           ` Alan BRASLAU
  2016-01-17 22:43             ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Alan BRASLAU @ 2016-01-17 22:39 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On Sun, 17 Jan 2016 20:09:56 +0100
Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> But, if I want to use the title etc. in the title page, should I do
> something like:
> 
> \starttitlepagemakeup
> \getvariable{document}{metadata:title}
> \stoptitlepagemakeup
> It depends, when you want the title in the pdf without a manual
> setting with \setupinteraction you can use the value of
> “metadata:title” in your document.

Thanks, again, these are useful pointers.
In conclusion, good practice could be (but would this work?):

\startdocument
  [title=My title,
   metadata:title=\documentvariable{title},
   author=Me,
   metadata:author=\documentvariable{author}]
...
\stopdocument


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

* Re: TeX markup in \setupinteraction for PDF metadata fields
  2016-01-17 22:39           ` Alan BRASLAU
@ 2016-01-17 22:43             ` Wolfgang Schuster
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2016-01-17 22:43 UTC (permalink / raw)
  To: Alan BRASLAU; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 648 bytes --]

> Alan BRASLAU <mailto:alan.braslau@cea.fr>
> 17. Januar 2016 um 23:39
> On Sun, 17 Jan 2016 20:09:56 +0100
>
> Thanks, again, these are useful pointers.
> In conclusion, good practice could be (but would this work?):
>
> \startdocument
> [title=My title,
> metadata:title=\documentvariable{title},
> author=Me,
> metadata:author=\documentvariable{author}]
> ...
> \stopdocument
I would separate both settings and put \setupdocument somewhere in the 
preamble.

\setupdocument
   [metadata:title=\documentvariable{title},
    metadata:author=\documentvariable{author}]

\startdocument
   [title=My title,
    author=Me]
...
\stopdocument

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1727 bytes --]

[-- 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] 9+ messages in thread

end of thread, other threads:[~2016-01-17 22:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-17 16:56 TeX markup in \setupinteraction for PDF metadata fields Kate F
2016-01-17 17:00 ` Wolfgang Schuster
2016-01-17 17:53   ` Kate F
2016-01-17 18:27     ` Wolfgang Schuster
2016-01-17 18:55       ` Alan BRASLAU
2016-01-17 19:09         ` Wolfgang Schuster
2016-01-17 22:39           ` Alan BRASLAU
2016-01-17 22:43             ` Wolfgang Schuster
2016-01-17 19:48       ` Kate F

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