ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gavin <gavinpublic@comcast.net>
To: Hans Hagen <j.hagen@xs4all.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: TikZ in buffers: My struggle with \definestartstop
Date: Thu, 8 Jul 2021 18:03:35 -0600	[thread overview]
Message-ID: <51B026BB-F301-41DC-B899-D820DE1A832B@comcast.net> (raw)
In-Reply-To: <c8c5c197-8f6a-3989-abc5-30c85f5c331b@xs4all.nl>

Thanks Hans!

That works great. I understand it all and it is working in my book, so even better. I did not know you could \typsetbuffer[a,b,c]. I will be using that again.

In case anyone finds this in the future, trying to solve a similar issue, my final version is below, including my \marginTikZ command.

Gavin


\setuppapersize[letter]

\setuplayout[
  backspace=90pt, % Horizontal layout
  leftmargin=36pt, % 1/2 in
  leftmargindistance=9pt, % 3/8 in
  width=306pt, % 4 1/4 in
  rightmargindistance=27pt, % 3/8 in
  rightmargin=144pt,  % 2 in
]

\startbuffer[starttikz]
   \usemodule[tikz]% Lots of setup can go here!
   \startTEXpage
   \starttikzpicture
\stopbuffer

\startbuffer[stoptikz]
   \stoptikzpicture
   \stopTEXpage
\stopbuffer

\define[2]\marginTikZ{
  \startplacefigure[location=margin, reference=fig:#1, title={#2}]
    \typesetbuffer[starttikz,#1,stoptikz]
  \stopplacefigure
}

\starttext

\startbuffer[BlueCircle]
 \draw[thick,blue] (0,0) circle (2cm)node{Ti{\it k}Z!};
\stopbuffer

\marginTikZ{BlueCircle}{Ti{\it k}Z drew this blue circle\dots slowly.}

\startbuffer[RedCircle]
 \draw[thick,red] (0,0) circle (2cm)node{Ti{\it k}Z!};
\stopbuffer

\marginTikZ{RedCircle}{Ti{\it k}Z drew this red circle\dots slowly.}

Take a look at the blue circle in \in{figure}[fig:BlueCircle] and the red circle in \in{figure}[fig:RedCircle]

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

      reply	other threads:[~2021-07-09  0:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 16:35 [OT] TeXShop v4.66 adds support for new ConTeXt's syncing method Nicola
2021-07-08 16:48 ` Nicola
2021-07-08 17:55   ` TikZ in buffers: My struggle with \definestartstop Gavin
2021-07-08 21:26     ` Hans Hagen
2021-07-09  0:03       ` Gavin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51B026BB-F301-41DC-B899-D820DE1A832B@comcast.net \
    --to=gavinpublic@comcast.net \
    --cc=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).