Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-23 Thread Jairo A. del Rio
Thank you very much. It's useful, indeed. However, what I need is to bypass
TeX (Lua > .tuc) if possible, since all the data I need to handle is
generated with Lua scripts.

Jairo

El mar, 23 de mar. de 2021 a la(s) 23:12, Aditya Mahajan (adit...@umich.edu)
escribió:

> On Tue, 23 Mar 2021, Jairo A. del Rio wrote:
>
> > Hi, list. I read about this:
> >
> > https://www.mail-archive.com/ntg-context@ntg.nl/msg60217.html
> >
> > But I want to know how to pass data to the .tuc file directly from Lua. I
> > think about some complex strings are calculations which are done in each
> > pass and slow down the whole compilation process. Something like:
> >
> > local function factorial(n)
> > if in_tuc then -- whatever in_tuc means
> >return factorials[n]
> > else
> >...
> >factorials[n] = ...
> >return ...
> > end
> > end
> >
> > Is that feasible? Should I use the CLD versions of the TeX macros
> instead?
>
> Does this help:
>
>
> https://wiki.contextgarden.net/System_Macros/Key_Value_Assignments#Multi-pass_data
>
> 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://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
___


Re: [NTG-context] Writing to .tuc directly from Lua

2021-03-23 Thread Aditya Mahajan
On Tue, 23 Mar 2021, Jairo A. del Rio wrote:

> Hi, list. I read about this:
> 
> https://www.mail-archive.com/ntg-context@ntg.nl/msg60217.html
> 
> But I want to know how to pass data to the .tuc file directly from Lua. I
> think about some complex strings are calculations which are done in each
> pass and slow down the whole compilation process. Something like:
> 
> local function factorial(n)
> if in_tuc then -- whatever in_tuc means
>return factorials[n]
> else
>...
>factorials[n] = ...
>return ...
> end
> end
> 
> Is that feasible? Should I use the CLD versions of the TeX macros instead?

Does this help:

https://wiki.contextgarden.net/System_Macros/Key_Value_Assignments#Multi-pass_data

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


[NTG-context] Writing to .tuc directly from Lua

2021-03-23 Thread Jairo A. del Rio
Hi, list. I read about this:

https://www.mail-archive.com/ntg-context@ntg.nl/msg60217.html

But I want to know how to pass data to the .tuc file directly from Lua. I
think about some complex strings are calculations which are done in each
pass and slow down the whole compilation process. Something like:

local function factorial(n)
if in_tuc then -- whatever in_tuc means
   return factorials[n]
else
   ...
   factorials[n] = ...
   return ...
end
end

Is that feasible? Should I use the CLD versions of the TeX macros instead?

Best regards,

Jairo
___
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
___


Re: [NTG-context] Formulanumbers in margin

2021-03-23 Thread Adam Reviczky
Hi,

So the numbercommand does work after all, I just needed to keep something
in the "formulanumber" part of the textline, otherwise it wouldn't get
drawn.

Not sure how nice this looks, but it does work like this now:

\starttext
\showframe
\setupformulas[numbercommand=\nbsp\inrightmargin]
\startplaceformula \startformula c^2 = a^2 + b^2
\stopformula \stopplaceformula
\stoptext

Adam

On Sun, Mar 21, 2021 at 8:41 PM Adam Reviczky  wrote:

