2

I have a tex code, where I try to generate some simple flows. I compile it like this:

  1. latex toc.tex
  2. dvips toc.dvi
  3. pstopdf toc.ps

The output I got:

enter image description here

And I would like to get rid of the msc IJS_{NK, dec/enc} text in the upper left corner, or at least move it somewhere else.

My code:

\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{tkz-base,tkz-fct}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{amsmath}
\usepackage{msc}
\begin{document}

\begin{figure*}[!h]
\center
\resizebox{12cm}{!} {
\begin{msc}{$IJS_{NK, dec/enc}$}
\small
\setlength{\instwidth}{1.7 cm}
\setlength{\instdist}{4.3 cm}
\setlength{\bottomfootdist}{0.2 cm}
%\setlength{\instwidth}{2 cm}
%\setlength{\instdist}{3.75 cm}
\setlength{\envinstdist}{1.2 cm}
\setlength{\topheaddist}{0.5 cm}
\instfoot

\declinst{I}{\scriptsize new node}{$I$} 
\declinst{R}{\scriptsize neighbour node}{$R$}
\declinst{J1k-1}{\scriptsize intermediate nodes}{$J_{1:k-1}$}
\declinst{Jk}{\scriptsize \:\: intermediate node}{$J_{k}$}
\declinst{S}{\scriptsize Sink}{$S$}

% left to right messages
\mess{$m_1 = \{n_I, I, R\}_{K_{DH}(I,S)}$}{I}{R}
\nextlevel
\mess{$\{n_R, m_1\}_{NK}$}{R}{J1k-1}
\nextlevel
\mess{$\{n_{J_{k-1}}, ..., n_{J_1}, n_R, m_1\}_{NK}$}{J1k-1}{Jk}
\nextlevel
\mess{$\{n_{J_k}, ..., n_{J_1}, n_R, m_1\}_{NK}$}{Jk}{S}
\nextlevel

% right to left messages
\nextlevel
\mess{$\{n_{J_k}, ..., n_{J_1}, n_R, m_2\}_{NK}$}{S}{Jk}
\nextlevel
\mess{$\{n_{J_{k-1}}, ..., n_{J_1}, n_R, m_2\}_{NK}$}{Jk}{J1k-1}
\nextlevel
\mess{$\{n_R, m_2\}_{NK}$}{J1k-1}{R}
\nextlevel
\mess{$m_3$}{R}{I}
%\nextlevel
\end{msc}
}
\fbox{
\begin{minipage}{11.5 cm}
$m_2 = \{pk(I), \{n_I, I, R, S\}_{K_{DH}(I,S)}\}_{K_{DH}(R,S)}$\\
$m_3 = \{K(R,I), \{n_I, I, R, S\}_{K_{DH}(I,S)} \}_{pk(I)}$
\end{minipage} 
}
\caption{$IJS_{NK, dec/enc}$: Proof by Induction.}
\label{figure : IJS-NK-dec-enc Induction}
\end{figure*}

\end{document}

SOLVED!

It was enough to add

\renewcommand\msckeyword{} 
\renewcommand\hmsckeyword{}
\renewcommand\mscdockeyword{}

before \begin{document} and .. done! This answear helped me: How to remove the word "msc" from the message sequence chart using msc package?.

enter image description here

  • I don't know how this connects to TikZ. msc uses PsTricks – percusse Oct 22 '16 at 12:59
  • @percusse: Sorry for this, my bad. I just started with TikZ, it was not very clear to me. – yak Oct 22 '16 at 13:02
  • No problem. It was a bit too short for a comment on my side. Since I don't know anything about msc just placed a remark. – percusse Oct 22 '16 at 13:05
1

Do \setmsckeyword{} and call msc with an empty argument.

I also reordered the input: the settings to the msc parameters are better done outside the box to be resized. I made both boxes as wide as \textwidth; change it to an explicit dimension or to a factor of \textwidth such as 0.8\textwidth.

Use \centering and not \center.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{msc}

\begin{document}

\begin{figure*}[!htp]
\centering

\setmsckeyword{}% remove the word msc
\setlength{\instwidth}{1.7 cm}
\setlength{\instdist}{4.3 cm}
\setlength{\bottomfootdist}{0.2 cm}
%\setlength{\instwidth}{2 cm}
%\setlength{\instdist}{3.75 cm}
\setlength{\envinstdist}{1.2 cm}
\setlength{\topheaddist}{0.5 cm}

\resizebox{\textwidth}{!}{% <-- don't forget this %
  \begin{msc}{}
  \declinst{I}{\scriptsize new node}{$I$} 
  \declinst{R}{\scriptsize neighbour node}{$R$}
  \declinst{J1k-1}{\scriptsize intermediate nodes}{$J_{1:k-1}$}
  \declinst{Jk}{\scriptsize \:\: intermediate node}{$J_{k}$}
  \declinst{S}{\scriptsize Sink}{$S$}
  %
  % left to right messages
  \mess{$m_1 = \{n_I, I, R\}_{K_{DH}(I,S)}$}{I}{R}
  \nextlevel
  \mess{$\{n_R, m_1\}_{NK}$}{R}{J1k-1}
  \nextlevel
  \mess{$\{n_{J_{k-1}}, \dots, n_{J_1}, n_R, m_1\}_{NK}$}{J1k-1}{Jk}
  \nextlevel
  \mess{$\{n_{J_k}, \dots, n_{J_1}, n_R, m_1\}_{NK}$}{Jk}{S}
  \nextlevel
  %
  % right to left messages
  \nextlevel
  \mess{$\{n_{J_k}, \dots, n_{J_1}, n_R, m_2\}_{NK}$}{S}{Jk}
  \nextlevel
  \mess{$\{n_{J_{k-1}}, \dots, n_{J_1}, n_R, m_2\}_{NK}$}{Jk}{J1k-1}
  \nextlevel
  \mess{$\{n_R, m_2\}_{NK}$}{J1k-1}{R}
  \nextlevel
  \mess{$m_3$}{R}{I}
  %\nextlevel
  \end{msc}% <-- don't forget this %
}

\fbox{% <-- don't forget this %
  \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule}
  $m_2 = \{pk(I), \{n_I, I, R, S\}_{K_{DH}(I,S)}\}_{K_{DH}(R,S)}$\\
  $m_3 = \{K(R,I), \{n_I, I, R, S\}_{K_{DH}(I,S)} \}_{pk(I)}$
  \end{minipage}% <-- don't forget this %
}

\caption{$IJS_{NK, \mathrm{dec}/\mathrm{enc}}$: Proof by Induction.}
\label{figure : IJS-NK-dec-enc Induction}
\end{figure*}

\end{document}

enter image description here

  • Gives me ! Package babel Error: Unknown language english. Either you have ... while compiling with pdflatex. – yak Oct 22 '16 at 13:48
  • @yak Remove the .aux file and retry. I didn't include babel in the example because it's not essential for it (likewise for the others I omitted); this way the code is more useful for future readers who will only see the necessary packages, Oh, and you can't use pdflatex with msc. – egreg Oct 22 '16 at 13:57
  • Ok, thank you, it's all ok now :) It's good to know that I cant use pdflatex with msc - didnt know this. Cheers – yak Oct 22 '16 at 14:01

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.