Re: [NTG-context] using metapost library makecirc with context.

2019-04-20 Thread Andrea De Michele
Hans Hagen  writes:

> On 4/19/2019 5:48 PM, Andrea De Michele wrote:
>>
>> I'm trying to use with Context  makecirc a metapost library to draw
>> electric circuits, but I have problems with the labels of the circuits
>> element that are not displayed correctly.
>>
>> FIRST EXAMPLE (No labels are displayed)
>> -
>> \starttext
>>
>> \startMPinclusions
>>input makecirc;
>> \stopMPinclusions
>>
>>
>> \startstaticMPfigure{circ1}
>>  u:= 1cm ;
>>  source.e((0,0u),DC,90,"\Delta V","2V") ;
>>  resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
>>  resistor.b((2u,-1u),normal,90,"R_2","2$\Omega$") ;
>>  wire(S.e.p,R.a.r,udsq) ;
>>  wire(S.e.n,R.b.l,udsq) ;
>>  wire(R.a.l,R.b.r,udsq) ;
>> \stopstaticMPfigure
>> \usestaticMPfigure[circ1]
>>
>> \stoptext
> I searched ctab for that library and it has soem hard wired latex
> stuff in it. You can make latex.mp empty (to play safe),
>
> Load the file with:
>
> \startMPinclusions
> string LaTeXsetup ; LaTeXsetup := "";
> input "makecirc.mp";
> vardef latex(expr t) = textext(t) enddef ;
> \stopMPinclusions
>
> I didn't look into the details but yoru example runs then.
>
>
> 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
> ___
>
Thank you,

I didn't understand the magic behind that  but it's works.

Another question: there is a library to draw electrics circuit
alternative to makecirc but more context/metafun friendly?



-- 
Andrea De Michele

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


[NTG-context] using metapost library makecirc with context.

2019-04-19 Thread Andrea De Michele

I'm trying to use with Context  makecirc a metapost library to draw
electric circuits, but I have problems with the labels of the circuits
element that are not displayed correctly.

FIRST EXAMPLE (No labels are displayed)
-
\starttext

\startMPinclusions
  input makecirc;
\stopMPinclusions


\startstaticMPfigure{circ1}
u:= 1cm ;
source.e((0,0u),DC,90,"\Delta V","2V") ;
resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
resistor.b((2u,-1u),normal,90,"R_2","2$\Omega$") ;
wire(S.e.p,R.a.r,udsq) ;
wire(S.e.n,R.b.l,udsq) ;
wire(R.a.l,R.b.r,udsq) ;
\stopstaticMPfigure
\usestaticMPfigure[circ1]

\stoptext
-

SECOND EXAMPLE (In the first circuit are displayed the labels of the
second one and in the second only ?? are displayed)
-
\starttext

\startstaticMPfigure{circ1}
  input makecirc;
u:= 1cm ;
source.e((0,0u),DC,90,"\Delta V","2V") ;
resistor.a((2u,1u),normal,90,"R_1","1$\Omega$") ;
resistor.b((2u,-1u),normal,90,"R_2","2$\Omega$") ;
wire(S.e.p,R.a.r,udsq) ;
wire(S.e.n,R.b.l,udsq) ;
wire(R.a.l,R.b.r,udsq) ;
\stopstaticMPfigure
\usestaticMPfigure[circ1]

\startstaticMPfigure{circ2}
  input makecirc;
u:= 1cm ;
source.e((0,0u),DC,90,"\Delta V","4V") ;
resistor.a((2u,1u),normal,90,"R_3","3$\Omega$") ;
resistor.b((2u,-1u),normal,90,"R_4","4$\Omega$") ;
wire(S.e.p,R.a.r,udsq) ;
wire(S.e.n,R.b.l,udsq) ;
wire(R.a.l,R.b.r,udsq) ;
\stopstaticMPfigure
\usestaticMPfigure[circ2]

\stoptext


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


Re: [NTG-context] macro expansion inside a block

2016-02-08 Thread Andrea De Michele
Hans Hagen <pra...@wxs.nl> writes:

> On 2/5/2016 5:13 PM, Andrea De Michele wrote:
>> Hi all,
>> I want to expand a macro inside a block when the block is written and not 
>> when it is used.
>> Here a simple example:
>>
>> \defineblock[myblock]
>> \hideblocks[myblock]
>>
>> \starttext
>>
>> \define\mynumber{1}
>> Some text: mynumber is :\mynumber
>> \beginmyblock
>>This is mynumber inside the first myblock, I want 1 and I obtain:  
>> \mynumber
>> \endmyblock
>>
>> \define\mynumber{2}
>> Some text: mynumber now is :\mynumber
>> \beginmyblock
>>This is mynumber inside the second myblock, I want 2 and I obtain:  
>> \mynumber
>> \endmyblock
>>
>> \useblocks[myblock]
>> \stoptext
>>
>> This produce:
>>
>> Some text: mynumber is :1
>> Some text: mynumber now is :2
>> This is mynumber inside the first myblock, I want 1 and I obtain: 2
>> This is mynumber inside the second myblock, I want 2 and I obtain: 2
>>
>> instead I want:
>>
>> Some text: mynumber is :1
>> Some text: mynumber now is :2
>> This is mynumber inside the first myblock, I want 1 and I obtain: 1
>> This is mynumber inside the second myblock, I want 2 and I obtain: 2
>>
>> It is possible in some way?
>
> no (at least not in a trivial way)

