Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2017-02-16 Thread Mojca Miklavec
On 16 February 2017 at 21:07, William Adams wrote:
> Another option here would be to use a tool which directly accepts SVGs ---
> one free/opensource tool for that is PartKAM/MakerCAM.
>
> My apologies for the late response --- investigating this sort of thing
> myself, though I'll likely be using a proprietary tool, Carbide Create to
> drive either a Nomad or a Shapeoko.

Now that you brought this topic out of the dead ...

I managed to convert the SVG to DXF somehow back then (I'm not 100%
sure how exactly, perhaps I was using Inkscape), but it turned out
that the conversion was faulty and useless (it converted circles into
octagons, proper scaling was lost, etc.), but I only realized that
once I got to the machine with a limited time slot.

The software that was installed next to the CNC did not accept PDFs,
but eventually the "operator" pulled out his laptop with a newer
version of (commercial) software and eventually imported my PDFs to
get the models for the CNC (annoyed for the fact that I didn't bring
"ready-to-use" files). He earlier explained that we should avoid PDFs
(as they could be bitmap etc.), but of course the vector PDFs
generated by ConTeXt were fine.

(It will probably be a while until I will go there next.)

Mojca
___
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] strange crash

2017-02-16 Thread Alan Braslau
On Thu, 16 Feb 2017 21:56:55 +0100
"j. van den hoff"  wrote:

> just to avoid confusion: my initial report concerned x86_64 linux.

I have no problem with your MWE under 64bit linux.

Hans did point-out that there might be some instability today as we are
in the process of putting into place a new luatex binary with a
matching ConTeXt macro version that uses some new features, that has
not been extensively tested on all of the platforms.

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
___

Re: [NTG-context] strange crash

2017-02-16 Thread Pablo Rodriguez
On 02/16/2017 10:32 PM, j. van den hoff wrote:
> On Thu, 16 Feb 2017 22:20:14 +0100, Pablo Rodriguez  wrote:
>> [...]
>> You might try the 32bit version for Linux.
> [...]
> unfortunately this does not run through:
> `source temp-ctx-install/tex/setuptex' complains `binaries for platform  
> 'linux-64' are missing? I guess your script installs a test of 32-linux  
> but it does not run on my 64 bit machine?

It isn’t the list of commands I sent, I guess it is ConTeXt Standalone
itself. I only requested the download for 32bit (as I do for Win32 and
Win64 in my Linux32 computer).

My guess is that the same way that first-setup.sh knows which platform
to download, setuptex expects the same platform to be downloaded.

I don’t know whether there is a way of specifying the platform.
Otherwise, it isn’t clear to me how to use 32bit versions in 64bit
architectures for Linux. It works fine in Windows.

>> Don’t get me wrong. I think this is the best way of testing it, since
>> I’m not in front of your computer. And I don’t have a 64bit computer to
>> test, either.
> 
> your feedback/help is of course appreciated. thank you.

My apologies. My comment was a bit rude.

Sorry for not being really helpul ;-),


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] strange crash

2017-02-16 Thread j. van den hoff

On Thu, 16 Feb 2017 22:20:14 +0100, Pablo Rodriguez  wrote:


On 02/16/2017 09:56 PM, j. van den hoff wrote:

[...]
just to avoid confusion: my initial report concerned x86_64 linux.


I know and you’d have downloaded the Linux64 binaries.


understood.



You might try the 32bit version for Linux. It takes less than 2 minutes
with a decent internet connection. After pasting the whole thing you
only have to wait the result:

cd && mkdir temp-ctx-install && cd temp-ctx-install &&\
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh . &&\
./first-setup.sh --platform=linux --modules=all && cd &&\
source temp-ctx-install/tex/setuptex && mtxrunjit --generate\
&& echo "\starttext a\footnote{b}\stoptext" \

test-ctx-temp.mkiv && contextjit --purgeall test-ctx-temp.mkiv


unfortunately this does not run through:
`source temp-ctx-install/tex/setuptex' complains `binaries for platform  
'linux-64' are missing? I guess your script installs a test of 32-linux  
but it does not run on my 64 bit machine?




If that works, you may copy from my previous message to test again.

Don’t get me wrong. I think this is the best way of testing it, since
I’m not in front of your computer. And I don’t have a 64bit computer to
test, either.


your feedback/help is of course appreciated. thank you.

joerg



Just in case it helps,

Pablo



--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
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] strange crash

2017-02-16 Thread Pablo Rodriguez
On 02/16/2017 09:56 PM, j. van den hoff wrote:
> [...]
> just to avoid confusion: my initial report concerned x86_64 linux.

