Re: [NTG-context] bug with special hyphenation?

2018-02-08 Thread Hans Hagen

On 2/8/2018 8:00 PM, Pablo Rodriguez wrote:


Have I hit an issue with the new hyphenator, or am I simply missing
somehting?

it's a border case that i'll look into

Hans

-
  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] image file resolver in Lua?

2018-02-08 Thread Henning Hraban Ramm
Am 2018-02-04 um 13:06 schrieb Hans Hagen :

> Not sure what you want top know but a lot of image properties can be checked 
> by prerolling:
> 
> \getfiguredimensions[t:/sources/cow.pdf]
...
> \NC \string\figurefilepath  \NC \figurefilepath  \NC \NR
> \NC \string\figurefilename  \NC \figurefilename  \NC \NR
> \NC \string\figurefiletype  \NC \figurefiletype  \NC \NR

Sorry, I didn’t recognize that this also answered my question!
Seems like I can condense my calculations a lot...

I started some documentation here: http://wiki.contextgarden.net/Image_Placement

A few of the variables don’t work:
\figurefileresolution, \figurefilecolor, \figurefilearguments, 
\figureorientation and \figurerotation all lead to errors.
I checked only in the garden yet, so maybe these are quite new?


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

___
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] bug with special hyphenation?

2018-02-08 Thread Pablo Rodriguez
Dear list,

I have been experiencing an issue with the new hyphenator for months (or
maybe almost a year), but it took me a while to discover what was
triggering it.

First, the mandatory sample:

\startluacode
function document.addfunnyhyphen(tfmdata)
local underscore = utf.byte("_")
local char   = tfmdata.characters[underscore]
if not char then return end
tfmdata.characters[0xFE000]   = {
width= 0,
height   = 0,
depth= 0,
commands = {
{ "right", -char.width },
{ "down", char.depth },
{ "slot", 1, underscore },
}
}
end


utilities.sequencers.appendaction("aftercopyingcharacters",
"after","document.addfunnyhyphen")

local shared = {
start  = 1,
length = 1,
before = utf.char(0xFE000),
after  = nil,
left   = false,
right  = false,
}

local all = table.setmetatableindex({ }, function(t,k)
return shared
end)

languages.hyphenators.traditional.installmethod("sha",
function(dictionary,word,n)
return all
end
)
\stopluacode

\definehyphenationfeatures
   [sha]
   [characters=all,
alternative=sha,
righthyphenchar="FE000]

\unexpanded\def\sha#1%
   {\begingroup\tt
\sethyphenationfeatures[sha]%
\setuphyphenation[method=traditional]%
#1%
\endgroup}

\showframe

\starttext
 some sha
 \sha{8b984688efec2}.\par

 \sha{8b984688efec2}\hskip0pt.\par

 {\sha{8b984688efe3a}\hskip0pt.}\par
\stoptext

Just in case you wonder, I need this to add SHA512 sums of attached
files to PDF documents. (I have mixed the code from different samples
that Hans gave me in replies to diverse questions.)

If I use the \sha command right before a point, I get:

- Only the first and the last character from the especially-hyphenated
text are formatted with the monospaced font. The other ones are
formatted with the Roman font.

- The point outside the command is formatted with the monospaced font,
instead of the Roman one.

- It might be possible that hyphenation could behave wrong in this case.

The simplest way to avoid the issue seems to be to use a zero-width space.

Have I hit an issue with the new hyphenator, or am I simply missing
somehting?

Many thanks for your 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
___

Re: [NTG-context] Sending data from lua to context and back to lua

2018-02-08 Thread Rudolf Bahr
On Thu, Feb 08, 2018 at 04:26:16PM +0100, Henning Hraban Ramm wrote:
> Am 2018-02-08 um 15:34 schrieb Rudolf Bahr :
> 
> > On Thu, Feb 08, 2018 at 09:30:48AM +0100, Thomas A. Schmitz wrote:
> >> On 02/07/2018 06:39 PM, Rudolf Bahr wrote:
> >>> Sometimes the necessity could arise to send data from lua to context
> >>> and answers back to lua. I tried this by using "read" and
> >>> "immediate\write" commands in context. These commands are described
> >>> in chapter 21 and 22 of Donald E. Knuth's "The TeXbook".
> >>> 
> >>> My question is: Do there exist better and more simple solutions?
> >> 
> >> You can print (typeset) information from inside lua code with the "context"
> >> function. Have you seen the manual cld-mkiv.pdf? It's in the minimals.
> >> 
> >> Thomas
> > 
> > Yes, thank you. I tried "context()" several times, but without success.
> > Could be, that I have a false meaning how to use it: If I transfer data
> > from context to lua and vice versa then in my imagination there must be 
> > variables in both languages  where the sent data is to be found.
> > 
> > With the use of "\immediate\write" and "\read" in context and the read and 
> > write
> > functions in lua I know exactly from where to where the data goes. How to 
> > do 
> > the same with "context()"?

 
> \startluacode
> 
> function SomeFunction()
>   context("Value")
> end
> 
> \stopluacode
> 
> \def\MyVar{\ctxlua{SomeFunction()}}
> 

YES! That's what I needed to get back data from lua to context!
Many thanks to Hraban, Hans and Thomas for your help!

Rudolf 

___
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] Overwritten text with newcolumnsets

