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
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 -----------------------------------------------------------------
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]
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.
Is there any way to integrate a standalone tikz into context documents? Sort of like svg is handled through inkscape.
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 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 -----------------------------------------------------------------
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/
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
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
participants (4)
-
Aditya Mahajan
-
Hans Hagen
-
Martin Althoff
-
Ulrike Fischer