I know and you’d have downloaded the Linux64 binaries.

You might try the 32bit version for Linux. It takes less than 2 minutes
with a decent internet connection. After pasting the whole thing you
only have to wait the result:

cd && mkdir temp-ctx-install && cd temp-ctx-install &&\
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh . &&\
./first-setup.sh --platform=linux --modules=all && cd &&\
source temp-ctx-install/tex/setuptex && mtxrunjit --generate\
&& echo "\starttext a\footnote{b}\stoptext" \
> test-ctx-temp.mkiv && contextjit --purgeall test-ctx-temp.mkiv

If that works, you may copy from my previous message to test again.

Don’t get me wrong. I think this is the best way of testing it, since
I’m not in front of your computer. And I don’t have a 64bit computer to
test, either.

Just in case it helps,

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] strange crash

2017-02-16 Thread j. van den hoff
On Thu, 16 Feb 2017 21:54:01 +0100, Alan Braslau   
wrote:



On Thu, 16 Feb 2017 21:40:40 +0100
Pablo Rodriguez  wrote:


On 02/16/2017 07:51 PM, j. van den hoff wrote:
> hi,
> in a pristine standalone context (installed yesterday) under ubuntu
> I see a seemingly consistent crash of luatex if the document
> contains footnotes [...]
> while without the footnote it does compile just fine (the same
> happens in more complicated documents: crashes until last footnote
> is removed, then it compiles...). I am not an experienced context
> user, but don't see that I could have done much wrong in installing
> context in the first place (notably, the search path seems
> correct). any idea what's going on here?

Weird, I can compile your sample in Linux32.


just to avoid confusion: my initial report concerned x86_64 linux.



On a fresh download of the Standalone, and using a new luatex binary
just compiled on the linux 32bit machine, I get the following:

tex error   > tex error on line 1 in file /root/foo.tex: ! Infinite
glue shrinkage inserted from \skip131


\page ->\par
 \dosingleempty \page_breaks_process
\strc_pagenumbers_flush_final_page ...\else \page
  [\p_strc_pagenumbers_page  
...

\dostoptext ...\strc_pagenumbers_flush_final_page
  \page \the
\everystoptext ... l.1 \dostoptext
\clf_stoptext ->\luafunction \16>>clf_stoptext
l.3 \stoptext

1 >>  \starttext
2 foo\footnote{bar}
3 \stoptext
4

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



--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
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] strange crash

2017-02-16 Thread Alan Braslau
On Thu, 16 Feb 2017 21:40:40 +0100
Pablo Rodriguez  wrote:

> On 02/16/2017 07:51 PM, j. van den hoff wrote:
> > hi,
> > in a pristine standalone context (installed yesterday) under ubuntu
> > I see a seemingly consistent crash of luatex if the document
> > contains footnotes [...]
> > while without the footnote it does compile just fine (the same
> > happens in more complicated documents: crashes until last footnote
> > is removed, then it compiles...). I am not an experienced context
> > user, but don't see that I could have done much wrong in installing
> > context in the first place (notably, the search path seems
> > correct). any idea what's going on here?
> 
> Weird, I can compile your sample in Linux32.

On a fresh download of the Standalone, and using a new luatex binary
just compiled on the linux 32bit machine, I get the following:

tex error   > tex error on line 1 in file /root/foo.tex: ! Infinite
glue shrinkage inserted from \skip131


\page ->\par 
 \dosingleempty \page_breaks_process 
\strc_pagenumbers_flush_final_page ...\else \page 
  [\p_strc_pagenumbers_page ...
\dostoptext ...\strc_pagenumbers_flush_final_page 
  \page \the
\everystoptext ... l.1 \dostoptext
 
\clf_stoptext ->\luafunction \16>>clf_stoptext 
   
l.3 \stoptext
   

1 >>  \starttext
2 foo\footnote{bar}
3 \stoptext
4  

___
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] strange crash

2017-02-16 Thread Pablo Rodriguez
On 02/16/2017 07:51 PM, j. van den hoff wrote:
> hi,
> in a pristine standalone context (installed yesterday) under ubuntu I see  
> a seemingly consistent crash of luatex if the document contains footnotes
> [...]
> while without the footnote it does compile just fine (the same happens in  
> more complicated documents: crashes until last footnote is removed, then  
> it compiles...). I am not an experienced context user, but don't see that  
> I could have done much wrong in installing context in the first place  
> (notably, the search path seems correct). any idea what's going on here?

