1

As part of my Tikz diagram, partly made of small orange squares, I want a title phrase including the orange square at end of it. I must be missing the "node" concept because the code below doesn't work - the phrase "all men with haplotype" over-writes the orange square instead of prefixing it.

Can someone kindly explain
1) How can I do what I want?
2) What is the explanation for the behavior I see?
3) Suppose I wanted an explanatory phrase with an colored square or circle, or two of them, interspersed in the text. Is there a simple way to do that?

\begin{tikzpicture}[
rect/.style={inner sep=0pt,minimum size=2mm,draw,rectangle},
alive/.style={fill=orange,draw}]
%% IBS enclosure for rectangle haplotype
\draw (0,0) rectangle (6,5);
\node[rect,alive,right](title) at (5,4.5) {};
\node[left of=title] {all men with haplotype};
\end{tikzpicture}
  • For 1) and 2): http://tex.stackexchange.com/questions/9386/difference-between-right-of-and-right-of-in-pgf-tikz – Torbjørn T. Aug 27 '13 at 05:02
  • For (3), are inline tikz shapes suitable? See here (slide 3), and this answer for baseline alignment. – simont Aug 27 '13 at 05:19
  • @Torb - thanks, that explains it. Is there a way I mark this Q as answered? – Charles Brenner Aug 27 '13 at 05:28
  • @simont - I suppose the idea is to string together nodes each representing a sentence fragment or a symbol, but I don't find the slide you mean. In particular the slide literally numbered 3 is blank. – Charles Brenner Aug 27 '13 at 05:29
  • Questions that are a repeat of previous questions are usually closed as duplicate. However, your third question is different, so that is perhaps not entirely appropriate. It's a little bit up to you I think, if you like we could close it as a duplicate, or you could edit the question to only be about the third issue. – Torbjørn T. Aug 27 '13 at 06:18
  • I'm happy to have it closed. – Charles Brenner Aug 27 '13 at 14:52

0 Answers0