ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* tikz problem with fontsize
@ 2019-08-31 19:44 Martin Althoff
  2019-08-31 20:00 ` Hans Hagen
  2019-09-01 15:40 ` Aditya Mahajan
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Althoff @ 2019-08-31 19:44 UTC (permalink / raw)
  To: ntg-context

Hello all, I am trying to set the fontsize in a tikz image and that is failing. Strangely
at the \node line with : ! Undefined control sequence.

As the MWE stands now, it will fail. The now commented line works.

main context file: /usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
current version: 2019.08.24 22:42

The fontsize statement work in kTikz.

What to do? Are there other ways to change font size in the Context TikZ?

Thanks for any input!

Martin


\usemodule[tikz]
\starttext

\starttikzpicture

\tikzstyle{label}=[minimum size=30mm,line
width=2mm,draw=blue!50,align=center,font=\fontsize{60}{60}\selectfont]
%\tikzstyle{label}=[minimum size=30mm,line width=2mm,draw=blue!50,align=center]

\node[label]  at  (1,1)  {88} ;
\stoptikzpicture
\stoptext

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tikz problem with fontsize
  2019-08-31 19:44 tikz problem with fontsize Martin Althoff
@ 2019-08-31 20:00 ` Hans Hagen
  2019-09-01  7:21   ` Martin Althoff
  2019-09-01 15:40 ` Aditya Mahajan
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2019-08-31 20:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Martin Althoff

On 8/31/2019 9:44 PM, Martin Althoff wrote:
> Hello all, I am trying to set the fontsize in a tikz image and that is failing. Strangely
> at the \node line with : ! Undefined control sequence.
> 
> As the MWE stands now, it will fail. The now commented line works.
> 
> main context file: /usr/local/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
> current version: 2019.08.24 22:42
> 
> The fontsize statement work in kTikz.
> 
> What to do? Are there other ways to change font size in the Context TikZ?
> 
> Thanks for any input!
> 
> Martin
> 
> 
> \usemodule[tikz]
> \starttext
> 
> \starttikzpicture
> 
> \tikzstyle{label}=[minimum size=30mm,line
> width=2mm,draw=blue!50,align=center,font=\fontsize{60}{60}\selectfont]
> %\tikzstyle{label}=[minimum size=30mm,line width=2mm,draw=blue!50,align=center]
> 
> \node[label]  at  (1,1)  {88} ;
> \stoptikzpicture
> \stoptext
just use context font commands, like

\tikzstyle{label}=[minimum size=30mm,line 
width=2mm,draw=blue!50,align=center,
font=\bfx]

but i think you can also do more, like

\tikzstyle{label}=[minimum size=30mm,line 
width=2mm,draw=blue!50,align=center,
font=\bfx\red\setstrut]

and such

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tikz problem with fontsize
  2019-08-31 20:00 ` Hans Hagen
@ 2019-09-01  7:21   ` Martin Althoff
  2019-09-01 11:05     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Althoff @ 2019-09-01  7:21 UTC (permalink / raw)
  To: ntg-context

Hi Hans, thanks for this. Yes, that works. 

Am I right to assume that Context does not have a full tikz engine in the background due
to the module implementation? For example, the \coordinate command is unknown as well.

Is there any way to integrate a standalone tikz into context documents? Sort of like svg
is handled through inkscape.

Martin


> just use context font commands, like
> 
> \tikzstyle{label}=[minimum size=30mm,line 
> width=2mm,draw=blue!50,align=center,
> font=\bfx]
> 
> but i think you can also do more, like
> 
> \tikzstyle{label}=[minimum size=30mm,line 
> width=2mm,draw=blue!50,align=center,
> font=\bfx\red\setstrut]
> 
> 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tikz problem with fontsize
  2019-09-01  7:21   ` Martin Althoff
@ 2019-09-01 11:05     ` Hans Hagen
  2019-09-01 14:25       ` Ulrike Fischer
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2019-09-01 11:05 UTC (permalink / raw)
  To: ntg-context@ntg.nl >> mailing list for ConTeXt users

