ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \documentvariable (used in environment)
@ 2020-07-22 22:21 Alan Braslau
  2020-07-23  4:36 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Braslau @ 2020-07-22 22:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

I have put the following in an environment

\startenvironment MYENVIRONMENT

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

\stopenvironment




and correct use would be

\environment MYENVIRONMENT

\startdocument [title={My title}]

\stopdocument


because, of course, the environment contains more than \setupdocument 
such as font loading that should be done before the \startdocument.

The metadata does not get set properly, having to do with expansion or 
other notions of TeX that I never seem to get right. What might be the 
proper way of handling this?

Thank you

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \documentvariable (used in environment)
  2020-07-22 22:21 \documentvariable (used in environment) Alan Braslau
@ 2020-07-23  4:36 ` Wolfgang Schuster
  2020-07-24 22:21   ` Alan Braslau
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2020-07-23  4:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Alan Braslau schrieb am 23.07.2020 um 00:21:
> Hello,
> 
> I have put the following in an environment
> 
> \startenvironment MYENVIRONMENT
> 
> \setupdocument
>    [metadata:title={\documentvariable{title}},
>     metadata:subtitle={\documentvariable{subtitle}},
>     metadata:author={\documentvariable{author}},
>     metadata:keywords={\documentvariable{keywords}}]
> 
> \stopenvironment
> 
> and correct use would be
> 
> \environment MYENVIRONMENT
> 
> \startdocument [title={My title}]
> 
> \stopdocument
> 
> because, of course, the environment contains more than \setupdocument 
> such as font loading that should be done before the \startdocument.
> 
> The metadata does not get set properly, having to do with expansion or 
> other notions of TeX that I never seem to get right. What might be the 
> proper way of handling this?

What exactly doesn't work and do you get the same problems when you set 
the values in the following minimal example (everything has to be in the 
same file).

%%%% begin example
\setupdocument
   [metadata:title={\documentvariable{title}},
    metadata:subtitle={\documentvariable{subtitle}},
    metadata:author={\documentvariable{author}},
    metadata:keywords={\documentvariable{keywords}}]

\startdocument [title={My title}]
\input knuth
\stopdocument
%%%% end example

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \documentvariable (used in environment)
  2020-07-23  4:36 ` Wolfgang Schuster
@ 2020-07-24 22:21   ` Alan Braslau
  2020-07-25  8:20     ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Braslau @ 2020-07-24 22:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Wolfgang Schuster

On 22/07/20 22:36, Wolfgang Schuster wrote:
> What exactly doesn't work and do you get the same problems when you set 
> the values in the following minimal example (everything has to be in the 
> same file).
> 
> %%%% begin example
> \setupdocument
>    [metadata:title={\documentvariable{title}},
>     metadata:subtitle={\documentvariable{subtitle}},
>     metadata:author={\documentvariable{author}},
>     metadata:keywords={\documentvariable{keywords}}]
> 
> \startdocument [title={My title}]
> \input knuth
> \stopdocument
> %%%% end example
> 
> Wolfgang

Thank you, Wolfgang.

The above example does work. It fails to set the metadata if one moves 
the \setupdocument to an environment file. As you write, "everything has 
to be in the same file". This is my question, how to set these using an 
environment file, thus NOT the same file as the \startdocument in a 
project structure.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \documentvariable (used in environment)
  2020-07-24 22:21   ` Alan Braslau
@ 2020-07-25  8:20     ` Wolfgang Schuster
  2020-07-25  8:40       ` Henning Hraban Ramm
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2020-07-25  8:20 UTC (permalink / raw)
  To: Alan Braslau; +Cc: mailing list for ConTeXt users

Alan Braslau schrieb am 25.07.2020 um 00:21:
> On 22/07/20 22:36, Wolfgang Schuster wrote:
>> What exactly doesn't work and do you get the same problems when you 
>> set the values in the following minimal example (everything has to be 
>> in the same file).
>>
>> %%%% begin example
>> \setupdocument
>>    [metadata:title={\documentvariable{title}},
>>     metadata:subtitle={\documentvariable{subtitle}},
>>     metadata:author={\documentvariable{author}},
>>     metadata:keywords={\documentvariable{keywords}}]
>>
>> \startdocument [title={My title}]
>> \input knuth
>> \stopdocument
>> %%%% end example
>>
>> Wolfgang
>
> Thank you, Wolfgang.
>
> The above example does work. It fails to set the metadata if one moves 
> the \setupdocument to an environment file. As you write, "everything 
> has to be in the same file".
The requirement was only necessary for the example to check if the 
metadata end up in the PDF file. You could have a environment file for 
\setupdocument but the goal here was to check the resulting metadata in 
the PDF.
> This is my question, how to set these using an environment file, thus 
> NOT the same file as the \startdocument in a project structure.
The problem is something in your environment/style file which causes a 
problem with the \setupdocument setup. What you should do to find the 
sulprit is:

1. Make a copy of your document
2. Remove all text between \startdocument and \stopdocument and add some 
dummy text (like in my example) to ensure ConTeXt produces a PDF
3. Remove setups from your environment (but keep the \setupdocument 
setup) file until the metadata appears in the PDF

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \documentvariable (used in environment)
  2020-07-25  8:20     ` Wolfgang Schuster