2018-02-08 Thread Charles Vejnar

Here it is:

\usemodule[newcolumnsets]
\setuplayout[grid=yes]
\setupbodyfont[10pt]
\definecolumnset[example][n=2]
\starttext
\startcolumnset[example]
\dorecurse{7}{\input knuth \par}
\placefigure[center]{Legend.}{\hbox{\externalfigure[dummy][height=8cm]}}
\dorecurse{8}{\input knuth \par}
\stopcolumnset
\stoptext

On 02/08/2018 04:38 AM, Henning Hraban Ramm wrote:

Am 2018-02-08 um 05:22 schrieb Charles Vejnar :


I am trying to add a figure now using \placefigure. But the placement in 
brackets is always ignored. AFAIK it's normal to get a figure at the top of a 
new page when it's larger than a column but it's also always on the left. I 
would like to get it horizontally centered (on the top of the next page as it 
is already). Any way to achieve that?


Please show us your code, otherwise nobody can spot the problem.


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

Re: [NTG-context] Sending data from lua to context and back to lua

2018-02-08 Thread Henning Hraban Ramm
Am 2018-02-08 um 15:34 schrieb Rudolf Bahr :

> On Thu, Feb 08, 2018 at 09:30:48AM +0100, Thomas A. Schmitz wrote:
>> On 02/07/2018 06:39 PM, Rudolf Bahr wrote:
>>> Sometimes the necessity could arise to send data from lua to context
>>> and answers back to lua. I tried this by using "read" and
>>> "immediate\write" commands in context. These commands are described
>>> in chapter 21 and 22 of Donald E. Knuth's "The TeXbook".
>>> 
>>> My question is: Do there exist better and more simple solutions?
>> 
>> You can print (typeset) information from inside lua code with the "context"
>> function. Have you seen the manual cld-mkiv.pdf? It's in the minimals.
>> 
>> Thomas
> 
> Yes, thank you. I tried "context()" several times, but without success.
> Could be, that I have a false meaning how to use it: If I transfer data
> from context to lua and vice versa then in my imagination there must be 
> variables in both languages  where the sent data is to be found.
> 
> With the use of "\immediate\write" and "\read" in context and the read and 
> write
> functions in lua I know exactly from where to where the data goes. How to do 
> the same with "context()"?

\startluacode

function SomeFunction()
  context("Value")
end

\stopluacode

\def\MyVar{\ctxlua{SomeFunction()}}

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

___
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] Sending data from lua to context and back to lua

2018-02-08 Thread Hans Hagen

On 2/8/2018 3:34 PM, Rudolf Bahr wrote:

On Thu, Feb 08, 2018 at 09:30:48AM +0100, Thomas A. Schmitz wrote:

On 02/07/2018 06:39 PM, Rudolf Bahr wrote:

Sometimes the necessity could arise to send data from lua to context
and answers back to lua. I tried this by using "read" and
"immediate\write" commands in context. These commands are described
in chapter 21 and 22 of Donald E. Knuth's "The TeXbook".

My question is: Do there exist better and more simple solutions?


You can print (typeset) information from inside lua code with the "context"
function. Have you seen the manual cld-mkiv.pdf? It's in the minimals.

Thomas


Yes, thank you. I tried "context()" several times, but without success.
Could be, that I have a false meaning how to use it: If I transfer data
from context to lua and vice versa then in my imagination there must be
variables in both languages  where the sent data is to be found.

With the use of "\immediate\write" and "\read" in context and the read and write
functions in lua I know exactly from where to where the data goes. How to do
the same with "context()"?

I have no clue what you want to achieve but Thomas means:

\setupwhitespace[line]

\starttext