On 9/1/2019 9:21 AM, Martin Althoff wrote:
> Hi Hans, thanks for this. Yes, that works.
> 
> Am I right to assume that Context does not have a full tikz engine in the background due
> to the module implementation? For example, the \coordinate command is unknown as well.

tikz is kind of generic so it assumes that you use the macro package 
font system (i suppose most examples in the manuals use latex commands 
for that)

what is \coordinate supposed to do: if it doesn't work it's not a tikz 
command i think

> Is there any way to integrate a standalone tikz into context documents? Sort of like svg
> is handled through inkscape.
probably but it defeats the idea of having a consisten approachg to fonts

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tikz problem with fontsize
  2019-09-01 11:05     ` Hans Hagen
@ 2019-09-01 14:25       ` Ulrike Fischer
  2019-09-02  4:49         ` Martin Althoff
  0 siblings, 1 reply; 7+ messages in thread
From: Ulrike Fischer @ 2019-09-01 14:25 UTC (permalink / raw)
  To: ntg-context

Am Sun, 1 Sep 2019 13:05:10 +0200 schrieb Hans Hagen:

> what is \coordinate supposed to do:

it stores a coordinate under a name. And it works fine for me (I
would have been quite surprised if not):

\usemodule[tikz]
\starttext

\starttikzpicture
\coordinate (a) at (1,1);
\coordinate (b) at (2,2);
\draw[red,<->](a)--(b);
\stoptikzpicture
\stoptext


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tikz problem with fontsize
  2019-08-31 19:44 tikz problem with fontsize Martin Althoff
  2019-08-31 20:00 ` Hans Hagen
@ 2019-09-01 15:40 ` Aditya Mahajan
  1 sibling, 0 replies; 7+ messages in thread
From: Aditya Mahajan @ 2019-09-01 15:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 31 Aug 2019, Martin Althoff wrote:

> What to do? Are there other ways to change font size in the Context TikZ?

The equivalent of LaTeX's \selectfont{}{} in ConTeXt is 
\switchtobodyfont[...].

See https://wiki.contextgarden.net/Font_Switching

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: tikz problem with fontsize
  2019-09-01 14:25       ` Ulrike Fischer
@ 2019-09-02  4:49         ` Martin Althoff
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Althoff @ 2019-09-02  4:49 UTC (permalink / raw)
  To: ntg-context

Thanks for all the replies.

@Ulrike: You are right, this example you give works for me too. Me experiencing it not
working must have come out of some strange constellation.

@Aditya: Yes, it does. But {} are needed: 

\tikzstyle{label}=[font={\switchtobodyfont[20pt] \red}]


@Hagen: Yes, most examples do use Latex commands. 

What confused me, was/is which commands are from the macro package i.e. Latex or Context
and which are actually Tikz. Integrating font handling makes sense. That is why the idea
of using Context font commands did not occur to me. 

With this in mind, I'll go back to some slightly different syntax used in Tikz 3.1.4
manual and see what happens.

Thanks, Martin

On Sun, 2019-09-01 at 16:25 +0200, Ulrike Fischer wrote:
> Am Sun, 1 Sep 2019 13:05:10 +0200 schrieb Hans Hagen:
> 
> > what is \coordinate supposed to do:
> 
> it stores a coordinate under a name. And it works fine for me (I
> would have been quite surprised if not):
> 
> \usemodule[tikz]
> \starttext
> 
> \starttikzpicture
> \coordinate (a) at (1,1);
> \coordinate (b) at (2,2);
> \draw[red,<->](a)--(b);
> \stoptikzpicture
> \stoptext
> 
> 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-09-02  4:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-31 19:44 tikz problem with fontsize Martin Althoff
2019-08-31 20:00 ` Hans Hagen
2019-09-01  7:21   ` Martin Althoff
2019-09-01 11:05     ` Hans Hagen
2019-09-01 14:25       ` Ulrike Fischer
2019-09-02  4:49         ` Martin Althoff
2019-09-01 15:40 ` Aditya Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).