1

I have long messages in an msc diagram. I thought of splitting the message into two lines so they do not overlap. I tried parbox but that resulted in an error. How can I split text line in an msc message? The code and ouput are shown below.

\documentclass[10pt]{llncs}
\usepackage{underscore}
\usepackage{lipsum}
\usepackage[font=itshape]{quoting} 
\usepackage[title]{appendix} 
\usepackage{graphicx} 
\usepackage{textcomp} 
\usepackage{msc} 
\usepackage{xcolor}

\begin{document}

\begin{figure}[htb!] 
\[
\resizebox{\textwidth}{!}{
\centering
\setmsckeyword{} 
\drawframe{no} 
\hspace{-1cm}

\begin{msc}[small values, /msc/level height=0.6cm, /msc/label distance=0.5ex , /msc/first level height=0.75cm]{}
\setlength{\instwidth}{2.5\mscunit} 
\setlength{\instdist}{5\mscunit}

\declinst{A}{}{A}
\declinst{B}{}{B}
\declinst{C}{}{C}

\mess{ Long message1(......,A very long message goes here,......)} {A}{B}
\mess{Long message2(......,A very long message goes here,......)} {B}{C} 
\nextlevel

\end{msc}
} 
 \]
 \caption[caption]{Figure.} 
\end{figure}

\end{document}

enter image description here

1 Answer 1

1

Note to other users: this code is written for the development version of msc, available from http://satoss.uni.lu/software/mscpackage/. It will not work with the version of msc that is on CTAN.


You can use \mess[text width=3cm,align=center]{...

output of code

\documentclass{article}
\usepackage{msc}
\begin{document}

\begin{figure}[htb!] 
\centering
\setmsckeyword{} 
\drawframe{no} 
\begin{msc}[small values, /msc/level height=0.6cm, /msc/label distance=0.5ex , /msc/first level height=0.75cm]{}
\setlength{\instwidth}{1.8\mscunit} 
\setlength{\instdist}{3\mscunit}

\declinst{A}{}{A}
\declinst{B}{}{B}
\declinst{C}{}{C}

\mess[text width=3cm,align=center]{ Long message1(......,A very long message goes here,......)} {A}{B}
\mess[text width=3cm,align=center]{Long message2(......,A very long message goes here,......)} {B}{C} 
\nextlevel

\end{msc}
\caption[caption]{Figure.} 
\end{figure}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .