0

I am drawing a msc diagram on Overleaf, but it keeps leaning to the right instead of being centered

I intend to save this diagram to an image file, for later use in another latex document where i cannot trivially draw it.

so it's essential i get it correctly drawn in the MWE

here's the code :

\usepackage[utf8]{inputenc} \documentclass{article} \usepackage{msc}

\begin{document}

\begin{msc}{lul}

\setlength{\instdist}{4.3cm} \setlength{\envinstdist}{1.07\envinstdist} \declinst{d1}{L}{L\textsubscript{d1}} \declinst{pi}{lul}{pi} \declinst{d2}{LL}{LL\textsubscript{d2}}

\mess{1. lol $\rightarrow \textbf{LUL} $}{d1}{pi} \nextlevel[2] \mess{2. lul $\rightarrow \textbf{lol} $}{pi}{d2}

\end{msc}

\end{document}

and here's the picture;

enter image description here

1 Answer 1

2

The diagram is too wide. The space it takes is well over 16cm, which is much more than a standard line width.

Reducing \instdist to 2.25cm makes the diagram fit in the standard line width. Your particular document might allow for more.

\documentclass{article}

\usepackage{msc}
\usepackage{showframe}

\begin{document}

\begin{center}
\setlength{\instdist}{2.25cm}
\setlength{\envinstdist}{1.07\envinstdist}
\begin{msc}{lul}
\declinst{d1}{L}{L\textsubscript{d1}}
\declinst{pi}{lul}{pi}\declinst{d2}{LL}{LL\textsubscript{d2}}
\mess{1. lol $\rightarrow \textbf{LUL} $}{d1}{pi}
\nextlevel[2]\mess{2. lul $\rightarrow \textbf{lol} $}{pi}{d2}
\end{msc}
\end{center}

\end{document}

The showframe package is used just to show the page margins, remove it for your document.

enter image description here

1
  • thank you so very much ! Commented Dec 8, 2022 at 23:24

You must log in to answer this question.

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