\startluacode
context("Here is lua.")
context.par()
context("I'm sending some picture names to Context in order to get 
back their sizes.")


local imageA = "2007-01-01---Intro.png"
local imageB = "2007-01-01---Neujahrsballade---1.png"
local imageC = "2007-01-01---Neujahrsballade---2.png"

local f = io.open("contextin.txt", "w")
f:write(imageA,"\n",imageB,"\n",imageC)
f:close()
\stopluacode

\openin15=contextin.txt
\read15 to \zeileA
\read15 to \zeileB
\read15 to \zeileC
\closein15

Here is \CONTEXT\ and what I got from Lua:

\startlines
\zeileA
\zeileB
\zeileC
\stoplines

Now I'm working ... and write my answers to a file for lua:

\startlines
\zeileA\ width=3000pt height=2000pt
\zeileB\ width=1200pt height=900pt
\zeileC\ width=1600pt height=1200pt
\stoplines

\immediate\openout7=contextout.txt
\immediate\write7{\zeileA\ width=3000pt height=2000pt \\}
\immediate\write7{\zeileB\ width=1200pt height=900pt  \\}
\immediate\write7{\zeileC\ width=1600pt height=1200pt \\}
\immediate\closeout7

\startluacode
context("Here is lua again and what I got back from Context:")
context.par()
context(io.loaddata("contextout.txt"))
\stopluacode

\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] Sending data from lua to context and back to lua

2018-02-08 Thread Thomas A. Schmitz

On 08.02.2018 15:34, Rudolf Bahr wrote:

With the use of "\immediate\write" and "\read" in context and the read and write
functions in lua I know exactly from where to where the data goes. How to do
the same with "context()"?


This question is impossible to answer - what is "the same"? Please make 
a minimal example to show what you have tried and where you had trouble 
- the manual I referred to provides good starting points.


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] Sending data from lua to context and back to lua

2018-02-08 Thread Rudolf Bahr
On Thu, Feb 08, 2018 at 09:30:48AM +0100, Thomas A. Schmitz wrote:
> On 02/07/2018 06:39 PM, Rudolf Bahr wrote:
> > Sometimes the necessity could arise to send data from lua to context
> > and answers back to lua. I tried this by using "read" and
> > "immediate\write" commands in context. These commands are described
> > in chapter 21 and 22 of Donald E. Knuth's "The TeXbook".
> > 
> > My question is: Do there exist better and more simple solutions?
> 
> You can print (typeset) information from inside lua code with the "context"
> function. Have you seen the manual cld-mkiv.pdf? It's in the minimals.
> 
> Thomas

Yes, thank you. I tried "context()" several times, but without success.
Could be, that I have a false meaning how to use it: If I transfer data
from context to lua and vice versa then in my imagination there must be 
variables in both languages  where the sent data is to be found.

With the use of "\immediate\write" and "\read" in context and the read and write
functions in lua I know exactly from where to where the data goes. How to do 
the same with "context()"?

Rudolf
___
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] Testing value of a \def

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

Great, thank you!

Lukas


On Thu, 08 Feb 2018 11:06:29 +0100, Wolfgang Schuster 
 wrote:




Procházka Lukáš Ing. 
8. Februar 2018 um 10:50
Hello,

I'm trying to test whether value of \jobname is "Test"; I suppose it
should be as the file name is "Test.mkiv".

But the code:


\starttext
  \jobname
  \doifelse{\jobname}{Test}{Yes}{No}
  \def\T{Test}
  \ifx\jobname\T True\else False\fi
  \ctxcommand{doifelse("\jobname" == "Test")}{1}{0}
\stoptext


yields "No", "False" and "1", so only the printed "1" is what I expect.

Why \doifelse and \ifx are evaluated as false?


The string from \jobname consists of catcode 12 letters while normal text
consists of catcode 11 letters. If you need the name of the file use one
of the commands below.


\starttext

\starttabulate
\NC \tex{jobfilefullname} \NC \jobfilefullname \NC\NR
\NC \tex{jobfilename} \NC \jobfilename \NC\NR
\NC \tex{jobfilesuffix}   \NC \jobfilesuffix   \NC\NR
\TB
\NC \tex{inputfilebarename}   \NC \inputfilebarename   \NC\NR
\NC \tex{inputfilerealsuffix} \NC \inputfilerealsuffix \NC\NR
\NC \tex{inputfilesuffix} \NC \inputfilesuffix \NC\NR
\NC \tex{inputfilename}   \NC \inputfilename   \NC\NR
\stoptabulate

\stoptext

Wolfgang




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

___
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] Change of font size affects header text size, too

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

Hello,

thanks both for quick answer.

Best regards,

