Re: [NTG-context] circuitikz meters

2019-10-01 Thread Hans Hagen

On 10/1/2019 7:42 PM, Martin Althoff wrote:

Thanks for that Henri. I didn't expect a simple thing like that. As I had some 
similar
"glitches" before, I'll have a look through the module.


If there are more such commands we can add them to the tikz module 
loader. Just collect them.



All the best, Martin

On Tue, 2019-10-01 at 14:03 +1300, Henri Menke wrote:

Circuitikz uses \textbf inside, which is a LaTeX macro.  Unfortunately, this is
hardcoded within the ammeter and voltmeter nodes, so you can't easily change
it.  Instead you can simply provide a macro that does the correct thing.

\usemodule[circuitikz]
\let\textbf\bold % <---
\starttext
\starttikzpicture
\draw (0,0)to[ammeter, t=A, i=$i$] ++(3,0);
\draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ;
\draw (0,2) to[voltmeter, l=$U$] (++3,2);
\stoptikzpicture
\stoptext

Cheers, Henri



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


Re: [NTG-context] circuitikz meters

2019-10-01 Thread Martin Althoff
Thanks for that Henri. I didn't expect a simple thing like that. As I had some 
similar
"glitches" before, I'll have a look through the module.

All the best, Martin

On Tue, 2019-10-01 at 14:03 +1300, Henri Menke wrote:
> Circuitikz uses \textbf inside, which is a LaTeX macro.  Unfortunately, this 
> is
> hardcoded within the ammeter and voltmeter nodes, so you can't easily change
> it.  Instead you can simply provide a macro that does the correct thing.
> 
> \usemodule[circuitikz]
> \let\textbf\bold % <---
> \starttext
> \starttikzpicture
> \draw (0,0)to[ammeter, t=A, i=$i$] ++(3,0);
> \draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ;
> \draw (0,2) to[voltmeter, l=$U$] (++3,2);
> \stoptikzpicture
> \stoptext
> 
> Cheers, Henri
> 

___
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] circuitikz meters

2019-09-30 Thread Henri Menke
Circuitikz uses \textbf inside, which is a LaTeX macro.  Unfortunately, this is
hardcoded within the ammeter and voltmeter nodes, so you can't easily change
it.  Instead you can simply provide a macro that does the correct thing.

\usemodule[circuitikz]
\let\textbf\bold % <---
\starttext
\starttikzpicture
\draw (0,0)to[ammeter, t=A, i=$i$] ++(3,0);
\draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ;
\draw (0,2) to[voltmeter, l=$U$] (++3,2);
\stoptikzpicture
\stoptext

Cheers, Henri

On 10/1/19 5:07 AM, Martin Althoff wrote:
> Hello ...
> 
> I am drawing some simple circuits for an electro-physics class I am teaching 
> using
> circuitikz. Using meters gives some effects I don't quite understand.
> 
> The MWE works as shown. The commented lines fail with "Undefined control 
> sequence". If I
> put the same 3 lines into Latex (via Texstudio on Linux), just the opposite 
> happens. The
> line with rmeter fails, the other two work. 
> 
> Why the difference? Some version issue? The "circuitikz manual version 
> 0.9.4.pdf" shows
> all 3 types of meters as choice. 
> 
> Actually I would prefer to use the "ammeter" and "voltmeter" within Context.
> 
> Thanks for any pointers.
> 
> Greetings, Martin
> 
> \usemodule[circuitikz]
> \starttext
> \starttikzpicture
> %\draw (0,0)to[ammeter, t=A, i=$i$] ++(3,0);
> \draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ;
> %\draw (0,2) to[voltmeter, l=$U$] (++3,2);
> \stoptikzpicture
> \stoptext
> 
> 
> Latex MWE, works as shown
> 
> \documentclass{article}
> \usepackage{circuitikz}
> \begin{document}
> \begin{circuitikz}
>   \draw (0,0) to[ammeter, t=A, i=$i$] ++(3,0);
>   %\draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ;
>   \draw (0,2) to[voltmeter, l=$U$] (++3,2);
> \end{circuitikz}
> \end{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
> ___
> 
___
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] circuitikz meters

2019-09-30 Thread Martin Althoff
Hello ...

I am drawing some simple circuits for an electro-physics class I am teaching 
using
circuitikz. Using meters gives some effects I don't quite understand.

The MWE works as shown. The commented lines fail with "Undefined control 
sequence". If I
put the same 3 lines into Latex (via Texstudio on Linux), just the opposite 
happens. The
line with rmeter fails, the other two work. 

Why the difference? Some version issue? The "circuitikz manual version 
0.9.4.pdf" shows
all 3 types of meters as choice. 

Actually I would prefer to use the "ammeter" and "voltmeter" within Context.

Thanks for any pointers.

Greetings, Martin

\usemodule[circuitikz]
\starttext
\starttikzpicture
%\draw (0,0)to[ammeter, t=A, i=$i$] ++(3,0);
\draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ;
%\draw (0,2) to[voltmeter, l=$U$] (++3,2);
\stoptikzpicture
\stoptext


Latex MWE, works as shown

\documentclass{article}
\usepackage{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) to[ammeter, t=A, i=$i$] ++(3,0);
%\draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ;
\draw (0,2) to[voltmeter, l=$U$] (++3,2);
\end{circuitikz}
\end{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
___