Weird, I can compile your sample in Linux32.

How about copying and pasting the following in your shell?

cd && mkdir temp-ctx-install && cd temp-ctx-install &&\
rsync -ptv rsync://contextgarden.net/minimals/setup/first-setup.sh . &&\
./first-setup.sh --modules=all && cd &&\
source temp-ctx-install/tex/setuptex && mtxrunjit --generate\
&& echo "\starttext a\footnote{b}\stoptext" \
> test-ctx-temp.mkiv && contextjit --purgeall test-ctx-temp.mkiv

It will download a temporary standalone and compile your document.

Let us know whether this work,

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] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2017-02-16 Thread William Adams
Another option here would be to use a tool which directly accepts SVGs ---
one free/opensource tool for that is PartKAM/MakerCAM.

My apologies for the late response --- investigating this sort of thing
myself, though I'll likely be using a proprietary tool, Carbide Create to
drive either a Nomad or a Shapeoko.

William

On Thu, Jun 30, 2016 at 3:15 AM, Hans Hagen  wrote:

> On 6/29/2016 10:49 PM, Mojca Miklavec wrote:
>
>> On 29 June 2016 at 14:12, Hans Hagen wrote:
>>
>>> On 6/29/2016 12:31 PM, Mojca Miklavec wrote:
>>>

 Hi,

 I want to play with CNC and don't yet have any experience with CAD
 software (nor the licence for the expensive ones) other than perhaps
 some Blender, so I decided to try to use the super ugly route with
 metapost -> svg -> dxf -> g-code
 for the first time.

 I have a few questions.

 (1) I love Hans' shortcuts in metafun, but I seem to remember that
 things
 like
 input metafun;
 or perhaps
 input mp-tool;
 used to work, so that I don't have to remember to use
 mpost -mem=metafun my-drawings.mp
 when compiling the graphics.

 Did the method with "input" ever work (or is it supposed to work)? Now
 I'm getting a bunch of weird errors.
 I would love to specify everything in the source file and then just
 call mpost. If that doesn't work, that's fine, I can still add
 "-mem=metafun", but ...

>>>
>>>
>>> input metafun.mpiv ;
>>>
>>
>> How should one properly compile that file then to get the SVG?
>>
>
> some mp directive (but i never tried) as i always just use \startMPpage ..
> \stopMPpage so that fonts etc work ok too
>
> Using just "mpost something.mp" doesn't work that way.
>>
>> (2) I guess that using "raw metapost" is the only sane way to generate
 SVG. If I use metapost inside ConTeXt that's probably not going to
 work, right?

 (3) Is there any way to convince the SVG output mode to generate
 something
 like
 
 rather than
 >>> >
 because the program I use to convert SVG to DXF has troubles
 interpreting "points" properly. I read somewhere that they assume 90
 points per inch because that's Inkskape's default.

>>>
>>> why not just
>>>
>>> \startMPpage
>>>   whatever you want
>>> \stopMPpage
>>>
>>> and then use mudraw (mutools) to go from pdf to svg (that's what i do
>>> when i
>>> need svg)
>>>
>>
>> Given that metapost supports SVG natively I imagined that it would
>> produce a simpler/cleaner output. Thanks a lot for the suggestion,
>> I'll test it.
>>
>
> the svg from pdf is normally quite simple as it just output the same
> paths, colors etc + text as outline
>
> It turned out that the (opensource) tools I used for converting SVG
>> into DXF gives very weird result, so I have to change the other parts
>> of the "toolchain" as well.
>>
>> Nevertheless, the question about whether one could convince MP to
>> output true units in cm/mm/in.--
>>
>
> no, but you can of course scale the whole lot just before shipping so that
> units represent cm
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.com | 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/list
> info/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> 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] strange crash

2017-02-16 Thread Marcus Vinicius Mesquita
I could compile the MWE with no problems whatsoever on arch linux 64bit.

On Thu, Feb 16, 2017 at 5:36 PM, j. van den hoff  wrote:
> On Thu, 16 Feb 2017 20:32:28 +0100, Alan Braslau 
> wrote:
>
>> I confirm this (with a different error message) on 32bit linux,
>
>
> thanks for confirming this.
>
>> but it compiles fine on 64bit linux, 64bit freebsd and 64bit osx.
>
>
> in my case it happens on a 64 bit linux(ubuntu) system:
>
> #arch
> x86_64
>
> and yes: under OSX everything is fine.
>
> joerg
>
>>
>> Alan
>>
>>
>>
>>
>> On Thu, 16 Feb 2017 19:51:25 +0100
>> "j. van den hoff"  wrote:
>>
>>> in a pristine standalone context (installed yesterday) under ubuntu I
>>> see a seemingly consistent crash of luatex if the document contains
>>> footnotes
>>>
>>> minimal example:
>>>
>>> \starttext
>>> foo\footnote{bar}
>>> \stoptext
>>>
>>>
>>> which crashes
>>
>>
>
>
> --
> Using Opera's revolutionary email client: http://www.opera.com/mail/
> ___
> 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
> ___



