1

I'm drawing a message exchange sequence with the msc package, and I have some problems with the \labeldist on the messages.

Here is the MWE :

\documentclass[border=2mm]{standalone}
\usepackage{graphicx}
\usepackage[table, usenames, dvipsnames]{xcolor}
\usepackage{pstricks, pst-node, pst-circ, pst-plot, pst-3dplot, pst-solides3d, pst-sigsys, pstricks-add, pst-eucl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}
\usepackage[locale=FR, per-mode=symbol, abbreviations]{siunitx}
\usepackage{msc}
\usepackage{graphicx}


\begin{document}

\renewcommand\msckeyword{}
\setlength{\instdist}{7cm} 
\setlength{\instwidth}{4cm}
\setlength{\envinstdist}{4.5cm}
%\setlength{\labeldist}{0.05cm}

\begin{msc}{}
    \declinst{client}{}{\textbf{Client}}
    \declinst{serveur}{}{\textbf{Server}}
        \mess{\rotatebox{-8}{small info}}{client}[.3]{serveur}[2]
        \action*{\textcolor{WildStrawberry}{Action !}}{serveur}
    \nextlevel[3]
        \mess{\rotatebox{4}{longer info to put here}}{serveur}[.3]{client}[1]
    \nextlevel[2]
\end{msc}

\end{document}

And it produces this :

MWE result

With the rotation of the label, the distances between the label and the arrow are bigger on the second message, and I can't solve it.

I've seen in the documentation that it's possible to adjust the \labeldist parameter, but I can't do it locally.

Has anybody an idea how to do it ? It should be really simple, but I can't find the solution...

2

use

    \mess{\rotatebox[origin=r]{4}{longer info to put here}}{serveur}[.3]{client}[1]
  • Thanks ! And any ideas to delete the frame around the picture ? – EisenHeim Sep 29 '15 at 14:23
  • 1
    write into the preamble after loading msc: \drawframe{no} – user2478 Sep 29 '15 at 14:30
  • I \include this drawing into my main.tex, and as I add pstricks lines on it, they don't appear at the same place on the main pdf. Have you any tracks ? Posting a MWE could be very long... – EisenHeim Sep 29 '15 at 14:46
  • I never used msc. So I have no idea how msc defines the coordinates. However you can use \rput(0,0){the msc image} or any other coordinates. – user2478 Sep 29 '15 at 14:49
  • Ah okay. But it's said in the doc that we can include PSTricks code within the \begin{msc}. When I compile the standalone it's OK, but not if I compile the main.tex... Maybe it's because of the width superior than the pagewidth... – EisenHeim Sep 29 '15 at 14:53
1

You can set \labeldist just before the command in question:

enter image description here

\documentclass[border=2mm]{standalone}
\usepackage{msc,graphicx,xcolor}

\begin{document}

\renewcommand\msckeyword{}
\setlength{\instdist}{7cm} 
\setlength{\instwidth}{4cm}
\setlength{\envinstdist}{4.5cm}

\begin{msc}{}
  \declinst{client}{}{\textbf{Client}}
  \declinst{serveur}{}{\textbf{Server}}
    \mess{\rotatebox{-8}{small info}}{client}[.3]{serveur}[2]
    \action*{\textcolor{red!80}{Action !}}{serveur}
  \nextlevel[3]
    \setlength{\labeldist}{-.5mm}
    \mess{\rotatebox{4}{longer info to put here}}{serveur}[.3]{client}[1]
  \nextlevel[2]
\end{msc}

\end{document}

One could also create this drawing using `pstricks alone.

  • Thanks, but herbert's solution seem less tricky for me, although it isn't a direct msc option. – EisenHeim Sep 29 '15 at 14:24

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.