:(

anyway, thank you.
-- 
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
___

[NTG-context] macro expansion inside a block

2016-02-05 Thread Andrea De Michele
Hi all,
I want to expand a macro inside a block when the block is written and not when 
it is used.
Here a simple example:

\defineblock[myblock]
\hideblocks[myblock]

\starttext

\define\mynumber{1}
Some text: mynumber is :\mynumber 
\beginmyblock
  This is mynumber inside the first myblock, I want 1 and I obtain:  \mynumber
\endmyblock

\define\mynumber{2}
Some text: mynumber now is :\mynumber 
\beginmyblock
  This is mynumber inside the second myblock, I want 2 and I obtain:  \mynumber
\endmyblock

\useblocks[myblock]
\stoptext

This produce:

Some text: mynumber is :1
Some text: mynumber now is :2
This is mynumber inside the first myblock, I want 1 and I obtain: 2
This is mynumber inside the second myblock, I want 2 and I obtain: 2

instead I want:

Some text: mynumber is :1
Some text: mynumber now is :2
This is mynumber inside the first myblock, I want 1 and I obtain: 1
This is mynumber inside the second myblock, I want 2 and I obtain: 2

It is possible in some way?


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

[NTG-context] \hl line thickness

2015-09-17 Thread Andrea De Michele
Hello,

there is a way to select the line thickness of a \hl[n] command?

I want to use \hl[n] for a fillin space in a question/answer
document. The \fillinline, \fillinrules, ... are not good for my goal
because they extend the horizontal line until the end of the line. I
need several fillin space of different width on the same line for
question like:
Complete the following sentence:

bla bla bla __ bla bla bla __ bla bla bla__.

The \hl[n] is ok for this but I like to have a thinner line.
-- 
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] Problem with the installation of a module

2015-08-21 Thread Andrea De Michele
Aditya Mahajan adit...@umich.edu writes:

 On Fri, 14 Aug 2015, Andrea De Michele wrote:

 I tried to install the PocketDiary module but I had some problem.
 I follow the instruction at:

 http://wiki.contextgarden.net/Modules

 so first I copy the files in my texmf-local directory and after that I run:

 You are storing the files according the Tex Directory Structure, right?
Yes. The files are in following two directories.

/home/admich/texlive/texmf-local/tex/context/third/pocketdiary/
/home/admich/texlive/texmf-local/doc/context/third/pocketdiary/

After mktexlsr texdoc find the documentation of the module:

~ $ texdoc -l pocket
 1 
/home/admich/texlive/texmf-local/doc/context/third/pocketdiary/t-pocketdiary.pdf
 2 /home/admich/texlive/texmf-local/doc/context/third/pocketdiary/README.txt
Please enter the number of the file to view, anything else to skip: 


The problem seems to be in how context find the files path. As you suggested I 
tried:

~ $ mtxrun --expand-var TEXMFLOCAL

home/admich/texlive/texmf-local

I think that the problem is here. It should be /home/admich/texlive/texmf-local



 context --generate

 but context didn't find the new module.

 I use linux and I have installed texlive 2015 in my home directory, so my 
 texmf-local directory is /home/admich/texlive/texmf-local

 In the output of  context --generate I noticed the following lines:

 ...
 resolvers   | resolving | locating list of 
 'home/admich/texlive/texmf-local' (cached)
 resolvers   | methods | resolving, method 'locators', how 'uri', handler 
 'file', argument 'home/admich/texlive/texmf-local'
 resolvers   | files | file locator 'home/admich/texlive/texmf-local' not 
 found
 ...

 This seems not correct because is missing the initial / . For example the 
 following lines are:

 resolvers   | resolving | locating list of 'selfautoparent:texmf-dist' 
 (cached)
 resolvers   | methods | resolving, method 'locators', how 'uri', handler 
 'file', argument 'selfautoparent:texmf-dist'
 resolvers   | files | file locator 'selfautoparent:texmf-dist' found as 
 '/home/admich/texlive/2015/texmf-dist'
 resolvers   | resolving |
 ...

 with the right initial /

 kpathsea find the right $TEXMFLOCAL:

 ~$ kpsewhich -var-value TEXMFLOCAL
 /home/admich/texlive/texmf-local

 context (mkiv) does not use kpse (texmf.cnf) but uses the values
 stored it texmfcnf.lua. To check the value of TEXMFLOCAL use

 mtxrun --expand-var TEXMFLOCAL

 You can also try:

 context --trackers=resolvers.\* filename

 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
 ___

-- 
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] Problem with the installation of a module