-- 
Todas as coisas fatigam o corpo, salvo a música, que não fatiga nem o
corpo nem seus membros, por ser descanso da alma, primavera do
coração, distração do aflito, entretenimento do solitário, e viático
do viajante.

Kunnâsh al-Hâ'ik (Cancioneiro de al-Hâ'ik)
___
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] strange crash

2017-02-16 Thread j. van den hoff
On Thu, 16 Feb 2017 20:32:28 +0100, Alan Braslau   
wrote:



I confirm this (with a different error message) on 32bit linux,


thanks for confirming this.


but it compiles fine on 64bit linux, 64bit freebsd and 64bit osx.


in my case it happens on a 64 bit linux(ubuntu) system:

#arch
x86_64

and yes: under OSX everything is fine.

joerg



Alan




On Thu, 16 Feb 2017 19:51:25 +0100
"j. van den hoff"  wrote:


in a pristine standalone context (installed yesterday) under ubuntu I
see a seemingly consistent crash of luatex if the document contains
footnotes

minimal example:

\starttext
foo\footnote{bar}
\stoptext


which crashes





--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
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] strange crash

2017-02-16 Thread Alan Braslau
I confirm this (with a different error message) on 32bit linux,
but it compiles fine on 64bit linux, 64bit freebsd and 64bit osx.

Alan




On Thu, 16 Feb 2017 19:51:25 +0100
"j. van den hoff"  wrote:

> in a pristine standalone context (installed yesterday) under ubuntu I
> see a seemingly consistent crash of luatex if the document contains
> footnotes
> 
> minimal example:
> 
> \starttext
> foo\footnote{bar}
> \stoptext
> 
> 
> which crashes

___
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] strange crash

2017-02-16 Thread j. van den hoff

hi,
in a pristine standalone context (installed yesterday) under ubuntu I see  
a seemingly consistent crash of luatex if the document contains footnotes


minimal example:

\starttext
foo\footnote{bar}
\stoptext


which crashes with this output:

8<-
tx-context | run 1: luatex  
--fmt="/usr/local/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"  
--jobname="tt"  
--lua="/usr/local/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"  
--no-parse-first-line --c:currentrun=1 --c:fulljobname="./tt.tex"  
--c:input="./tt.tex" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"

This is LuaTeX, Version 1.0.3 (TeX Live 2017/dev)
 system commands enabled.
open source > level 1, order 1, name  
'/usr/local/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'

system  >
system  > ConTeXt  ver: 2017.01.27 14:39 MKIV beta  fmt:  
2017.2.15  int: english/english

system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name  
'/usr/local/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
close source> level 2, order 2, name  
'/usr/local/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'

system  > files > jobname 'tt', input './tt', result 'tt'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/home/myusername/tt/tt.tex'
fonts   > preloading latin modern fonts (second stage)
fonts   > 'fallback modern-designsize rm 12pt' is loaded

mtx-context | fatal error: no return code, message: luatex: execution  
interrupted

8<-

while without the footnote it does compile just fine (the same happens in  
more complicated documents: crashes until last footnote is removed, then  
it compiles...). I am not an experienced context user, but don't see that  
I could have done much wrong in installing context in the first place  
(notably, the search path seems correct). any idea what's going on here?


thx/joerg

--
Using Opera's revolutionary email client: http://www.opera.com/mail/
___
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] labeltext via lua

2017-02-16 Thread Hans Hagen

On 2/16/2017 3:06 PM, Andreas Schneider wrote:

Am 2017-02-16 14:43, schrieb Hans Hagen:


because additional ones live at the tex end

why not use context.labeltext etc?

Hans


`context.labeltext` would immediately print the label, so I cannot use
the value within lua. My workaround would be a crossover between lua and
tex, but that results in the bookmark having the wrong label:

\setuplabeltext[en][test=Something]
\startluacode
context.startsectionlevel{title="\\labeltext[test]"}
-- ...
context.stopsectionlevel()
\stopluacode

