(The lines are not meant to be dashed. I'm using unicode box drawing characters, but apparently the font used by this site makes the drawing look dashed.)
┌──────┐ ┌────┐ ┌───────┐ ┌───┐ ┌────┐ ┌───────┐
│ some ├─┤ or ├─┤ a lot ├─┤ ├─┤ of ├─┤ words │
├──────┤ ├────┤ ├───────┤ ├───┤ ├────┤ ├───────┤
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ even │ │ │ │ │ │ │
│ foo │ │ x │ │ multi │ │ │ │ │ │ │
│ │ │ │ │ line │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
└──────┘ └────┘ └───────┘ └───┘ └────┘ └───────┘
Calling it a graph seems a bit overkill.
I think I still remember how positioning works, but I'm a bit rusty on TikZ overall, and at the moment I don't see how I can make this drawing given the following requirements:
- Text in the upper boxes is not multiline, so the upper boxes are all the same fixed height.
- Text in the lower boxes can be multiline; I'm ok with manually putting
\\, but an automatic line break would be preferrable. - The lower boxes have all the height of the one of them that requires the most, based on its content.
- Each lower box has the same width as the corresponding upper box; in a way it's just one box split in 2.
- The lines connecting the boxes have all the same length and are vertically in the middle of the upper boxes.
- The width of the boxes is determined by the content in the upper boxes.
- The whole drawing spans the whole textwidth.
(The assumption that the page is wide enough if made.)
Note: Unfortunately I've not given enough time to my brain to think before posting the question, so I misdesigned one of the requirements. The following 2 points
- The width of the boxes is determined by the content in the upper boxes.
- Text in the lower boxes can be multiline; I'm ok with manually putting
\\, but an automatic line break would be preferrable.
should have actually been
- The width of the boxes is determined by the content in the
upperlower boxes. - Text in the lower boxes can be manually made multiline, e.g. via explicit
\\or similar;I'm ok with manually putting\\, but an automatic line break would be preferrable.
So I have misguided the answers, which are all great, by the way.
Therefore I've upvoted all of them, but I'll accept the one that gives the best result according to what I wanted to achieve. I apologize for the mistake.