Lukas


On Thu, 08 Feb 2018 12:49:53 +0100, Wolfgang Schuster 
 wrote:




Procházka Lukáš Ing. 
8. Februar 2018 um 12:14
Hello,

in the following example:


\setupheadertexts[Left][Right]

\starttext
  Aaa

  \page

  \startsection[title={Sec}]
\start
  \setupbodyfont[6pt]
  \dorecurse{12}{\input knuth}
\stop
  \stopsection
\stoptext


header text size on page #2 is small (6 pt) although body font change
was intended only to text inside section "Sec" -
thus the text "\input knuth" is surrounded by \start ... \stop.

How to change the bodyfont size of the running text only (ad-hoc in
the middle of the document), without changing header text size?


Use \switchtobodyfont[6pt].

Wolfgang




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

___
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] Change of font size affects header text size, too

2018-02-08 Thread Hans Hagen

On 2/8/2018 12:14 PM, Procházka Lukáš Ing. wrote:

Hello,

in the following example:


\setupheadertexts[Left][Right]

\starttext
   Aaa

   \page

   \startsection[title={Sec}]
     \start
   \setupbodyfont[6pt]
   \dorecurse{12}{\input knuth}
     \stop
   \stopsection
\stoptext


header text size on page #2 is small (6 pt) although body font change 
was intended only to text inside section "Sec" -

thus the text "\input knuth" is surrounded by \start ... \stop.

How to change the bodyfont size of the running text only (ad-hoc in the 
middle of the document), without changing header text size?

\switchtobodyfont


-
  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] Change of font size affects header text size, too

2018-02-08 Thread Wolfgang Schuster



Procházka Lukáš Ing. 
8. Februar 2018 um 12:14
Hello,

in the following example:


\setupheadertexts[Left][Right]

\starttext
  Aaa

  \page

  \startsection[title={Sec}]
\start
  \setupbodyfont[6pt]
  \dorecurse{12}{\input knuth}
\stop
  \stopsection
\stoptext


header text size on page #2 is small (6 pt) although body font change 
was intended only to text inside section "Sec" -

thus the text "\input knuth" is surrounded by \start ... \stop.

How to change the bodyfont size of the running text only (ad-hoc in 
the middle of the document), without changing header text size?


Use \switchtobodyfont[6pt].

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
___

[NTG-context] Change of font size affects header text size, too

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

Hello,

in the following example:


\setupheadertexts[Left][Right]

\starttext
  Aaa

  \page

  \startsection[title={Sec}]
\start
  \setupbodyfont[6pt]
  \dorecurse{12}{\input knuth}
\stop
  \stopsection
\stoptext


header text size on page #2 is small (6 pt) although body font change was intended only 
to text inside section "Sec" -
thus the text "\input knuth" is surrounded by \start ... \stop.

How to change the bodyfont size of the running text only (ad-hoc in the middle 
of the document), without changing header text size?

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

HdrSz.mkiv
Description: Binary data


HdrSz.pdf
Description: Adobe PDF document
___
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] Testing value of a \def

2018-02-08 Thread Wolfgang Schuster



Procházka Lukáš Ing. 
8. Februar 2018 um 10:50
Hello,

I'm trying to test whether value of \jobname is "Test"; I suppose it 
should be as the file name is "Test.mkiv".


But the code:


\starttext
  \jobname
  \doifelse{\jobname}{Test}{Yes}{No}
  \def\T{Test}
  \ifx\jobname\T True\else False\fi
  \ctxcommand{doifelse("\jobname" == "Test")}{1}{0}
\stoptext


yields "No", "False" and "1", so only the printed "1" is what I expect.

Why \doifelse and \ifx are evaluated as false?


The string from \jobname consists of catcode 12 letters while normal text
consists of catcode 11 letters. If you need the name of the file use one
of the commands below.


\starttext

\starttabulate
\NC \tex{jobfilefullname} \NC \jobfilefullname \NC\NR
\NC \tex{jobfilename} \NC \jobfilename \NC\NR
\NC \tex{jobfilesuffix}   \NC \jobfilesuffix   \NC\NR
\TB
\NC \tex{inputfilebarename}   \NC \inputfilebarename   \NC\NR
\NC \tex{inputfilerealsuffix} \NC \inputfilerealsuffix \NC\NR
\NC \tex{inputfilesuffix} \NC \inputfilesuffix \NC\NR
\NC \tex{inputfilename}   \NC \inputfilename   \NC\NR
\stoptabulate

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

[NTG-context] Testing value of a \def

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

Hello,