@ 2020-07-25  8:40       ` Henning Hraban Ramm
  2020-07-25 14:37         ` Alan Braslau
  0 siblings, 1 reply; 6+ messages in thread
From: Henning Hraban Ramm @ 2020-07-25  8:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 25.07.2020 um 10:20 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
> 
> Alan Braslau schrieb am 25.07.2020 um 00:21:
>> On 22/07/20 22:36, Wolfgang Schuster wrote:
>>> What exactly doesn't work and do you get the same problems when you set the values in the following minimal example (everything has to be in the same file).
>>> 
>>> %%%% begin example
>>> \setupdocument
>>>    [metadata:title={\documentvariable{title}},
>>>     metadata:subtitle={\documentvariable{subtitle}},
>>>     metadata:author={\documentvariable{author}},
>>>     metadata:keywords={\documentvariable{keywords}}]
>>> 
>>> \startdocument [title={My title}]
>>> \input knuth
>>> \stopdocument
>>> %%%% end example
>>> 
>>> Wolfgang
>> 
>> Thank you, Wolfgang.
>> 
>> The above example does work. It fails to set the metadata if one moves the \setupdocument to an environment file. As you write, "everything has to be in the same file".
> The requirement was only necessary for the example to check if the metadata end up in the PDF file. You could have a environment file for \setupdocument but the goal here was to check the resulting metadata in the PDF.
>> This is my question, how to set these using an environment file, thus NOT the same file as the \startdocument in a project structure.
> The problem is something in your environment/style file which causes a problem with the \setupdocument setup. What you should do to find the sulprit is:
> 
> 1. Make a copy of your document
> 2. Remove all text between \startdocument and \stopdocument and add some dummy text (like in my example) to ensure ConTeXt produces a PDF
> 3. Remove setups from your environment (but keep the \setupdocument setup) file until the metadata appears in the PDF

A typical case if something in an environment doesn’t work, but in a single file: Are there modes involved? Maybe your \setupdocument is within a \startmode ... \stopmode that doesn’t get activated.

Best, Hraban

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: \documentvariable (used in environment)
  2020-07-25  8:40       ` Henning Hraban Ramm
@ 2020-07-25 14:37         ` Alan Braslau
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Braslau @ 2020-07-25 14:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thank you all.

No modes, no funniness in the environment file.

The test case works (Acroread/properties shows the Title, Author, 
Subject, and Keywords fields). However, my real case does get the other 
fields (Author, Subject, and Keywords) but contains in the Title field 
the filename (without the .tex extension) of the main file (and 
filename.tex under File).

I'll chase it down...

Alan

On 25/07/20 02:40, Henning Hraban Ramm wrote:
> 
>> Am 25.07.2020 um 10:20 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:
>>
>> Alan Braslau schrieb am 25.07.2020 um 00:21:
>>> On 22/07/20 22:36, Wolfgang Schuster wrote:
>>>> What exactly doesn't work and do you get the same problems when you set the values in the following minimal example (everything has to be in the same file).
>>>>
>>>> %%%% begin example
>>>> \setupdocument
>>>>     [metadata:title={\documentvariable{title}},
>>>>      metadata:subtitle={\documentvariable{subtitle}},
>>>>      metadata:author={\documentvariable{author}},
>>>>      metadata:keywords={\documentvariable{keywords}}]
>>>>
>>>> \startdocument [title={My title}]
>>>> \input knuth
>>>> \stopdocument
>>>> %%%% end example
>>>>
>>>> Wolfgang
>>>
>>> Thank you, Wolfgang.
>>>
>>> The above example does work. It fails to set the metadata if one moves the \setupdocument to an environment file. As you write, "everything has to be in the same file".
>> The requirement was only necessary for the example to check if the metadata end up in the PDF file. You could have a environment file for \setupdocument but the goal here was to check the resulting metadata in the PDF.
>>> This is my question, how to set these using an environment file, thus NOT the same file as the \startdocument in a project structure.
>> The problem is something in your environment/style file which causes a problem with the \setupdocument setup. What you should do to find the sulprit is:
>>
>> 1. Make a copy of your document
>> 2. Remove all text between \startdocument and \stopdocument and add some dummy text (like in my example) to ensure ConTeXt produces a PDF
>> 3. Remove setups from your environment (but keep the \setupdocument setup) file until the metadata appears in the PDF
> 
> A typical case if something in an environment doesn’t work, but in a single file: Are there modes involved? Maybe your \setupdocument is within a \startmode ... \stopmode that doesn’t get activated.
> 
> Best, Hraban
> 
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2020-07-25 14:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22 22:21 \documentvariable (used in environment) Alan Braslau
2020-07-23  4:36 ` Wolfgang Schuster
2020-07-24 22:21   ` Alan Braslau
2020-07-25  8:20     ` Wolfgang Schuster
2020-07-25  8:40       ` Henning Hraban Ramm
2020-07-25 14:37         ` Alan Braslau

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