Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Aditya Mahajan

On Tue, 3 Mar 2015, Hans Hagen wrote:


On 3/3/2015 6:12 PM, Aditya Mahajan wrote:

2. The metafun alternative is a bit inconvenient. Suppose you want to
draw a bunch of such graphics (words connected by arrows). Then, you
will need to ensure that node names are unique. (Is there a way to get
around that?)


\newcounter\connectedwordcounter

\starttexdefinition unexpanded fromword [#1]#2
\expandafter\pushmacro\csname cwc>#1\endcsname % nesting hack
\doglobal\increment\connectedwordcounter
\setxvalue{cwc>#1}{\connectedwordcounter}%
\startpositionoverlay{highlightoverlay}
\setMPpositiongraphic
  {\getvalue{cwc>#1}>f}
  {highlightgraphic}
  {from=\getvalue{cwc>#1}>f,to=\getvalue{cwc>#1}>t}
\stoppositionoverlay
\hpos{\getvalue{cwc>#1}>f}{#2}%
\stoptexdefinition

\starttexdefinition unexpanded toword [#1]#2
\hpos{\getvalue{cwc>#1}>t}{#2}
\expandafter\popmacro\csname cwc>#1\endcsname % nesting hack
\stoptexdefinition


Thanks.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Hans Hagen

On 3/3/2015 6:12 PM, Aditya Mahajan wrote:

On Tue, 3 Mar 2015, Jörg Weger wrote:


In the minimal working example below inside of a text two words should
be printed inside of rounded TikZ rectangles and should be connected
by an TikZ arrow pointing from the first word to the other.

TikZ offers the remember picture/overlay option for that.

I have seen a solution similar to what I want to achieve in the
METAFUN manual but I don’t have a clue how to get that METAPOST
alternative working.


Here is how to get the metafun alternative working.

1. I don't understand why I need to manually input the mp-abck file;
that should be input automatically.

2. The metafun alternative is a bit inconvenient. Suppose you want to
draw a bunch of such graphics (words connected by arrows). Then, you
will need to ensure that node names are unique. (Is there a way to get
around that?)

3. I did not bother to set the style of the boxes and arrows. So it
looks a bit dry.

\startMPdefinitions
   % I don't know why this does not get loaded automatically.
   input mp-abck.mpiv;
\stopMPdefinitions

\defineoverlay[highlight] [\positionoverlay{highlightoverlay}]

\startpositionoverlay{highlightoverlay}
   \setMPpositiongraphic{n1}{highlightgraphic}{from=n1,to=n2}
\stoppositionoverlay

\startMPpositiongraphic{highlightgraphic}
   save n; path n[];

   initialize_box(\MPpos{\MPvar{from}}); n[1] := pxy;
   initialize_box(\MPpos{\MPvar{to}});   n[2] := pxy;

   draw n[1];
   draw n[2];

   drawarrow (center n[1]){dir 45} .. {dir -45}(center n[2])
cutbefore n[1]
cutafter  n[2];

   anchor_box(\MPanchor{\MPvar{from}});
\stopMPpositiongraphic

\setuppapersize[A6]

\setupbackgrounds[page][background=highlight]

\starttext
\hpos{n1}{this} belongs to \hpos{n2}{that}
\stoptext


\startMPdefinitions
% I don't know why this does not get loaded automatically. Answer: 
seldom needed.

input mp-abck.mpiv;
\stopMPdefinitions

\defineoverlay[highlight] [\positionoverlay{highlightoverlay}]

\startMPpositiongraphic{highlightgraphic}
save n; path n[];

initialize_box(\MPpos{\MPvar{from}}); n[1] := pxy;
initialize_box(\MPpos{\MPvar{to}});   n[2] := pxy;

draw n[1];
draw n[2];

if ypart center n[1] > ypart center n[2] :
drawarrow (center n[1]){dir 225} ... {dir -225}(center n[2])
cutbefore n[1]
cutafter  n[2] ;
else :
drawarrow (center n[1]){dir 45} ... {dir -45}(center n[2])
cutbefore n[1]
cutafter  n[2] ;
fi ;

anchor_box(\MPanchor{\MPvar{from}});
\stopMPpositiongraphic

\newcounter\connectedwordcounter

\starttexdefinition unexpanded fromword [#1]#2
\expandafter\pushmacro\csname cwc>#1\endcsname % nesting hack
\doglobal\increment\connectedwordcounter
\setxvalue{cwc>#1}{\connectedwordcounter}%
\startpositionoverlay{highlightoverlay}
\setMPpositiongraphic
  {\getvalue{cwc>#1}>f}
  {highlightgraphic}
  {from=\getvalue{cwc>#1}>f,to=\getvalue{cwc>#1}>t}
\stoppositionoverlay
\hpos{\getvalue{cwc>#1}>f}{#2}%
\stoptexdefinition

\starttexdefinition unexpanded toword [#1]#2
\hpos{\getvalue{cwc>#1}>t}{#2}
\expandafter\popmacro\csname cwc>#1\endcsname % nesting hack
\stoptexdefinition

\setuppapersize[A6]

\setupbackgrounds[page][background=highlight]

\starttext
\fromword[foo]{this} belongs to \toword[foo]{that}
\fromword[bar]{this} belongs to \toword[bar]{that}
\fromword[foo]{this} belongs to \toword[foo]{that}
\fromword[bar]{this} belongs \fromword[bar]{this} belongs to 
\toword[bar]{that} to \toword[bar]{that}

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] siunitx feature in unit module

2015-03-03 Thread Hans Hagen

On 3/3/2015 6:47 PM, Andrea De Michele wrote:

Romain Diss  writes:


Hi,


with siunitx LaTeX package its possible to obtain physics units like m/s
printed in different way changing one option:
e.g.
\si{\metre\per\second} produce ms^{-1}

\unit{10 meter inverse second}


Thank you.



\si[per-mode=symbol]{\metre\per\second} produce m/s

\unit{10 meter per second}


\si[per-mode=fraction]{\metre\per\second} produce \frac{m}{s}

I think it is not possible with \unit{}


Do you know if there is the project to implement this feature?


currently not on the agenda

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] siunitx feature in unit module

2015-03-03 Thread Andrea De Michele
Romain Diss  writes:

> Hi,
>
>> with siunitx LaTeX package its possible to obtain physics units like m/s
>> printed in different way changing one option:
>> e.g.
>> \si{\metre\per\second} produce ms^{-1}
> \unit{10 meter inverse second}

Thank you.
>
>> \si[per-mode=symbol]{\metre\per\second} produce m/s
> \unit{10 meter per second}
>
>> \si[per-mode=fraction]{\metre\per\second} produce \frac{m}{s}
> I think it is not possible with \unit{}
>
Do you know if there is the project to implement this feature?

> All the best.

-- 
Andrea De Michele

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] mkiv document saved as xml.

2015-03-03 Thread Hans Hagen

On 3/3/2015 1:54 PM, John Culleton wrote:

The WIKI is in transition and the other posts
here deawl with advanced details. So I have a
simple question:
Given a mkiv document how do I export it to a
generic xml docuument?


\setupbackend
  [export=yes]

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Aditya Mahajan

On Tue, 3 Mar 2015, Jörg Weger wrote:

In the minimal working example below inside of a text two words should 
be printed inside of rounded TikZ rectangles and should be connected by 
an TikZ arrow pointing from the first word to the other.


TikZ offers the remember picture/overlay option for that.

I have seen a solution similar to what I want to achieve in the METAFUN 
manual but I don’t have a clue how to get that METAPOST alternative working.


Here is how to get the metafun alternative working.

1. I don't understand why I need to manually input the mp-abck file; that 
should be input automatically.


2. The metafun alternative is a bit inconvenient. Suppose you want to draw 
a bunch of such graphics (words connected by arrows). Then, you will need 
to ensure that node names are unique. (Is there a way to get around that?)


3. I did not bother to set the style of the boxes and arrows. So it looks 
a bit dry.


\startMPdefinitions
  % I don't know why this does not get loaded automatically.
  input mp-abck.mpiv;
\stopMPdefinitions

\defineoverlay[highlight] [\positionoverlay{highlightoverlay}]

\startpositionoverlay{highlightoverlay}
  \setMPpositiongraphic{n1}{highlightgraphic}{from=n1,to=n2}
\stoppositionoverlay

\startMPpositiongraphic{highlightgraphic}
  save n; path n[];

  initialize_box(\MPpos{\MPvar{from}}); n[1] := pxy;
  initialize_box(\MPpos{\MPvar{to}});   n[2] := pxy;

  draw n[1];
  draw n[2];

  drawarrow (center n[1]){dir 45} .. {dir -45}(center n[2])
   cutbefore n[1]
   cutafter  n[2];

  anchor_box(\MPanchor{\MPvar{from}});
\stopMPpositiongraphic

\setuppapersize[A6]

\setupbackgrounds[page][background=highlight]

\starttext
\hpos{n1}{this} belongs to \hpos{n2}{that}
\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Mojca Miklavec
On Tue, Mar 3, 2015 at 2:27 PM, Ulrike Fischer  wrote:
>
>>> I'm always using (on windows)
>>> first-setup.bat --keep
>>
>> I would advise you against using the --keep option unless there are
>> some other/strong reasons to do so.
>
> Then the instructions here are quite misleading:
> http://wiki.contextgarden.net/ConTeXt_Standalone#Updating_2

Thank you. Removed. I need to review the page. There are some weird
statements there.

If you are familiar with rsync: all that --keep does is omit the
"--delete" flag in rsync modules. It's not exactly the same, but it is
roughly "equally evil" as setting the TeX Live's option to keep the
removed modules installed. Except that here it would accumulate all
the files that ever existed in ConTeXt since the first day when the
user first installed the distribution. When, say, fonts in TeX Live
move around, users would end up with duplicate files at two locations.

> I'm not a regularly context user, I maintain the installation mostly
> for tests and want "an up-to-date, complete (with all modules)"
> installation and was looking for a command that compares to "tlmgr
> update --all" from texlive.
>
> Did I got it right now that I should do "first-setup.bat" and that
> "first-setup.bat --keep" doesn't update the modules?

No, --keep isn't related to updating modules at all. The flag would
help you keep things that you install in your tree from your own
sources (something that doesn't come from the distribution). But it
would also keep all other outdated files. It's waay better to keep
your own files elsewhere. (Even if simply under "texmf-local" that's
created for you. But not in "texmf-modules" to "texmf-context" or
alike.)

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] mkiv document saved as xml.

2015-03-03 Thread John Culleton
The WIKI is in transition and the other posts
here deawl with advanced details. So I have a
simple question:
Given a mkiv document how do I export it to a
generic xml docuument?

I have another question later. 

-- 
John Culleton
Wexford Press
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Updated PDF e-book: "Create Book Covers with
Scribus 1.4.5" coming soon at
http://www.booklocker.com/!
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Ulrike Fischer
Am Tue, 3 Mar 2015 14:11:56 +0100 schrieb Mojca Miklavec:

>> -- that tikz is not mentioned on the module list:
>> http://modules.contextgarden.net/
> 
> That site is used for uploading modules by authors. I never thought
> about users trying to learn about existence of modules via that site.

tikz isn't mentioned here too:

http://wiki.contextgarden.net/Modules


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Ulrike Fischer
Am Tue, 3 Mar 2015 14:11:56 +0100 schrieb Mojca Miklavec:

>> -- the installation advices on contextgarden doesn't explain what to
>> do if you want to update modules too.

> Do you want to say that the module gets removed next time when you run
> first-setup.bat? If that is the case, it should be fixed. Updating
> works for me and also keeps the modules up to date.

I have no idea ;-). 

 
>> I'm always using (on windows)
>> first-setup.bat --keep
> 
> I would advise you against using the --keep option unless there are
> some other/strong reasons to do so. 

Then the instructions here are quite misleading:
http://wiki.contextgarden.net/ConTeXt_Standalone#Updating_2

I'm not a regularly context user, I maintain the installation mostly
for tests and want "an up-to-date, complete (with all modules)"
installation and was looking for a command that compares to "tlmgr
update --all" from texlive.  

Did I got it right now that I should do "first-setup.bat" and that
"first-setup.bat --keep" doesn't update the modules?

-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Mojca Miklavec
On Tue, Mar 3, 2015 at 1:38 PM, Ulrike Fischer wrote:
>
> I wanted to try the example in my context standalone installation
> and got an "undefined command error" on the \usetikzlibrary.
> After a bit digging I could repair this with "first-install.bat
> --modules="t-tikz" which seems to get me the newest tikz.
>
> But during this digging I saw
>
> -- that tikz is not mentioned on the module list:
> http://modules.contextgarden.net/

That site is used for uploading modules by authors. I never thought
about users trying to learn about existence of modules via that site.

> -- Following the link to the module
> (http://modules.contextgarden.net/TikZ) from
> http://wiki.contextgarden.net/TikZ gives an "internal error message"

I removed the link.

> -- the installation advices on contextgarden doesn't explain what to
> do if you want to update modules too.

Do you want to say that the module gets removed next time when you run
first-setup.bat? If that is the case, it should be fixed. Updating
works for me and also keeps the modules up to date.

> I'm always using (on windows)
> first-setup.bat --keep

I would advise you against using the --keep option unless there are
some other/strong reasons to do so. But you shouldn't need keep just
for the sake of a potential bug.

I would need to check again what exactly --all does. But --modules=all
should install all modules and --modules=t-tikz should be sufficient
to keep that module. However I don't know what happens if you use
--modules=t-somethingelse next time. Maybe that removes the modules
that you installed previously as it expects the complete list of
modules. I need to check.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Problem with MkIV and TikZ picture remembering

2015-03-03 Thread Ulrike Fischer
Am Tue, 3 Mar 2015 08:54:00 +0100 schrieb Wolfgang Schuster:

I wanted to try the example in my context standalone installation
and got an "undefined command error" on the \usetikzlibrary.
After a bit digging I could repair this with "first-install.bat
--modules="t-tikz" which seems to get me the newest tikz.

But during this digging I saw

-- that tikz is not mentioned on the module list:
http://modules.contextgarden.net/

-- Following the link to the module
(http://modules.contextgarden.net/TikZ) from
http://wiki.contextgarden.net/TikZ gives an "internal error message"

-- the installation advices on contextgarden doesn't explain what to
do if you want to update modules too. I'm always using (on windows)
first-setup.bat --keep as explained here
http://wiki.contextgarden.net/ConTeXt_Standalone#Updating_2. But
this doesn't seem to update the modules. Is first-setup.bat --all
better if one simply wants the newest complete standalone?


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] No escape to TeX for inline typing?

2015-03-03 Thread Christoph Reller
On Sun, 01 Mar 2015 11:30:46 +0100, Hans Hagen  wrote:

>
> On 2/28/2015 2:00 PM, Christoph Reller wrote:
>
> > Dear Hans,
> >
> > Can you please add the above patch, or is there a particular reason
> > for not
> > doing so?
> >
> > Kind regards,
> >
> > Christoph
>
> I'll add it but there will only be a new beta when Alan and I are
> satisfied about the publication subsystem we're working on.
>
> Hans
>

Thanks a lot, Hans!

Christoph
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___