> Thanks Hraban,
>
> That should be fine, I've tried to increase the margins as well, but not
> sure that's the issue as I can perfectly place text with \inmargin
> directly, just not with the numbercommand.
>
> MWE:
>
> \starttext
> \setuplayout[margin=2cm, leftmargin=2cm, rightmargin=2cm]
>
> \showframe
> \showlayout
>
> \setupcaption[figure][location={rightmargin}]
> \startplacefigure[title=Cow] \externalfigure[cow] \stopplacefigure
>
> \define[1]\MyFormulaNumber{\inleftmargin{#1}}
> \setupformula[numbercommand=\MyFormulaNumber]
>
> \inleftmargin{Left Margin Text}
> \inrightmargin{Right Margin Text}
>
> \startplaceformula[reference=eq1] \startformula c^2 = a^2 + b^2
> \stopformula \stopplaceformula
> \stoptext
>
> Adam
>
> On Sun, Mar 21, 2021 at 8:31 PM Henning Hraban Ramm 
> wrote:
>
>>
>> > Am 21.03.2021 um 20:56 schrieb Adam Reviczky :
>> >
>> > Thanks Hraban,
>> >
>> > I've tried the numbercommand as well, but that also just makes the
>> formula number disappear, unless I am doing something wrong.
>> >
>> > The framing as per the math manual (manuals/math/math-framing.tex)
>> however does work, so not sure:
>> > \setupformula[numbercommand={\inframed[framecolor=green]}]
>>
>> Are your margins actually non-zero? (\setuplayout)
>> Maybe check with \showlayout
>>
>> 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
___


Re: [NTG-context] PDF custom properties

2021-03-23 Thread Alan Bowen
Hi, Pablo—

My inquiry concerns the possibility of getting *custom* properties that I
could specify using \setupinteraction in a way that would output in the PDF
file (under Document Info or Document Properties) as:

Editor (not Author)   editors names

Title title of work
Subtitle (not Subject)the subtitle of the work
Subject the subject of the work
Keywordkeywords

See https://wiki.contextgarden.net/Interaction PDF Header and Custom
Properties.

Thanks for the PDF spec file. I will check it out for any hints about
non-standard metadata.

Alan


On Tue, Mar 23, 2021 at 4:33 PM Pablo Rodriguez  wrote:

> On 3/23/21 8:25 PM, Alan Bowen wrote:
> > I should like to set the PDf properties so that the Document Info panel
> has
> > Editor ...
> > Title ...
> > Subtitle ...
> > Subject ...
> > Keyword 
> >
> > The problem is that currently
> > \setupinteraction[subtitle=text,] goes to Subject and that there are no
> > keys to get output labelled Subject or Editor.
>
> Sorry, Alan, I’m afraid I don’t get your point.
>
>   \setupinteraction
> [state=start,
>  title=Title,
>  author=Author,
>  subtitle=Subject,
>  keyword=Keyword]
>   \starttext
>   \null
>   \stoptext
>
> According to the PDF spec
> (
> https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#nameddest=G13.2348400
> ),
> there is no editor field in standard metadata (unless you mean creator
> or producer).
>
> Just in case it might help,
>
> 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://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
___


Re: [NTG-context] PDF custom properties

2021-03-23 Thread Pablo Rodriguez
On 3/23/21 8:25 PM, Alan Bowen wrote:
> I should like to set the PDf properties so that the Document Info panel has
> Editor ...
> Title ...
> Subtitle ...
> Subject ...
> Keyword 
>
> The problem is that currently 
> \setupinteraction[subtitle=text,] goes to Subject and that there are no
> keys to get output labelled Subject or Editor.

Sorry, Alan, I’m afraid I don’t get your point.

  \setupinteraction
[state=start,
 title=Title,
 author=Author,
 subtitle=Subject,
 keyword=Keyword]
  \starttext
  \null
  \stoptext

According to the PDF spec
(https://www.adobe.com/content/dam/acom/en/devnet/pdf/PDF32000_2008.pdf#nameddest=G13.2348400),
there is no editor field in standard metadata (unless you mean creator
or producer).

Just in case it might help,

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


[NTG-context] PDF custom properties

2021-03-23 Thread Alan Bowen
I should like to set the PDf properties so that the Document Info panel has
Editor ...
Title ...
Subtitle ...
Subject ...
Keyword 

The problem is that currently
\setupinteraction[subtitle=text,] goes to Subject and that there are no
keys to get output labelled Subject or Editor.

I have experimented with \pdfbackendsetinfo{ key }{ Text } but, so far,
unsuccessfully.

If this is possible,any suggestions about how to do it will be most welcome.

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
___