我正在使用 msc 包生成消息序列图,下面是文档。我想用两行写评论,因为在我的页面上一行写不下。我试过了,\newline
但没有成功。我谈论的评论:
\msccomment[position]{text}{instname}
我怎样才能强制对两行进行注释?
\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}
输出如下:
答案1
\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}