I am reproducing the following figure in TikZ:
The upper right '}' curly brace and its full label is produced by the TikZ code that looks like:
\tikzstyle{ssbrace} = [decorate, decoration = {brace, amplitude = 6pt}, xshift = 8pt]
\tikzstyle{ssbracemath} = [midway, anchor = west, xshift = 4pt]
\draw [ssbrace] (\xvrr,\yGt) -- (\xvrr,\yPb)
node [ssbracemath] (upperss) {$\in \mathbb{S}_d \oplus 0_{n_\text{sl}}$};
where \xvrr
, \yGt
, and yPb
are macros that expand to strings such as e.g. 0.5/2+0.85/2+10pt/2-3pt
, meaning: sum half the unit width for the figure -with- half of 85% of the unit width of the figure -with- half of 10 points -and then subtract- 3 points. The complex syntax is because the various components of the string come from more primitive macros that define numerous adjustable parameters. Assume
\newcommand{\xvrr}{0.5/2+0.85/2+10pt/2-3pt}
\newcommand{\yGt}{0.1+10pt}
\newcommand{\yBp}{0.5+10pt}
\newcommand{\yyPc}{1+0.1+10pt}
\newcommand{\eqmarg}{2pt}
for sake of the example.
What I would then like to do is render the \mathbb{S}_{n_\text{P}}
"S" part of the lower label so that its x center is equal to the x center of the upper label (node upperss
) and with a parameteric y coordinate of \yyPc
. That is,
\draw (upperss.center,\yyPc) node [anchor=center] (lowerss) {$\mathbb{S}_{n_\text{P}}$};
although the above raises the error "Package PGF Math Error: Unknown function `upperss' (in 'upperss.center'). \draw (upperss.center,\yyPc)" among others, hence my attempts at intuiting TikZ syntax have evidently failed.
With the lowerss
node in place, I'd finally like to render the 'in' (\in
) for the lower label centered between the rightmost extent of the lower brace and the leftmost extent of lowerss
. For this, I attach an empty node named lowerssbrace
to the lower brace, and then invoke
\draw (lowerssbrace.east/2+lowerss.west/2,\yyPc) node [anchor=center] {$\in$};
I don't know whether this will work either. In fact, my knowledge of what permutations of which kinds of coordinate arithmetic TikZ supports is limited to "It seems to understand what both (1/2+1/2,1-1/2)
and (lowerss.center)
mean as coordinates." Whether or not it can mix relative and absolute dimensions, mix named coordinates and dimensions, or perform basic arithmetic such as lowerssbrace.east/2
: I have no idea, although my hopes are high.
Note also that the rightmost labeled arrow relies on coordinates (upperss.center,upperss.south+\eqmarg)
and (upperss.center,lowerss.north-\eqmarg)
, hence I also have cases where named coordinates are summed with absolute dimensions.
Everything else in the figure is working as expected.
Is what I'm trying to accomplish here possible to do in TikZ? If so, what is the required syntax?
Many thanks for any assistance. You will have saved me days of spelunking through documentation, assuming this is even possible.
matrix
andpositioning
libraries. for details readtikz & pgf
manual. request "do-it-for-me here aren't very welcome. show us what you try so far.tikz-matrix
.let
operation, see chapter 14.15 in the TikZ manual, which lets you access the x- and y-components of a coordinate. Note also that when you mix numbers and units, the unitless numbers are seen aspt
. Try for example\tikz \draw [->] (0.5,0) -- (0.5+10pt,0);
which doesn't do what it seems you think it does.