1

I am trying to draw a message sequence chart using LaTex. Currently I have some problems with a long action. How can I make it to linebreak automatically?

This is the part of the MSC (before asking, I have included the msc package and it compiles well)

\newcommand\setmscoptions{\setlength{\instdist}{5cm}\setlength{\levelheight}{1.5 \levelheight}\setlength{\instwidth}{3cm}}

\setmscoptions
\begin{msc}{Sequence Chart}
\declinst{A}{}{A}
\declinst{B}{}{B}
\declinst{C}{}{C}

\action*{This is a very log action that does not fit on one line}{B}
\end{msc}
1

Putting the text in a \parbox works fine here.

output of code

\documentclass{article}
\usepackage{msc}
\newcommand\setmscoptions{%
  \setlength{\instdist}{1cm}% % reduced from 5cm
  \setlength{\levelheight}{1.5 \levelheight}%
  \setlength{\instwidth}{3cm}}

\begin{document}   

\setmscoptions
\begin{msc}{Sequence Chart}
\declinst{A}{}{A}
\declinst{B}{}{B}
\declinst{C}{}{C}

\action*{\parbox{3cm}{This is a very long action that does not fit on one line}}{B}
\end{msc}
\end{document}

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.