
次のコードがあります:
\documentclass[a4paper]{article}
%% Language and font encodings
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
%% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{tikz} % For graphics
\usepackage{pgfplots}
\usepackage{xcolor}
\usetikzlibrary{matrix,arrows,calc,positioning,shapes,decorations.pathreplacing}
\usepackage{graphicx}
\usepackage{tikz-uml}
\title{Your Paper}
\author{You}
\begin{document}
\maketitle
\section{Introduction}
Diagram below:
\small\begin{tikzpicture}
\begin{umlseqdiag}
\umlactor{User}
\umlobject{Proxy}
\umlobject[x=7]{Entry station}
\umlobject[x=10]{Dst station}
\begin{umlcall}[op=retrieve(token),return=pkt-info]{User}{Proxy}
\begin{umlcall}[op=RReq,return=success]{Proxy}{Entry station}
\end{umlcall}
\begin{umlcall}[op=RReq,return=success]{Entry station}{Dst station}
\end{umlcall}
\begin{umlcallself}[op=lookup,return=pkt-info]{Dst station}
\end{umlcallself}
\begin{umlcall}[op=RRes,return=success]{Dst station}{Entry station}
\end{umlcall}
\begin{umlcall}[op=RRes,return=success]{Entry station}{Proxy}
\end{umlcall}
\end{umlcall}
\begin{umlfragment}[type=loop, label=$\forall p_k$, inner ysep=1]
\begin{umlcall}[dt=7, op=retrieve(token $p_k$),return=fragment $p_k$]{User}{Proxy}
\umlcreatecall[x=7]{Proxy}{Station}
\begin{umlcall}[op=RRes,return=success]{Proxy}{Station}
\end{umlcall}
\end{umlcall}
\end{umlfragment}
\begin{umlcallself}[dt=5, op=aggregate($p_k$), return=packet $p$]{User}
\end{umlcallself}
\end{umlseqdiag}
\end{tikzpicture}
\end{document}
問題はオブジェクトにありますStation
。実際、create 呼び出しはしたくありません。そのレーンをオブジェクト用に配置しStation
て使用したいだけです。呼び出しは発生させたくないのですcreate
。
不可能な場合は、少なくともラベルを変更して、代わりにcreate
何か他のものが表示されるようにするにはどうすればよいですか?
答え1
そのノードのテキストはパッケージのコード内に直接書き込まれており (最新バージョンでは 4622 行目)、再定義可能なマクロによって表されるわけではありません。
ただし、 の助けを借りてxpatch
、 の定義を にパッチして、たとえば に\umlcreatecall
置き換えることができます。これは、必要に応じて定義および再定義できるマクロです。以下では、最初に を として定義し、図内で で再定義しました。{create}
{\CreateTxt}
\newcommand{\CreateTxt}{create}
\renewcommand
関係のない注意: をgraphicx
2 回ロードしますが、これは実際には必要ありません。また、 とgraphicx
は両方ともxcolor
によってロードされるtikz
ため、これらを明示的に追加することは厳密には必要ではありません。一方、 はとtikz
の両方によってロードされるため、これらのいずれかが存在する場合、要点がわかります。pgfplots
tikz-uml
\documentclass[a4paper]{article}
%% Language and font encodings
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
%% Useful packages
\usepackage{amsmath}
\usepackage{tikz-uml}
\usepackage{xpatch}
\newcommand\CreateTxt{create}
% in the macro \umlcreatecall, replace "{create}" with "{\CreateTxt}":
\xpatchcmd{\umlcreatecall}{{create}}{{\CreateTxt}}{}{}
\begin{document}
\begin{tikzpicture}
\small
\begin{umlseqdiag}
\umlactor{User}
\umlobject{Proxy}
\umlobject[x=7]{Entry station}
\umlobject[x=10]{Dst station}
\begin{umlcall}[op=retrieve(token),return=pkt-info]{User}{Proxy}
\begin{umlcall}[op=RReq,return=success]{Proxy}{Entry station}
\end{umlcall}
\begin{umlcall}[op=RReq,return=success]{Entry station}{Dst station}
\end{umlcall}
\begin{umlcallself}[op=lookup,return=pkt-info]{Dst station}
\end{umlcallself}
\begin{umlcall}[op=RRes,return=success]{Dst station}{Entry station}
\end{umlcall}
\begin{umlcall}[op=RRes,return=success]{Entry station}{Proxy}
\end{umlcall}
\end{umlcall}
\begin{umlfragment}[type=loop, label=$\forall p_k$, inner ysep=1]
\begin{umlcall}[dt=7, op=retrieve(token $p_k$),return=fragment $p_k$]{User}{Proxy}
% redefine \CreateTxt to be empty
\renewcommand\CreateTxt{}
\umlcreatecall[x=7]{Proxy}{Station}
\begin{umlcall}[op=RRes,return=success]{Proxy}{Station}
\end{umlcall}
\end{umlcall}
\end{umlfragment}
\begin{umlcallself}[dt=5, op=aggregate($p_k$), return=packet $p$]{User}
\end{umlcallself}
\end{umlseqdiag}
\end{tikzpicture}
\end{document}