2

I am using msc package to generate message sequence charts, here is documentation. I want to make a comment in 2 lines, because it does not fit in one line on my page. I tried \newline but it didn't work. Comments I am talking about:

\msccomment[position]{text}{instname}

How can I force comment on 2 lines?

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{eurosym}
\usepackage{wasysym}
\usepackage{todonotes}
\usepackage{geometry}
\usepackage{enumitem}
\usepackage{ulem}
\usepackage{msc}
\usepackage[parfill]{parskip}
\title{aaa}
\author{aaa }

\begin{document}
\normalsize
\maketitle
\tableofcontents
\newpage
\subsection{whatever}
\begin{center}
\begin{msc}{diagram}
\setlength{\instdist}{9cm}
\setlength{\envinstdist}{2\envinstdist}
\declinst{dd}{}{DD}
\declinst{ff}{}{FF}
\nextlevel[2]
\mess{something}{dd}{ff}
\msccomment[r]{my very long comment is here}{ff}
\end{msc}
\end{center}
\end{document}

Output is like this: enter image description here

7
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – jens_bo
    Dec 5, 2014 at 12:59
  • @jens_bo thank you, done. I am not sure which packages are needed to compile this, so I'll just leave all of them. I compile it with Xelatex. Dec 5, 2014 at 13:09
  • If you are using xelatex you should definitely not be using inputenc, and probably not fontenc either Dec 5, 2014 at 14:51
  • @DavidCarlisle but thing is, I had all these packages before and now I need to make sequence diagram, and this msc package requires Xelatex.. I cannot produce pdf with pdflatex. Dec 5, 2014 at 16:46
  • well remove inputenc (with 2014 latex it does nothing with xetex, with older ones it would mess your document up completely) you can just about get away with using classic tex fonts and T1 encoding if you only have ascii input not acented latters. as far as I can see the only dependency is pstrics so it doesn't need xetex you could use latex/dvips or even probably pdflatex with pdf-auto-pst or whatever it's called to run pstricks in pdflatex Dec 5, 2014 at 16:51

1 Answer 1

2
\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{msc}
\usepackage[parfill]{parskip}
\title{aaa}
\author{aaa }

\begin{document}
\normalsize
\maketitle
\tableofcontents
\newpage
\subsection{whatever}
\begin{center}
\begin{msc}{diagram}
\setlength{\instdist}{9cm}
\setlength{\envinstdist}{2\envinstdist}
\declinst{dd}{}{DD}
\declinst{ff}{}{FF}
\nextlevel[2]
\mess{something}{dd}{ff}

\msccomment[r]{\begin{tabular}[t]{@{}l@{}}
my very\\long\\ comment\\ is here\end{tabular}}{ff}
\end{msc}
\end{center}
\end{document}
0

You must log in to answer this question.

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