I'm trying to test whether value of \jobname is "Test"; I suppose it should be as the 
file name is "Test.mkiv".

But the code:


\starttext
  \jobname
  \doifelse{\jobname}{Test}{Yes}{No}
  \def\T{Test}
  \ifx\jobname\T True\else False\fi
  \ctxcommand{doifelse("\jobname" == "Test")}{1}{0}
\stoptext


yields "No", "False" and "1", so only the printed "1" is what I expect.

Why \doifelse and \ifx are evaluated as false?

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

Test.mkiv
Description: Binary data


Test.pdf
Description: Adobe PDF document
___
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] Overwritten text with newcolumnsets

2018-02-08 Thread Henning Hraban Ramm
Am 2018-02-08 um 05:22 schrieb Charles Vejnar :

> I am trying to add a figure now using \placefigure. But the placement in 
> brackets is always ignored. AFAIK it's normal to get a figure at the top of a 
> new page when it's larger than a column but it's also always on the left. I 
> would like to get it horizontally centered (on the top of the next page as it 
> is already). Any way to achieve that?

Please show us your code, otherwise nobody can spot the problem.


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

___
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] Change of nuts.dimensions function ?

2018-02-08 Thread Hans Hagen

On 2/7/2018 2:57 PM, Joseph Canedo wrote:

Hello all,

It seems that with latest ConTeXt beta (with luatex 1.07.0) it seems 
that nuts.dimensions function behaviour has changed. Simple MWE shows 
the change.


Which function should be used now to get natural width of a range [n, t[ 
of nodes please?
i'll check it but if you're on windows you're running the (currently 
very) experimental version which can actually be broken in some aspects 
(so you then need to update regularaly)


Hans


-
  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] Wrong Lua package loaded by 'require'

2018-02-08 Thread Hans Hagen

On 2/7/2018 11:51 PM, Przemek Wesolek wrote:

Hi,

I have problems using PGF graph drawing with ConTeXt. The problem is
described on https://tex.stackexchange.com/questions/414102/

It all boils down to Lua trying to load wrong file. When

   require 'pgf.gd.control'

is called, ConTeXt resolvers come into play and 'lua variable format'
locates Control.lua -- note the uppercase letter here -- which cannot be
loaded (on Linux) and 'require' fails:


having two files with the same name looks like an error in pgf to me

Hans


sandbox > requiring: pgf.gd.control
resolvers   > libraries > locating, level '1', method 'already loaded', 
name 'pgf.gd.control'
resolvers   > libraries > locating, level '1', method 'preload table', name 
'pgf.gd.control'
resolvers   > libraries > locating, level '1', method 'lua variable 
format', name 'pgf.gd.control'
resolvers   > libraries > lua format, checking 33 paths
resolvers   > libraries > lua format, identifying 'pgf/gd/control.lua' 
using format 'tex'
resolvers   > libraries > lua format, 'pgf/gd/control.lua' found on 
'/opt/texlive/2017/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/Control.lua'
resolvers   > libraries > locating, level '1', method 'lib variable 
format', name 'pgf.gd.control'


I suspect some part of the system (ConTeXt? kpsewhich? TeXLive?) messes
up and the resolver instead of pgf/gd/control.lua hits
pgf/gd/force/Control.lua. But I have plainly no experience in where to
look...

One more place, where I found some traces: in
texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/trees/929f6dbc83f6d3b65
dab91f1efa4aacb.lua file I have (in ["content"]["files"])


["control.lua"]={ "tex/generic/pgf/graphdrawing/lua/pgf/gd", 
"tex/generic/pgf/graphdrawing/lua/pgf/gd/force" }


as well as (in ["content"]["remap"])


["control.lua"]="Control.lua"


Clearly not OK.
context ignores cases in filenames and in fact in tds there cannot be 
two files with the same name ... keep in mind that windows is case 
insensitive ... if there are files with the same name then they normally 
are in (sub)paths that are identified by some distinctive category 
(variable)


Hans

-
  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] Sending data from lua to context and back to lua

2018-02-08 Thread Thomas A. Schmitz

On 02/07/2018 06:39 PM, Rudolf Bahr wrote:

Sometimes the necessity could arise to send data from lua to context
and answers back to lua. I tried this by using "read" and
"immediate\write" commands in context. These commands are described
in chapter 21 and 22 of Donald E. Knuth's "The TeXbook".

My question is: Do there exist better and more simple solutions?


You can print (typeset) information from inside lua code with the 
"context" function. Have you seen the manual cld-mkiv.pdf? It's in the 
minimals.


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
___