2

I haven't found an answer that quite fits my situation. I need to link two rectangles, with a curved arrow, passing through the bottom right of a third rectangle, avoiding the text.

I'm using a university-specific document type, so hopefully the below MWE is okay using a normal document style.

 \documentclass[a4paper,10pt]{article}
 \usepackage[english]{babel}
 \usepackage{amsmath,amsthm}
 \usepackage{amsfonts}
 \usepackage[a4paper,layout=a4paper,
        bindingoffset=4cm,left=0cm,right=2cm,
        head=2.5cm, bmargin=2cm]{geometry}
 \usepackage{microtype} 
 \usepackage{verbatim}
 \usepackage{graphicx}
 \usepackage{url}  
 \usepackage[round]{natbib} 
 \usepackage{listings}
 \usepackage{booktabs}
 \usepackage{multirow} 
 \RequirePackage[l2tabu, orthodox]{nag}
 \usepackage{tikz} 
 \usetikzlibrary{arrows, shapes, chains, fit, backgrounds, calc, decorations.pathreplacing, matrix}
 \usepackage{hyperref}
 \usepackage{cleveref} 
 \usepackage[flushleft]{threeparttable}
 \usepackage[inline, shortlabels]{enumitem} 
 \usepackage{tikzlings}

\begin{document}

\begin{figure}[htbp]
\centering
\begin{tikzpicture}[every node/.style=draw, align=center, arrow/.style={thick, -stealth}]
\node[rectangle, fill=white] (PSRW) {One \\ two three \\ four five \\ six};
\node [right, single arrow, inner sep = 10pt, minimum height=1cm, rotate=-45, above left = of PSRW, xshift=1cm, yshift=-.3cm] (NW) {};
\cat[scale=0.6, above right = of PSRW, xshift=10cm, yshift=0cm] (ACat) {};
\mouse[scale=0.5, above right = of PSRW, xshift=13.5cm, yshift=0cm] (AMouse) {};

\node[draw=none, text width=2cm, above right = of PSRW, xshift = 6cm, yshift=-2.5cm] (Imp) {Seven \\ Eight \\ Nine \\ Ten \\ Eleven};

\node[draw=none, text width=2.5cm, below = 3cm of PSRW] (SC) {Twelve \\ Thirteen};
% lines here omitted for brevity
 \node[draw=none, text width=1cm, above right = of SC, xshift=1cm, yshift=-.8cm] (TI) {Twelve, \\ thirteen};
   \end{tikzpicture}
\caption{Horrible part diagram of hand drawn one}
\label{fig:ThisDiagramIsDrivingMeToDrink}
\end{figure}
\end{document}

The problem is that I need to draw an arrow that goes from the left of the mice, through the bottom right of the PSRW rectangle, and attaches to the north west of the TI box. I would like to use a coordinate system relative to the internal bottom right of the PRSW box. I think that perhaps my supervisors won't like my little images, so that detail there may shift and I don't want to rewrite a bunch of coordinates to deal with any shifting.

I tried:

   \draw[arrow] ([xshift=-3cm]Imp.west) to [bend right, looseness=2] (TI.west);

but it doesn't pass through the PSRW box: My unsuccessful attempt to draw the curved arrow

I've seen answers based on relative coordinates to the underlying geometry, but none based on relative coordinates to polygons that may shift position.

Perhaps the closest answer I have seen is for the opposite problem so that the curved lines are outside the polygons. The other answers tend to be like this one, which are linking two points directly with a curve.

I can't show the actual (handwritten) diagram that I am trying to replicate due to academic paywall. But if any of you have access to Peter Checkland's work on soft systems methodology, I'm trying to replicate his two-stream diagram using Tikz.

Because of the complexity of the diagram, and my ongoing need to adjust parts of it to fit on the page, I have to place the polygons before I place the arrows.

3

Meow. You can draw a smooth plot through these coordinates.

\draw[thick,-stealth] plot[smooth] coordinates 
    {([yshift=3mm,xshift=-1mm]tikzlings.south west) ([xshift=-1mm,yshift=1mm]PSRW.south east) (TI.north west)};

Full code:

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{shapes.arrows,positioning}

\usepackage{tikzlings}
\begin{document}
\begin{tikzpicture}[every node/.style=draw, align=center, arrow/.style={thick, -stealth}]
 \node[rectangle, fill=white] (PSRW) {One \\ two three \\ four five \\ six};
 \node[single arrow, inner sep = 10pt, minimum height=1cm, rotate=-45, above
    left =9mm and 4mm of PSRW.north west,anchor=north] (NW) {};
 \begin{scope}[local bounding box=tikzlings]
  \cat[scale=0.6, above right = of PSRW, xshift=10cm, yshift=0cm] (ACat) {};
  \mouse[scale=0.5, above right = of PSRW, xshift=13.5cm, yshift=0cm] (AMouse) {};
 \end{scope} 
 \node[draw=none, text width=2cm, above right = of PSRW, xshift = 6cm, yshift=-2.5cm] (Imp) {Seven \\ Eight \\ Nine \\ Ten \\ Eleven};
 \node[draw=none, text width=2.5cm, below = 3cm of PSRW] (SC) {Twelve \\ Thirteen};
 \node[draw=none, text width=1cm, above right = of SC, xshift=1cm, yshift=-.8cm] (TI) {Twelve, \\ thirteen};
 \draw[thick,-stealth] plot[smooth] coordinates 
    {([yshift=3mm,xshift=-1mm]tikzlings.south west) ([xshift=-1mm,yshift=1mm]PSRW.south east) (TI.north west)};
 \end{tikzpicture}
\end{document}

enter image description here

3
  • LOL, apt username. How do I make that curve pass slightly inside the PSRW box, so xshift and yshift relate to PSRW.south east? Do I use the same shift logic as for the tikzlings?
    – Michelle
    Jan 15 '20 at 9:24
  • 1
    @Michelle E.g. \draw[thick,-stealth] plot[smooth] coordinates {([yshift=3mm,xshift=-1mm]tikzlings.south west) ([xshift=-1mm,yshift=1mm]PSRW.south east) (TI.north west)}; (but now this makes the impression that we cats cut the corners. ;-)
    – user194703
    Jan 15 '20 at 9:26
  • haha good one meow
    – js bibra
    Jan 16 '20 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.