0

I've got this right now:
enter image description here

As you can see, the text does not occupy the whitespace above the left graph which makes it look very awkward.

It also has to work with multiple lines\sections\paragraphs etc.

I would like that space to be usable with by the text. Here is my MWE:

\documentclass{report}
\usepackage{fullpage}

\usepackage{pgf-umlsd}
\usepackage{wrapfig}
\usepackage{subfig}
\usepackage{lipsum}

\begin{document}
\begin{wrapfigure}{r}{10cm}
    \begin{center}
    \subfloat[Example one]{
        \begin{sequencediagram}
            \newthread{a}{Test}
            \newthread{b}{Test}

            \begin{sdblock}{Test}{}
                \mess{a}{Test}{b}
            \end{sdblock}
        \end{sequencediagram}
    }
    \subfloat[Example number two with a long caption.]{
        \begin{sequencediagram}
            \newthread{a}{Testing}
            \newthread{b}{Very much testing}

            \begin{sdblock}{Event}{}
                \mess{a}{Long test}{b}
            \end{sdblock}

            \begin{sdblock}{Event}{}
                \mess{a}{Long test}{b}
            \end{sdblock}

            \begin{sdblock}{Event}{}
                \mess{a}{Long test}{b}
            \end{sdblock}
        \end{sequencediagram}
    }
    \caption{My mice graphs.}   
    \end{center}
\end{wrapfigure}

\lipsum

\end{document}

Edit: specifying the height of the wrapfigure gives me this:

enter image description here

  • Welcome to TeX.SX! Try specifying the height of the wrapfigure (optional argument). – TeXnician Nov 12 '18 at 18:48
  • Did that, edited – Tvde1 Nov 12 '18 at 18:50
  • if I run the example as posted I get output not like either image you show, all the text on all three pages is in one narrow column t the left of the image – David Carlisle Nov 12 '18 at 20:23
  • That shouldn't be possible with LaTeX right? – Tvde1 Nov 12 '18 at 20:52
2

You can shape the paragraphs, which requires a bit of hand work, but less than involved in producing the tikz layout so perhaps an acceptable solution:

enter image description here

\documentclass{report}
\usepackage{fullpage}

\usepackage{pgf-umlsd}
\usepackage{wrapfig}
\usepackage{subfig}
\usepackage{capt-of}
\usepackage{lipsum}

\begin{document}



\def\sln{0pt .4\textwidth}
\def\mln{0pt .65\textwidth}
\def\lln{0pt \textwidth}


\begin{picture}(0,0)
\put(170,0){%
\begin{minipage}[t]{.5\textwidth}\expandafter\def\csname @captype\endcsname{figure}
    \begin{center}
    \subfloat[Example one]{
        \begin{sequencediagram}
            \newthread{a}{Test}
            \newthread{b}{Test}
            \begin{sdblock}{Test}{}
                \mess{a}{Test}{b}
            \end{sdblock}
        \end{sequencediagram}
    }
    \subfloat[Example number two with a long caption.]{
        \begin{sequencediagram}
            \newthread{a}{Testing}
            \newthread{b}{Very much testing}
%
            \begin{sdblock}{Event}{}
                \mess{a}{Long test}{b}
            \end{sdblock}
%
            \begin{sdblock}{Event}{}
                \mess{a}{Long test}{b}
            \end{sdblock}
%
            \begin{sdblock}{Event}{}
                \mess{a}{Long test}{b}
            \end{sdblock}
        \end{sequencediagram}
    }
    \caption{My mice graphs.}   
    \end{center}
\end{minipage}}%
\end{picture}

\parshape 12
\mln\mln\mln\mln\mln\mln\mln\mln\mln\mln\mln
\sln
\lipsum[1]

\parshape 1
\sln
\lipsum[2]

\lipsum[3]

\lipsum[4-7]

\end{document}
  • It works. But it's a shame there's so much hardcoding. I had to hardcode every \section's paragraph lengths again – Tvde1 Nov 13 '18 at 9:49

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.