![\umlassoc{Ticket}{passenger} 包 pgf 错误:没有已知名为 ticket 的形状](https://linux22.com/image/361175/%5Cumlassoc%7BTicket%7D%7Bpassenger%7D%20%E5%8C%85%20pgf%20%E9%94%99%E8%AF%AF%EF%BC%9A%E6%B2%A1%E6%9C%89%E5%B7%B2%E7%9F%A5%E5%90%8D%E4%B8%BA%20ticket%20%E7%9A%84%E5%BD%A2%E7%8A%B6%20.png)
\documentclass[12pt,article]{article}
\usepackage{tikzscale}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\linespread{1.05}
\usepackage{tikz}
\pgfdeclarelayer{background,foreground}
\pgfsetlayers{background,main,foreground}
\usepackage{tikz-uml}
\usepackage{amsmath}
\usepackage{savetrees}
%\usepackage{pgf-umlcd}
%\usepackage{pgfmanual}
\begin{document}
\begin{figure}[h!]
\begin{tikzpicture}
\begin{umlpackage}{airline class diagram}
\umlclass[x=5,y=-6]{passenger }{+ name : string\\ + Age : int \\ + address : string }{+ searchflight() \\ + viewSchedule() \\ + reserveseat() \\ + purchaseTicket()\\ + cancleTicket()\\ + Payment()}
\umlclass[x=5,y=-1]{Payment }{+ Amount }{}
\umlclass[x=-2,y=-6]{Ticket }{+ ticketno \\ + StartingLocation \\ + DestinationLocation \\ + PassengerNo }{ + cancleTicket() \\ + Payment( ) }
\umlclass[x=11,y=-1]{ticketClerk }{+ name \\ + Location }{+ reserveseat() \\ + reserveTicket()\\ + cancleTicket()\\ + receivePayment()}
\umlclass[x=11,y=-6]{airline database }{+ id }{ +response()}
\umlclass[x=5,y=-12]{Plane }{+ model \\ +capacity \\ + flightNo. }
\umlassoc{Ticket}{passenger}
\end{umlpackage}
\end{tikzpicture}
\end{figure}
\end{document}
我运行此代码然后发现一个错误
! Package pgf Error: No shape named Ticket is known.
See the pgf package documentation for explanation.
Type H <return> for immediate help.
...
l.28 \umlassoc{Ticket}{passenger}