2015-08-16 Thread Andrea De Michele
Aditya Mahajan adit...@umich.edu writes:

 On Sat, 15 Aug 2015, Andrea De Michele wrote:

 The problem seems to be in how context find the files path. As you suggested 
 I tried:

 ~ $ mtxrun --expand-var TEXMFLOCAL

 home/admich/texlive/texmf-local

 I think that the problem is here. It should be 
 /home/admich/texlive/texmf-local

 Not sure why the starting / is lost on your system. You can look in
 texmfcnf.lua in $TEXMF/web2c/. A simpler solution might be to set

 TEXMFLOCAL=/home/admich/texlive/texmf-local

 in your shell (.bashrc, etc.)

This work for me, 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
 ___

-- 
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] Problem with the installation of a module

2015-08-15 Thread Andrea De Michele
Aditya Mahajan adit...@umich.edu writes:

 On Fri, 14 Aug 2015, Andrea De Michele wrote:

 I tried to install the PocketDiary module but I had some problem.
 I follow the instruction at:

 http://wiki.contextgarden.net/Modules

 so first I copy the files in my texmf-local directory and after that I run:

 You are storing the files according the Tex Directory Structure, right?

Yes. The files are in following two directories.

/home/admich/texlive/texmf-local/tex/context/third/pocketdiary/
/home/admich/texlive/texmf-local/doc/context/third/pocketdiary/

After mktexlsr texdoc find the documentation of the module:

~ $ texdoc -l pocket
 1 
/home/admich/texlive/texmf-local/doc/context/third/pocketdiary/t-pocketdiary.pdf
 2 /home/admich/texlive/texmf-local/doc/context/third/pocketdiary/README.txt
Please enter the number of the file to view, anything else to skip: 


The problem seems to be in how context find the files path. As you suggested I 
tried:

~ $ mtxrun --expand-var TEXMFLOCAL

home/admich/texlive/texmf-local

I think that the problem is here. It should be /home/admich/texlive/texmf-local


 context --generate

 but context didn't find the new module.

 I use linux and I have installed texlive 2015 in my home directory, so my 
 texmf-local directory is /home/admich/texlive/texmf-local

 In the output of  context --generate I noticed the following lines:

 ...
 resolvers   | resolving | locating list of 
 'home/admich/texlive/texmf-local' (cached)
 resolvers   | methods | resolving, method 'locators', how 'uri', handler 
 'file', argument 'home/admich/texlive/texmf-local'
 resolvers   | files | file locator 'home/admich/texlive/texmf-local' not 
 found
 ...

 This seems not correct because is missing the initial / . For example the 
 following lines are:

 resolvers   | resolving | locating list of 'selfautoparent:texmf-dist' 
 (cached)
 resolvers   | methods | resolving, method 'locators', how 'uri', handler 
 'file', argument 'selfautoparent:texmf-dist'
 resolvers   | files | file locator 'selfautoparent:texmf-dist' found as 
 '/home/admich/texlive/2015/texmf-dist'
 resolvers   | resolving |
 ...

 with the right initial /

 kpathsea find the right $TEXMFLOCAL:

 ~$ kpsewhich -var-value TEXMFLOCAL
 /home/admich/texlive/texmf-local

 context (mkiv) does not use kpse (texmf.cnf) but uses the values
 stored it texmfcnf.lua. To check the value of TEXMFLOCAL use

 mtxrun --expand-var TEXMFLOCAL

 You can also try:

 context --trackers=resolvers.\* filename

 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
 ___

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

[NTG-context] Problem with the installation of a module

2015-08-14 Thread Andrea De Michele
I tried to install the PocketDiary module but I had some problem.
I follow the instruction at:

http://wiki.contextgarden.net/Modules

so first I copy the files in my texmf-local directory and after that I run:

 context --generate

but context didn't find the new module.

I use linux and I have installed texlive 2015 in my home directory, so my 
texmf-local directory is /home/admich/texlive/texmf-local

In the output of  context --generate I noticed the following lines:

...
resolvers   | resolving | locating list of 
'home/admich/texlive/texmf-local' (cached)
resolvers   | methods | resolving, method 'locators', how 'uri', handler 
'file', argument 'home/admich/texlive/texmf-local'
resolvers   | files | file locator 'home/admich/texlive/texmf-local' not 
found
...

This seems not correct because is missing the initial / . For example the 
following lines are:

resolvers   | resolving | locating list of 'selfautoparent:texmf-dist' 
(cached)
resolvers   | methods | resolving, method 'locators', how 'uri', handler 
'file', argument 'selfautoparent:texmf-dist'
resolvers   | files | file locator 'selfautoparent:texmf-dist' found as 
'/home/admich/texlive/2015/texmf-dist'
resolvers   | resolving |
...

with the right initial /

kpathsea find the right $TEXMFLOCAL:

~$ kpsewhich -var-value TEXMFLOCAL
/home/admich/texlive/texmf-local




-- 
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] siunitx feature in unit module

2015-03-03 Thread Andrea De Michele
Romain Diss romain.d...@yahoo.fr 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
___

[NTG-context] siunitx feature in unit module

2015-02-28 Thread Andrea De Michele
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}
\si[per-mode=symbol]{\metre\per\second} produce m/s
\si[per-mode=fraction]{\metre\per\second} produce \frac{m}{s}

have the unit module the same feature? If yes how can obtain the effect
(I didn't find nothing on the manual)?

Thank you for help
-- 
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
___