Re: [NTG-context] typesetting information from git

2018-02-23 Thread Schmitz Thomas A.


> On 23. Feb 2018, at 22:00, Hans Hagen  wrote:
> 
> maybe you mean
> 
> \startluacode
> 
> context.setupdocument {
>gitversion = string.strip(
>os.resultof("git --no-pager log --pretty='%h of %aD' -1 " .. 
> environment.jobfilefullname) or "")
> }
> 
> \stopluacode
> 
> \setupfootertexts
> [this is from file: \documentvariable{gitversion}]
> 
> \starttext
> 
> [[\ctxlua{context(environment.jobfilefullname)}]]
> 
> [[\ctxlua{context(environment.jobfilename)}]]
> 
> \ctxlua{inspect(table.sortedkeys(environment))}
> 
> test
> 
> \stoptext

Yes, sorry, I wasn’t clear enough. environment.jobfilefullname is excellent, I 
can work from here. Just to provide a clearer explanation: I have an 
environment style.tex. With it, I process a number of xml files: foo.xml, 
bar.xml, arg.xml with the call

context —environment style foo.xml etc.

and I want the git revision of the xml file printed not of the style file, 
obviously). jobfilefullname does what I want, and I’ll look into the other 
variables as well. Very handy, thanks!

Thomas
___
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] typesetting information from git

2018-02-23 Thread Hans Hagen

On 2/23/2018 9:38 PM, Schmitz Thomas A. wrote:

Hi,

I like to add a sort of watermark with info about the git revision at the 
bottom of some files that I typeset. I’m using Lua, so I have:

