由于 ,以下代码无法正确编译\{ \}
。当我删除它们时,它看起来正常。是否有可能有一个包含花括号的方程式顺序图堵塞?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgf-umlsd}
\begin{document}
\begin{figure}[htbp]
\begin{sequencediagram}
\newthread{t1}{Thread1}
\newthread[gray]{t2}{Thread2}
\mess[1]{t1}{${m_{1}= \{ID, E_{CV}(I)\}}$}{t2}
\end{sequencediagram}
\end{figure}
\end{document}
无错误版本:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgf-umlsd}
\begin{document}
\begin{figure}[htbp]
\begin{sequencediagram}
\newthread{t1}{Thread1}
\newthread[gray]{t2}{Thread2}
\mess[1]{t1}{${m_{1}= ID, E_{CV}(I)}$}{t2}
\end{sequencediagram}
\end{figure}
\end{document}
替代示例:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgf-umlsd}
\begin{document}
\begin{figure}[htbp]
\begin{sequencediagram}
\newthread{t1}{Thread1}
\newthread[gray]{t2}{Thread2}
\mess[1]{t1}{$a = \{ b + c \} $}{t2}
\end{sequencediagram}
\end{figure}
\end{document}
答案1
您可以向软件包维护人员报告此问题,参数#3
既可用作排版文本(因此可以使用 tex 命令\{
),也可在内部用作节点名称(如\label{...}
),这受到更多限制。此补丁在创建节点名称之前使字符串安全
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgf-umlsd}
\renewcommand{\mess}[4][0]{%
\stepcounter{seqlevel}%
\path
(#2)+(0,-\theseqlevel*\unitfactor-0.7*\unitfactor) node (mess from) {};
\addtocounter{seqlevel}{#1}
\path
(#4)+(0,-\theseqlevel*\unitfactor-0.7*\unitfactor) node (mess to) {};
\draw[->,>=angle 60] (mess from) -- (mess to) node[midway, above]
{#3};
\node (\detokenize{#3 from}) at (mess from) {};
\node (\detokenize{#3 to}) at (mess to) {};
}
\begin{document}
\begin{figure}[htbp]
\begin{sequencediagram}
\newthread{t1}{Thread1}
\newthread[gray]{t2}{Thread2}
\mess[1]{t1}{$\{ m_{1}= ID, E_{CV}(I)\}$}{t2}
\end{sequencediagram}
\end{figure}
\end{document}