The title correctly reads "Something", but the bookmark in the PDF
viewer shows "test".


also with this?

\enabledirectives[references.bookmarks.preroll]



-
  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] labeltext via lua

2017-02-16 Thread Andreas Schneider

Am 2017-02-16 14:43, schrieb Hans Hagen:


because additional ones live at the tex end

why not use context.labeltext etc?

Hans


`context.labeltext` would immediately print the label, so I cannot use 
the value within lua. My workaround would be a crossover between lua and 
tex, but that results in the bookmark having the wrong label:


\setuplabeltext[en][test=Something]
\startluacode
context.startsectionlevel{title="\\labeltext[test]"}
-- ...
context.stopsectionlevel()
\stopluacode

The title correctly reads "Something", but the bookmark in the PDF 
viewer shows "test".



Best regards,
Andreas

___
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] labeltext via lua

2017-02-16 Thread Hans Hagen

On 2/16/2017 2:12 PM, Andreas Schneider wrote:

Am 2017-02-16 11:50, schrieb Hans Hagen:

languages.data.labels.texts.appendix.labels.en

look into lang-txt.lua


Hello Hans,

I already looked into this and even printed the whole languages.data
table at runtime, but didn't find my keys in there.

Here is an example which apparently doesn't work (or I'm still
overlooking something):

```
\mainlanguage[de]

\setuplabeltext[de][Page=Seite]
\setuplabeltext[en][Page=Page]

\starttext

\startluacode
local language = languages.numbers[tex.getcount("mainlanguagenumber")]
local lbl = languages.data.labels.texts["Page"]
local text
if lbl == nil then
text = "[NOT FOUND]"
else
text = lbl.labels[language]
end
context("For language "..language.." we get "..text)
\stopluacode

\stoptext


because additional ones live at the tex end

why not use context.labeltext etc?

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] labeltext via lua

2017-02-16 Thread Andreas Schneider

Am 2017-02-16 11:50, schrieb Hans Hagen:

languages.data.labels.texts.appendix.labels.en

look into lang-txt.lua


Hello Hans,

I already looked into this and even printed the whole languages.data 
table at runtime, but didn't find my keys in there.


Here is an example which apparently doesn't work (or I'm still 
overlooking something):


```
\mainlanguage[de]

\setuplabeltext[de][Page=Seite]
\setuplabeltext[en][Page=Page]

\starttext

\startluacode
local language = languages.numbers[tex.getcount("mainlanguagenumber")]
local lbl = languages.data.labels.texts["Page"]
local text
if lbl == nil then
text = "[NOT FOUND]"
else
text = lbl.labels[language]
end
context("For language "..language.." we get "..text)
\stopluacode

\stoptext
```

Thank you very much!

Best regards
Andreas
___
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] labeltext via lua

2017-02-16 Thread Hans Hagen

On 2/16/2017 11:36 AM, Andreas Schneider wrote:

Hello,

if I define a labeltext via \setuplabeltext[en][test=Something], how can
I access that value via lua?
(context.labeltext obviously prints the content, but doesn't allow me to
use it in lua).


languages.data.labels.texts.appendix.labels.en

look into lang-txt.lua


As a related side-request: how can I fix expansion in cases like this:
\startsectionlevel[title=\labeltext{test}] ... this causes the bookmark
to read "test" instead of "Something". \expandafter\startsectionlevel...
didn't cut it.

Best regards
Andreas
___

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
___



--

-
  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] labeltext via lua

2017-02-16 Thread Andreas Schneider

Hello,

if I define a labeltext via \setuplabeltext[en][test=Something], how can 
I access that value via lua?
(context.labeltext obviously prints the content, but doesn't allow me to 
use it in lua).


As a related side-request: how can I fix expansion in cases like this: 
\startsectionlevel[title=\labeltext{test}] ... this causes the bookmark 
to read "test" instead of "Something". \expandafter\startsectionlevel... 
didn't cut it.


Best regards
Andreas
___
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] Section 1.2)-3

2017-02-16 Thread Procházka Lukáš Ing .

Hello,

how to \setuphead to produce numbers like "1.2)-3"?


\setuphead[section][]
\setuphead[subsection][]
\setuphead[subsubsection][]

\section{Sec} % To give "1. Sec"
  \subsection{SSec} % To give "1.1) SSec"
\subsubsection{SSSec} % To give "1.1)-1. SSSec"


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

Tel: +420 241 096 751 (+420 720 951 172)
Fax: +420 244 461 038

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