context(os.resultof("git --no-pager log --pretty='%h of %aD' -1 foo.xml”))

which gives something like "git revision b085c92a of Wed, 14 Feb 2018 12:49:35 
+0100.” Suppose I want to make this more general. What would be the easiest way to 
either say “the xml file that is being processed” (something like arg[1]) or “the 
xml file whose name is in the Lua variable ‘foo?’”


maybe you mean

\startluacode

context.setupdocument {
gitversion = string.strip(
os.resultof("git --no-pager log --pretty='%h of %aD' -1 " .. 
environment.jobfilefullname) or "")

}

\stopluacode

\setupfootertexts
 [this is from file: \documentvariable{gitversion}]

\starttext

[[\ctxlua{context(environment.jobfilefullname)}]]

[[\ctxlua{context(environment.jobfilename)}]]

\ctxlua{inspect(table.sortedkeys(environment))}

test

\stoptext






-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] typesetting information from git

2018-02-23 Thread Hans Hagen

On 2/23/2018 9:38 PM, Schmitz Thomas A. wrote:

Hi,

I like to add a sort of watermark with info about the git revision at the 
bottom of some files that I typeset. I’m using Lua, so I have:

context(os.resultof("git --no-pager log --pretty='%h of %aD' -1 foo.xml”))

which gives something like "git revision b085c92a of Wed, 14 Feb 2018 12:49:35 
+0100.” Suppose I want to make this more general. What would be the easiest way to 
either say “the xml file that is being processed” (something like arg[1]) or “the 
xml file whose name is in the Lua variable ‘foo?’”

I'm not sure if i understand well but something

\startluacode

context.setupdocument {
gitversion = string.strip(os.resultof("git --no-pager log 
--pretty='%h of %aD' -1 foo.tex") or "")

}

\stopluacode

\setupfootertexts
 [this is from file: \documentvariable{gitversion}]

\starttext

test

\stoptext

(as long as uou make sure you call the got command only once and not 
again in each footer)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] typesetting information from git

2018-02-23 Thread Schmitz Thomas A.
Hi,

I like to add a sort of watermark with info about the git revision at the 
bottom of some files that I typeset. I’m using Lua, so I have:

context(os.resultof("git --no-pager log --pretty='%h of %aD' -1 foo.xml”))

which gives something like "git revision b085c92a of Wed, 14 Feb 2018 12:49:35 
+0100.” Suppose I want to make this more general. What would be the easiest way 
to either say “the xml file that is being processed” (something like arg[1]) or 
“the xml file whose name is in the Lua variable ‘foo?’”

Thanks!

Thomas

___
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] Problem with Lua: context.component()

2018-02-23 Thread Hans Hagen

On 2/23/2018 3:26 PM, Procházka Lukáš Ing. wrote:

Hello,

suppose having:

 t1.mkiv
\starttext
   a

   \startluacode
     context.setvalue("b", "bbb")
     context.setvalue("c", 2)
     context.component("t2.mkiv")
   \stopluacode
\stoptext


and

 t2.mkiv
\startcomponent *
   \b\c
\stopcomponent


I get no result when trying to compile t1.mkiv - log tells:

context.component(false,"foo")


context.component { "foo" }

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] Problem with Lua: context.component()

2018-02-23 Thread Procházka Lukáš Ing .

Hello,

suppose having:

 t1.mkiv
\starttext
  a

  \startluacode
context.setvalue("b", "bbb")
context.setvalue("c", 2)
context.component("t2.mkiv")
  \stopluacode
\stoptext


and

 t2.mkiv
\startcomponent *
  \b\c
\stopcomponent


I get no result when trying to compile t1.mkiv - log tells:

"
...
system  > jobfiles > unknown tex file '{t2.mkiv}\stoptext \finishjob ' 
< 
close source> level 1, order 3, name 
'd:/Ctx-Beta/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'

tex error   > tex error on line 0 in file : ! Emergency stop

<*> cont-yes.mkiv




*** (job aborted, no legal \end found)
"

So - how to use 'context.component()' (input a component within Lua) well?

Thank you in advance.

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

t1.log
Description: Binary data


t1.mkiv
Description: Binary data


t2.mkiv
Description: Binary data
___
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] Problem with a macro

2018-02-23 Thread Wolfgang Schuster



Fabrice Couvreur 
22. Februar 2018 um 22:15
Hi,
How to make the numbers of the integral are on the right with the 
macro of Hans ?



The position of the limits are fixed for the \autointegral command.

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
___

Re: [NTG-context] rulecolor in columns

2018-02-23 Thread Wolfgang Schuster



Henning Hraban Ramm 
23. Februar 2018 um 14:38
I tried to add the example to the garden, but at least there it 
doesn’t work:

http://wiki.contextgarden.net/Columns

As soon as I use \setupcolors, I get only a single column or the 
example doesn’t compile at all. Strange.


The garden uses MkIV where \color expects a argument (i.e. 
\color[]{}).



Below is a example how you can add a colored rule to \startcolumns but 
the better solution
is to switch to MkIV and and use mixedcolumns environment which has a 
option to change

the color of the rule between the columns.


\enableregime[utf-8]
\mainlanguage[fr]

\setupcolors[state=start]

% \unexpanded\def\ColumnsRule
%   {\bgroup
%\hskip\dimexpr(1.5\bodyfontsize+\linewidth)/2\relax
%\color[red]{\vrule width\linewidth}%
%\hskip\dimexpr(1.5\bodyfontsize+\linewidth)/2\relax
%\egroup}

\definemeasure[columndistance][2em]

\setupcolumns[distance=\measure{columndistance}]

\unexpanded\def\ColumnsRule
  {\bgroup
   \hskip\dimexpr(\measure{columndistance}+\linewidth)/2\relax
   \color[red]{\vrule width\linewidth}%
   \hskip\dimexpr(\measure{columndistance}+\linewidth)/2\relax
   \egroup}

\setupcolumns[rule=\ColumnsRule]

\starttext

\startcolumns
\input tufte
\stopcolumns

\stoptext


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
___

Re: [NTG-context] rulecolor in columns

2018-02-23 Thread Henning Hraban Ramm
I tried to add the example to the garden, but at least there it doesn’t work:
http://wiki.contextgarden.net/Columns

As soon as I use \setupcolors, I get only a single column or the example 
doesn’t compile at all. Strange.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

Am 2018-02-23 um 13:50 schrieb Gerard :

> Thanks Thomas,
> 
> I use Texworks with Context (pdftex)...
> 
> With the code below, I get the text in blue and separator in red. See the 
> command \setupcolors[textcolor=red] and \color[blue] before \startcolumns.
> 
> Gérard
> 
> 
> --- exemple basique-
> \enableregime[utf-8]
> \mainlanguage[fr]
> \setupcolors[state=start,textcolor=blue]
> 
> \setupcolumns[n=2,rule=on,rulecolor=red]
> \starttext
> \setupcolors[textcolor=red]
> \color[blue]
> \startcolumns
> \input tufte 
> \stopcolumns
> \stoptext
> 
> 
> Le 23/02/2018 à 13:23, Schmitz Thomas A. a écrit :
>>> On 23. Feb 2018, at 12:04, Gerard 
>>>  wrote:
>>> 
>>> Why does not work "rulecolor" in my example below ? it keeps the color of 
>>> textcolor...
>>> 
>>> The other options of setcolumns (background...) work well but I fail on 
>>> that one. Have I understood everything?
>>> 
>>> 
>> If you look into the source (page-mul.mkiv), there is no key “rulecolor” for 
>> \setupcolumns. I don’t think that the color can be set separately?
>> 
>> Thomas
>> ___
>> 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
> ___

___
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] rulecolor in columns

2018-02-23 Thread Gerard

Thanks Thomas,

I use Texworks with Context (pdftex)...

With the code below, I get the text in blue and separator in red. See 
the command \setupcolors[textcolor=red] and \color[blue] before 
\startcolumns.


Gérard

--- exemple basique-

\enableregime[utf-8]

\mainlanguage[fr]

\setupcolors[state=start,textcolor=blue]


\setupcolumns[n=2,rule=on,rulecolor=red]

\starttext

\setupcolors[textcolor=red]

\color[blue]

\startcolumns

\input tufte

\stopcolumns

\stoptext



Le 23/02/2018 à 13:23, Schmitz Thomas A. a écrit :



On 23. Feb 2018, at 12:04, Gerard  wrote:

Why does not work "rulecolor" in my example below ? it keeps the color of 
textcolor...

The other options of setcolumns (background...) work well but I fail on that 
one. Have I understood everything?


If you look into the source (page-mul.mkiv), there is no key “rulecolor” for 
\setupcolumns. I don’t think that the color can be set separately?

Thomas
___
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] rulecolor in columns

2018-02-23 Thread Schmitz Thomas A.


> On 23. Feb 2018, at 12:04, Gerard  wrote:
> 
> Why does not work "rulecolor" in my example below ? it keeps the color of 
> textcolor...
> 
> The other options of setcolumns (background...) work well but I fail on that 
> one. Have I understood everything?
> 

If you look into the source (page-mul.mkiv), there is no key “rulecolor” for 
\setupcolumns. I don’t think that the color can be set separately?

Thomas
___
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] rulecolor in columns

2018-02-23 Thread Gerard
Hi, Why does not work "rulecolor" in my example below ? it keeps the 
color of textcolor...


The other options of setcolumns (background...) work well but I fail on 
that one.Have I understood everything?


I am able to use ConTexT enough. Take a look at my little newspaper 



I did not find any information in "Context the manual" about rulecolor 
and I did not find anything on the internet.


Thanks for the help ! and thanks to "google translate" :-D

G.

ps : I'm trying to write a brief notice in French

% exemple basique ---

\enableregime[utf-8]

\mainlanguage[fr]

\setupcolors[state=start,textcolor=blue]

\setupcolumns[n=2,rule=on,rulecolor=red]

\starttext

\startcolumns

\input tufte

\stopcolumns

\stoptext


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