I am using msc Latex package for building sequence diagrams, but I can only run it with Xelatex, which I don't like, but apparently it's possible I can use pdflatex if I run it with:
pdflatex -shell-escape <file>
option.
But I am using Vim-Latex, and where do I specify this option? I cannot figure this out.
This is my vimrc:
let g:Tex_DefaultTargetFormat='pdf'
function CompileXeTex()
let oldCompileRule=g:Tex_CompileRule_pdf
let g:Tex_CompileRule_pdf = 'xelatex -aux-directory=F:/Vim/my_latex_doc/temp --synctex=-1 -src-specials -interaction=nonstopmode $*'
call Tex_RunLaTeX()
let g:Tex_CompileRule_pdf=oldCompileRule
endfunction
P.s. This says that with newest msc version all PSTricks dependancies are removed but I downloaded that version, put it instead of old one, but I still get such errors when running with pdflatex:
error| Undefined control sequence. \c@lor@to@ps
So I guess it still depends on PSTricks. Or unless it's not enough to change msc.sty? I just changed the contents of the file to new version.
So my goal is to run this with Pdflatex instead of Xelatex.
My code:
\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[pdf]{pstricks}
\title{aaa}
\author{aaaaa}
\begin{document}
\normalsize
\maketitle
\tableofcontents
\newpage
\section{In}
\section{aa}
\subsection{}
\begin{center}
\begin{msc}{Deactivate cc}
\setlength{\instdist}{9cm}
\setlength{\envinstdist}{2\envinstdist}
\declinst{cc}{}{C}
\declinst{tt}{}{T}
\nextlevel
\mess{NonceC}{cc}{tt}
\nextlevel[2]
\mess{\{$pu_C$, $[byebye]_{pr_C}\}_{pu_T}$}{cc}{tt}
\end{msc}
\end{center}
\end{document}
EDIT: I added:
let g:Tex_CompileRule_pdf = 'pdflatex -interaction=nonstopmode -shell-escape $*'
to my vimrc as suggested, but I still get PSTricks error:
error| Option clash for package pstricks.
Best Answer
Use it this way: packages which uses
PSTricks
should not be loaded when runningpdflatex
and, of course,tikz
andtodonotes
should not be loaded when runninglatex
. My example use thepostscript
environment: