Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Respect is a rational process -- McCoy, "The Galileo Seven", stardate 2822.3


computers / comp.text.tex / Re: tikz matrix customization and repeating macro within tikz

SubjectAuthor
* tikz matrix customization and repeating macro within tikzDave94705
`- Re: tikz matrix customization and repeating macro within tikzKevin Ryde

1
tikz matrix customization and repeating macro within tikz

<2864e47c-635d-4a17-b8a4-416e99ff180an@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=3641&group=comp.text.tex#3641

  copy link   Newsgroups: comp.text.tex
X-Received: by 2002:a37:7d06:: with SMTP id y6mr8760452qkc.472.1622296969064;
Sat, 29 May 2021 07:02:49 -0700 (PDT)
X-Received: by 2002:aed:3071:: with SMTP id 104mr7628980qte.119.1622296968860;
Sat, 29 May 2021 07:02:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.text.tex
Date: Sat, 29 May 2021 07:02:48 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=45.30.90.187; posting-account=TEWWXwoAAABVTlovvE5oUyiszPAiy7tz
NNTP-Posting-Host: 45.30.90.187
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2864e47c-635d-4a17-b8a4-416e99ff180an@googlegroups.com>
Subject: tikz matrix customization and repeating macro within tikz
From: david.jo...@gmail.com (Dave94705)
Injection-Date: Sat, 29 May 2021 14:02:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Dave94705 - Sat, 29 May 2021 14:02 UTC

There is very likely a much better way to do this, but I sure cannot figure it out.

I want to create a flow diagram and I am using the matrix function. But not all rows have the same width and not all columns have the same height. I set it up as a matrix and then added points around it.

In below example:

Is there a way to set up the starting matrix definitions of \node (A1) {A1} ... as a line by line macro so instead of 3 by 3, I have 3 calls to a macro with the first call defining the As, etc? I have tried (basic) looping but if nothing else the & throws things. I want a macro so I can generalize dimension and save typing.
The only way I seem to successfully get to points outside the matrix like AA1 and CC3 is using \coordinate for each point I want. \draw using +() at the starting point works but not at the ending point (++ is the same) see \draw[purple] (A1) -- (A3)+(0,0.75cm); which ignores the +(0,0.75cm).
\draw[green, yshift=0.25cm] (B1) -- (B3); ignores the yshift. If yshift worked it would solve my problem nicely.
\draw's line to a node seems to stop at the node boundary but coordinates made by adding to a node seems to be from the center of the node. Anyway to have \draw go to node's center?

Thanks for any help.

\documentclass{article}
\usepackage{tikz}

\begin{document}
% starting with manual page 332
\normalsize
\begin{tikzpicture}
\matrix[column sep=8mm,row sep=3mm]
{
\node (A1) {A1}; & \node (A2) {A2};& \node (A3) {A3};
\\
\node (B1) {B1}; & \node (B2) {B2};& \node (B3) {B3};
\\
\node (C1) {C1}; & \node (C2) {C2};& \node (C3) {C3};
\\
\node (D1) {}; & \node (D2) {};& \node (D3) {};
\\
};
\coordinate[yshift=1.0cm] (AA1) at (A1);
\coordinate[yshift=1.0cm] (AA3) at (A3);
\coordinate[yshift=-0.35cm] (CC1) at (C1);
\coordinate[yshift=-0.35cm] (CC3) at (C3);
\begin{scope}%[every path/.style=line]
\draw[red] (A1) -- (AA1) -- (AA3) -- (A3);
\draw[dotted] (A1) -- (A3)+(0,0.75cm);
%
\draw[blue, dashed] (B1)+(0,0.25cm)-- (B3);
\draw[green, yshift=0.25cm] (B1) -- (B3);
%
\draw[dotted, purple] (C1) -- (C3)+(0,-0.25cm);
\draw (CC1) -- (CC3);
% \draw[orange] (D1) -- (D3);
\end{scope}
\end{tikzpicture}
\end{document}

Re: tikz matrix customization and repeating macro within tikz

<87eedlby2i.fsf@blah.blah>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=3647&group=comp.text.tex#3647

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!aioe.org!fjyhYVen8i/J7G3tydKL4w.user.gioia.aioe.org.POSTED!not-for-mail
From: user42_k...@yahoo.downwithspam.com.au (Kevin Ryde)
Newsgroups: comp.text.tex
Subject: Re: tikz matrix customization and repeating macro within tikz
Date: Tue, 01 Jun 2021 21:53:41 +1000
Organization: Bah Humbug
Lines: 19
Message-ID: <87eedlby2i.fsf@blah.blah>
References: <2864e47c-635d-4a17-b8a4-416e99ff180an@googlegroups.com>
NNTP-Posting-Host: fjyhYVen8i/J7G3tydKL4w.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain
X-Complaints-To: abuse@aioe.org
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:jkPf/AfdiXKjp3osl7WN5VyBrX4=
X-Notice: Filtered by postfilter v. 0.9.2
 by: Kevin Ryde - Tue, 1 Jun 2021 11:53 UTC

Dave94705 <david.jobman.schwartz@gmail.com> writes:
>
> \draw[purple] (A1) -- (A3)+(0,0.75cm);

Yeah, no, that parses as a next coordinate. The calc library and
($(A3)+(0,0.75cm)$) might do what you want.

> \draw[green, yshift=0.25cm] (B1) -- (B3); ignores the yshift.

Can put in an individual coordinate like ([yshift=0.25cm] B1)

> \draw's line to a node seems to stop at the node boundary

Yes, and outer sep.

> but coordinates made by adding to a node seems to be from the
> center of the node. Anyway to have \draw go to node's center?

(B1.center) and there's other pre-defined anchor points in nodes.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor